/**
 * src/css/pages/admin.css — shared "Admin" look across admin.html (hub),
 * admin-users.html, admin-projects.html, admin-system.html.
 *
 * Owns: the 4 admin.* pages only. Consumes tokens from design-system.css
 * (loaded before this file on every admin page, same load order as
 * src/css/pages/index.css on index.html). Loaded LAST so it wins
 * equal-specificity ties against the Tailwind CDN utility classes and the
 * small per-page inline <style> blocks (sidebar-pre-collapsed anti-flicker
 * script only — no page-specific inline component CSS remains).
 *
 * Provenance: every class here existed as an inline <style> block inside
 * the original admin.html (2382 lines, pre-split, see
 * docs/plans/2026-08-01_admin-split-inventory.md §1.1). Class names,
 * selectors and behavior are preserved exactly — colors/shadows/easings are
 * additionally routed through design-system.css custom properties (the
 * "Industrial Modern" token sheet) instead of the old hard-coded hex, which
 * is the design-token pass requested for this wave. `.dp-card` is
 * deliberately NOT redefined here: design-system.css already ships a
 * premium version (shadow + hover lift) and admin.html's old inline
 * `.dp-card { background:#fff;border:1px solid #E2E8F0;border-radius:12px; }`
 * (no shadow) was just shadowing it — dropping the override means every
 * dp-card on these 4 pages now gets the same elevation treatment as the
 * rest of the app for free.
 *
 * Two selectors from the old admin.html inline block are intentionally NOT
 * ported: `.nav-item`/`.nav-item.active` (dead CSS — no element in
 * admin.html ever carried class="nav-item"; the sidebar always used
 * `.sidebar-link`) and `#sidebar`/`#sidebar-overlay`/`#main-content`
 * (admin.html's own bespoke pre-mobile-drawer.js sidebar mechanics —
 * superseded by the canonical index.html shell + shared mobile-drawer.js
 * per the explicit spec instruction; see inventory §1.1 row 9/10 for the
 * zero-loss rationale). `#bottom-nav`/`.bottom-nav-item` are also not
 * ported — the new pages use index.html's Tailwind-only mobile bottom nav
 * markup instead of a bespoke dark-navy fixed bar, again per "same shell as
 * index.html".
 */

/* ── Material Symbols (canonical index.html definition) ─────────────────── */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::-webkit-scrollbar { width: 4px; background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: var(--r-full); }

