/* ==========================================================================
   Duque Workforce Connect — Admin Stylesheet (consolidated)
   Contains only the tokens, base resets, and component styles actually used
   by admin.php. Merged from index.css + admin.css; unused rules removed.
   ========================================================================== */

:root {
    /* Brand palette — unified with the login page (ink / maple / gold) */
    --primary: #b3283d;
    --primary-dark: #8a1f30;
    --primary-light: #d1435a;
    --dark: #0c0c0c;
    --dark-soft: #1c1c1c;
    --light: #f1f5f9;
    --text-muted: #6b7280;
    --white: #ffffff;
    --border: #e5e7eb;

    --gold: #c9a24d;
    --gold-light: #e4c877;
    --gold-dark: #9c7a2e;
    --maple: #b3283d;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;

    --shadow-sm: 0 2px 8px rgba(12, 12, 12, 0.06);
    --shadow-md: 0 12px 30px rgba(12, 12, 12, 0.08);
    --shadow-lg: 0 25px 50px -12px rgba(12, 12, 12, 0.18);
    --shadow-primary: 0 12px 24px rgba(179, 40, 61, 0.22);

    --font-display: "Sora", "Segoe UI", sans-serif;
    --font-body: "Inter", "Roboto", sans-serif;

    /* Admin-only tokens */
    --admin-bg: #f6f7f9;
    --admin-panel-width: min(560px, 100vw);
    --sidebar-width: 240px;

    --tint-primary-soft: color-mix(in srgb, var(--primary) 7%, var(--white));
    --tint-primary-softer: color-mix(in srgb, var(--primary) 4%, var(--white));
    --tint-gold-soft: color-mix(in srgb, var(--gold) 16%, var(--white));
    --line-soft: color-mix(in srgb, var(--dark) 8%, transparent);

    /* Fixed tokens — the sidebar/topbar stay a dark "ink" bar and their
       text stays white in both themes, so these never flip. */
    --ink-fixed: #0c0c0c;
    --on-dark: #ffffff;
}

/* ---------------- Dark theme ----------------
   Toggled via [data-theme="dark"] on <html>. Re-points the same tokens
   the light theme already uses (--white/--dark/--admin-bg/--border/
   --text-muted), so every component that was already built on tokens
   restyles itself automatically. Chosen for a soft, natural feel —
   muted charcoal surfaces and off-white text rather than pure
   black/white — not a high-contrast look. */
[data-theme="dark"] {
    --white: #202126;
    --dark: #e6e6ea;
    --dark-soft: #2b2c31;
    --admin-bg: #17181c;
    --border: #35363c;
    --text-muted: #9297a4;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.42);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.55);

    color-scheme: dark;
}

/* ---------------- Base reset ---------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

html { font-size: 90%; }

@media (max-width: 480px) {
    html { font-size: 93.75%; }
}

@media (max-width: 360px) {
    html { font-size: 87.5%; }
}

body {
    font-family: var(--font-body);
    color: var(--dark);
    line-height: 1.65;
    background: var(--admin-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color .2s ease, color .2s ease;
}

/* ---------------- Theme toggle ---------------- */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 24px);
    margin: 4px 12px 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04);
    color: #cbd5e1;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover {
    background: rgba(255,255,255,0.08);
    color: var(--on-dark);
}
.theme-toggle i { width: 16px; text-align: center; color: var(--gold-light); }
.theme-toggle .theme-toggle-label { flex: 1; text-align: left; }
.theme-toggle .theme-toggle-track {
    position: relative;
    width: 34px;
    height: 19px;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    flex-shrink: 0;
    transition: background 0.2s ease;
}
.theme-toggle .theme-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--on-dark);
    transition: transform 0.2s ease;
}
[data-theme="dark"] .theme-toggle .theme-toggle-track { background: var(--gold-dark); }
[data-theme="dark"] .theme-toggle .theme-toggle-thumb { transform: translateX(15px); }

img, svg {
    max-width: 100%;
    height: auto;
    -webkit-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    --user-drag: none;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
    line-height: 1.15;
}

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

