:root {
    --navy: #1f4e79;
    --navy-dark: #163a5b;
    --light: #ecf0f4;
    --green: #2e8b57;
    --green-dark: #256f46;
    --text: #22303c;
    --muted: #667486;
    --border: #d5dde5;
    --danger: #b23b3b;
    --white: #fff;
    --shadow: 0 1px 3px rgba(31,78,121,.12), 0 1px 2px rgba(31,78,121,.08);
    /* Dynamic content width: use most of the viewport on large screens while
       keeping comfortable side gutters and an upper bound for readability. */
    --content-width: min(1720px, 94vw);
    /* Spacing scale (Phase 1, Sprint 6) — reference these instead of ad-hoc px
       so vertical rhythm stays consistent across new components/views. */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    /* Corner radius scale */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-pill: 999px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--light);
    line-height: 1.5;
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- Top bar */
.topbar { background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.topbar-inner {
    max-width: var(--content-width); margin: 0 auto; padding: 10px 20px;
    display: flex; align-items: center; gap: 16px; row-gap: 8px; min-height: 60px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; flex-shrink: 0; order: 1; }
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 8px; background: var(--green);
    display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
.brand-logo {
    height: 34px; width: auto; max-width: 120px; object-fit: contain;
    border-radius: 4px;
}
.brand-text { font-size: 18px; font-weight: 600; }
.brand-text small { font-weight: 400; opacity: .8; font-size: 12px; }

.mainnav {
    display: flex; gap: 2px; order: 2; flex: 1 1 auto; flex-wrap: nowrap; align-items: center;
    margin-left: 8px;
}
.mainnav a {
    color: #dfe8f1; padding: 8px 10px; border-radius: 6px; font-size: 14px; white-space: nowrap;
}
.mainnav a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.mainnav a.nav-manager { color: #bfe6cf; }

/* Dropdown nav groups (native <details>) */
.navgroup { position: relative; }
.navgroup > summary {
    list-style: none; cursor: pointer; color: #dfe8f1; padding: 8px 12px; border-radius: 6px;
    font-size: 14px; white-space: nowrap; user-select: none; display: inline-flex; align-items: center; gap: 6px;
}
.navgroup > summary::-webkit-details-marker { display: none; }
.navgroup > summary::after {
    content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg); transition: transform .15s ease; margin-top: -2px; opacity: .8;
}
.navgroup[open] > summary::after { transform: rotate(-135deg); margin-top: 2px; }
.navgroup > summary:hover { background: rgba(255,255,255,.12); color: #fff; }
.navgroup[open] > summary { background: rgba(255,255,255,.14); color: #fff; }
.navgroup-menu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
    background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
    padding: 6px; min-width: 200px; display: flex; flex-direction: column; gap: 2px;
}
.navgroup-menu a {
    color: var(--text); padding: 9px 12px; border-radius: 6px; font-size: 14px; white-space: nowrap;
}
.navgroup-menu a:hover { background: var(--light); color: var(--navy); text-decoration: none; }
.navgroup-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.navgroup-header {
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); padding: 4px 12px 2px;
}
.navgroup-menu a .nav-module {
    display: inline-block; min-width: 74px; margin-right: 8px; font-size: 11px; font-weight: 600;
    letter-spacing: .03em; text-transform: uppercase; color: var(--muted);
}
.navgroup-menu a:hover .nav-module { color: var(--navy); }

/* Hamburger toggle (mobile only) */
.nav-toggle {
    display: none; order: 2; margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,.4);
    border-radius: 8px; width: 42px; height: 38px; cursor: pointer; padding: 0;
    flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }

.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; order: 3; margin-left: auto; }
.who { font-size: 14px; opacity: .9; }

/* User menu (dropdown on the signed-in employee's name, top-right) */
.usermenu > summary.who { opacity: 1; }
.usermenu-menu { left: auto; right: 0; }
.usermenu-signout { margin: 0; }
.usermenu-signout button {
    display: block; width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer;
    color: var(--text); padding: 9px 12px; border-radius: 6px; font-size: 14px; white-space: nowrap;
}
.usermenu-signout button:hover { background: var(--light); color: var(--navy); }
.inline-form { display: inline; margin: 0; }

