/* =========================================================================
   Sovereign Institutional Design System
   Forest (#054239) & Sand (#b9a779) — RTL-first, ITF Qomra
   ========================================================================= */

/* ---- Fonts: ITF Qomra Arabic ---- */
@font-face {
    font-family: "ITF Qomra";
    src: url("/fonts/itfQomraArabic-Light.otf") format("opentype");
    font-weight: 300;
    font-display: swap;
}
@font-face {
    font-family: "ITF Qomra";
    src: url("/fonts/itfQomraArabic-Regular.otf") format("opentype");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "ITF Qomra";
    src: url("/fonts/itfQomraArabic-Medium.otf") format("opentype");
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: "ITF Qomra";
    src: url("/fonts/itfQomraArabic-Medium.otf") format("opentype");
    font-weight: 600 900;
    font-display: swap;
}

/* ---- Design tokens ---- */
:root {
    --primary: #054239;
    --primary-deep: #002a24;
    --primary-soft: #7aaea2;
    --primary-tint: rgba(5, 66, 57, 0.04);
    --primary-tint-2: rgba(5, 66, 57, 0.08);
    --gold: #b9a779;
    --gold-soft: #d8c595;
    --gold-glow: rgba(185, 167, 121, 0.25);
    --gold-ink: #8c7c4f; /* AA-contrast gold for text/meaningful icons on light bg */

    --surface: #f8f9fa;
    --surface-2: #f3f4f6;
    --surface-3: #edeeef;
    --white: #ffffff;
    --on-surface: #191c1d;
    --on-surface-variant: #404946;
    --muted: #707976;
    --outline: #e5e7eb;
    --outline-strong: #bfc8c5;

    --error: #ba1a1a;
    --error-bg: #ffdad6;
    --success: #146c43;
    --success-bg: #d6f3e3;
    --info-bg: #e7f0ee;

    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    --shadow-1: 0 4px 20px rgba(0, 0, 0, 0.04);
    --shadow-2: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-nav: 0 1px 0 rgba(0, 0, 0, 0.05);

    --container: 1280px;
    --gutter: 24px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --t-fast: 200ms;
    --t-page: 400ms;
}

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: "ITF Qomra", "Segoe UI", Tahoma, sans-serif;
    font-weight: 400;
    color: var(--on-surface);
    background-color: var(--surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--primary-deep); }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; color: var(--on-surface); margin: 0 0 .5rem; }
h1 { font-size: clamp(28px, 4vw, 48px); }
h2 { font-size: clamp(24px, 3vw, 36px); }
h3 { font-size: 22px; }
h4 { font-size: 18px; }
p { margin: 0 0 1rem; }

img, svg { max-width: 100%; }

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.muted { color: var(--muted); }
.text-gold { color: var(--gold-ink); }
.text-center { text-align: center; }

/* Global focus-visible fallback for every interactive element */
:focus-visible { outline: 3px solid var(--gold-glow); outline-offset: 2px; border-radius: 2px; }

/* Directional icons mirror automatically in RTL */
html[dir="rtl"] .dir-icon { transform: scaleX(-1); }
.section { padding-block: clamp(40px, 6vw, 80px); }

