:root {
    --brand-600: #4f46e5;
    --brand-500: #6366f1;
    --brand-100: #e0e7ff;
    --sidebar-width: 282px;
    --sidebar-width-mobile: min(88vw, 320px);
    --bg-page: #f1f5f9;
    --bg-sidebar: #0f172a;
    --bg-surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-soft: #e2e8f0;
}

body.admin-shell {
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.12), transparent 45%), var(--bg-page);
    color: var(--text-main);
}

.admin-shell .wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

.admin-shell .sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: linear-gradient(180deg, #111827, var(--bg-sidebar));
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 24px 38px -30px rgba(2, 6, 23, 0.95);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    z-index: 1024;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-shell .sidebar .sidebar-header {
    background: transparent;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding: 16px 16px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.admin-shell .sidebar .sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.admin-shell .sidebar .sidebar-brand-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.26);
    color: #c7d2fe;
    font-size: 0.92rem;
}

.admin-shell .sidebar .sidebar-brand-text {
    margin: 0;
    font-size: 1.04rem;
    font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.admin-shell .sidebar .sidebar-close-btn {
    color: #cbd5e1;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-shell .sidebar .sidebar-close-btn:hover {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.22);
}

.admin-shell .sidebar .sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.2rem 0.3rem 1.2rem;
}

.admin-shell .sidebar ul.components {
    padding: 0.55rem 0;
    margin-bottom: 0;
}

.admin-shell .sidebar .sidebar-section {
    margin-top: 0.8rem;
}

.admin-shell .sidebar .sidebar-nav-item {
    list-style: none;
}

.admin-shell .sidebar ul li > a,
.admin-shell .sidebar .nav-link {
    color: #d1d8e4;
    border-radius: 12px;
    margin: 0.18rem 0.55rem;
    padding: 0.72rem 0.78rem;
    font-size: 0.93rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    min-height: 46px;
    gap: 0.7rem;
}

.admin-shell .sidebar .nav-link .nav-icon {
    width: 1.45rem;
    text-align: center;
    color: #a5b4fc;
    flex: 0 0 auto;
}

.admin-shell .sidebar .nav-link .nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-shell .sidebar ul li > a:hover,
.admin-shell .sidebar .nav-link:hover,
.admin-shell .sidebar .nav-link.active,
.admin-shell .sidebar ul li > a[aria-expanded="true"] {
    background: rgba(99, 102, 241, 0.24);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.24);
}

.admin-shell .sidebar .nav-link:hover .nav-icon,
.admin-shell .sidebar .nav-link.active .nav-icon,
.admin-shell .sidebar .nav-link[aria-expanded="true"] .nav-icon {
    color: #ffffff;
}

.admin-shell .sidebar .nav-link-submenu::after {
    content: "\f078";
    border: 0;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: auto;
    font-size: 0.68rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.admin-shell .sidebar .nav-link-submenu[aria-expanded="true"]::after {
    transform: rotate(180deg);
    opacity: 1;
}

.admin-shell .sidebar ul ul a {
    margin-left: 0.55rem;
    margin-right: 0.55rem;
    width: auto;
    background: rgba(15, 23, 42, 0.82);
    color: #d1d8e4 !important;
    border-radius: 10px;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    padding-left: 2rem !important;
}

.admin-shell .sidebar ul ul a:hover,
.admin-shell .sidebar ul ul a:focus {
    color: #ffffff !important;
    background: rgba(99, 102, 241, 0.28) !important;
}

.admin-shell .sidebar .collapse,
.admin-shell .sidebar .collapsing {
    background: transparent;
}

.admin-shell .sidebar .collapse a,
.admin-shell .sidebar .collapsing a {
    color: #cbd5e1 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.admin-shell .sidebar .collapse a i,
.admin-shell .sidebar .collapsing a i {
    color: inherit !important;
    opacity: 1 !important;
}

.admin-shell .menu-title {
    color: #94a3b8;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.5rem 1rem 0.2rem;
    margin-bottom: 0;
    font-weight: 700;
}

.admin-shell #content {
    width: auto;
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    background: transparent;
}

.admin-shell .admin-navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 14px 30px -28px rgba(15, 23, 42, 0.85);
}

.admin-shell .sidebar-toggle-btn {
    background: var(--brand-600);
    color: #ffffff;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 24px -16px rgba(79, 70, 229, 0.9);
}

.admin-shell .sidebar-toggle-btn:hover {
    background: #4338ca;
    color: #ffffff;
}

.admin-shell .topbar-user-wrap {
    max-width: min(420px, 100%);
}

