/* =============================================================================
   admin-control.css — Owner Console (/owner)
   Control-panel shell: sidebar + workspace, compact HUD, table-style roster.
   All classes prefixed `ac-` to avoid collisions.
   ========================================================================== */

.ac-page {
    position: relative;
    max-width: 1600px;
    margin: 0 auto;
    padding: 120px 20px 80px;
    box-sizing: border-box;
    color: #e8eefc;
    --ac-owner: #fbbf24;
    --ac-emerald: #34d399;
    --ac-sapphire: #60a5fa;
    --ac-ruby: #fb7185;
    --ac-accent: #74d3ff;
    --ac-blue: #4a90e2;
    --ac-roster-cols: 48px minmax(140px, 1.2fr) 100px minmax(100px, 1fr) 110px 88px;
}

.ac-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 20, 0.82);
    pointer-events: none;
    z-index: -1;
}

/* ── Access gate ─────────────────────────────────────────────────────────── */
.ac-auth { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.ac-auth-box {
    text-align: center;
    padding: 44px 40px;
    border-radius: 12px;
    background: rgba(14, 20, 38, 0.75);
    border: 1px solid rgba(251, 191, 36, 0.18);
    backdrop-filter: blur(10px);
    max-width: 500px;
}
.ac-auth-state h1 { font-size: 1.6rem; margin: 14px 0 8px; }
.ac-auth-state p { color: rgba(200, 214, 240, 0.72); margin: 6px 0; }
.ac-back-link { color: var(--ac-accent); text-decoration: none; }
.ac-back-link:hover { text-decoration: underline; }
.ac-spinner {
    width: 38px; height: 38px; margin: 0 auto;
    border: 3px solid rgba(251, 191, 36, 0.2);
    border-top-color: var(--ac-owner);
    border-radius: 50%;
    animation: acSpin 0.8s linear infinite;
}
@keyframes acSpin { to { transform: rotate(360deg); } }

/* ── Console shell ───────────────────────────────────────────────────────── */
.ac-root { opacity: 0; transform: translateY(8px); }
.ac-root.is-mounted {
    opacity: 1;
    transform: none;
    transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}

.ac-shell {
    display: flex;
    min-height: calc(100vh - 200px);
    background: rgba(13, 20, 38, 0.75);
    border: 1px solid rgba(251, 191, 36, 0.12);
    border-top: 2px solid rgba(251, 191, 36, 0.55);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.ac-sidebar {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(116, 211, 255, 0.1);
    background: rgba(8, 12, 24, 0.45);
    padding: 20px 0;
}

.ac-sidebar-brand {
    padding: 0 18px 18px;
    border-bottom: 1px solid rgba(116, 211, 255, 0.08);
    margin-bottom: 12px;
}

.ac-eyebrow {
    display: inline-block;
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.14em;
    color: var(--ac-owner);
    padding: 3px 8px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 999px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.ac-sidebar-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

.ac-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 10px;
    flex: 1;
}

.ac-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    color: rgba(200, 214, 240, 0.6);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 11px 14px;
    font-family: inherit;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.ac-tab .material-symbols-outlined { font-size: 1.15rem; }
.ac-tab:hover { color: #dbe7ff; background: rgba(255, 255, 255, 0.04); }
.ac-tab.is-active {
    color: #fff;
    border-left-color: var(--ac-owner);
    background: rgba(251, 191, 36, 0.08);
}

.ac-sidebar-foot {
    margin-top: auto;
    padding: 12px 14px 0;
    border-top: 1px solid rgba(116, 211, 255, 0.08);
}

.ac-btn--block { width: 100%; justify-content: center; }

/* ── Workspace ───────────────────────────────────────────────────────────── */
.ac-workspace {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 22px 24px 24px;
    overflow: hidden;
}

.ac-toast {
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    background: rgba(74, 144, 226, 0.14);
    border: 1px solid rgba(74, 144, 226, 0.4);
    animation: acFade 0.2s ease;
}
.ac-toast[data-type="success"] { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.45); }
.ac-toast[data-type="error"] { background: rgba(248, 113, 113, 0.14); border-color: rgba(248, 113, 113, 0.5); color: #fecaca; }

/* ── Status HUD ──────────────────────────────────────────────────────────── */
.ac-hud {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 24px;
    padding: 12px 16px;
    margin-bottom: 20px;
    background: rgba(8, 12, 24, 0.5);
    border: 1px solid rgba(116, 211, 255, 0.1);
    border-radius: 8px;
}

.ac-stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.ac-stat-num {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
}

.ac-stat-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(200, 214, 240, 0.5);
}

.ac-stat--owner .ac-stat-num { color: var(--ac-owner); }
.ac-stat--emerald .ac-stat-num { color: var(--ac-emerald); }
.ac-stat--sapphire .ac-stat-num { color: var(--ac-sapphire); }
.ac-stat--ruby .ac-stat-num { color: var(--ac-ruby); }
.ac-stat--total .ac-stat-num { color: var(--ac-accent); }

.ac-stat--divider {
    margin-left: auto;
    padding-left: 20px;
    border-left: 1px solid rgba(116, 211, 255, 0.15);
}

/* ── Panels ──────────────────────────────────────────────────────────────── */
.ac-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    animation: acPanelIn 0.22s ease-out;
}
.ac-panel[hidden] { display: none; }

@keyframes acPanelIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@keyframes acFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ac-panel-head {
    margin-bottom: 16px;
}

.ac-panel-head h2 {
    margin: 0 0 4px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.ac-panel-head p {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(200, 214, 240, 0.55);
    max-width: 60ch;
}

/* ── Toolbar / search / filters ──────────────────────────────────────────── */
.ac-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding-bottom: 14px;
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(13, 20, 38, 0.92);
}

.ac-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 220px;
    background: rgba(8, 12, 24, 0.6);
    border: 1px solid rgba(116, 211, 255, 0.18);
    border-radius: 8px;
    padding: 0 12px;
    transition: border-color 0.15s ease;
}