/* ---- Page fade-in ---- */
main { flex: 1 0 auto; }
.page-enter { animation: fadeUp var(--t-page) var(--ease) both; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    /* End at `none` (not translateY(0)) so the container does NOT remain a
       containing block for position:fixed modals after the animation ends. */
    to { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

/* Staggered reveal (driven by site.js) */
[data-reveal] { opacity: 0; transform: translateY(14px); }
[data-reveal].is-visible {
    /* End at `none` (not translateY(0)) so it doesn't leave a stacking context
       that would trap popovers (column chooser, dropdowns) behind later siblings. */
    opacity: 1; transform: none;
    transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
    --btn-h: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: var(--btn-h);
    padding-inline: 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color var(--t-fast) var(--ease),
                box-shadow var(--t-fast) var(--ease),
                color var(--t-fast) var(--ease),
                transform var(--t-fast) var(--ease),
                border-color var(--t-fast) var(--ease);
    user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--gold-glow); outline-offset: 2px; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-deep); color: #fff; box-shadow: var(--shadow-2); }

.btn-secondary { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-secondary:hover { background: var(--primary-tint); color: var(--primary-deep); }

.btn-tertiary { background: transparent; color: var(--gold); }
.btn-tertiary:hover { background: var(--gold-glow); color: #8c7c4f; }

.btn-ghost { background: transparent; color: var(--on-surface-variant); border-color: var(--outline); }
.btn-ghost:hover { background: var(--surface-2); }

.btn-danger { background: transparent; color: var(--error); border-color: transparent; }
.btn-danger:hover { background: var(--error-bg); }

.btn-lg { --btn-h: 56px; font-size: 16px; padding-inline: 1.75rem; }
.btn-sm { --btn-h: 36px; font-size: 13px; padding-inline: .85rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; }

.btn .material-symbols-outlined { font-size: 20px; }

/* =========================================================================
   Cards & elevation
   ========================================================================= */
.card {
    background: var(--white);
    border: 1px solid var(--outline);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    padding: 24px;
    transition: box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.card-hover:hover { box-shadow: var(--shadow-2); transform: translateY(-3px); }
.card-pad-lg { padding: 32px; }
.card-flush { padding: 0; overflow: hidden; }

.section-head { margin-bottom: 1.25rem; }
.section-head h2, .section-head h3 { margin-bottom: .25rem; }
.eyebrow {
    display: inline-flex; align-items: center; gap: .4rem;
    color: var(--gold-ink); font-weight: 500; font-size: 13px;
    letter-spacing: .04em; text-transform: uppercase;
}

/* =========================================================================
   Forms
   ========================================================================= */
.field { margin-bottom: 1.25rem; }
.field > label, .form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--on-surface-variant);
    margin-bottom: .5rem;
}
.req { color: var(--error); margin-inline-start: 2px; }
.optional { color: var(--muted); font-weight: 400; font-size: 12px; }

.input, .select, .textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 15px;
    color: var(--on-surface);
    background: #fff;
    border: 1px solid var(--outline-strong);
    border-radius: var(--radius);
    transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: #9aa3a0; }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23707976' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-inline-start: 14px;
    padding-inline-end: 40px;
}
html[dir="ltr"] .select { background-position: right 14px center; }

.field-error { color: var(--error); font-size: 13px; margin-top: .4rem; display: block; }
.input-validation-error { border-color: var(--error) !important; }
.validation-summary-errors ul { margin: 0; padding-inline-start: 1.1rem; color: var(--error); }
.text-danger { color: var(--error); font-size: 13px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* Toggle switch (field config) */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; inset: 0; cursor: pointer;
    background: var(--outline-strong); border-radius: 999px;
    transition: background-color var(--t-fast) var(--ease);
}
.switch .slider::before {
    content: ""; position: absolute; height: 20px; width: 20px;
    inset-inline-start: 3px; top: 3px; background: #fff; border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform var(--t-fast) var(--ease);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }
html[dir="rtl"] .switch input:checked + .slider::before { transform: translateX(-20px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--gold-glow); }

.toggle-row {
    display: flex; align-items: center; gap: 16px;
    padding: 16px; border: 1px solid var(--outline); border-radius: var(--radius-md);
    transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.toggle-row:hover { border-color: var(--outline-strong); }
.toggle-row.is-on { border-color: var(--primary-soft); background: var(--primary-tint); }
.toggle-row .ico {
    width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center;
    border-radius: var(--radius); background: var(--surface-2); color: var(--primary);
}
.toggle-row .meta { flex: 1 1 auto; min-width: 0; }
.toggle-row .meta strong { display: block; font-weight: 500; font-size: 15px; }
.toggle-row .meta span { font-size: 13px; color: var(--muted); }

/* =========================================================================
   Tables + Group Button Action
   ========================================================================= */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--outline); }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table thead th {
    background: var(--surface-2);
    font-weight: 500; font-size: 13px; color: var(--on-surface-variant);
    text-align: start; padding: 14px 18px; white-space: nowrap;
    letter-spacing: .01em;
}
.table tbody td { padding: 16px 18px; border-bottom: 1px solid var(--outline); font-size: 14px; vertical-align: middle; }
.table tbody tr { transition: background-color var(--t-fast) var(--ease); }
.table tbody tr:hover { background: var(--primary-tint); }
.table tbody tr:last-child td { border-bottom: none; }
.table .col-num { text-align: center; font-variant-numeric: tabular-nums; }
.cell-title { font-weight: 500; color: var(--on-surface); }
.cell-sub { font-size: 12.5px; color: var(--muted); }

/* Group button action — segmented cluster with thin dividers */
.group-actions {
    display: inline-flex; align-items: stretch;
    border: 1px solid var(--outline); border-radius: var(--radius);
    overflow: hidden; background: #fff;
}
.group-actions > * {
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    min-height: 36px; padding-inline: .7rem;
    background: #fff; color: var(--on-surface-variant);
    border: none; border-inline-start: 1px solid var(--outline);
    font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
    transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
    text-decoration: none;
}
.group-actions > *:first-child { border-inline-start: none; }
.group-actions > *:hover { background: var(--primary-tint); color: var(--primary); }
.group-actions .ga-danger:hover { background: var(--error-bg); color: var(--error); }
.group-actions .material-symbols-outlined { font-size: 19px; }

/* =========================================================================
   Badges / chips
   ========================================================================= */
.badge {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: 4px 12px; border-radius: var(--radius-xl);
    font-size: 12.5px; font-weight: 500; line-height: 1.4;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge-published { background: var(--success-bg); color: var(--success); }
.badge-draft { background: var(--surface-3); color: var(--on-surface-variant); }
.badge-closed { background: var(--error-bg); color: var(--error); }
.badge-gold { background: var(--gold-glow); color: #8c7c4f; }
.badge-info { background: var(--info-bg); color: var(--primary); }
.badge-flag { background: #fdecc8; color: #8a5a00; }
.chip {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: 6px 14px; border-radius: var(--radius-xl);
    background: var(--surface-2); color: var(--on-surface-variant);
    font-size: 13px; font-weight: 500;
}
.chip .material-symbols-outlined { font-size: 17px; color: var(--gold); }

/* =========================================================================
   Tabs (login / register)
   ========================================================================= */
.tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--outline); margin-bottom: 1.75rem; }
.tab {
    appearance: none; background: none; border: none; cursor: pointer;
    font-family: inherit; font-size: 17px; font-weight: 500; color: var(--muted);
    padding: 0 0 14px; position: relative; transition: color var(--t-fast) var(--ease);
}
.tab::after {
    content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 3px;
    background: var(--primary); border-radius: 3px 3px 0 0;
    transform: scaleX(0); transform-origin: center; transition: transform var(--t-fast) var(--ease);
}
.tab.active { color: var(--primary); }
.tab.active::after { transform: scaleX(1); }
.tab-panel { animation: fadeIn var(--t-fast) var(--ease) both; }
.tab-panel[hidden] { display: none; }

/* =========================================================================
   Stepper (multi-step forms)
   ========================================================================= */
.stepper { display: flex; align-items: flex-start; gap: 0; margin: 1.5rem 0 2.5rem; }
.stepper .step { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; }
.stepper .step .dot {
    width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
    background: #fff; border: 2px solid var(--outline-strong); color: var(--muted);
    font-weight: 500; z-index: 1; transition: all var(--t-fast) var(--ease);
}
.stepper .step .lbl { margin-top: .55rem; font-size: 13px; color: var(--muted); max-width: 150px; }
.stepper .step::before {
    content: ""; position: absolute; top: 19px; height: 2px; background: var(--outline);
    inset-inline-start: -50%; width: 100%; z-index: 0;
}
.stepper .step:first-child::before { display: none; }
.stepper .step.is-active .dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-tint-2); }
.stepper .step.is-active .lbl { color: var(--on-surface); font-weight: 500; }
.stepper .step.is-done .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.stepper .step.is-done::before, .stepper .step.is-active::before { background: var(--primary-soft); }