/* Custom scrollbars for admin scroll containers */
.admin-panel-body,
.sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--primary) 55%, var(--border)) transparent;
}
.admin-panel-body::-webkit-scrollbar { width: 8px; }
.admin-panel-body::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--primary) 55%, var(--border));
    border-radius: 10px;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ---------------- Button (used by the Change Password form) ---------------- */
.btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--on-dark);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    box-shadow: var(--shadow-primary);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px rgba(179, 40, 61, 0.3);
    filter: brightness(1.05);
}

.btn:active {
    transform: translateY(-1px);
}

/* ---------------- Shell layout ---------------- */
.admin-shell {
    display: flex;
    min-height: 100vh;
    max-width: 100%;
}

/* ---------------- Sidebar ---------------- */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--ink-fixed);
    color: var(--on-dark);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(255,255,255,0.04);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: relative;
}

.sidebar-brand::after {
    content: "";
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--gold) 45%, var(--gold-light));
}

.sidebar-brand img {
    height: 32px;
    width: auto;
}

.sidebar-brand span {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gold);
}

.sidebar-brand small {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 600;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 12px;
    flex: 1;
    overflow-y: auto;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    color: #cbd5e1;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.side-link i {
    width: 18px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.15s ease;
}

.side-link:hover {
    background: rgba(255,255,255,0.06);
    color: var(--on-dark);
    transform: translateX(2px);
}

.side-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--on-dark);
    border-left-color: var(--gold);
    box-shadow: var(--shadow-sm);
}

.side-link.active i {
    color: var(--gold-light);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-logout:hover {
    background: rgba(255,255,255,0.06);
    color: var(--on-dark);
}

/* ---------------- Main content ---------------- */
.admin-main {
    flex: 1;
    padding: 36px 40px 80px;
    max-width: 100%;
}

.view { display: none; }
.view.active { display: block; animation: viewIn 0.25s ease; }

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

.view-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}

.view-head h1 {
    font-family: var(--font-display);
    font-size: 1.7rem;
    color: var(--dark);
    position: relative;
    padding-left: 14px;
}

.view-head h1::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--primary), var(--gold));
}

.view-head p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ---------------- Dashboard stat cards ---------------- */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--gold));
    opacity: 0;
    transition: opacity 0.18s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before { opacity: 1; }

.stat-card--link {
    cursor: pointer;
}

.stat-card--link:active {
    transform: translateY(0);
}

.stat-card--link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.stat-card i {
    font-size: 1.5rem;
    color: var(--on-dark);
    background: linear-gradient(135deg, var(--primary), var(--gold));
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-num {
    display: block;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ---------------- Profile ---------------- */
.profile-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 22px 26px;
    margin: auto;
    max-width: 100%;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.profile-row:last-child { border-bottom: none; }
.profile-row span { color: var(--text-muted); }
.profile-row strong { color: var(--dark); }

.password-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 100%;
}

.password-form input {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.password-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--tint-primary-soft);
}

.password-form span {
    font-size: 0.82rem;
    font-weight: 600;
}

/* ---------------- Search ---------------- */
.admin-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    min-width: 240px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--tint-primary-soft);
}

.admin-search i { color: var(--text-muted); }

.admin-search input {
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    width: 100%;
    background: transparent;
    color: var(--dark);
}

/* ---------------- Applicants list ---------------- */
.app-list {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
}

.app-list-head,
.app-row {
    display: grid;
    grid-template-columns: 60px 1fr 140px 1.3fr 190px 120px;
    gap: 12px;
    align-items: center;
    padding: 14px 10px;
    grid-auto-flow: column; /* to ensure columns are created automatically */
}

.app-list-head {
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #cbd5e1;
    background: var(--ink-fixed);
    position: relative;
}

.app-list-head::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), var(--primary) 60%, transparent);
}

.app-row {
    border-bottom: 1px solid var(--line-soft);
    cursor: pointer;
    position: relative;
    border-left: 3px solid transparent;
    transition: background 0.14s ease, border-color 0.14s ease;
    animation: rowIn 0.25s ease backwards;
}

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