/* ---------------------------------------------------------------- Responsive nav (phone / tablet) */
@media (max-width: 820px) {
    .nav-toggle { display: inline-flex; }
    .topbar-right { order: 4; margin-left: 12px; }
    .topbar-right .who { display: none; }
    /* Keep the user menu usable on mobile: show its trigger and render it as a
       proper white dropdown (not the stacked, transparent in-nav style). */
    .topbar-right .usermenu > summary.who { display: inline-flex; }
    .topbar-right .usermenu.navgroup { position: relative; }
    .topbar-right .usermenu-menu {
        position: absolute; right: 0; left: auto; top: calc(100% + 6px);
        background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); margin: 0;
        min-width: 200px;
    }
    .topbar-right .usermenu-menu a { color: var(--text); }
    .topbar-right .usermenu-menu a:hover { background: var(--light); color: var(--navy); }
    .topbar-right .usermenu-menu .navgroup-divider { background: var(--border); }
    .mainnav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; }
    .mainnav.nav-open { display: flex; }
    .mainnav a, .navgroup > summary { padding: 12px 10px; font-size: 15px; }
    .navgroup { position: static; }
    .navgroup-menu {
        position: static; box-shadow: none; border: 0; background: rgba(255,255,255,.06);
        margin: 2px 0 2px 12px; min-width: 0; padding: 4px;
    }
    .navgroup-menu a { color: #dfe8f1; }
    .navgroup-menu a:hover { background: rgba(255,255,255,.12); color: #fff; }
    .navgroup-header { color: #aab8c6; }
    .navgroup-divider { background: rgba(255,255,255,.15); }
    .navgroup-menu a .nav-module { color: #aab8c6; }
    .navgroup-menu a:hover .nav-module { color: #fff; }
}

/* ---------------------------------------------------------------- Buttons */
.btn {
    display: inline-block; border: 0; border-radius: 6px; cursor: pointer;
    font: inherit; font-size: 14px; padding: 8px 16px; text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #922f2f; color: #fff; }
.btn-light { background: #fff; color: var(--navy); border: 1px solid var(--border); }
.btn-light:hover { background: #eef3f8; }
.btn-ghost { background: transparent; color: #dfe8f1; border: 1px solid rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ---------------------------------------------------------------- Layout */
.page { max-width: var(--content-width); margin: 26px auto 60px; padding: 0 20px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; color: var(--navy); }
.page-head p { margin: 0; color: var(--muted); }

.card {
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px;
}
.card h2 { margin: 0 0 14px; font-size: 18px; color: var(--navy); }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Stat tiles */
.stat {
    background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--navy);
    border-radius: 10px; padding: 18px 20px; box-shadow: var(--shadow);
}
.stat.green { border-left-color: var(--green); }
.stat .num { font-size: 30px; font-weight: 700; color: var(--navy); }
.stat .lbl { color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { color: var(--muted); font-weight: 600; background: #f6f9fc; }
.table tr:hover td { background: #f9fbfd; }

/* ---------------------------------------------------------------- Badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-pending { background: #fdf0d5; color: #8a6d1a; }
.badge-approved { background: #dbf0e3; color: var(--green-dark); }
.badge-rejected, .badge-cancelled { background: #f6dede; color: var(--danger); }
.badge-acknowledged { background: #dbf0e3; color: var(--green-dark); }
.badge-neutral { background: #e4ebf2; color: var(--navy); }

/* ---------------------------------------------------------------- Forms */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
/* Shared form-component helpers (Phase 1, Sprint 6 — form-row TagHelper) */
.required-mark { color: var(--danger); font-weight: 700; }
.form-hint { font-size: 12px; color: var(--muted); margin: -2px 0 6px; }
.form-control, textarea, select, input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel] {
    width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px;
    font: inherit; font-size: 14px; background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
.field-validation-error, .validation-summary-errors { color: var(--danger); font-size: 13px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }

.dl { display: grid; grid-template-columns: 200px 1fr; gap: 10px 16px; }
.dl dt { color: var(--muted); font-size: 14px; }
.dl dd { margin: 0; font-size: 14px; }
@media (max-width: 620px) { .dl { grid-template-columns: 1fr; gap: 2px 0; } .dl dd { margin-bottom: 10px; } }

/* ---------------------------------------------------------------- Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.alert-success { background: #dbf0e3; color: var(--green-dark); border: 1px solid #b7ddc6; }
.alert-error { background: #f6dede; color: var(--danger); border: 1px solid #e6bcbc; }
.alert-info { background: #dde9f3; color: var(--navy); border: 1px solid #bcd3e6; }

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

/* ---------------------------------------------------------------- Auth / careers */
.auth-wrap { max-width: 420px; margin: 60px auto; }
.auth-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 30px; }
.auth-card h1 { color: var(--navy); font-size: 22px; margin: 0 0 6px; }

.hero { background: linear-gradient(135deg, var(--navy), var(--navy-dark)); color: #fff; border-radius: 12px; padding: 46px 40px; margin-bottom: 24px; }
.hero h1 { font-size: 32px; margin: 0 0 10px; }
.hero p { font-size: 17px; opacity: .92; margin: 0 0 20px; max-width: 620px; }

.job { border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; background: #fff; margin-bottom: 14px; box-shadow: var(--shadow); }
.job h3 { margin: 0 0 6px; color: var(--navy); font-size: 18px; }
.job .meta { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.job .meta span { margin-right: 16px; }



/* ---------------------------------------------------------------- Checkbox grid (multi-select) */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 18px; margin-top: 4px; }
.checkbox-item { display: flex; align-items: center; gap: 8px; font-weight: normal; cursor: pointer; }
.checkbox-item input { width: auto; margin: 0; }
.checkbox-item span { font-size: 14px; }



/* ---------------------------------------------------------------- Tabbed detail view (menu-style sections) */
.tabs { margin-bottom: 18px; }
.tab-nav {
    display: flex; flex-wrap: wrap; gap: 4px;
    border-bottom: 2px solid var(--border); margin-bottom: 18px;
}
.tab-nav button {
    appearance: none; background: transparent; border: none; cursor: pointer;
    padding: 10px 18px; font-size: 14px; font-weight: 600; color: var(--muted);
    border-bottom: 3px solid transparent; margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}
.tab-nav button:hover { color: var(--navy); }
.tab-nav button.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
@media (max-width: 620px) {
    .tab-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tab-nav button { white-space: nowrap; }
}

/* ---------------------------------------------------------------- Responsive: phone / tablet */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 760px) {
    .topbar-inner { padding: 10px 14px; }
    .page { padding: 0 14px; margin: 16px auto 48px; }
    .page-head h1 { font-size: 22px; }
    .card { padding: 16px; }
    .hero { padding: 30px 22px; }
    .hero h1 { font-size: 24px; }
    .form-actions { flex-wrap: wrap; }
    .form-actions .btn { flex: 1 1 auto; }
    /* Wide tables scroll horizontally instead of squashing */
    .table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .dl { grid-template-columns: 1fr; gap: 2px 0; }
    .dl dd { margin-bottom: 10px; }
}



/* ---------------------------------------------------------------- Recruiting pipeline board */
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 12px; align-items: start; }
.pipeline-col { background: #f6f9fc; border: 1px solid var(--border); border-radius: 10px; padding: 10px; min-height: 80px; }
.pipeline-col h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: flex; justify-content: space-between; align-items: center; }
.pipeline-col h3 .count { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; font-size: 12px; color: var(--navy); }
.pipeline-col.terminal { background: #eef1f4; }
.pcard { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); }
.pcard a.name { font-weight: 600; color: var(--navy); font-size: 14px; }
.pcard .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pcard .rate { color: #b8860b; font-size: 12px; }
.pipeline-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
@media (max-width: 900px) {
    .pipeline { grid-template-columns: repeat(6, 78vw); }
}
.badge-stage-new { background: #fdf0d5; color: #8a6d1a; }
.badge-stage-screening { background: #e4ebf2; color: var(--navy); }
.badge-stage-interview { background: #dbe7fb; color: #2c5aa0; }
.badge-stage-offer { background: #e6dcf5; color: #6b3fa0; }
.badge-stage-hired { background: #dbf0e3; color: var(--green-dark); }
.badge-stage-rejected { background: #f6dede; color: var(--danger); }


/* ---------------------------------------------------------------- Footer */
.footer { border-top: 1px solid var(--border); background: var(--white); }
.footer-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}



/* ---------------------------------------------------------------- Recruiting Workflow */
.workflow-container {
    max-width: var(--content-width);
    margin: 0 auto;
}

.workflow-header {
    margin-bottom: 30px;
}

.applicant-info {
    font-size: 16px;
    color: var(--muted);
}

.applicant-info .email {
    margin-left: 10px;
    font-size: 14px;
}

/* Horizontal progress bar */
.workflow-progress-bar {
    display: flex;
    align-items: center;
    margin: 30px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.progress-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.stage-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e9ecef;
    border: 3px solid #dee2e6;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 18px;
    color: #6c757d;
    transition: all 0.2s;
}

.progress-stage.stage-complete .stage-icon {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.progress-stage.stage-active .stage-icon {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(31, 78, 121, 0.2);
}

.stage-label {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: var(--text);
}

.progress-connector {
    flex: 1;
    height: 3px;
    background: #dee2e6;
    margin: 0 8px;
    min-width: 30px;
}

.progress-connector.complete {
    background: var(--green);
}

/* Stage cards */
.workflow-stages {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stage-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: all 0.2s;
}

.stage-card.active {
    border-color: var(--navy);
}

.stage-card.complete {
    background: #f8f9fa;
}

.stage-card-header {
    padding: 20px;
    cursor: pointer;
    user-select: none;
}

.stage-card-header:hover {
    background: rgba(31, 78, 121, 0.03);
}

.stage-card-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stage-description {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.stage-meta {
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.status-badge.complete {
    background: var(--green);
    color: #fff;
}

.status-badge.in-progress {
    background: #ffc107;
    color: #000;
}

.stage-card-body {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stage-card-body.expanded {
    padding: 20px;
    max-height: 5000px;
}

.stage-card-body.collapsed {
    max-height: 0;
    padding: 0 20px;
}

.stage-form {
    margin-bottom: 20px;
}

.question-group {
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 6px;
}

.question-group label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.question-group .required {
    color: var(--danger);
    margin-left: 4px;
}

.question-readonly {
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-left: 4px solid var(--green);
}

.question-readonly strong {
    display: block;
    margin-bottom: 6px;
}

.question-readonly .answer {
    color: var(--text);
}

.stage-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.stage-documents {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.stage-documents h4 {
    font-size: 16px;
    margin-bottom: 12px;
}

.document-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.document-list li {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-link {
    flex: 1;
    font-weight: 500;
}

.doc-meta {
    font-size: 12px;
    color: var(--muted);
}

.btn-link-danger {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 12px;
    text-decoration: underline;
}

.btn-link-danger:hover {
    color: #8b2b2b;
}

.upload-form {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.workflow-footer {
    margin: 40px 0;
    text-align: center;
}



/* ===================================================================
   New Hire wizard (one card/slide per step)
   =================================================================== */
.progress-stage { cursor: pointer; }
.progress-stage.locked { cursor: not-allowed; opacity: 0.55; }
.progress-stage.viewing .stage-label { color: var(--navy); text-decoration: underline; }
.progress-stage.viewing .stage-icon { box-shadow: 0 0 0 4px rgba(31, 78, 121, 0.18); }

.workflow-slides { margin-top: 8px; }
.wizard-slide { display: none; }              /* JS reveals the active one */
.wizard-slide .slide-card { width: 100%; max-width: 1100px; margin: 0 auto; }

.stage-card.slide-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 0;
}
.stage-card.slide-card .stage-card-header {
    padding: 20px 24px 8px;
    border-bottom: 1px solid #eef1f4;
}
.stage-card.slide-card .stage-card-body { padding: 20px 24px 24px; }

/* Wizard navigation bar (Prev / Next) */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #eef1f4;
}

/* Two-up form row */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 640px) { .form-row-2 { grid-template-columns: 1fr; } }

/* Candidate summary (step 0, after creation) */
.candidate-summary {
    display: grid;
    grid-template-columns: 140px 1fr;
    row-gap: 10px;
    margin: 0;
}
.candidate-summary dt { font-weight: 600; color: #6c757d; }
.candidate-summary dd { margin: 0; }
.status-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--navy);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

/* File-type question block */
.question-file-block {
    border: 1px dashed #cfd6dd;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 16px 0;
    background: #fbfcfd;
}
.question-file-block > label { font-weight: 600; display: block; margin-bottom: 4px; }
.question-file-block .upload-form { margin-top: 10px; }
.question-file-block .form-row { display: flex; gap: 8px; align-items: center; }



/* --- Workflow admin reorder (up/down) buttons --- */
.reorder-cell { display: flex; align-items: center; gap: 8px; }
.reorder-num { min-width: 18px; text-align: center; font-weight: 600; color: #64748b; }
.reorder-btns { display: inline-flex; flex-direction: column; gap: 2px; }
.reorder-btn {
    line-height: 1;
    padding: 1px 6px;
    font-size: 11px;
    cursor: pointer;
}
.reorder-btn:disabled { opacity: 0.3; cursor: default; }



/* ---- New Hire wizard: documents to send + applicant portal ---- */
.secure-link-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.secure-link-input { flex: 1 1 320px; min-width: 220px; font-family: monospace; font-size: 12px; }

/* Multi-column layout: optional left panels column + center content + optional right sidebar */
.stage-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.stage-layout:not(.has-sidebar):not(.has-panels-left) {
    display: block; /* Single column when neither side column is present */
}
.stage-layout > .stage-card {
    flex: 1 1 55%;
    min-width: 0;
    max-width: none; /* fill remaining width when panels/sidebar are present */
}
.stage-sidebar {
    flex: 0 0 340px;
    min-width: 280px;
}
/* Left column holding admin-defined custom action panels */
.stage-panels-left {
    flex: 0 0 320px;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sidebar-card {
    position: sticky;
    top: 20px;
}

.send-docs-list { list-style: none; margin: 10px 0; padding: 0; }
.send-doc-item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 7px 4px; border-bottom: 1px solid #e6ede6;
}
.send-doc-item:last-child { border-bottom: none; }
.send-doc-check { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; margin: 0; }
.send-doc-name { font-weight: 600; }
.send-doc-phase {
    font-size: 11px; background: #e2ecf7; color: #2c4f77;
    padding: 1px 7px; border-radius: 10px;
}
.send-doc-required {
    font-size: 11px; background: #fbe6e6; color: #9a3131;
    padding: 1px 7px; border-radius: 10px;
}
.send-docs-options { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.send-opt { display: flex; align-items: center; gap: 6px; margin: 0; }

.doc-badge { font-size: 11px; padding: 2px 9px; border-radius: 10px; white-space: nowrap; }
.doc-badge.notsent { background: #ececec; color: #666; }
.doc-badge.sent { background: #e2ecf7; color: #2c4f77; }
.doc-badge.complete { background: #e3f5e3; color: #256b25; }

/* Built-in stage action panel (schedule interview / create offer) */
.stage-action-card { margin-bottom: 16px; }
.action-required-note {
    font-size: 12px; padding: 8px 10px; border-radius: 6px; margin-bottom: 12px;
    line-height: 1.4;
}
.action-required-note.pending { background: #fdf3e2; color: #8a5a12; border: 1px solid #f2d9a8; }
.action-required-note.ok { background: #e3f5e3; color: #256b25; border: 1px solid #bfe3bf; }

.action-item-list { list-style: none; margin: 0 0 12px; padding: 0; }
.action-item {
    padding: 9px 4px; border-bottom: 1px solid #e6ede6;
}
.action-item:last-child { border-bottom: none; }
.action-item-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.action-item-title { font-weight: 600; }
.action-item-meta {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-size: 12px; color: #666; margin-top: 3px;
}
.action-item-link { font-size: 12px; font-weight: 600; margin-left: auto; white-space: nowrap; }

.offer-badge { font-size: 11px; padding: 2px 9px; border-radius: 10px; white-space: nowrap; }
.offer-badge.draft { background: #ececec; color: #666; }
.offer-badge.sent { background: #e2ecf7; color: #2c4f77; }
.offer-badge.accepted { background: #e3f5e3; color: #256b25; }
.offer-badge.declined { background: #fbe6e6; color: #9a3131; }
.offer-badge.expired { background: #f3e9d2; color: #7a5c15; }

/* Applicant secure portal */
.applicant-docs { max-width: 640px; }
.applicant-doc-list { list-style: none; margin: 16px 0; padding: 0; }
.applicant-doc-item {
    padding: 14px; border: 1px solid #e0e0e0; border-radius: 8px; margin-bottom: 12px;
}
.applicant-doc-item.done { background: #f6fbf6; border-color: #cfe6cf; }
.applicant-doc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.applicant-doc-name { font-weight: 600; }
.applicant-doc-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.applicant-upload-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted.small { font-size: 12px; }

@media (max-width: 820px) {
    .stage-layout.has-sidebar, .stage-layout.has-panels-left { flex-direction: column; }
    .stage-sidebar { flex: 1 1 auto; width: 100%; }
    .stage-panels-left { flex: 1 1 auto; width: 100%; }
    .sidebar-card { position: static; }
    .send-doc-item { flex-direction: column; align-items: flex-start; }
    .applicant-doc-head { flex-direction: column; align-items: flex-start; }
}



/* ---------------------------------------------------------------- Analytics charts */
.chart-empty { color: var(--muted); font-style: italic; padding: 12px 0; }

/* Horizontal bars */
.chart-bars { display: flex; flex-direction: column; gap: 10px; }
.chart-bar-row { display: flex; align-items: center; gap: 10px; }
.chart-bar-label { flex: 0 0 140px; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-bar-track { flex: 1 1 auto; background: #eef1f5; border-radius: 6px; height: 18px; overflow: hidden; }
.chart-bar-fill { height: 100%; border-radius: 6px; min-width: 2px; transition: width .3s ease; }
.chart-bar-value { flex: 0 0 60px; text-align: right; font-size: 13px; font-weight: 600; color: var(--navy); }

/* Donut */
.chart-donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.chart-donut-total { font-size: 22px; font-weight: 700; fill: var(--navy); }
.chart-donut-sub { font-size: 11px; fill: var(--muted); }
.chart-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.chart-legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.chart-legend-dot { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.chart-legend-label { flex: 1 1 auto; color: var(--text); }
.chart-legend-val { color: var(--muted); font-weight: 600; }

/* Trend columns */
.chart-trend { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 10px; }
.chart-trend-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.chart-trend-bar-wrap { flex: 1 1 auto; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-trend-bar { width: 70%; max-width: 34px; background: var(--navy); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .3s ease; }
.chart-trend-val { font-size: 11px; font-weight: 600; color: var(--navy); }
.chart-trend-label { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Analytics layout helpers */
.analytics-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.chart-card-title { margin: 0 0 14px; font-size: 15px; color: var(--navy); font-weight: 600; }
.stat.wide .num { font-size: 24px; }

/* Clickable chart-card title that reveals a customization panel. Rendered as a
   full-width button so the whole title row is the click target. */
button.chart-card-title-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px 0;
    font-family: inherit;
}
button.chart-card-title-toggle:hover { color: #2a6db0; }
.chart-card-title-toggle .customize-hint {
    font-size: 13px;
    font-weight: 500;
    color: #6b7684;
    white-space: nowrap;
    margin-left: 10px;
}
.chart-card-title-toggle:hover .customize-hint { color: #2a6db0; }
.chart-card-title-toggle .chevron { display: inline-block; transition: transform .15s ease; }
.chart-card-title-toggle.is-open .chevron { transform: rotate(180deg); }


/* ---------------------------------------------------------------- Print / Save-as-PDF
   Lets any analytics dashboard or report be saved to PDF with charts intact via the
   browser's built-in "Print → Save as PDF". Chrome/Edge print background graphics by
   default for color-adjust:exact, so bars/donuts keep their colors. */
.print-actions { display: inline-flex; gap: 8px; }

@media print {
    /* Hide app chrome and interactive-only elements */
    .topbar, .footer, .sidebar, nav, .no-print,
    .print-actions, .analytics-toolbar .btn,
    .report-columns, #reportForm { display: none !important; }

    body { background: #fff !important; }
    .page { max-width: none !important; margin: 0 !important; padding: 0 !important; }

    /* Print report title banner (populated per-page) */
    .print-title { display: block !important; }

    /* Keep colors of chart fills, badges, buttons-turned-labels */
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

    /* Cards flatten to clean bordered blocks; don't split a chart across pages */
    .card, .chart-card, .stat, .chart-donut-wrap, .chart-bars, .chart-trend,
    table, tr, .chart-bar-row { break-inside: avoid; page-break-inside: avoid; }

    .card, .chart-card { box-shadow: none !important; border: 1px solid #d5dde5 !important; }

    /* Stat tiles sit inline nicely on paper */
    .grid-2, .grid-3 { display: grid !important; }

    a[href]:after { content: ""; } /* don't append URLs after links */
    h2, h3 { color: #1f4e79 !important; }
}

/* A print-only heading shown at the top of a saved PDF */
.print-title { display: none; font-size: 18px; font-weight: 700; color: #1f4e79; margin: 0 0 4px; }
.print-sub { display: none; font-size: 12px; color: #667486; margin: 0 0 16px; }
@media print { .print-sub { display: block !important; } }



/* ---- Inventory request status badges (statuses owned by desktop schema) ---- */
.badge-denied { background: #f6dede; color: var(--danger); }
.badge-fulfilled { background: #dbf0e3; color: var(--green-dark); }

/* ---- Star / quick-action toggle (shown on main module pages) ---- */
.star-toggle-form { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.star-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff; border: 1px solid #d5dde5; border-radius: 999px;
    padding: 4px 12px; font-size: 13px; font-weight: 600; color: #667486;
    cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.star-toggle:hover { background: #f4f7fa; color: #1f4e79; }
.star-toggle .star-icon { font-size: 16px; line-height: 1; color: #b7bfc9; }
.star-toggle.is-starred { border-color: #e6c34a; color: #8a6d1a; background: #fdf9ec; }
.star-toggle.is-starred .star-icon { color: #e6b800; }



/* ---------------------------------------------------------------- Loading Spinner */
.spinner-overlay {
    position: fixed; inset: 0; background: rgba(31, 48, 60, 0.4);
    display: none; align-items: center; justify-content: center; z-index: 9999;
}
.spinner-overlay.is-active { display: flex; }
.spinner {
    width: 50px; height: 50px; border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff; border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}
@keyframes spinner-rotate {
    to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------- Toast Notifications */
.toast-container {
    position: fixed; top: 80px; right: 20px; z-index: 10000;
    display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
    min-width: 300px; max-width: 500px; padding: 14px 18px; border-radius: 6px;
    background: #fff; box-shadow: 0 4px 12px rgba(31, 48, 60, 0.15);
    display: flex; align-items: center; gap: 12px;
    opacity: 0; transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: auto;
}
.toast.is-visible { opacity: 1; transform: translateX(0); }
.toast-icon {
    width: 20px; height: 20px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.toast-message { flex: 1; font-size: 14px; line-height: 1.4; }
.toast-close {
    background: none; border: none; font-size: 18px; color: #667486;
    cursor: pointer; padding: 0; width: 20px; height: 20px; line-height: 1;
    display: grid; place-items: center;
}
.toast-close:hover { color: #22303c; }

.toast.success .toast-icon { background: #d4edda; color: #155724; }
.toast.success .toast-message { color: #155724; }
.toast.error .toast-icon { background: #f8d7da; color: #721c24; }
.toast.error .toast-message { color: #721c24; }
.toast.info .toast-icon { background: #d1ecf1; color: #0c5460; }
.toast.info .toast-message { color: #0c5460; }
.toast.warning .toast-icon { background: #fff3cd; color: #856404; }
.toast.warning .toast-message { color: #856404; }



/* ============================================================
   Inventory retail store (employee catalog + request cart)
   ============================================================ */
.store-layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}
.store-main { flex: 1; min-width: 0; }

.store-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.chip {
    border: 1px solid #d0d7de;
    background: #fff;
    color: #3F4C5E;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s ease;
}
.chip:hover { border-color: #1F4E79; }
.chip-active {
    background: #1F4E79;
    border-color: #1F4E79;
    color: #fff;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
@media (max-width: 1200px) { .store-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .store-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .store-grid { grid-template-columns: 1fr; } }

.store-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e9ee;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow .15s ease, transform .15s ease;
}
.store-card:hover { box-shadow: 0 6px 18px rgba(31,78,121,.12); transform: translateY(-2px); }
.store-card-media {
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #1F4E79, #2E8B57);
}
.store-card-body { padding: 12px 14px; flex: 1; }
.store-card-cat {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #8a94a2;
    margin-bottom: 4px;
}
.store-card-name { font-weight: 600; color: #2b3440; margin-bottom: 6px; }
.store-card-desc { font-size: 12px; color: #6b7480; margin-bottom: 8px; }
.store-card-price { font-size: 18px; font-weight: 700; color: #1F4E79; }
.store-card-stock { font-size: 12px; color: #2E8B57; margin-top: 4px; }
.store-card-stock.oos { color: #b02a37; }
.store-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px 14px;
    border-top: 1px solid #f0f2f5;
}
.store-card-actions .qty-input { width: 56px; }
.store-card-actions .btn { flex: 1; }

/* Sticky cart sidebar */
.store-cart { width: 320px; flex-shrink: 0; }
.store-cart-inner {
    position: sticky;
    top: 20px;
    border: 1px solid #e5e9ee;
    border-radius: 10px;
    background: #fff;
    padding: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.cart-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
}
.cart-line-info { min-width: 0; }
.cart-line-name { font-weight: 600; font-size: 14px; color: #2b3440; }
.cart-line-right { display: flex; align-items: center; gap: 8px; }
.cart-qty { width: 52px; }
.cart-line-total { font-weight: 600; color: #1F4E79; min-width: 62px; text-align: right; }
.cart-remove {
    border: none;
    background: transparent;
    color: #b02a37;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.store-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 16px;
    border-bottom: 2px solid #1F4E79;
    margin-bottom: 6px;
}
.store-cart-total strong { font-size: 20px; color: #1F4E79; }

@media (max-width: 900px) {
    .store-layout { flex-direction: column; }
    .store-cart { width: 100%; }
    .store-cart-inner { position: static; }
}



/* ============================================================
   Group 6: UX Polish - Button states, transitions, accessibility
   ============================================================ */

/* Button loading states & smooth transitions */
.btn {
    transition: all 0.2s ease-in-out;
    position: relative;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Focus visible for keyboard navigation accessibility */
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #1F4E79;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Smooth transitions for inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #1F4E79;
    box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.1);
}

/* Loading spinner animation refinement */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    animation: spin 0.8s linear infinite;
}

/* Toast slide-in animation */
.toast {
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.is-visible {
    transform: translateX(0);
}

/* Card hover effects for interactive elements */
.store-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.store-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}



/* ============================================================
   Modal dialogs (shared across app)
   ============================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal h3 {
    margin-top: 0;
    margin-bottom: 16px;
}



/* ============================================================
   MOBILE-RESPONSIVE FOUNDATION (Phase 1, Sprint 1)
   ------------------------------------------------------------
   Adds the pieces the codebase was missing:
   - visibility/stacking utility classes
   - 44px minimum touch targets on small screens
   - 16px form-control text on mobile (prevents iOS zoom-on-focus)
   - a .responsive-table wrapper alias
   NOTE: media-query conditions cannot use CSS custom properties,
   so breakpoints are written as literals. Shared breakpoints:
     mobile  <= 480px
     tablet  <= 768px
   ============================================================ */

/* ---- Responsive visibility / stacking utilities ---- */
.hide-mobile { display: initial; }
.show-mobile { display: none; }

@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: initial !important; }
    /* Stack any fl/flex row into a column on small screens */
    .stack-mobile { flex-direction: column !important; align-items: stretch !important; }
    .stack-mobile > * { width: 100%; }
}

/* ---- Responsive table wrapper (explicit alias for .table-wrap) ----
   Bare .table already scrolls at <=760px via the global rule, but wrapping
   a table in .responsive-table keeps the horizontal scroll contained without
   turning the table into a block element, which reads better for very wide
   admin grids. */
.responsive-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.responsive-table > .table { white-space: nowrap; }

/* ---- Touch targets & mobile form ergonomics ---- */
@media (max-width: 768px) {
    /* WCAG / mobile: interactive controls should be at least ~44px tall */
    .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .btn-sm { min-height: 40px; }

    /* 16px text stops iOS Safari from auto-zooming when a field is focused */
    .form-control, textarea, select,
    input[type=text], input[type=email], input[type=password],
    input[type=date], input[type=tel], input[type=number] {
        font-size: 16px;
        min-height: 44px;
    }
    textarea { min-height: 96px; }

    /* In table action cells, stack inline forms/buttons vertically so they
       don't overflow. Scoped to tables so the topbar sign-out form is unaffected. */
    .table td .inline-form { display: block; margin-bottom: 6px; }
    .table td .inline-form:last-child { margin-bottom: 0; }
    .table td .btn { width: 100%; }
}