.form-step { animation: fadeIn var(--t-fast) var(--ease) both; }
.form-step[hidden] { display: none; }
.step-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--outline); }

/* File dropzone */
.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
    padding: 28px; text-align: center; cursor: pointer;
    border: 1.5px dashed var(--outline-strong); border-radius: var(--radius-md);
    background: var(--surface); color: var(--muted);
    transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); }
.dropzone .material-symbols-outlined { font-size: 34px; color: var(--gold); }
.dropzone input[type=file] { display: none; }
.dropzone .fname { color: var(--primary); font-weight: 500; }

/* Review list */
.review-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }
@media (max-width: 640px) { .review-list { grid-template-columns: 1fr; } }
.review-list .ri { padding: 12px 0; border-bottom: 1px solid var(--outline); }
.review-list .ri dt { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.review-list .ri dd { margin: 0; font-weight: 500; }

/* =========================================================================
   Public navbar
   ========================================================================= */
.site-header { background: #fff; border-bottom: 1px solid var(--outline); position: sticky; top: 0; z-index: 50; }
.navbar { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 600; font-size: 20px; color: var(--primary); }
.brand img { width: 38px; height: 38px; }
.nav-links { display: flex; align-items: center; gap: 1.75rem; }
.nav-links a { color: var(--on-surface-variant); font-weight: 500; font-size: 15px; position: relative; padding-block: .35rem; }
.nav-links a::after {
    content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: var(--gold);
    transform: scaleX(0); transition: transform var(--t-fast) var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-links a.active::after, .nav-links a:hover::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: .75rem; }

.lang-toggle {
    appearance: none; background: var(--surface-2); border: 1px solid var(--outline);
    border-radius: var(--radius); height: 40px; padding-inline: .9rem;
    font-family: inherit; font-weight: 500; font-size: 14px; color: var(--on-surface-variant); cursor: pointer;
    display: inline-flex; align-items: center; gap: .4rem; transition: all var(--t-fast) var(--ease);
}
.lang-toggle:hover { border-color: var(--primary); color: var(--primary); }
.nav-toggle { display: none; appearance: none; background: none; border: none; cursor: pointer; color: var(--primary); padding: .35rem; }

.avatar {
    width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff;
    display: inline-grid; place-items: center; font-weight: 500; font-size: 15px; cursor: pointer;
}
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 210px;
    background: #fff; border: 1px solid var(--outline); border-radius: var(--radius-md);
    box-shadow: var(--shadow-2); padding: .5rem; z-index: 60; display: none;
}
.dropdown.open .dropdown-menu { display: block; animation: fadeUp 160ms var(--ease) both; }
.dropdown-menu a, .dropdown-menu button {
    display: flex; align-items: center; gap: .6rem; width: 100%;
    padding: .6rem .7rem; border-radius: var(--radius); font-size: 14px; color: var(--on-surface-variant);
    background: none; border: none; font-family: inherit; cursor: pointer; text-align: start;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); color: var(--primary); }
.dropdown-menu .uname { padding: .4rem .7rem; font-size: 13px; color: var(--muted); }
.dropdown-menu .sep { height: 1px; background: var(--outline); margin: .4rem 0; }
.dropdown-menu .material-symbols-outlined { font-size: 19px; }