.app-row:nth-child(1) { animation-delay: 0.01s; }
.app-row:nth-child(2) { animation-delay: 0.03s; }
.app-row:nth-child(3) { animation-delay: 0.05s; }
.app-row:nth-child(4) { animation-delay: 0.07s; }
.app-row:nth-child(5) { animation-delay: 0.09s; }

.app-row:last-child { border-bottom: none; }

.app-row:hover {
    background: var(--tint-primary-softer);
    border-left-color: var(--primary);
}

.app-row::after {
    content: "\f105";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translate(-6px, -50%);
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.14s ease, transform 0.14s ease;
    pointer-events: none;
}

.app-row:hover::after {
    opacity: 1;
    transform: translate(0, -50%);
}

.app-row .idx {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    background: var(--admin-bg);
    border-radius: 6px;
    padding: 3px 8px;
    display: inline-block;
    font-weight: 600;
}

.app-row .name {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.94rem;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-row .name .avatar {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    color: var(--on-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-display);
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}

.app-row .cell-muted {
    color: var(--text-muted);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-row .date {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
    padding-right: 22px;
}

/* ---------------- Status column (badge + dropdown) ---------------- */
.status-cell {
    position: relative;
    display: flex;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--status-color, #94a3b8) 35%, var(--border));
    background: color-mix(in srgb, var(--status-color, #94a3b8) 12%, var(--white));
    color: color-mix(in srgb, var(--status-color, #94a3b8) 70%, var(--dark));
    border-radius: 20px;
    font-family: var(--font-body);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.14s ease, background 0.14s ease, transform 0.1s ease;
}

.status-badge:hover {
    border-color: color-mix(in srgb, var(--status-color, #94a3b8) 55%, var(--border));
}

.status-badge:active { transform: scale(0.97); }

.status-badge .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--status-color, #94a3b8);
    flex-shrink: 0;
}

.status-badge span.status-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge i {
    font-size: 0.62rem;
    opacity: 0.7;
    flex-shrink: 0;
}

.status-badge.is-unset {
    color: var(--text-muted);
    border-style: dashed;
    background: var(--white);
}

/* ---------------- Status line inside the right-side detail panel ---------------- */
/* Plain text, no pill/dropdown — strip the default .meta pill styling entirely. */
.admin-panel-head .meta #panelStatus {
    display: inline;
    background: none;
    border: none;
    padding: 0;
    color: var(--text-muted);
    font-weight: 400;
    white-space: normal;
    max-width: 100%;
}

/* Just the status name gets the assigned status color and extra weight;
   the "- was set on ..." text around it stays plain.
   Scoped under .admin-panel-head .meta so it out-specifies the generic
   ".admin-panel-head .meta span" rule (which would otherwise force the
   muted text color and hide the per-status color). */
.admin-panel-head .meta .status-label-plain {
    color: color-mix(in srgb, var(--status-color, #94a3b8) 75%, var(--dark));
    font-weight: 700;
}

.admin-panel-head .meta .status-label-plain.is-unset {
    color: var(--text-muted);
    font-weight: 600;
    font-style: italic;
}

.status-menu {
    display: none;
    position: fixed;
    z-index: 200;
    min-width: 210px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(20, 24, 40, 0.14);
    padding: 6px;
}

.status-menu.open { display: block; }

.status-option {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 9px;
    border: none;
    background: none;
    border-radius: 7px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--dark);
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}

.status-option:hover { background: var(--admin-bg); }

.status-option.active {
    background: var(--tint-primary-softer);
    font-weight: 600;
}

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

.app-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.app-empty i {
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: block;
    color: var(--border);
}

.app-empty a { color: var(--primary); font-weight: 600; text-decoration: none; }
.app-empty a:hover { text-decoration: underline; }

/* ---------------- Right-side modal ---------------- */
.admin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 12, 12, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 100;
}

.admin-overlay.open { opacity: 1; pointer-events: auto; }

.admin-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--admin-panel-width);
    background: var(--white);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 101;
    display: flex;
    flex-direction: column;
}

.admin-panel::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--gold));
}

.admin-panel.open { transform: translateX(0); }

.admin-panel-head {
    padding: 26px 26px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    background: var(--tint-primary-softer);
}

.admin-panel-head h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--dark);
    padding-left: 12px;
    border-left: 3px solid var(--gold);
    line-height: 1.3;
}