.ac-search .material-symbols-outlined { color: rgba(200, 214, 240, 0.45); font-size: 1.2rem; }
.ac-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #eaf2ff;
    padding: 10px 0;
    font-family: inherit;
    font-size: 0.88rem;
}
.ac-search:focus-within { border-color: var(--ac-blue); }

.ac-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.ac-select {
    background: rgba(8, 12, 24, 0.6);
    border: 1px solid rgba(116, 211, 255, 0.18);
    border-radius: 8px;
    color: #eaf2ff;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 0.88rem;
}
.ac-select:focus { outline: none; border-color: var(--ac-blue); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.ac-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
    transition: transform 0.15s ease, background-color 0.15s ease, opacity 0.2s ease;
}
.ac-btn .material-symbols-outlined { font-size: 1.1rem; }
.ac-btn:hover { transform: translateY(-1px); }
.ac-btn:disabled, .ac-btn.is-busy { opacity: 0.55; cursor: default; transform: none; }
.ac-btn--primary { background: var(--ac-blue); color: #fff; }
.ac-btn--primary:hover { background: #5aa1f2; }
.ac-btn--gold { background: var(--ac-owner); color: #3a2c05; }
.ac-btn--ghost { background: rgba(255, 255, 255, 0.04); border-color: rgba(116, 211, 255, 0.22); color: #dbe7ff; }

/* Owner AI-database action card (Administrators panel). */
.ac-ai-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 4px 0 18px;
    padding: 16px 18px;
    border: 1px solid rgba(245, 205, 110, 0.35);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(245, 205, 110, 0.08), rgba(245, 205, 110, 0.02));
}
.ac-ai-tools__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ac-ai-tools__text strong { font-size: 1rem; color: #ffe7a8; }
.ac-ai-tools__text span { font-size: 0.85rem; color: rgba(255, 255, 255, 0.6); }
.ac-ai-tools .ac-btn { flex-shrink: 0; }
.ac-btn--ghost:hover { background: rgba(116, 211, 255, 0.1); }
.ac-btn--danger { background: rgba(248, 113, 113, 0.14); border-color: rgba(248, 113, 113, 0.45); color: #fecaca; }
.ac-btn--danger:hover { background: rgba(248, 113, 113, 0.24); }
.ac-btn--sm { padding: 6px 12px; font-size: 0.8rem; }

.ac-icon-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(116, 211, 255, 0.18);
    border-radius: 8px;
    color: #dbe7ff;
    cursor: pointer;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ac-icon-btn:hover { background: rgba(116, 211, 255, 0.1); }

/* ── Tier badges & permission chips ──────────────────────────────────────── */
.ac-tier {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid currentColor;
    white-space: nowrap;
}
.ac-tier::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.ac-tier--owner { color: var(--ac-owner); background: rgba(251, 191, 36, 0.1); }
.ac-tier--emerald { color: var(--ac-emerald); background: rgba(52, 211, 153, 0.1); }
.ac-tier--sapphire { color: var(--ac-sapphire); background: rgba(96, 165, 250, 0.1); }
.ac-tier--ruby { color: var(--ac-ruby); background: rgba(251, 113, 133, 0.1); }
.ac-tier--none { color: rgba(200, 214, 240, 0.6); background: rgba(255, 255, 255, 0.04); }

.ac-perm {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(52, 211, 153, 0.1);
    color: #9defb9;
    border: 1px solid rgba(52, 211, 153, 0.22);
}
.ac-perm--revoked {
    background: rgba(248, 113, 113, 0.1);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.28);
    text-decoration: line-through;
}

/* ── Roster (table-style grid) ───────────────────────────────────────────── */
.ac-roster-head,
.ac-admin-card {
    display: grid;
    grid-template-columns: var(--ac-roster-cols);
    align-items: center;
    gap: 10px 12px;
}

.ac-roster-head {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(200, 214, 240, 0.4);
    padding: 6px 14px 8px;
    border-bottom: 1px solid rgba(116, 211, 255, 0.1);
    margin-bottom: 4px;
}

.ac-roster {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 4px;
}

.ac-admin-card {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(116, 211, 255, 0.08);
    border-radius: 8px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    animation: acRowIn 0.18s ease-out both;
}

.ac-admin-card:nth-child(1) { animation-delay: 0ms; }
.ac-admin-card:nth-child(2) { animation-delay: 40ms; }
.ac-admin-card:nth-child(3) { animation-delay: 80ms; }
.ac-admin-card:nth-child(4) { animation-delay: 120ms; }
.ac-admin-card:nth-child(5) { animation-delay: 160ms; }
.ac-admin-card:nth-child(6) { animation-delay: 200ms; }
.ac-admin-card:nth-child(7) { animation-delay: 240ms; }
.ac-admin-card:nth-child(8) { animation-delay: 280ms; }

@keyframes acRowIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

.ac-admin-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(251, 191, 36, 0.22);
}

.ac-admin-card.is-owner {
    border-left: 3px solid var(--ac-owner);
    background: rgba(251, 191, 36, 0.04);
}

.ac-admin-card > .ac-avatar {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
}

.ac-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(116, 211, 255, 0.08);
    border: 1px solid rgba(116, 211, 255, 0.2);
}

.ac-admin-main { display: contents; }
.ac-admin-name { display: contents; }

.ac-admin-name strong {
    grid-column: 2;
    grid-row: 1;
    font-size: 0.92rem;
    color: #fff;
    font-weight: 600;
    align-self: center;
}

.ac-admin-name .ac-tier {
    grid-column: 3;
    grid-row: 1;
    justify-self: start;
    align-self: center;
}

.ac-admin-sub {
    grid-column: 2 / 4;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: rgba(200, 214, 240, 0.55);
}

.ac-admin-sub code {
    font-size: 0.68rem;
    color: rgba(200, 214, 240, 0.4);
}

.ac-admin-perms {
    grid-column: 4;
    grid-row: 1 / 3;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-content: center;
}

.ac-admin-meta {
    grid-column: 5;
    grid-row: 1 / 3;
    font-size: 0.72rem;
    color: rgba(200, 214, 240, 0.45);
    line-height: 1.35;
}

.ac-admin-actions {
    grid-column: 6;
    grid-row: 1 / 3;
    display: flex;
    justify-content: flex-end;
}

.ac-empty {
    color: rgba(200, 214, 240, 0.5);
    font-style: italic;
    padding: 24px 4px;
    text-align: center;
    grid-column: 1 / -1;
}

.ac-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(200, 214, 240, 0.6);
    font-size: 0.88rem;
    padding: 32px 4px;
}

