.category-manager {
    --category-primary: #6d28d9;
    --category-primary-dark: #4c1d95;
    --category-border: #e7e9f2;
    --category-muted: #64748b;
    --category-dark: #172033;
}

.category-banner {
    display: flex;
    min-height: 210px;
    margin-bottom: 25px;
    padding: 35px 40px;
    overflow: hidden;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    border-radius: 25px;
    background:
        radial-gradient(circle at 80% 20%, rgba(34, 211, 238, .45), transparent 30%),
        linear-gradient(135deg, #4c1d95, #7c3aed 55%, #2563eb);
    box-shadow: 0 22px 50px rgba(109, 40, 217, .18);
}

.category-banner-label {
    display: inline-flex;
    padding: 7px 13px;
    align-items: center;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 100px;
    background: rgba(255,255,255,.12);
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
}

.category-banner h2 {
    margin: 17px 0 8px;
    color: #fff;
    font-size: 34px;
    font-weight: 700;
}

.category-banner p {
    max-width: 620px;
    margin: 0;
    color: rgba(255,255,255,.8);
    font-size: 16px;
}

.category-banner-icon {
    display: grid;
    width: 120px;
    height: 120px;
    flex: 0 0 120px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 35px;
    background: rgba(255,255,255,.13);
    font-size: 56px;
    transform: rotate(-6deg);
    backdrop-filter: blur(10px);
}

.category-statistics {
    display: grid;
    margin-bottom: 25px;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.stat-card {
    display: flex;
    padding: 20px;
    align-items: center;
    border: 1px solid var(--category-border);
    border-radius: 19px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15,23,42,.05);
    gap: 15px;
}

.stat-icon {
    display: grid;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    place-items: center;
    border-radius: 15px;
    font-size: 23px;
}

.stat-purple {
    color: #6d28d9;
    background: #f3e8ff;
}

.stat-green {
    color: #15803d;
    background: #dcfce7;
}

.stat-orange {
    color: #c2410c;
    background: #ffedd5;
}

.stat-card div {
    display: flex;
    flex-direction: column;
}

.stat-card small {
    color: var(--category-muted);
}

.stat-card strong {
    color: var(--category-dark);
    font-size: 27px;
    line-height: 1.1;
}

.category-panel {
    height: 100%;
    padding: 25px;
    border: 1px solid var(--category-border);
    border-radius: 23px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(15,23,42,.06);
}

.panel-heading {
    display: flex;
    margin-bottom: 25px;
    padding-bottom: 20px;
    align-items: center;
    border-bottom: 1px solid var(--category-border);
    gap: 13px;
}

.panel-icon {
    display: grid;
    width: 47px;
    height: 47px;
    flex: 0 0 47px;
    place-items: center;
    color: #fff;
    border-radius: 14px;
    background: linear-gradient(135deg, #6d28d9, #8b5cf6);
    font-size: 20px;
}

.panel-heading h3,
.list-heading h3 {
    margin: 0;
    color: var(--category-dark);
    font-size: 20px;
    font-weight: 700;
}

.panel-heading p,
.list-heading p {
    margin: 3px 0 0;
    color: var(--category-muted);
    font-size: 13px;
}

.image-upload-wrapper {
    margin-bottom: 23px;
    text-align: center;
}

.category-image-preview {
    position: relative;
    display: grid;
    height: 190px;
    margin-bottom: 12px;
    overflow: hidden;
    place-items: center;
    border: 2px dashed #d8dce8;
    border-radius: 19px;
    background: #f8fafc;
}

.category-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    display: flex;
    align-items: center;
    color: #94a3b8;
    flex-direction: column;
    gap: 8px;
}

.image-placeholder i {
    font-size: 41px;
}

.image-upload-button {
    display: inline-flex;
    min-height: 42px;
    margin: 0;
    padding: 0 17px;
    align-items: center;
    color: #6d28d9;
    border-radius: 12px;
    background: #f3e8ff;
    gap: 8px;
    font-weight: 700;
    cursor: pointer;
}

.image-upload-wrapper > small {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
}

.form-group-modern {
    position: relative;
    margin-bottom: 20px;
}

.form-group-modern > label {
    margin-bottom: 8px;
    color: #334155;
    font-weight: 700;
}

.form-group-modern > label span {
    color: #e11d48;
}

.input-modern {
    display: flex;
    height: 48px;
    padding: 0 14px;
    align-items: center;
    border: 1px solid #dfe3ec;
    border-radius: 13px;
    background: #fff;
    gap: 10px;
}

.input-modern:focus-within {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139,92,246,.12);
}

.input-modern i {
    color: #94a3b8;
}

.input-modern input {
    width: 100%;
    height: 100%;
    outline: 0;
    border: 0;
    color: var(--category-dark);
    background: transparent;
}

.form-group-modern textarea {
    width: 100%;
    padding: 13px 14px 28px;
    resize: vertical;
    outline: 0;
    border: 1px solid #dfe3ec;
    border-radius: 13px;
}

.form-group-modern textarea:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139,92,246,.12);
}

.character-counter {
    position: absolute;
    right: 12px;
    bottom: 8px;
    color: #94a3b8;
    font-size: 11px;
}

.status-switch-card {
    display: flex;
    margin-bottom: 22px;
    padding: 15px;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--category-border);
    border-radius: 14px;
    background: #f8fafc;
}