.admin-panel-head .meta {
    margin-top: 10px;
    padding-left: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-panel-head .meta span,
.admin-panel-head .meta a, button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.admin-panel-head .meta a, button { color: var(--primary); }
.admin-panel-head .meta a:hover, button:hover { border-color: var(--primary); background: var(--tint-primary-soft); cursor: pointer;}
.admin-panel-head .meta i { color: var(--primary); font-size: 0.85em; }

.panel-close {
    border: none;
    background: var(--white);
    color: var(--dark);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
    transition: background 0.15s ease, transform 0.15s ease;
}

.panel-close:hover { background: var(--border); transform: rotate(90deg); }

.admin-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 26px 60px;
}

.qa-section-title {
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dark);
    margin: 30px 0 14px;
    padding: 8px 12px;
    background: var(--tint-gold-soft);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.qa-section-title::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--gold);
    flex-shrink: 0;
}

.qa-section-title:first-child { margin-top: 0; }

.qa-item {
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border);
    background: var(--admin-bg);
    transition: border-color 0.15s ease, background 0.15s ease;
    animation: rowIn 0.2s ease backwards;
}

.qa-item:hover {
    border-left-color: var(--primary);
    background: var(--tint-primary-softer);
}

.qa-item:last-child { margin-bottom: 0; }

.qa-question {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 600;
}

.qa-answer { font-size: 0.96rem; color: var(--dark); font-weight: 500; word-break: break-word; }
.qa-answer.empty { color: var(--text-muted); font-weight: 400; font-style: italic; }

.qa-subcard {
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-top: 10px;
    box-shadow: var(--shadow-sm);
}

.qa-subcard + .qa-subcard { margin-top: 12px; }

.qa-subcard .qa-subtitle {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--primary-dark);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.qa-subgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.qa-subgrid .qa-item { padding: 0; border: none; background: none; margin-bottom: 0; }
.qa-subgrid .qa-item:hover { background: none; }

.doc-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.88rem;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.doc-file:hover { box-shadow: var(--shadow-sm); border-color: var(--primary); }

.doc-file .doc-name {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dark);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-file .doc-name i {
    color: var(--primary);
    flex-shrink: 0;
    background: var(--tint-primary-soft);
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.doc-file .doc-size { color: var(--text-muted); font-size: 0.78rem; flex-shrink: 0; }
.doc-file a.doc-open {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 12px;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.doc-file a.doc-open:hover { background: var(--tint-primary-soft); border-color: var(--primary); text-decoration: none; }

.no-docs { color: var(--text-muted); font-size: 0.88rem; font-style: italic; }

[hidden] { display: none !important; }

/* ---------------- Mobile top bar (hidden on desktop) ---------------- */
.mobile-topbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--ink-fixed);
    color: var(--gold);
    position: sticky;
    top: 0;
    z-index: 90;
}

.mobile-topbar img { height: 26px; width: auto; }

.mobile-topbar span {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.92rem;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--on-dark);
    font-size: 1.15rem;
    padding: 6px;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.menu-toggle:hover { background: rgba(255,255,255,0.08); }

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--on-dark);
    font-size: 1rem;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
    align-self: flex-start;
}

/* Dimmed backdrop behind the off-canvas sidebar */
.sidebar-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(12, 12, 12, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 149;
}