.ac-loading::before {
    content: '';
    width: 18px;
    height: 18px;
    flex: none;
    border: 2px solid rgba(116, 211, 255, 0.25);
    border-top-color: var(--ac-owner);
    border-radius: 50%;
    animation: acSpin 0.7s linear infinite;
}

/* ── Drawer ──────────────────────────────────────────────────────────────── */
.ac-drawer { position: fixed; inset: 0; z-index: 1200; }
.ac-drawer[hidden], .ac-modal[hidden] { display: none; }
.ac-overlay {
    position: absolute;
    inset: 0;
    background: rgba(4, 7, 16, 0.7);
    backdrop-filter: blur(3px);
    animation: acFade 0.2s ease;
}

.ac-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(480px, 94vw);
    background: #0d1426;
    border-left: 1px solid rgba(251, 191, 36, 0.2);
    padding: 24px 22px;
    box-sizing: border-box;
    overflow-y: auto;
    animation: acSlideIn 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes acSlideIn {
    from { transform: translateX(100%); }
    to { transform: none; }
}

.ac-drawer-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 8px; }
.ac-drawer-head .ac-avatar { width: 56px; height: 56px; }
.ac-drawer-head-titles { flex: 1; min-width: 0; }
.ac-drawer-head h2 { margin: 0 0 6px; font-size: 1.2rem; }
.ac-drawer-close { margin-left: auto; }
.ac-drawer-uid { font-size: 0.72rem; color: rgba(200, 214, 240, 0.5); word-break: break-all; }

