    /* ==========================================================================
       aonline admin — shared framework stylesheet
       Theme: neutral charcoal chrome + cool selection-blue accent
               (modelled on Lightroom Classic's panel UI, not its logo colours)
       ========================================================================== */

    :root {
        /* --- surfaces --- */
        --bg-app:        #1c1d21;
        --bg-sidebar:    #202226;
        --bg-panel:      #26282e;
        --bg-elevated:   #2e3038;
        --bg-hover:      #34363d;

        /* --- borders --- */
        --border-subtle: #34363d;
        --border-strong: #3f424a;

        /* --- text --- */
        --text-primary:   #e9e9eb;
        --text-secondary: #a4a6ad;
        --text-muted:     #6c6e76;

        /* --- accents --- */
        --accent:        #4f8ff0;
        --accent-dim:    rgba(79,143,240,0.14);
        --accent-strong: #6ba3ff;
        --amber:         #e3a33e;
        --amber-dim:     rgba(227,163,62,0.14);
        --green:         #52b788;
        --green-dim:     rgba(82,183,136,0.14);
        --red:           #e0605a;
        --red-dim:       rgba(224,96,90,0.14);

        /* --- layout --- */
        --sidebar-w:   248px;
        --topbar-h:    60px;
        --radius-sm:   4px;
        --radius-md:   7px;
        --shadow-panel: 0 24px 60px -24px rgba(0,0,0,0.65);

        --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    }

    *, *::before, *::after { box-sizing: border-box; }

    html, body {
        height: 100%;
        margin: 0;
    }

    body  {
        font-family: var(--font-ui), serif;
        background: var(--bg-app);
        color: var(--text-primary);
        font-size: 14px;
        line-height: 1.5;
        -webkit-font-smoothing: antialiased;
    }

    a  { color: inherit; }

    button  { font-family: inherit; }

    ::selection { background: var(--accent-dim); color: var(--text-primary); }

    .is-hidden {
        display: none !important;
    }

    /* reduced motion */
    @media (prefers-reduced-motion: reduce) {
        *{ animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
    }

    /* focus visibility */
    a:focus-visible,
    button:focus-visible,
    input:focus-visible {
        outline: 2px solid var(--accent-strong);
        outline-offset: 2px;
    }

    /* ==========================================================================
       App shell
       ========================================================================== */

    .app-shell {
        display: flex;
        min-height: 100vh;
    }

    /* ---- sidebar ---- */

    .sidebar {
        width: var(--sidebar-w);
        flex-shrink: 0;
        background: var(--bg-sidebar);
        border-right: 1px solid var(--border-subtle);
        display: flex;
        flex-direction: column;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .sidebar-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 18px 20px;
        border-bottom: 1px solid var(--border-subtle);
    }

    .brand-mark {
        width: 30px;
        height: 30px;
        border-radius: var(--radius-sm);
        background: linear-gradient(150deg, var(--accent) 0%, #2f5fbf 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 12.5px;
        letter-spacing: 0.3px;
        color: #fff;
        flex-shrink: 0;
    }

    .brand-name {
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0.2px;
    }

    .brand-name em {
        font-style: normal;
        color: var(--text-muted);
        font-weight: 500;
        margin-left: 4px;
    }

    .sidebar-nav {
        flex: 1;
        overflow-y: auto;
        padding: 14px 10px;
    }

    .nav-group {
        margin-bottom: 4px;
    }

    .nav-group-title {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 1.1px;
        text-transform: uppercase;
        padding: 10px 10px 6px;
        cursor: pointer;
    }

    .nav-group-title .chev {
        width: 8px;
        height: 8px;
        border-right: 1.5px solid var(--text-muted);
        border-bottom: 1.5px solid var(--text-muted);
        transform: rotate(45deg);
        transition: transform 0.18s ease;
        margin-top: -2px;
    }

    .nav-group.is-collapsed .chev {
        transform: rotate(-45deg);
        margin-top: 2px;
    }

    .nav-list {
        list-style: none;
        margin: 0;
        padding: 0 0 6px;
        display: grid;
        gap: 2px;
        overflow: hidden;
        max-height: 400px;
        transition: max-height 0.22s ease, opacity 0.22s ease;
    }

    .nav-group.is-collapsed .nav-list {
        max-height: 0;
        opacity: 0;
        padding: 0;
    }

    .aonline-admin-menu {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 10px 8px 14px;
        border-radius: var(--radius-sm);
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 13.5px;
        font-weight: 500;
        position: relative;
        border-left: 2px solid transparent;
        cursor: pointer;
    }

    .aonline-admin-menu svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
        opacity: 0.85;
    }

    .aonline-admin-menu:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
    }

    .aonline-admin-menu.active {
        background: var(--accent-dim);
        color: var(--text-primary);
        border-left-color: var(--accent);
    }

    .sidebar-footer {
        border-top: 1px solid var(--border-subtle);
        padding: 14px 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .user-chip {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
    }

    .avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--bg-elevated);
        border: 1px solid var(--border-strong);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 11.5px;
        font-weight: 700;
        color: var(--accent-strong);
        flex-shrink: 0;
    }

    .user-meta {
        display: flex;
        flex-direction: column;
        min-width: 0;
        line-height: 1.25;
    }

    .user-name {
        font-size: 13px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .user-role {
        font-size: 11px;
        color: var(--text-muted);
    }

    .logout-link {
        font-size: 12px;
        color: var(--text-muted);
        text-decoration: none;
        flex-shrink: 0;
        border-bottom: 1px solid transparent;
    }

    .logout-link:hover {
        color: var(--red);
        border-bottom-color: currentColor;
    }

    /* ---- main column ---- */

    .main {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

    .topbar {
        height: var(--topbar-h);
        border-bottom: 1px solid var(--border-subtle);
        background: var(--bg-panel);
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 0 24px;
        position: sticky;
        top: 0;
        z-index: 20;
    }

    .page-title {
        font-size: 16px;
        font-weight: 600;
        margin: 0;
        letter-spacing: 0.1px;
    }

    .topbar-right {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 14px;
    }

    .topbar-search {
        background: var(--bg-elevated);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        padding: 7px 12px;
        font-size: 13px;
        color: var(--text-primary);
        width: 220px;
    }

    .topbar-search::placeholder { color: var(--text-muted); }

    .topbar-search:focus {
        outline: none;
        border-color: var(--accent);
    }

    .burger {
        display: none;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        width: 32px;
        height: 32px;
        background: none;
        border: none;
        cursor: pointer;
        flex-shrink: 0;
    }

    .burger span {
        display: block;
        height: 2px;
        width: 100%;
        background: var(--text-primary);
        border-radius: 2px;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(10,10,12,0.55);
        z-index: 15;
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .content {
        padding: 26px 28px 60px;
        animation: fadeUp 0.4s ease both;
    }

    @keyframes fadeUp {
        from{ opacity: 0; transform: translateY(8px); }
        to{ opacity: 1; transform: translateY(0); }
    }

    /* ==========================================================================
       Components
       ========================================================================== */

    /* stat cards */

    .stat-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        margin-bottom: 26px;
    }

    .stat-card {
        background: var(--bg-panel);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        padding: 18px 20px;
    }

    .stat-label {
        font-size: 12px;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.6px;
        font-weight: 600;
    }

    .stat-value {
        font-size: 27px;
        font-weight: 700;
        margin: 8px 0 4px;
        letter-spacing: -0.2px;
    }

    .stat-delta {
        font-size: 12px;
        font-weight: 600;
    }

    .stat-delta.up { color: var(--green); }
    .stat-delta.down { color: var(--red); }

    /* panel */

    .panel {
        background: var(--bg-panel);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
    }

    .panel-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-subtle);
    }

    .panel-header h2 {
        font-size: 14px;
        font-weight: 600;
        margin: 0;
    }

    .panel-link {
        font-size: 12.5px;
        color: var(--accent-strong);
        text-decoration: none;
    }

    .panel-link:hover { text-decoration: underline; }

    .two-col {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 18px;
        align-items: start;
    }

    /* status list (dashboard side panel) */

    .status-list {
        list-style: none;
        margin: 0;
        padding: 6px 0;
    }

    .status-list li {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 11px 20px;
        font-size: 13px;
        border-bottom: 1px solid var(--border-subtle);
    }

    .status-list li:last-child { border-bottom: none; }

    .status-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .status-dot.green { background: var(--green); }
    .status-dot.amber { background: var(--amber); }
    .status-dot.red { background: var(--red); }

    .status-list .label { color: var(--text-secondary); }
    .status-list .value { margin-left: auto; font-weight: 600; }

    /* tables */

    .table-wrap {
        overflow-x: auto;
    }

    table.data-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13.5px;
    }

    .data-table th {
        text-align: left;
        font-size: 11.5px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-muted);
        font-weight: 600;
        padding: 12px 20px;
        border-bottom: 1px solid var(--border-subtle);
        white-space: nowrap;
    }

    .data-table td {
        padding: 12px 20px;
        border-bottom: 1px solid var(--border-subtle);
        color: var(--text-secondary);
        white-space: nowrap;
    }

    .data-table td.primary {
        color: var(--text-primary);
        font-weight: 500;
    }

    /* zebra striping — rename to .aonline-zebra / .aonline-row if you want this
       to match the existing aonline component conventions */
    .data-table tbody tr:nth-child(even) {
        background: rgba(255,255,255,0.015);
    }

    .data-table tbody tr:hover {
        background: var(--bg-hover);
    }

    .data-table tr:last-child td { border-bottom: none; }

    /* badges */

    .badge {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 3px 9px;
        border-radius: 100px;
        font-size: 11.5px;
        font-weight: 600;
    }

    .badge.active { background: var(--green-dim); color: var(--green); }
    .badge.pending { background: var(--amber-dim); color: var(--amber); }
    .badge.suspended { background: var(--red-dim); color: var(--red); }
    .badge.open { background: var(--accent-dim); color: var(--accent-strong); }

    /* buttons */

    .btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 15px;
        border-radius: var(--radius-sm);
        font-size: 13px;
        font-weight: 600;
        border: 1px solid var(--border-strong);
        background: var(--bg-elevated);
        color: var(--text-primary);
        cursor: pointer;
        text-decoration: none;
    }

    .btn:hover { background: var(--bg-hover); }

    .btn.primary {
        background: var(--accent);
        border-color: var(--accent);
        color: #fff;
    }

    .btn.primary:hover { background: var(--accent-strong); }

    .btn.small {
        padding: 5px 10px;
        font-size: 12px;
    }

    .action-link {
        color: var(--accent-strong);
        text-decoration: none;
        font-size: 12.5px;
        font-weight: 600;
        margin-right: 12px;
    }

    .action-link:hover { text-decoration: underline; }

    /* toolbar (search + actions above a table) */

    .toolbar {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 18px;
    }

    .toolbar-search {
        flex: 1;
        max-width: 320px;
        background: var(--bg-panel);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        padding: 9px 13px;
        color: var(--text-primary);
        font-size: 13.5px;
    }

    .toolbar-search::placeholder { color: var(--text-muted); }

    .toolbar-search:focus {
        outline: none;
        border-color: var(--accent);
    }

    .toolbar-spacer { flex: 1; }

    /* pagination footer */

    .pagination {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 20px;
        font-size: 12.5px;
        color: var(--text-muted);
    }

    .pagination .btns { display: flex; gap: 8px; }

    /* ==========================================================================
       Responsive — sidebar becomes an off-canvas drawer
       ========================================================================== */

    @media (max-width: 900px) {
        .sidebar {
            position: fixed;
            left: 0;
            top: 0;
            z-index: 30;
            transform: translateX(-100%);
            transition: transform 0.25s ease;
            box-shadow: var(--shadow-panel);
        }

        .sidebar.is-open {
            transform: translateX(0);
        }

        .burger { display: flex; }

        .backdrop.is-open {
            display: block;
            opacity: 1;
        }

        .stat-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .two-col {
            grid-template-columns: 1fr;
        }

        .topbar-search { display: none; }

        .content { padding: 20px 16px 48px; }
    }

    @media (max-width: 520px) {
        .stat-grid { grid-template-columns: 1fr; }
    }

    /* ==========================================================================
       Login page
       ========================================================================== */

    .login-body {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 24px;
        background:
                radial-gradient(900px 500px at 20% 15%, #24262c 0%, transparent 60%),
                radial-gradient(800px 600px at 85% 90%, #202329 0%, transparent 55%),
                var(--bg-app);
    }

    .login-stage {
        width: 100%;
        max-width: 372px;
        animation: fadeUp 0.5s ease both;
    }

    .login-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin-bottom: 26px;
    }

    .login-brand .brand-mark {
        width: 44px;
        height: 44px;
        font-size: 15px;
        border-radius: 9px;
    }

    .login-brand .word {
        font-size: 13px;
        letter-spacing: 2.6px;
        text-transform: uppercase;
        color: var(--text-muted);
        font-weight: 600;
    }

    .login-card {
        background: var(--bg-panel);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        padding: 34px 32px 28px;
        box-shadow: var(--shadow-panel);
    }

    .login-card h1 {
        font-size: 20px;
        font-weight: 700;
        margin: 0 0 6px;
    }

    .login-card .sub {
        margin: 0 0 26px;
        font-size: 13px;
        color: var(--text-muted);
    }

    .field {
        display: flex;
        flex-direction: column;
        gap: 7px;
        margin-bottom: 18px;
    }

    .field label {
        font-size: 11.5px;
        letter-spacing: 0.8px;
        text-transform: uppercase;
        color: var(--text-muted);
        font-weight: 600;
    }

    .field input {
        background: var(--bg-elevated);
        border: 1px solid var(--border-strong);
        border-radius: var(--radius-sm);
        padding: 10px 12px;
        font-size: 14.5px;
        color: var(--text-primary);
    }

    .field input::placeholder { color: var(--text-muted); }

    .field input:focus {
        outline: none;
        border-color: var(--accent);
    }

    .field-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 12.5px;
        margin: -6px 0 20px;
    }

    .remember {
        display: flex;
        align-items: center;
        gap: 7px;
        color: var(--text-secondary);
        cursor: pointer;
    }

    .remember input {
        accent-color: var(--accent);
    }

    .forgot {
        color: var(--accent-strong);
        text-decoration: none;
    }

    .forgot:hover { text-decoration: underline; }

    .login-error {
        display: none;
        font-size: 12.5px;
        color: var(--red);
        background: var(--red-dim);
        border-left: 2px solid var(--red);
        padding: 9px 11px;
        margin-bottom: 16px;
        border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    }

    .login-error.show { display: block; }

    .login-submit {
        width: 100%;
        padding: 11px 16px;
        border-radius: var(--radius-sm);
        border: none;
        background: var(--accent);
        color: #fff;
        font-size: 13.5px;
        font-weight: 700;
        letter-spacing: 0.3px;
        cursor: pointer;
    }

    .login-submit:hover { background: var(--accent-strong); }

    .login-footnote {
        text-align: center;
        margin-top: 22px;
        font-size: 11.5px;
        color: var(--text-muted);
    }