.sidebar-scrim.open { opacity: 1; pointer-events: auto; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
    .mobile-topbar { display: flex; }
    .sidebar-scrim { display: block; }
    .sidebar-brand span { font-size: 0.82rem; color: var(--gold);}
    .admin-shell { flex-direction: column; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: min(280px, 82vw);
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        z-index: 150;
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        box-shadow: var(--shadow-lg);
    }

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

    .sidebar-brand {
        border-bottom: 1px solid rgba(255,255,255,0.08);
        padding: 20px 16px;
        align-items: flex-start;
    }
    .sidebar-brand::after { display: block; }

    .sidebar-close { display: block; }

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

    .side-link { width: 100%; }

    .sidebar-logout { margin: 12px; border-top: 1px solid rgba(255,255,255,0.08); }

    .admin-main { padding: 24px 16px 60px; }

    /* Tablets in this range (iPad mini/Air/Pro portrait, ~768–900px) now
       have the sidebar collapsed to an off-canvas menu, so admin-main runs
       full width — but the 6-column applicant/employer table
       (60px + 1fr + 140px + 1.3fr + 190px + 120px) still had ~510px of
       fixed-width columns competing for space, squeezing Phone/Email into
       a sliver. Dropping to the same 4-column layout used on phones (id,
       name, status, date — phone/email tucked into the detail panel
       instead) keeps every column legibly wide on a tablet, not just
       technically un-broken. */
    .app-list-head, .app-row {
        grid-template-columns: 40px 1fr 170px 100px;
    }
    .app-list-head span:nth-child(3),
    .app-list-head span:nth-child(4),
    .app-row .cell-muted { display: none; }

    .admin-panel { width: min(480px, 92vw); }
}

/* Prevent background scroll while the mobile sidebar is open */
body.sidebar-open-lock { overflow: hidden; }

@media (max-width: 640px) {
    .app-list-head, .app-row {
        grid-template-columns: 34px 1fr 150px 90px;
    }
    .sidebar-brand span { font-size: 0.82rem; color: var(--gold);}
    .app-list-head span:nth-child(3),
    .app-list-head span:nth-child(4),
    .app-row .cell-muted { display: none; }

    .status-badge span.status-label { max-width: 90px; }

    .admin-panel { width: 100vw; }
    .qa-subgrid { grid-template-columns: 1fr; }
    .app-row::after { display: none; }

    .view-head {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-search { min-width: 0; width: 100%; }

    .stat-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

    .profile-card,
    .password-form { max-width: 100%; }

    .profile-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .admin-panel-head { padding: 20px 18px 16px; }
    .admin-panel-body { padding: 18px 18px 50px; }
}

/* ---------------- Small phones ---------------- */
@media (max-width: 480px) {
    .admin-main { padding: 18px 12px 50px; }

    .sidebar-brand span { font-size: 0.82rem; color: var(--gold);}
    .sidebar-brand small { font-size: 0.62rem; }

    .view-head h1 { font-size: 1.35rem; }

    .stat-cards { grid-template-columns: 1fr 1fr; gap: 10px; }

    .stat-card { padding: 16px; gap: 12px; }
    .stat-card i { width: 42px; height: 42px; font-size: 1.2rem; }
    .stat-num { font-size: 1.25rem; }

    .app-list-head, .app-row {
        grid-template-columns: 28px 1fr 120px 70px;
        padding: 12px 14px;
        gap: 8px;
    }

    .app-row .date { padding-right: 0; font-size: 0.72rem; }
    .app-row .name { font-size: 0.85rem; }
    .status-badge { padding: 5px 8px; font-size: 0.68rem; }
    .status-badge span.status-label { max-width: 60px; }

    .admin-panel-head h2 { font-size: 1.1rem; }
    .admin-panel-head .meta { gap: 6px; }
    .admin-panel-head .meta span,
    .admin-panel-head .meta a { padding: 4px 10px; font-size: 0.75rem; }

    .qa-item { padding: 10px 12px; }
    .qa-answer { font-size: 0.88rem; }

    .doc-file {
        flex-wrap: wrap;
        padding: 10px 12px;
    }
    .doc-file .doc-size { order: 3; }

    .btn { width: 100%; padding: 13px 20px; }
}