.ac-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 18px 0; }
.ac-info-grid > div { display: flex; flex-direction: column; gap: 3px; }
.ac-info-grid dt { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.07em; color: rgba(200, 214, 240, 0.45); }
.ac-info-grid dd { margin: 0; font-size: 0.88rem; color: #e8eefc; }

.ac-drawer-section { margin: 20px 0; }
.ac-drawer-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(200, 214, 240, 0.5);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.ac-tier-select { display: flex; gap: 8px; flex-wrap: wrap; }
.ac-tier-opt {
    flex: 1;
    min-width: 85px;
    text-align: center;
    cursor: pointer;
    padding: 9px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid rgba(116, 211, 255, 0.18);
    background: rgba(255, 255, 255, 0.02);
    color: rgba(200, 214, 240, 0.7);
    text-transform: capitalize;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.ac-tier-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.ac-tier-opt:hover { border-color: rgba(116, 211, 255, 0.35); }
.ac-tier-opt.is-selected { color: #fff; }
.ac-tier-opt.is-selected[data-tier="ruby"] { border-color: var(--ac-ruby); background: rgba(251, 113, 133, 0.12); }
.ac-tier-opt.is-selected[data-tier="sapphire"] { border-color: var(--ac-sapphire); background: rgba(96, 165, 250, 0.12); }
.ac-tier-opt.is-selected[data-tier="emerald"] { border-color: var(--ac-emerald); background: rgba(52, 211, 153, 0.12); }

.ac-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(116, 211, 255, 0.07);
}
.ac-switch-row:last-child { border-bottom: none; }
.ac-switch-label { font-size: 0.86rem; }
.ac-switch-label small { display: block; color: rgba(200, 214, 240, 0.5); font-size: 0.72rem; margin-top: 2px; }
.ac-switch { position: relative; width: 42px; height: 24px; flex: none; cursor: pointer; }
.ac-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ac-switch-track { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.14); border-radius: 999px; transition: background 0.2s ease; }
.ac-switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; }
.ac-switch input:checked + .ac-switch-track { background: var(--ac-emerald); }
.ac-switch input:checked + .ac-switch-track::after { transform: translateX(18px); }