.admin-shell .user-dropdown-trigger {
    color: #1e293b;
    font-weight: 600;
    max-width: 250px;
}

.admin-shell .card,
.admin-shell .ui-card {
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.85);
    background: var(--bg-surface);
}

.admin-shell .card-header,
.admin-shell .ui-card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-soft);
    border-top-left-radius: 14px !important;
    border-top-right-radius: 14px !important;
    font-weight: 600;
}

.admin-shell .ui-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.admin-shell .ui-form-group {
    margin-bottom: 1rem;
}

.admin-shell .form-control,
.admin-shell .form-select,
.admin-shell .input-group-text,
.admin-shell .ui-input,
.admin-shell .ui-select {
    border-radius: 10px;
    border-color: #cbd5e1;
}

.admin-shell .form-control:focus,
.admin-shell .form-select:focus,
.admin-shell .ui-input:focus,
.admin-shell .ui-select:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.2);
}

.admin-shell .btn,
.admin-shell .ui-btn {
    border-radius: 10px;
    font-weight: 600;
}

.admin-shell .btn-primary,
.admin-shell .ui-btn-primary {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
    border: none;
}

.admin-shell .btn-primary:hover,
.admin-shell .ui-btn-primary:hover {
    background: linear-gradient(135deg, #4338ca, var(--brand-600));
}

.admin-shell .ui-btn-secondary {
    border: 1px solid #cbd5e1;
    color: #334155;
    background: #ffffff;
}

.admin-shell .ui-btn-secondary:hover {
    background: #eef2ff;
    border-color: #a5b4fc;
}

.admin-shell .badge,
.admin-shell .ui-badge {
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.45rem 0.68rem;
}

.admin-shell .table,
.admin-shell .ui-table {
    color: #1e293b;
}

.admin-shell .table > :not(caption) > * > *,
.admin-shell .ui-table > :not(caption) > * > * {
    border-bottom-color: #e2e8f0;
}

.admin-shell .table thead th,
.admin-shell .ui-table thead th {
    color: #475569;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
    white-space: nowrap;
}

.admin-shell .table-hover tbody tr:hover,
.admin-shell .ui-table tbody tr:hover {
    background-color: #eef2ff;
}

.admin-shell .table-responsive,
.admin-shell .ui-table-wrap {
    border-radius: 12px;
}

.admin-shell .ui-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.admin-shell .ui-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.admin-shell .pagination .page-link {
    border-radius: 8px;
    margin: 0 3px;
    border-color: #cbd5e1;
    color: #334155;
}

.admin-shell .pagination .page-item.active .page-link {
    background: var(--brand-600);
    border-color: var(--brand-600);
}

.admin-shell .overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    z-index: 1023;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.admin-shell .overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 1024px) {
    .admin-shell .user-dropdown-trigger {
        max-width: 180px;
    }
}

@media (max-width: 768px) {
    .admin-shell .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: var(--sidebar-width-mobile);
        min-width: var(--sidebar-width-mobile);
        max-width: var(--sidebar-width-mobile);
        transform: translateX(-108%);
        z-index: 1024;
        border-right-color: rgba(129, 140, 248, 0.28);
    }

    .admin-shell .sidebar.active,
    .admin-shell .sidebar.is-open {
        transform: translateX(0);
        box-shadow: 0 30px 45px -25px rgba(2, 6, 23, 0.95);
    }

    .admin-shell.sidebar-open {
        overflow: hidden;
    }

    .admin-shell #content {
        width: 100%;
    }

    .admin-shell .topbar-user-wrap {
        max-width: 72%;
    }

    .admin-shell .ui-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-shell .table thead th,
    .admin-shell .ui-table thead th {
        white-space: normal;
        line-height: 1.25;
    }

    .admin-shell .table > :not(caption) > * > *,
    .admin-shell .ui-table > :not(caption) > * > * {
        padding: 0.45rem 0.5rem;
        font-size: 0.82rem;
    }
}

@media (max-width: 576px) {
    .admin-shell .sidebar .nav-link {
        min-height: 50px;
        padding-top: 0.78rem;
        padding-bottom: 0.78rem;
    }

    .admin-shell .container-fluid.py-4 {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }

    .admin-shell .card-header {
        padding: 0.85rem 1rem;
    }

    .admin-shell .card-body {
        padding: 0.9rem;
    }

    .admin-shell .ui-table-actions .btn,
    .admin-shell .btn-group .btn {
        width: auto;
        min-width: 2.1rem;
    }

    .admin-shell .user-dropdown-trigger {
        max-width: 140px;
    }
}