.status-switch-card div:first-child {
    display: flex;
    flex-direction: column;
}

.status-switch-card small {
    color: var(--category-muted);
}

.status-switch-card .form-check-input {
    width: 47px;
    height: 24px;
    cursor: pointer;
}

.status-switch-card .form-check-input:checked {
    border-color: #6d28d9;
    background-color: #6d28d9;
}

.form-actions {
    display: grid;
    gap: 9px;
}

.save-button,
.cancel-button {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 13px;
    gap: 8px;
    font-weight: 700;
}

.save-button {
    color: #fff;
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    box-shadow: 0 12px 25px rgba(109,40,217,.2);
}

.save-button:disabled {
    opacity: .65;
    cursor: wait;
}

.cancel-button {
    color: #475569;
    background: #eef2f7;
}

.button-spinner {
    animation: categorySpin .8s linear infinite;
}

@keyframes categorySpin {
    to { transform: rotate(360deg); }
}

.list-heading {
    display: flex;
    margin-bottom: 24px;
    padding-bottom: 20px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--category-border);
    gap: 15px;
}

.category-search {
    display: flex;
    width: min(290px, 100%);
    height: 44px;
    margin: 0;
    padding: 0 13px;
    align-items: center;
    border: 1px solid #dfe3ec;
    border-radius: 13px;
    background: #f8fafc;
    gap: 9px;
}

.category-search input {
    width: 100%;
    outline: 0;
    border: 0;
    background: transparent;
}

.category-loading,
.categories-empty {
    display: flex;
    min-height: 300px;
    align-items: center;
    justify-content: center;
    color: var(--category-muted);
    flex-direction: column;
    gap: 13px;
    text-align: center;
}

.loading-spinner {
    width: 43px;
    height: 43px;
    border: 4px solid #ede9fe;
    border-top-color: #6d28d9;
    border-radius: 50%;
    animation: categorySpin .8s linear infinite;
}

.categories-empty > span {
    display: grid;
    width: 75px;
    height: 75px;
    place-items: center;
    color: #6d28d9;
    border-radius: 22px;
    background: #f3e8ff;
    font-size: 35px;
}

.categories-empty h4 {
    margin: 0;
    color: var(--category-dark);
    font-weight: 700;
}

.categories-empty p {
    margin: 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.category-item {
    overflow: hidden;
    border: 1px solid var(--category-border);
    border-radius: 19px;
    background: #fff;
    transition: .25s;
}

.category-item:hover {
    box-shadow: 0 18px 38px rgba(15,23,42,.1);
    transform: translateY(-4px);
}

.category-item.is-inactive {
    opacity: .76;
}

.category-item-image {
    position: relative;
    height: 150px;
    overflow: hidden;
    background: linear-gradient(135deg, #4c1d95, #2563eb);
}

.category-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: rgba(255,255,255,.92);
    font-size: 64px;
    font-weight: 700;
}

.category-position,
.category-status {
    position: absolute;
    top: 11px;
    padding: 5px 9px;
    border-radius: 20px;
    background: rgba(255,255,255,.92);
    font-size: 11px;
    font-weight: 700;
}

.category-position {
    left: 11px;
    color: #334155;
}

.category-status {
    right: 11px;
    color: #15803d;
}

.is-inactive .category-status {
    color: #c2410c;
}

.category-item-content {
    padding: 17px;
}

.category-item-content > small {
    color: #7c3aed;
    font-weight: 700;
}

.category-item-content h4 {
    margin: 4px 0 7px;
    color: var(--category-dark);
    font-size: 19px;
    font-weight: 700;
}

.category-item-content p {
    min-height: 42px;
    margin: 0;
    color: var(--category-muted);
    line-height: 1.45;
}

.category-updated {
    margin-top: 13px;
    color: #94a3b8;
    font-size: 11px;
}

.category-actions {
    display: grid;
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid var(--category-border);
    grid-template-columns: 1fr 43px 43px;
    gap: 7px;
}

.action-button {
    height: 41px;
    border: 0;
    border-radius: 11px;
    font-weight: 700;
}

.edit-action {
    color: #6d28d9;
    background: #f3e8ff;
}

.toggle-action {
    color: #0369a1;
    background: #e0f2fe;
}

.delete-action {
    color: #be123c;
    background: #ffe4e6;
}

.category-alert {
    border-radius: 23px !important;
}

.alert-confirm-button,
.alert-cancel-button,
.alert-delete-button {
    margin: 5px;
    padding: 11px 20px;
    border: 0;
    border-radius: 11px;
    font-weight: 700;
}

.alert-confirm-button {
    color: #fff;
    background: #6d28d9;
}

.alert-delete-button {
    color: #fff;
    background: #e11d48;
}

.alert-cancel-button {
    color: #334155;
    background: #e9edf3;
}

.validation-message-list {
    text-align: left;
}

.validation-message-list > div {
    display: flex;
    margin-bottom: 7px;
    padding: 9px 11px;
    color: #991b1b;
    border-radius: 9px;
    background: #fef2f2;
    gap: 8px;
}

@media (max-width: 991px) {
    .category-statistics {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .category-banner {
        padding: 27px 23px;
    }

    .category-banner h2 {
        font-size: 27px;
    }

    .category-banner-icon {
        display: none;
    }

    .category-panel {
        padding: 18px;
    }

    .list-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .category-search {
        width: 100%;
    }
}