/* ── Top bar frosted glass (canonical index.html definition) ────────────── */
.topbar-glass {
    background: rgba(247,249,251,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ── Sidebar Collapse (canonical index.html block, byte-identical logic) ── */
nav.sidebar-nav {
    transition: width var(--dur-3) var(--ease-std);
    overflow: hidden;
}
nav.sidebar-nav.sidebar-collapsed {
    width: 64px !important;
}
nav.sidebar-nav.sidebar-collapsed .sidebar-text,
nav.sidebar-nav.sidebar-collapsed .sidebar-brand-text {
    display: none;
}
nav.sidebar-nav.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
nav.sidebar-nav.sidebar-collapsed .sidebar-admin-label {
    display: none;
}
.main-content {
    transition: margin-left var(--dur-3) var(--ease-std);
}
.main-content.sidebar-collapsed {
    margin-left: 64px !important;
}
/* Pre-collapsed state (anti-flicker) */
html.sidebar-pre-collapsed .sidebar-nav {
    width: 64px !important;
}
html.sidebar-pre-collapsed .sidebar-nav .sidebar-text,
html.sidebar-pre-collapsed .sidebar-nav .sidebar-brand-text,
html.sidebar-pre-collapsed .sidebar-nav .sidebar-admin-label {
    display: none !important;
}
html.sidebar-pre-collapsed .sidebar-nav .sidebar-link {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
html.sidebar-pre-collapsed .main-content {
    margin-left: 64px !important;
}
/* Active link strip (canonical index.html definition) */
.sidebar-link {
    position: relative;
    min-height: var(--touch);
}
.sidebar-link.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    border-radius: 3px 0 0 3px;
    background: var(--amber-500);
}

/* ── Section heading (admin.html original: .section-eyebrow / .section-title) */
.section-eyebrow {
    font-size: var(--fs-11);
    font-weight: 700;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--text-4);
    margin-bottom: 4px;
}
.section-title {
    font-size: var(--fs-20);
    font-weight: 700;
    color: var(--navy-500);
    letter-spacing: var(--tracking-tight);
}

/* ── Buttons (admin.html original: .btn-primary / .btn-danger / .btn-secondary,
   token-ified — same class names, JS/markup untouched) ───────────────────── */
.btn-primary {
    background: var(--navy-500);
    color: #fff;
    border-radius: var(--r-md);
    font-weight: 600;
    transition: background var(--dur-1) var(--ease-std),
                transform var(--dur-1) var(--ease-std),
                box-shadow var(--dur-1) var(--ease-std);
    box-shadow: var(--sh-xs);
}
.btn-primary:hover { background: var(--navy-400); transform: translateY(-1px); box-shadow: var(--sh-md); }
.btn-primary:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
    border-radius: var(--r-md);
    font-weight: 600;
    transition: background var(--dur-1) var(--ease-std);
}
.btn-danger:hover { background: #fee2e2; }

.btn-secondary {
    background: var(--bg-app);
    color: var(--text-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font-weight: 600;
    transition: background var(--dur-1) var(--ease-std), border-color var(--dur-1) var(--ease-std);
}
.btn-secondary:hover { background: var(--bg-subtle); border-color: var(--surface-300); }

/* ── User cards (admin-users.html) ───────────────────────────────────────── */
.user-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    transition: box-shadow var(--dur-2) var(--ease-std),
                transform var(--dur-2) var(--ease-std),
                border-color var(--dur-2) var(--ease-std);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.user-card:hover {
    border-color: var(--surface-300);
    box-shadow: var(--sh-md);
    transform: translateY(-2px);
}

/* ── Status badges (admin-users.html: role pill) ─────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--r-full); font-size: var(--fs-11); font-weight: 600; }
.badge-green  { background: var(--success-bg); color: var(--success); }
.badge-amber  { background: var(--warning-bg); color: var(--warning); }
.badge-red    { background: var(--danger-bg);  color: var(--danger); }
.badge-purple { background: #faf5ff; color: #7c3aed; }
.badge-gray   { background: var(--bg-subtle); color: var(--text-2); }

/* ── NAS grid cells (admin-projects.html) ────────────────────────────────── */
.nas-field-cell { padding: 1.25rem; border-bottom: 1px solid var(--bg-subtle); }
.nas-field-cell:nth-child(n+4) { border-bottom: none; }
@media (min-width: 640px) {
    .nas-field-cell { border-right: 1px solid var(--bg-subtle); }
    .nas-field-cell:nth-child(3n) { border-right: none; }
}

/* ── Glassmorphism modals (admin-users.html: Edit / Sessions / Stats) ───── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(2,36,72,0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: var(--z-modal);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.modal-box {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: var(--r-2xl);
    padding: 28px;
    width: 100%; max-width: 480px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: var(--sh-xl);
    animation: dp-modal-fadeUp var(--dur-2) var(--ease-out);
}
.modal-box.sessions-box { max-width: 640px; }
@keyframes dp-modal-fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ── Form inputs (all 4 pages) ───────────────────────────────────────────── */
.form-input {
    width: 100%; border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 10px 14px; font-size: var(--fs-14); font-family: inherit;
    outline: none; transition: border-color var(--dur-1) var(--ease-std), box-shadow var(--dur-1) var(--ease-std);
    background: #fff;
}
.form-input:focus { border-color: var(--navy-500); box-shadow: 0 0 0 3px var(--ring-navy); }

/* ── Session rows (admin-users.html: Sessions modal) ─────────────────────── */
.session-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--bg-subtle); }
.session-row:last-child { border-bottom: none; }
.action-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--r-sm); font-size: var(--fs-11); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.chip-login  { background: var(--success-bg); color: var(--success); }
.chip-logout { background: #fef9c3; color: #92400e; }
.chip-failed { background: var(--danger-bg); color: var(--danger); }

/* ── Main tab bar (admin-users.html: Users / Access Control switch) ──────── */
.main-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--r-md);
    font-size: var(--fs-13);
    font-weight: 500;
    color: var(--text-3);
    cursor: pointer;
    transition: all var(--dur-1) var(--ease-std);
    white-space: nowrap;
    border: none;
    background: transparent;
}
.main-tab-btn:hover { background: var(--bg-subtle); color: var(--navy-500); }
.main-tab-btn.active { background: var(--navy-500); color: #fff; font-weight: 600; }
.main-tab-btn .material-symbols-outlined { font-size: 16px; }
.main-tab-strip { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.main-tab-strip::-webkit-scrollbar { display: none; }

/* ── Sub-tab bar (admin-users.html: Pending / Approved / Audit Logs) ─────── */
.sub-tab-bar { display: flex; gap: 2px; background: var(--bg-subtle); border-radius: var(--r-md); padding: 4px; }
.sub-tab-btn {
    flex: 1; padding: 8px 12px; font-size: var(--fs-13); font-weight: 500;
    border-radius: 7px; border: none; background: transparent;
    color: var(--text-3); cursor: pointer; transition: all var(--dur-1) var(--ease-std);
    white-space: nowrap;
}
.sub-tab-btn.active { background: #fff; color: var(--navy-500); font-weight: 600; box-shadow: var(--sh-xs); }

/* ═══════════════════════════════════════════════════════════════════════
   NEW — Admin breadcrumb strip (hub ▸ section), all 4 pages except the hub
   card links use it to show "you are here" + a back-to-hub affordance.
   Purely additive; nothing existing references these classes.
   ═══════════════════════════════════════════════════════════════════════ */
.admin-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-13);
    font-weight: 500;
    color: var(--text-3);
    margin-bottom: 10px;
}
.admin-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-3);
    text-decoration: none;
    transition: color var(--dur-1) var(--ease-std);
    border-radius: var(--r-sm);
}
.admin-breadcrumb a:hover { color: var(--navy-500); }
.admin-breadcrumb .material-symbols-outlined { font-size: 16px; }
.admin-breadcrumb .current { color: var(--navy-500); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════
   NEW — Admin Hub section cards (admin.html landing). This is the hero
   element of the redesign — built to the same elevation/hover-craft bar as
   #projectGrid > div.project-card in src/css/pages/index.css.
   ═══════════════════════════════════════════════════════════════════════ */
@keyframes admin-card-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.admin-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--sp-6);
}
.admin-hub-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 26px;
    background: var(--bg-card);
    border: 1px solid var(--surface-200);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-sm);
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    animation: admin-card-in var(--dur-3) var(--ease-out) both;
    transition: box-shadow var(--dur-2) var(--ease-std),
                transform var(--dur-2) var(--ease-std),
                border-color var(--dur-2) var(--ease-std);
}
.admin-hub-card:nth-child(1) { animation-delay: 0ms; }
.admin-hub-card:nth-child(2) { animation-delay: 45ms; }
.admin-hub-card:nth-child(3) { animation-delay: 90ms; }
.admin-hub-card:nth-child(4) { animation-delay: 135ms; }
.admin-hub-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--amber-400), var(--amber-600));
    transform: scaleY(0);
    transform-origin: top;
    transition: transform var(--dur-2) var(--ease-out);
}
.admin-hub-card:hover {
    box-shadow: 0 4px 6px rgba(15,23,42,0.07), 0 24px 50px rgba(2,36,72,0.16);
    transform: translateY(-4px);
    border-color: var(--navy-200);
}
.admin-hub-card:hover::before { transform: scaleY(1); }
.admin-hub-card:active { transform: translateY(-1px) scale(0.99); }
.admin-hub-card:focus-visible { outline: 2px solid var(--amber-500); outline-offset: 2px; }
.admin-hub-card.is-disabled { cursor: not-allowed; opacity: 0.72; }
.admin-hub-card.is-disabled:hover { transform: none; box-shadow: var(--sh-sm); border-color: var(--surface-200); }
.admin-hub-card.is-disabled:hover::before { transform: scaleY(0); }
@media (prefers-reduced-motion: reduce) {
    .admin-hub-card { animation: none; }
}