@media (max-width: 880px) {
    .nav-links { position: absolute; inset-inline: 0; top: 72px; flex-direction: column; align-items: stretch;
        background: #fff; border-bottom: 1px solid var(--outline); padding: 1rem var(--gutter); gap: .25rem; display: none; box-shadow: var(--shadow-1); }
    .nav-links.open { display: flex; }
    .nav-links a { padding: .7rem 0; }
    .nav-toggle { display: inline-grid; }
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer { background: var(--primary-deep); color: #cdd8d4; margin-top: auto; }
.site-footer .container { padding-block: 48px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: flex-start; }
.site-footer .brand { color: #fff; }
.site-footer .brand-tag { max-width: 360px; color: #9fb1ab; font-size: 14px; margin-top: .75rem; }

/* SSF brand lockups (off-white horizontal logo on dark backgrounds) */
.footer-logo-link { display: inline-block; }
.footer-logo-link img { height: 46px; width: auto; display: block; }
.side-logo-link { display: block; padding-inline: 6px; }
.side-logo-link img { width: 100%; max-width: 216px; height: auto; display: block; }
.side-portal { font-size: 11px; color: var(--gold); letter-spacing: .08em; text-transform: uppercase; font-weight: 500; padding-inline: 8px; margin-top: 8px; margin-bottom: 2rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-links a { color: #cdd8d4; font-size: 14px; }
.footer-links a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2rem; padding-top: 1.5rem; font-size: 13px; color: #8ea29c; }

/* =========================================================================
   Hero (landing) + auth split + sovereign pattern
   ========================================================================= */
.sov-pattern {
    background-color: var(--primary);
    background-image: radial-gradient(circle at 1px 1px, rgba(185,167,121,.18) 1px, transparent 0);
    background-size: 22px 22px;
}
.hero { position: relative; overflow: hidden; color: #fff; background: var(--primary); }
.hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(60% 80% at 80% 20%, rgba(185,167,121,.18), transparent 60%);
}
.hero .container { position: relative; z-index: 1; padding-block: clamp(56px, 9vw, 120px); }
.hero h1 { color: #fff; max-width: 18ch; }
.hero p { color: #cfe0db; font-size: clamp(16px, 2vw, 20px); max-width: 56ch; }
.hero .hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.hero .btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.hero .btn-secondary:hover { background: rgba(255,255,255,.1); border-color: #fff; color: #fff; }

.auth-wrap { display: grid; grid-template-columns: 1fr 0.85fr; gap: 2rem; align-items: start; max-width: 980px; margin-inline: auto; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { order: -1; } }
.auth-side { color: #fff; border-radius: var(--radius-lg); padding: 32px; }
.auth-side .material-symbols-outlined { font-size: 30px; color: var(--gold); }
.auth-side h3 { color: #fff; margin-top: 1rem; }
.auth-side p { color: #bcd0ca; }
.auth-side .secure { display: flex; align-items: center; gap: .6rem; color: #9fb1ab; font-size: 13px; margin-top: 1.5rem; }
.auth-side .secure .material-symbols-outlined { font-size: 18px; color: var(--gold); }

/* =========================================================================
   Admin shell (dashboard / management)
   ========================================================================= */
.admin-shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.admin-side {
    background: var(--primary); color: #cfe0db; display: flex; flex-direction: column;
    padding: 24px 18px; position: sticky; top: 0; height: 100vh;
}
.admin-side .brand { color: #fff; padding-inline: 6px; margin-bottom: 2rem; align-items: center; }
.admin-side .brand .b-name { font-size: 17px; line-height: 1.2; }
.admin-side .brand .b-sub { font-size: 11px; color: var(--gold); letter-spacing: .08em; text-transform: uppercase; font-weight: 500; }
.admin-nav { display: flex; flex-direction: column; gap: .25rem; flex: 1 1 auto; }
.admin-nav a {
    display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border-radius: var(--radius);
    color: #cfe0db; font-weight: 500; font-size: 15px; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a.active { background: rgba(185,167,121,.16); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
html[dir="rtl"] .admin-nav a.active { box-shadow: inset -3px 0 0 var(--gold); }
.admin-nav .material-symbols-outlined { font-size: 21px; }
.admin-side .side-cta { margin-top: 1rem; }
.admin-side .side-foot { color: #8ea29c; font-size: 12px; margin-top: 1rem; }

.admin-main { background: var(--surface); min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
    height: 72px; background: #fff; border-bottom: 1px solid var(--outline);
    display: flex; align-items: center; justify-content: space-between; padding-inline: 32px; gap: 1rem;
    position: sticky; top: 0; z-index: 40;
}
.admin-content { padding: 32px; }
.page-title { margin-bottom: 1.5rem; }
.page-title h1 { font-size: 28px; margin-bottom: .25rem; }
.page-title p { color: var(--muted); margin: 0; }

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { position: fixed; inset-inline-start: 0; top: 0; width: 264px; z-index: 80; transform: translateX(-110%); transition: transform var(--t-fast) var(--ease); }
    html[dir="rtl"] .admin-side { transform: translateX(110%); }
    .admin-side.open { transform: translateX(0); }
    .admin-content { padding: 20px; }
    .admin-topbar { padding-inline: 20px; }
}

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 800px) { .stat-grid { grid-template-columns: 1fr; } }
.stat-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.stat-card .stat-ico { width: 48px; height: 48px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--primary-tint); color: var(--primary); }
.stat-card .stat-val { font-size: 34px; font-weight: 600; line-height: 1; color: var(--on-surface); font-variant-numeric: tabular-nums; }
.stat-card .stat-lbl { color: var(--muted); font-size: 14px; margin-top: .35rem; }
.stat-card .stat-delta { color: var(--success); font-size: 12.5px; font-weight: 500; margin-top: .5rem; display: inline-block; }
.stat-card.stat-accent { background: var(--primary); color: #fff; border-color: transparent; }
.stat-card.stat-accent .stat-val, .stat-card.stat-accent .stat-lbl { color: #fff; }
.stat-card.stat-accent .stat-ico { background: rgba(255,255,255,.12); color: var(--gold); }
.stat-card.stat-accent .stat-delta { color: var(--gold-soft); }

/* Bars (applicants by dept) */
.bar-row { margin-bottom: 1rem; }
.bar-row .bar-head { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: .4rem; }
.bar-row .bar-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--primary-soft)); width: 0; transition: width 900ms var(--ease); }

/* Activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: .8rem; padding: .8rem 0; border-bottom: 1px solid var(--outline); }
.feed li:last-child { border-bottom: none; }
.feed .fdot { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-tint); color: var(--primary); display: grid; place-items: center; flex: 0 0 auto; }
.feed .fdot .material-symbols-outlined { font-size: 18px; }
.feed .ftxt { font-size: 14px; }
.feed .ftime { font-size: 12px; color: var(--muted); }

/* =========================================================================
   Job cards (public listing)
   ========================================================================= */
.jobs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 22px; }
.job-card { display: flex; flex-direction: column; gap: .85rem; height: 100%; }
.job-card .jc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.job-card .jc-dept { color: var(--gold-ink); font-weight: 500; font-size: 13px; }
.job-card h3 { font-size: 19px; margin: 0; }
.job-card .jc-desc { color: var(--on-surface-variant); font-size: 14px; flex: 1 1 auto;
    display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.job-card .jc-meta { display: flex; flex-wrap: wrap; gap: .5rem; }
.job-card .jc-foot { display: flex; align-items: center; justify-content: space-between; padding-top: .85rem; border-top: 1px solid var(--outline); }
.job-card .jc-foot .when { font-size: 12.5px; color: var(--muted); }

/* Job opportunity images */
.jc-image { margin: -24px -24px 2px; height: 160px; overflow: hidden; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--surface-2); }
.jc-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 400ms var(--ease); }
.job-card.has-image:hover .jc-image img { transform: scale(1.04); }
.job-banner { border-radius: var(--radius-lg); overflow: hidden; height: 280px; margin-bottom: 1.5rem; box-shadow: var(--shadow-1); }
.job-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 640px) { .job-banner { height: 180px; } }
.job-img-preview { width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--outline); margin-bottom: 10px; display: block; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 1.75rem; }
.toolbar .search { position: relative; flex: 1 1 280px; }
.toolbar .search .input { padding-inline-start: 42px; }
.toolbar .search .material-symbols-outlined { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 20px; }
.toolbar .select { width: auto; min-width: 160px; }

/* Job management page (stats + cards) */
.stat-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1040px) { .stat-grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stat-grid.cols-4 { grid-template-columns: 1fr; } }

.jm-card { display: flex; flex-direction: column; gap: .7rem; height: 100%; }
.jm-card-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.jm-title-link { display: block; text-decoration: none; color: inherit; }
.jm-title-link h3 { font-size: 19px; margin: .15rem 0 0; transition: color var(--t-fast) var(--ease); }
.jm-title-link:hover h3 { color: var(--primary); }
.jm-card .jc-desc { color: var(--on-surface-variant); font-size: 14px; flex: 1 1 auto; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jm-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.jm-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-top: .85rem; border-top: 1px solid var(--outline); }
.jm-appl { display: inline-flex; align-items: baseline; gap: .35rem; text-decoration: none; }
.jm-appl:hover .jm-appl-lbl { color: var(--primary); }
.jm-appl-num { font-size: 20px; font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; }
.jm-appl-lbl { font-size: 12.5px; color: var(--muted); }
.chip.chip-danger { background: var(--error-bg); color: var(--error); }
.chip.chip-danger .material-symbols-outlined { color: var(--error); }

/* Departments management */
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.dept-card { display: flex; align-items: flex-start; gap: 14px; }
.dept-card.is-inactive { opacity: .6; }
.dept-ico { width: 52px; height: 52px; flex: 0 0 auto; border-radius: var(--radius-md); background: var(--primary-tint); color: var(--primary); display: grid; place-items: center; }
.dept-ico .material-symbols-outlined { font-size: 28px; }
.dept-body { flex: 1 1 auto; min-width: 0; }
.dept-body > strong { font-weight: 500; display: block; }
.dept-actions { flex: 0 0 auto; }

/* Icon picker */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; max-height: 210px; overflow-y: auto; padding: 6px; border: 1px solid var(--outline); border-radius: var(--radius-md); background: var(--surface); }
.icon-opt { display: grid; place-items: center; aspect-ratio: 1; background: #fff; border: 1px solid var(--outline); border-radius: var(--radius); cursor: pointer; color: var(--on-surface-variant); transition: all var(--t-fast) var(--ease); }
.icon-opt:hover { border-color: var(--primary-soft); color: var(--primary); background: var(--primary-tint); }
.icon-opt.selected { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: var(--shadow-1); }
.icon-opt .material-symbols-outlined { font-size: 22px; }

/* Department select with live icon preview */
.dept-select { display: flex; align-items: stretch; gap: 8px; }
.dept-select-ico { flex: 0 0 auto; width: 48px; display: grid; place-items: center; background: var(--primary-tint); color: var(--primary); border-radius: var(--radius); font-size: 22px; }
.dept-select .select { flex: 1 1 auto; }

/* Department label with inline icon (job cards / details) */
.jc-dept { display: inline-flex; align-items: center; gap: .3rem; color: var(--gold-ink); font-weight: 500; font-size: 13px; }
.jc-dept .material-symbols-outlined { font-size: 16px; flex: 0 0 auto; }

/* =========================================================================
   Alerts
   ========================================================================= */
.alert { display: flex; align-items: flex-start; gap: .7rem; padding: 14px 16px; border-radius: var(--radius-md); font-size: 14px; margin-bottom: 1.25rem; }
.alert .material-symbols-outlined { font-size: 20px; flex: 0 0 auto; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error { background: var(--error-bg); color: var(--error); }
.alert-info { background: var(--info-bg); color: var(--primary); }

/* =========================================================================
   Workflow builder (create job)
   ========================================================================= */
.wf-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 1rem; }
.wf-step {
    display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
    background: #fff; border: 1px solid var(--outline); border-radius: var(--radius-md);
    transition: box-shadow var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.wf-step.dragging { opacity: .6; box-shadow: var(--shadow-2); border-color: var(--primary-soft); }
.wf-step.drop-target { border-color: var(--gold); }
.wf-step .wf-handle { cursor: grab; color: var(--muted); padding-top: 6px; touch-action: none; }
.wf-step .wf-num { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 500; margin-top: 4px; }
.wf-step .wf-body { flex: 1 1 auto; min-width: 0; }
.wf-step .wf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .wf-step .wf-grid { grid-template-columns: 1fr; } }
.wf-step .wf-del { color: var(--muted); background: none; border: none; cursor: pointer; padding: 6px; border-radius: var(--radius); transition: all var(--t-fast) var(--ease); margin-top: 4px; }
.wf-step .wf-del:hover { background: var(--error-bg); color: var(--error); }
.wf-moves { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.wf-moves button { color: var(--muted); background: none; border: none; cursor: pointer; padding: 2px 4px; border-radius: var(--radius-sm); transition: all var(--t-fast) var(--ease); line-height: 0; }
.wf-moves button:hover { background: var(--primary-tint); color: var(--primary); }
.wf-moves button:disabled { opacity: .35; cursor: not-allowed; }
.wf-moves .material-symbols-outlined { font-size: 18px; }
.wf-step .input { min-height: 42px; padding: 8px 12px; font-size: 14px; }
.wf-empty { color: var(--muted); text-align: center; padding: 1.5rem; border: 1.5px dashed var(--outline-strong); border-radius: var(--radius-md); }

.utility-bar { display: flex; gap: 1rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--outline); }

/* Pipeline view (job details) */
.pipeline { display: flex; flex-direction: column; gap: 0; }
.pipeline .pstep { display: flex; gap: 1rem; padding-bottom: 1.5rem; position: relative; }
.pipeline .pstep:not(:last-child)::before { content: ""; position: absolute; inset-inline-start: 16px; top: 34px; bottom: 0; width: 2px; background: var(--outline); }
html[dir="rtl"] .pipeline .pstep:not(:last-child)::before { inset-inline-start: auto; inset-inline-end: 16px; }
.pipeline .pnum { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; background: var(--primary-tint); color: var(--primary); display: grid; place-items: center; font-weight: 500; z-index: 1; border: 2px solid var(--primary-soft); }
.pipeline .pbody strong { display: block; font-weight: 500; }
.pipeline .pbody span { font-size: 13.5px; color: var(--muted); }

/* Utilities */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.stack > * + * { margin-top: 1.25rem; }
.divider { height: 1px; background: var(--outline); border: none; margin: 1.5rem 0; }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.flex-wrap { flex-wrap: wrap; }

/* =========================================================================
   Application-form field manager (create/edit job)
   ========================================================================= */
.fm-section { font-size: 15px; font-weight: 600; color: var(--primary); margin: 1.75rem 0 .75rem; padding-bottom: .5rem; border-bottom: 2px solid var(--primary-tint-2); }
.fm-section:first-of-type { margin-top: .25rem; }
.fm-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 14px 16px; border: 1px solid var(--outline); border-radius: var(--radius-md); margin-bottom: 10px; transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease); }
.fm-row:hover { border-color: var(--outline-strong); }
.fm-row.is-off { opacity: .55; background: var(--surface-2); }
.fm-info { flex: 1 1 auto; min-width: 0; }
.fm-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.fm-head strong { font-weight: 500; font-size: 15px; }
.fm-type { font-size: 11px; color: var(--gold-ink); background: var(--gold-glow); padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.fm-hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.fm-toggles { display: flex; gap: .5rem; flex: 0 0 auto; }
.fm-check { display: inline-flex; align-items: center; gap: .4rem; padding: 7px 12px; border: 1px solid var(--outline); border-radius: var(--radius); font-size: 13px; font-weight: 500; color: var(--on-surface-variant); cursor: pointer; user-select: none; transition: all var(--t-fast) var(--ease); white-space: nowrap; }
.fm-check input { accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }
.fm-check.on { border-color: var(--primary); color: var(--primary); background: var(--primary-tint); }
.fm-check input:disabled { opacity: .4; cursor: not-allowed; }
.fm-row-custom { flex-wrap: wrap; align-items: stretch; }
.fm-custom-body { flex: 1 1 320px; min-width: 0; }
.fm-custom-body .input, .fm-custom-body .select { min-height: 42px; padding: 8px 12px; font-size: 14px; }
@media (max-width: 660px) { .fm-row { flex-direction: column; } .fm-toggles { width: 100%; } }

/* Field search */
.fm-search { position: relative; margin-bottom: 1rem; }
.fm-search > .material-symbols-outlined { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 20px; pointer-events: none; }
.fm-search .input { padding-inline-start: 42px; }

/* Collapsible field-manager groups (accordion) */
.fm-group { border: 1px solid var(--outline); border-radius: var(--radius-md); margin-bottom: 10px; overflow: hidden; }
.fm-group-head { display: flex; align-items: center; gap: .6rem; width: 100%; padding: 13px 16px; background: var(--surface-2); border: none; cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 500; color: var(--on-surface); text-align: start; transition: background-color var(--t-fast) var(--ease); }
.fm-group-head:hover { background: var(--surface-3); }
.fm-group-title { flex: 1 1 auto; }
.fm-group-count { font-size: 12px; font-weight: 500; color: var(--primary); background: var(--primary-tint); padding: 3px 11px; border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fm-chevron { color: var(--muted); transition: transform var(--t-fast) var(--ease); }
.fm-group.is-collapsed .fm-chevron { transform: rotate(-90deg); }
html[dir="ltr"] .fm-group.is-collapsed .fm-chevron { transform: rotate(90deg); }
.fm-group-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.fm-group.is-collapsed .fm-group-body { display: none; }
.fm-group-body .fm-row { margin-bottom: 0; }

/* Two-column form layout with live preview aside (fills the full content width) */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; width: 100%; }
.form-main { min-width: 0; }
.form-aside { position: sticky; top: 88px; }
@media (max-width: 1080px) { .form-layout { grid-template-columns: 1fr; } .form-aside { display: none; } }

.preview-card { padding: 20px; }
.preview-head { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.1rem; }
.preview-ico { width: 40px; height: 40px; flex: 0 0 auto; border-radius: var(--radius-md); background: var(--primary-tint); color: var(--primary); display: grid; place-items: center; }
.preview-head strong { font-weight: 600; }
.preview-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 1.25rem; }
.preview-summary .ps-item { text-align: center; padding: 10px 6px; background: var(--surface-2); border-radius: var(--radius); }
.preview-summary .ps-item strong { display: block; font-size: 22px; font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; line-height: 1; }
.preview-summary .ps-item span { font-size: 11.5px; color: var(--muted); }
.preview-list { max-height: calc(100vh - 320px); overflow-y: auto; display: flex; flex-direction: column; gap: 1.1rem; padding-inline-end: 4px; }
.pv-sec-title { font-size: 12px; font-weight: 600; color: var(--gold-ink); margin-bottom: .35rem; }
.pv-item { display: flex; align-items: center; gap: .5rem; padding: 5px 0; font-size: 13.5px; color: var(--on-surface-variant); border-bottom: 1px dashed var(--outline); }
.pv-sec .pv-item:last-child { border-bottom: none; }
.pv-req { color: var(--error); font-weight: 700; width: 12px; text-align: center; flex: 0 0 auto; }
.pv-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary-soft); flex: 0 0 auto; margin-inline: 3px; }
.pv-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 1.5rem 0; }

/* Quick-jump nav + scroll anchoring + sticky save bar */
html { scroll-behavior: smooth; }
.form-jump { display: flex; flex-wrap: wrap; gap: .5rem; }
.form-section { scroll-margin-top: 88px; }
.form-sticky-bar { position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; padding: 14px 20px; background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); border: 1px solid var(--outline); border-radius: var(--radius-lg); box-shadow: 0 -6px 24px rgba(0, 0, 0, .07); }
.form-sticky-hint { font-size: 13px; }
.form-sticky-bar .sticky-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-inline-start: auto; }
@media (max-width: 560px) { .form-sticky-hint { display: none; } .form-sticky-bar .sticky-actions { width: 100%; } .form-sticky-bar .sticky-actions .btn { flex: 1 1 auto; } }

/* =========================================================================
   Interviews calendar
   ========================================================================= */
.cal-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.cal-month { font-size: 22px; margin: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-dow-row { margin-bottom: 8px; }
.cal-dow { text-align: center; font-size: 13px; font-weight: 500; color: var(--muted); padding: 6px 0; }
.cal-cell { min-height: 106px; border: 1px solid var(--outline); border-radius: var(--radius); padding: 6px; background: #fff; display: flex; flex-direction: column; gap: 4px; transition: border-color var(--t-fast) var(--ease); }
.cal-cell.cal-blank { background: var(--surface-2); border-style: dashed; }
.cal-cell.is-today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cal-day { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
.cal-num { font-weight: 500; font-size: 14px; font-variant-numeric: tabular-nums; }
.cal-cell.is-today .cal-num { background: var(--primary); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal-add { opacity: 0; background: none; border: none; cursor: pointer; color: var(--muted); border-radius: var(--radius-sm); line-height: 0; padding: 2px; transition: opacity var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.cal-cell:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-add:hover { background: var(--primary-tint); color: var(--primary); }
.cal-add .material-symbols-outlined { font-size: 18px; }
.cal-iv { display: flex; align-items: center; gap: .3rem; padding: 3px 6px; border-radius: var(--radius-sm); font-size: 11.5px; background: var(--primary-tint); color: var(--primary); text-decoration: none; overflow: hidden; border-inline-start: 3px solid var(--primary); transition: background-color var(--t-fast) var(--ease); }
.cal-iv:hover { background: var(--primary-tint-2); color: var(--primary-deep); }
.cal-iv.mode-Online { background: var(--gold-glow); color: #8c7c4f; border-inline-start-color: var(--gold); }
.cal-iv.mode-Phone { background: var(--info-bg); }
.cal-iv-time { font-weight: 600; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.cal-iv-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .cal-grid { gap: 4px; } .cal-cell { min-height: 78px; padding: 4px; } .cal-iv-name { display: none; } .cal-dow { font-size: 11px; } }

/* Agenda (list) view */
.agenda-item { display: flex; align-items: stretch; gap: 1rem; padding: 14px 16px; border: 1px solid var(--outline); border-radius: var(--radius-md); background: #fff; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.agenda-item:hover { border-color: var(--primary-soft); box-shadow: var(--shadow-1); }
.agenda-item.is-past { opacity: .6; }
.agenda-date { flex: 0 0 auto; min-width: 92px; text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding-inline-end: 1rem; border-inline-end: 1px solid var(--outline); }
.agenda-date .ad-day { font-size: 28px; font-weight: 600; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; }
.agenda-date .ad-mon { font-size: 12px; color: var(--muted); }
.agenda-date .ad-time { font-size: 13px; font-weight: 500; color: var(--on-surface-variant); margin-top: 4px; }
.agenda-body { flex: 1 1 auto; min-width: 0; }
.agenda-body > strong { font-weight: 500; }
.agenda-actions { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: .5rem; }
@media (max-width: 640px) {
    .agenda-item { flex-wrap: wrap; }
    .agenda-date { flex-direction: row; gap: .5rem; align-items: baseline; min-width: 0; width: 100%; border-inline-end: none; border-bottom: 1px solid var(--outline); padding-inline-end: 0; padding-bottom: 8px; text-align: start; }
    .agenda-date .ad-day { font-size: 18px; }
    .agenda-actions { flex-direction: row; width: 100%; justify-content: space-between; align-items: center; }
}

/* =========================================================================
   Filter chips + interview cards
   ========================================================================= */
a.chip { text-decoration: none; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
a.chip:hover { background: var(--primary-tint); color: var(--primary); }
.chip-active { background: var(--primary); color: #fff; }
.chip-active .material-symbols-outlined { color: #fff; }

/* Bulk selection (applicants flag/shortlist) */
.bulk-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 12px 16px; background: var(--primary-tint); border: 1px solid var(--primary-soft); border-radius: var(--radius-md); margin-bottom: 1rem; animation: fadeUp 160ms var(--ease) both; }
.bulk-bar[hidden] { display: none; }
.bulk-bar .bulk-count { font-weight: 500; color: var(--primary); }
.bulk-bar .bulk-count strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.bulk-bar .bulk-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-inline-start: auto; }
.table input[type="checkbox"] { accent-color: var(--primary); width: 17px; height: 17px; cursor: pointer; }
.jm-appl-badge { display: inline-grid; place-items: center; background: var(--primary); color: #fff; border-radius: 999px; padding: 0 7px; min-width: 20px; height: 20px; font-size: 12px; font-weight: 600; }

/* Applicants: dynamic filters + column chooser */
.filters-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 1.25rem; }
.filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-field .filter-label { display: inline-flex; align-items: center; gap: .25rem; font-size: 12px; color: var(--muted); font-weight: 500; }
.filter-field .filter-label .material-symbols-outlined { font-size: 15px; color: var(--gold-ink); }
.filter-field .select { min-width: 160px; min-height: 42px; padding: 8px 12px; font-size: 14px; }
.filters-clear { align-self: flex-end; }

.col-chooser { position: relative; margin-inline-start: auto; align-self: flex-end; }
.col-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; }
.col-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 70; width: 300px; max-width: 92vw; background: #fff; border: 1px solid var(--outline); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); animation: modalIn 160ms var(--ease) both; overflow: hidden; }
.col-menu[hidden] { display: none; }
.col-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--outline); background: var(--surface-2); }
.col-menu-title { font-size: 14px; font-weight: 600; }
.col-menu-x { background: none; border: none; cursor: pointer; color: var(--muted); padding: 2px; border-radius: var(--radius-sm); line-height: 0; }
.col-menu-x:hover { background: var(--surface-3); color: var(--on-surface); }
.col-search { position: relative; padding: 10px 12px 4px; }
.col-search .material-symbols-outlined { position: absolute; inset-inline-start: 22px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; pointer-events: none; }
.col-search input { width: 100%; min-height: 38px; padding: 8px 12px; padding-inline-start: 38px; border: 1px solid var(--outline-strong); border-radius: var(--radius); font-family: inherit; font-size: 13.5px; }
.col-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--gold-glow); }
.col-menu-list { display: flex; flex-direction: column; gap: 1px; max-height: 300px; overflow-y: auto; padding: 6px; }
.col-opt { display: flex; align-items: center; gap: .55rem; padding: 8px 10px; border-radius: var(--radius); font-size: 14px; cursor: pointer; }
.col-opt:hover { background: var(--surface-2); }
.col-opt input { accent-color: var(--primary); width: 16px; height: 16px; flex: 0 0 auto; }
.col-opt-ico { font-size: 18px; color: var(--gold-ink); flex: 0 0 auto; }
.col-opt-label { flex: 1 1 auto; min-width: 0; }
.col-menu-foot { display: flex; gap: .5rem; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--outline); background: var(--surface); }
.col-menu-foot .btn { flex: 1 1 0; }

.iv-card { border: 1px solid var(--outline); border-radius: var(--radius-md); padding: 16px; background: #fff; display: flex; flex-direction: column; gap: .6rem; }
.iv-card.is-cancelled { opacity: .55; }
.iv-when { display: flex; align-items: flex-start; gap: .6rem; }
.iv-when > .material-symbols-outlined { font-size: 24px; color: var(--primary); flex: 0 0 auto; }
.iv-when strong { display: block; font-weight: 500; }
.iv-dt { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.iv-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.iv-notes { font-size: 13.5px; color: var(--on-surface-variant); background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius); margin: 0; white-space: pre-line; }

/* =========================================================================
   Modal
   ========================================================================= */
.modal-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(0, 42, 36, .45); backdrop-filter: blur(2px);
    display: none; align-items: flex-start; justify-content: center;
    padding: 6vh 16px; overflow-y: auto;
}
.modal-overlay.open { display: flex; animation: fadeIn 160ms var(--ease) both; }
body.modal-open { overflow: hidden; }
.modal {
    background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-2);
    width: 100%; max-width: 520px; animation: modalIn 220ms var(--ease) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 20px 24px; border-bottom: 1px solid var(--outline); }
.modal-head h3 { margin: 0; font-size: 19px; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--muted); padding: 6px; border-radius: var(--radius); line-height: 0; transition: all var(--t-fast) var(--ease); }
.modal-close:hover { background: var(--surface-2); color: var(--on-surface); }
.modal-body { padding: 24px; }
.modal-foot { display: flex; gap: .75rem; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--outline); }
.modal .for-user { color: var(--muted); font-size: 14px; margin-bottom: 1.25rem; }
.modal .for-user strong { color: var(--on-surface); }

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