.ac-drawer-footer { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.ac-drawer-footer .ac-btn { flex: 1; justify-content: center; }

.ac-mini-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ac-mini-log li { background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(116, 211, 255, 0.08); border-radius: 8px; padding: 8px 11px; font-size: 0.8rem; }
.ac-mini-log .ac-log-when { display: block; font-size: 0.68rem; color: rgba(200, 214, 240, 0.45); margin-top: 3px; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.ac-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ac-modal-card {
    position: relative;
    width: min(540px, 96vw);
    max-height: 88vh;
    overflow-y: auto;
    background: #0d1426;
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 12px;
    animation: acPop 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes acPop {
    from { opacity: 0; transform: scale(0.97) translateY(6px); }
    to { opacity: 1; transform: none; }
}

.ac-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid rgba(116, 211, 255, 0.1); }
.ac-modal-head h2 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.ac-modal-head h2 .material-symbols-outlined { color: var(--ac-owner); }
.ac-modal-body { padding: 18px 20px 22px; }
.ac-search--inline { margin-bottom: 12px; }
.ac-search--inline .ac-btn { margin-left: 4px; }

.ac-appoint-results { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.ac-result {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(116, 211, 255, 0.12);
    border-radius: 8px;
    padding: 8px 11px;
    color: #e8eefc;
    transition: background-color 0.15s ease;
}
.ac-result:hover { background: rgba(116, 211, 255, 0.08); }
.ac-result .ac-avatar { width: 34px; height: 34px; }
.ac-result-main { flex: 1; min-width: 0; }
.ac-result-main strong { display: block; font-size: 0.88rem; }
.ac-result-main code { font-size: 0.65rem; color: rgba(200, 214, 240, 0.45); }

.ac-appoint-config { margin-top: 14px; border-top: 1px solid rgba(116, 211, 255, 0.1); padding-top: 14px; }
.ac-selected-user { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.ac-selected-user strong { font-size: 0.95rem; }
.ac-config-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: rgba(200, 214, 240, 0.5); margin: 0 0 8px; }
.ac-perm-checks { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.ac-perm-check { display: flex; align-items: center; gap: 9px; font-size: 0.86rem; cursor: pointer; }
.ac-perm-check input { width: 16px; height: 16px; accent-color: var(--ac-emerald); }

/* ── Audit log ───────────────────────────────────────────────────────────── */
.ac-logs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.ac-log-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(116, 211, 255, 0.08);
    border-radius: 8px;
    padding: 11px 14px;
    transition: background-color 0.15s ease;
}
.ac-log-item:hover { background: rgba(255, 255, 255, 0.035); }

.ac-log-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(116, 211, 255, 0.08);
    color: var(--ac-accent);
}
.ac-log-icon .material-symbols-outlined { font-size: 1.1rem; }
.ac-log-icon--appoint { background: rgba(52, 211, 153, 0.1); color: var(--ac-emerald); }
.ac-log-icon--promote { background: rgba(96, 165, 250, 0.1); color: var(--ac-sapphire); }
.ac-log-icon--demote { background: rgba(251, 191, 36, 0.1); color: var(--ac-owner); }
.ac-log-icon--revoke { background: rgba(248, 113, 113, 0.1); color: #fb7185; }
.ac-log-body { flex: 1; min-width: 0; }
.ac-log-text { font-size: 0.86rem; line-height: 1.45; }
.ac-log-text strong { color: #fff; }
.ac-log-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 3px; font-size: 0.7rem; color: rgba(200, 214, 240, 0.45); }
.ac-log-more { display: flex; justify-content: center; margin-top: 12px; }

/* ── Governance ──────────────────────────────────────────────────────────── */
.ac-governance-settings {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(116, 211, 255, 0.1);
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.ac-governance-settings__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-size: 0.95rem;
    color: #fff;
}
.ac-governance-settings__title .material-symbols-outlined { font-size: 1.1rem; color: var(--ac-accent); }
.ac-governance-settings__note {
    margin: 0 0 12px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(200, 214, 240, 0.6);
}
.ac-governance-settings__actions { display: flex; gap: 10px; margin-top: 4px; }

.ac-toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; margin-bottom: 10px; }
.ac-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.ac-toggle-track {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: rgba(248, 113, 113, 0.3);
    transition: background 0.2s ease;
    flex-shrink: 0;
}
.ac-toggle-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
}
.ac-toggle input:checked + .ac-toggle-track { background: #22c55e; }
.ac-toggle input:checked + .ac-toggle-track::after { transform: translateX(18px); }
.ac-toggle-label strong { color: #fff; }

.ac-governance-note { font-size: 0.8rem; color: rgba(200, 214, 240, 0.55); margin: 0; flex: 1; min-width: 220px; }

.ac-votes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.ac-vote-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(116, 211, 255, 0.08);
    border-radius: 8px;
    padding: 12px 14px;
}
.ac-vote-body { flex: 1; min-width: 0; }
.ac-vote-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.9rem; }
.ac-vote-head strong { color: #fff; }
.ac-vote-status {
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 7px;
    border-radius: 999px;
    margin-left: auto;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(200, 214, 240, 0.65);
}
.ac-vote-status--active { background: rgba(96, 165, 250, 0.12); color: var(--ac-sapphire); }
.ac-vote-status--passed { background: rgba(52, 211, 153, 0.12); color: var(--ac-emerald); }
.ac-vote-status--failed { background: rgba(248, 113, 113, 0.12); color: #fb7185; }
.ac-vote-reason { margin: 6px 0; font-size: 0.84rem; color: rgba(200, 214, 240, 0.7); word-break: break-word; }
.ac-vote-tally { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.ac-vote-bar { flex: 1; height: 6px; border-radius: 999px; background: rgba(248, 113, 113, 0.2); overflow: hidden; max-width: 200px; }
.ac-vote-bar span { display: block; height: 100%; background: var(--ac-emerald); }
.ac-vote-count { font-size: 0.72rem; color: rgba(200, 214, 240, 0.55); white-space: nowrap; }
.ac-vote-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.7rem; color: rgba(200, 214, 240, 0.45); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .ac-shell { flex-direction: column; min-height: auto; }
    .ac-sidebar {
        width: 100%;
        flex-direction: column;
        padding: 14px 0 0;
        border-right: none;
        border-bottom: 1px solid rgba(116, 211, 255, 0.1);
    }
    .ac-sidebar-brand { padding: 0 16px 12px; }
    .ac-sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 10px 10px;
        gap: 6px;
    }
    .ac-tab {
        width: auto;
        flex-shrink: 0;
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: 8px;
        padding: 10px 14px;
    }
    .ac-tab.is-active {
        border-left-color: transparent;
        border-bottom-color: var(--ac-owner);
    }
    .ac-sidebar-foot {
        margin-top: 0;
        padding: 0 14px 14px;
        border-top: none;
    }
    .ac-btn--block { width: auto; }
    .ac-stat--divider {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        width: 100%;
        padding-top: 8px;
        border-top: 1px solid rgba(116, 211, 255, 0.1);
    }
    .ac-info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .ac-roster-head { display: none; }
    .ac-admin-card {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 14px;
    }
    .ac-admin-main { display: block; flex: 1; min-width: 0; }
    .ac-admin-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .ac-admin-name strong,
    .ac-admin-name .ac-tier,
    .ac-admin-sub,
    .ac-admin-perms,
    .ac-admin-meta,
    .ac-admin-actions {
        grid-column: unset;
        grid-row: unset;
    }
    .ac-admin-perms { margin-top: 6px; }
    .ac-admin-meta { width: 100%; font-size: 0.7rem; }
    .ac-admin-actions { width: 100%; justify-content: flex-start; }
}

@media (max-width: 600px) {
    .ac-page { padding: 110px 12px 60px; }
    .ac-workspace { padding: 16px; }
    .ac-hud { gap: 8px 16px; padding: 10px 12px; }
    .ac-stat-num { font-size: 1.15rem; }
}

/* ── Legal policies editor ───────────────────────────────────────────────── */
.ac-panel--policies {
    min-height: 0;
}

.ac-policies {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ac-policy-editor {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: rgba(8, 12, 24, 0.45);
    border: 1px solid rgba(116, 211, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.ac-policy-editor__meta {
    display: flex;
    justify-content: flex-end;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(116, 211, 255, 0.08);
}

.ac-policy-version {
    font-size: 0.75rem;
    color: rgba(200, 214, 240, 0.5);
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 999px;
    padding: 4px 12px;
}

.ac-policy-version strong { color: var(--ac-owner); }

.ac-policy-tabs {
    display: flex;
    border-bottom: 1px solid rgba(116, 211, 255, 0.08);
}

.ac-policy-tab {
    flex: 1;
    padding: 11px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(200, 214, 240, 0.45);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.ac-policy-tab:hover { color: rgba(200, 214, 240, 0.75); }
.ac-policy-tab.is-active {
    color: var(--ac-accent);
    border-bottom-color: var(--ac-owner);
}

.ac-policy-panes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.ac-policy-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.ac-policy-pane:first-child {
    border-right: 1px solid rgba(116, 211, 255, 0.08);
}

.ac-policy-pane__label {
    display: block;
    padding: 10px 14px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(200, 214, 240, 0.45);
}

.ac-policy-textarea {
    flex: 1;
    min-height: 280px;
    margin: 0;
    padding: 12px 14px 16px;
    background: rgba(4, 7, 16, 0.5);
    border: none;
    border-top: 1px solid rgba(116, 211, 255, 0.06);
    color: #e8eefc;
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    resize: none;
    outline: none;
}

.ac-policy-textarea:focus {
    background: rgba(4, 7, 16, 0.65);
}

.ac-policy-preview {
    flex: 1;
    min-height: 280px;
    overflow-y: auto;
    padding: 12px 16px 16px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(232, 238, 252, 0.9);
}

.ac-policy-preview h3 { font-size: 1.1rem; margin: 0 0 10px; color: #fff; }
.ac-policy-preview h4 { font-size: 0.95rem; margin: 14px 0 8px; color: #fff; }
.ac-policy-preview p { margin: 0 0 10px; color: rgba(200, 214, 240, 0.75); }
.ac-policy-preview ul { margin: 0 0 10px; padding-left: 1.2rem; }
.ac-policy-preview li { margin-bottom: 4px; }
.ac-policy-preview__empty { color: rgba(200, 214, 240, 0.4); font-style: italic; }

.ac-policy-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-top: 1px solid rgba(116, 211, 255, 0.08);
    background: rgba(4, 7, 16, 0.35);
}

.ac-policy-bar__info {
    font-size: 0.75rem;
    color: rgba(200, 214, 240, 0.45);
}

.ac-policy-bar__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .ac-policy-panes { grid-template-columns: 1fr; }
    .ac-policy-pane:first-child { border-right: none; border-bottom: 1px solid rgba(116, 211, 255, 0.08); }
    .ac-policy-textarea,
    .ac-policy-preview { min-height: 220px; }
}

@media (max-width: 600px) {
    .ac-policy-bar { flex-direction: column; align-items: stretch; }
    .ac-policy-bar__actions { justify-content: flex-end; }
    .ac-policy-tab { font-size: 0.72rem; padding: 10px 6px; }
}

/* ── Polish ──────────────────────────────────────────────────────────────── */
.ac-page ::selection { background: rgba(251, 191, 36, 0.3); color: #fff; }

.ac-policy-tab:focus-visible,
.ac-tab:focus-visible,
.ac-btn:focus-visible,
.ac-icon-btn:focus-visible,
.ac-result:focus-visible,
.ac-select:focus-visible,
.ac-search input:focus-visible {
    outline: 2px solid var(--ac-owner);
    outline-offset: 2px;
}

.ac-drawer-panel,
.ac-modal-card,
.ac-roster,
.ac-logs,
.ac-votes,
.ac-policy-preview {
    scrollbar-width: thin;
    scrollbar-color: rgba(116, 211, 255, 0.25) transparent;
}

.ac-drawer-panel::-webkit-scrollbar,
.ac-modal-card::-webkit-scrollbar,
.ac-roster::-webkit-scrollbar,
.ac-logs::-webkit-scrollbar,
.ac-votes::-webkit-scrollbar,
.ac-policy-preview::-webkit-scrollbar { width: 8px; }

.ac-drawer-panel::-webkit-scrollbar-thumb,
.ac-modal-card::-webkit-scrollbar-thumb,
.ac-roster::-webkit-scrollbar-thumb,
.ac-logs::-webkit-scrollbar-thumb,
.ac-votes::-webkit-scrollbar-thumb,
.ac-policy-preview::-webkit-scrollbar-thumb {
    background: rgba(116, 211, 255, 0.2);
    border-radius: 999px;
}

/* ── World Atlas pipeline (World Atlas tab) ──────────────────────────────────
   Step cards wired by atlas-export.js. Steps 1–3 are the map→database
   pipeline (cool blue); step 4 is the gold publish action that used to live
   in the Administrators panel. */
.ac-atlas { display: flex; flex-direction: column; gap: 16px; }

.ac-atlas-scope {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px;
    border: 1px solid rgba(116, 211, 255, 0.16);
    border-radius: 12px;
    background: rgba(8, 12, 24, 0.45);
}
.ac-atlas-scope__title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(200, 214, 240, 0.55);
}
.ac-atlas-scope__title .material-symbols-outlined { font-size: 1.05rem; }
.ac-atlas-scope .ac-toggle-label { font-size: 0.85rem; color: rgba(255, 255, 255, 0.62); line-height: 1.45; }
.ac-atlas-scope .ac-toggle-label strong { color: #eaf2ff; }

.ac-atlas-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ac-atlas-step {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid rgba(116, 211, 255, 0.16);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(116, 211, 255, 0.05), rgba(116, 211, 255, 0.01));
}
.ac-atlas-step--gold {
    border-color: rgba(245, 205, 110, 0.35);
    background: linear-gradient(135deg, rgba(245, 205, 110, 0.08), rgba(245, 205, 110, 0.02));
}
.ac-atlas-step__num {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--ac-accent);
    border: 1px solid rgba(116, 211, 255, 0.35);
    background: rgba(116, 211, 255, 0.08);
}
.ac-atlas-step--gold .ac-atlas-step__num {
    color: var(--ac-owner);
    border-color: rgba(245, 205, 110, 0.45);
    background: rgba(245, 205, 110, 0.1);
}
.ac-atlas-step__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}
.ac-atlas-step__body strong { font-size: 0.98rem; color: #eaf2ff; }
.ac-atlas-step--gold .ac-atlas-step__body strong { color: #ffe7a8; }
.ac-atlas-step__body span { font-size: 0.84rem; color: rgba(255, 255, 255, 0.58); line-height: 1.45; }
.ac-atlas-step__body code {
    font-size: 0.8rem;
    padding: 1px 5px;
    border-radius: 5px;
    background: rgba(116, 211, 255, 0.1);
    color: #bfe6ff;
}
.ac-atlas-step .ac-btn { flex-shrink: 0; min-width: 128px; justify-content: center; }

.ac-atlas-status {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.86rem;
    line-height: 1.5;
    border: 1px solid rgba(116, 211, 255, 0.22);
    background: rgba(116, 211, 255, 0.06);
    color: #dbe7ff;
}
.ac-atlas-status[data-kind="success"] { border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); color: #b9f3dd; }
.ac-atlas-status[data-kind="error"] { border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); color: #fecaca; }

@media (max-width: 720px) {
    .ac-atlas-step { flex-wrap: wrap; }
    .ac-atlas-step .ac-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .ac-spinner { animation-duration: 1.6s; }
    .ac-root.is-mounted { transition: none; }
    .ac-btn:hover,
    .ac-admin-card:hover { transform: none; }
    .ac-drawer-panel,
    .ac-modal-card,
    .ac-panel,
    .ac-admin-card,
    .ac-toast { animation: none; }
    .ac-loading::before { animation-duration: 1.6s; }
}