.admin-hub-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--navy-500), var(--navy-400));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--sh-sm);
    transition: transform var(--dur-2) var(--ease-std);
}
.admin-hub-icon .material-symbols-outlined { font-size: 26px; }
.admin-hub-card:hover .admin-hub-icon { transform: scale(1.06); }
.admin-hub-card.is-disabled .admin-hub-icon { background: linear-gradient(135deg, var(--surface-400), var(--surface-300)); }

.admin-hub-title {
    margin: 0;
    font-size: var(--fs-18);
    font-weight: 700;
    letter-spacing: var(--tracking-tight);
    color: var(--text-1);
}
.admin-hub-desc {
    margin: 0;
    font-size: var(--fs-13);
    color: var(--text-3);
    line-height: 1.5;
    flex: 1;
}
.admin-hub-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border-soft);
    font-size: var(--fs-12);
    font-weight: 600;
    color: var(--text-3);
}
.admin-hub-meta .admin-hub-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--navy-500);
    font-variant-numeric: var(--tnum);
}
.admin-hub-meta .admin-hub-stat .material-symbols-outlined { font-size: 15px; }
.admin-hub-arrow {
    width: 17px; height: 17px;
    color: var(--navy-500);
    opacity: 0;
    transform: translateX(-5px);
    transition: opacity var(--dur-2) var(--ease-std), transform var(--dur-2) var(--ease-std);
}
.admin-hub-card:hover .admin-hub-arrow { opacity: 1; transform: translateX(0); }
.admin-hub-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--r-full);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--bg-subtle);
    color: var(--text-3);
    border: 1px solid var(--border);
}

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .admin-hub-grid { gap: var(--sp-4); }
    .admin-hub-card { padding: 20px; }
    .admin-hub-icon { width: 44px; height: 44px; }
}
