/* =========================================================
   Cloud9 Security Platform — admin UI
   Brand: uniform grey + sky blue (matches the public website)
   ========================================================= */
:root {
  --c9-grey-950: #15191d;
  --c9-grey-900: #1f2429;
  --c9-grey-800: #2c333a;
  --c9-grey-700: #3b444d;
  --c9-grey-600: #59636e;
  --c9-grey-400: #9aa4ae;
  --c9-grey-200: #d9dee3;
  --c9-grey-100: #eef1f4;
  --c9-grey-50:  #f6f8fa;
  --c9-sky:      #4fc3f7;
  --c9-sky-300:  #8fd8fa;
  --c9-sky-100:  #e3f5fd;
  --c9-sky-700:  #0a6f9f;
  --sidebar-w: 260px;

  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: var(--c9-grey-700);
  --bs-link-color: var(--c9-sky-700);
  --bs-link-color-rgb: 10, 111, 159;
  --bs-link-hover-color: var(--c9-grey-900);
  --bs-border-radius: .6rem;
}

body { background: var(--c9-grey-100); }
h1, h2, h3, h4, h5, h6 { color: var(--c9-grey-900); }
.sky { color: var(--c9-sky); }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--c9-sky-700); }

/* Accessibility */
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 2000; background: var(--c9-sky); color: var(--c9-grey-950); padding: .6rem 1rem; border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid var(--c9-sky); outline-offset: 2px; }
.form-control:focus, .form-select:focus, .btn:focus-visible { border-color: var(--c9-sky-700); box-shadow: 0 0 0 .25rem rgba(79,195,247,.4); }

/* Buttons */
.btn-sky { background: var(--c9-sky); border: 1px solid var(--c9-sky); color: var(--c9-grey-950); font-weight: 600; }
.btn-sky:hover, .btn-sky:focus-visible { background: var(--c9-sky-300); border-color: var(--c9-sky-300); color: var(--c9-grey-950); }
.btn-icon { border: 0; font-size: 1.5rem; line-height: 1; padding: .25rem .5rem; color: var(--c9-grey-800); }

/* ---------- Layout ---------- */
.sidebar { background: var(--c9-grey-900); color: var(--c9-grey-200); }
@media (min-width: 992px) {
  /* Bootstrap makes .offcanvas-lg transparent on large screens — restore the dark panel */
  .sidebar.offcanvas-lg { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); overflow-y: auto; z-index: 1030;
    background-color: var(--c9-grey-900) !important; flex-direction: column; }
  .main-col { margin-left: var(--sidebar-w); }
}
@media (max-width: 991.98px) {
  .sidebar.offcanvas-lg { --bs-offcanvas-width: 280px; background: var(--c9-grey-900); }
}
.main-col { min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.content { min-width: 0; }   /* let wide tables scroll inside .table-responsive instead of stretching the page */

.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar .brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; }
.sidebar .brand strong { display: block; font-size: 1.25rem; letter-spacing: .05em; line-height: 1; }
.sidebar .brand small { display: block; font-size: .65rem; letter-spacing: .25em; text-transform: uppercase; color: var(--c9-grey-400); margin-top: 3px; }
.sidebar-nav { padding: 1rem .75rem 2rem; width: 100%; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .16em; color: var(--c9-grey-400); padding: 1rem .75rem .4rem; font-weight: 700; }
.nav-item-link { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: .5rem; color: var(--c9-grey-200); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav-item-link i { font-size: 1.1rem; width: 1.2rem; text-align: center; }
.nav-item-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item-link.active { background: rgba(79,195,247,.14); color: #fff; box-shadow: inset 3px 0 0 var(--c9-sky); }
.nav-item-link.active i { color: var(--c9-sky); }
.nav-item-link.disabled { color: var(--c9-grey-400); cursor: default; }
.nav-item-link.disabled:hover { background: transparent; color: var(--c9-grey-400); }
.soon { margin-left: auto; font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; padding: .15rem .45rem; border-radius: 999px; background: rgba(255,255,255,.08); }

.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem; background: #fff; border-bottom: 1px solid var(--c9-grey-200); padding: .65rem 1.25rem; min-height: 64px; }
.page-title { font-size: 1.2rem; margin: 0; font-weight: 700; }
.user-btn { display: flex; align-items: center; gap: .6rem; border: 0; padding: .25rem .5rem; }
.user-btn::after { margin-left: .25rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--c9-grey-800); color: var(--c9-sky); display: grid; place-items: center; font-weight: 700; font-size: .9rem; flex-shrink: 0; }

.content { flex: 1; padding: 1.5rem 1.25rem; }
@media (min-width: 1200px) { .content { padding: 2rem; } }
.admin-footer { padding: 1rem 1.25rem; font-size: .8rem; color: var(--c9-grey-600); border-top: 1px solid var(--c9-grey-200); background: #fff; }

/* ---------- Components ---------- */
.panel { border: 1px solid var(--c9-grey-200); box-shadow: 0 1px 2px rgba(21,25,29,.04); }
.panel .card-header { background: #fff; border-bottom: 1px solid var(--c9-grey-200); padding: .9rem 1.25rem; }
.welcome { border-left: 4px solid var(--c9-sky); }

.stat-tile { display: flex; align-items: center; gap: 1rem; background: #fff; border: 1px solid var(--c9-grey-200); border-radius: .75rem; padding: 1.15rem 1.25rem; height: 100%; }
.stat-tile > i { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; background: var(--c9-grey-800); color: var(--c9-sky); flex-shrink: 0; }
.stat-tile.accent { border-color: var(--c9-sky); background: var(--c9-sky-100); }
.stat-tile.accent > i { background: var(--c9-sky); color: var(--c9-grey-950); }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--c9-grey-900); line-height: 1; }
.stat-value.money { font-size: clamp(1.05rem, 1.6vw, 1.4rem); white-space: nowrap; }
.stat-tile > div { min-width: 0; }
.stat-label { font-size: .85rem; color: var(--c9-grey-600); margin-top: .25rem; }

.rollout { list-style: none; padding: 0; margin: 0; counter-reset: r; }
.rollout li { counter-increment: r; position: relative; padding: .55rem 0 .55rem 2.4rem; border-bottom: 1px dashed var(--c9-grey-200); }
.rollout li:last-child { border-bottom: 0; }
.rollout li::before { content: counter(r); position: absolute; left: 0; top: .45rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--c9-grey-100); color: var(--c9-grey-600); }
.rollout li.done::before { content: "\2713"; background: var(--c9-sky); color: var(--c9-grey-950); }
.rollout li.done { color: var(--c9-grey-900); font-weight: 600; }

.badge-module { background: var(--c9-grey-800); color: #fff; font-weight: 600; }
pre { white-space: pre-wrap; word-break: break-word; background: #fff; border: 1px solid var(--c9-grey-200); border-radius: .4rem; padding: .6rem; font-size: .78rem; }

/* ---------- Auth (login) ---------- */
.auth-body { background: var(--c9-grey-100); }
.auth-wrap { min-height: 100vh; display: flex; }
.auth-aside { flex: 0 0 42%; background: linear-gradient(160deg, var(--c9-grey-900), var(--c9-grey-950) 60%, #183a4b); color: var(--c9-grey-200); padding: 3.5rem; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(79,195,247,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(79,195,247,.07) 1px, transparent 1px); background-size: 40px 40px; pointer-events: none; }
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside h2 { color: #fff; font-weight: 800; letter-spacing: .03em; }
.auth-aside p { max-width: 26rem; color: var(--c9-grey-400); }
.auth-points { list-style: none; padding: 0; margin: 2rem 0 0; }
.auth-points li { display: flex; gap: .75rem; align-items: center; padding: .45rem 0; }
.auth-points i { color: var(--c9-sky); font-size: 1.2rem; }
.auth-form-col { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 1rem; padding: 2.25rem 2rem; box-shadow: 0 20px 50px rgba(21,25,29,.1); border-top: 4px solid var(--c9-sky); }

.error-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.error-card { background: #fff; border-radius: 1rem; padding: 2.5rem; max-width: 460px; text-align: center; box-shadow: 0 20px 50px rgba(21,25,29,.1); border-top: 4px solid var(--c9-sky); }
.error-code { font-size: 4.5rem; font-weight: 800; color: var(--c9-grey-900); line-height: 1; margin-bottom: .5rem; }

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

/* ---------- Step 3: settings, users, roles ---------- */
.settings-tabs .nav-link { color: var(--c9-grey-700); font-weight: 600; border-radius: .5rem; }
.settings-tabs .nav-link:hover { background: #fff; }
.settings-tabs .nav-link.active { background: var(--c9-grey-800); color: #fff; }
.settings-tabs .nav-link.active i { color: var(--c9-sky); }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; background: linear-gradient(transparent, var(--c9-grey-100) 35%); padding: 1rem 0 .5rem; }
.avatar-sm { width: 34px; height: 34px; font-size: .78rem; }
.temp-pw { border-left: 4px solid #b58100; }
.temp-pw-value { font-size: 1.15rem; background: #fff; color: var(--c9-grey-950); padding: .2rem .55rem; border-radius: .35rem; border: 1px dashed #b58100; letter-spacing: .06em; user-select: all; }
.breadcrumb a { text-decoration: none; }

.perm-matrix-wrap { max-height: 72vh; }
.perm-matrix { font-size: .85rem; }
.perm-matrix thead th { position: sticky; top: 0; background: var(--c9-grey-50); z-index: 2; vertical-align: bottom; }
.perm-matrix .perm-col { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 230px; font-weight: 500; }
.perm-matrix thead .perm-col { z-index: 3; background: var(--c9-grey-50); }
.perm-matrix .role-col { min-width: 92px; text-align: center; font-size: .75rem; line-height: 1.2; }
.perm-matrix .role-col span { display: block; font-weight: 700; color: var(--c9-grey-900); }
.perm-matrix .role-col small { color: var(--c9-grey-600); font-weight: 400; }
.perm-matrix .module-row th { background: var(--c9-grey-800); color: #fff; text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; position: sticky; left: 0; }
.perm-matrix tbody tr:hover td, .perm-matrix tbody tr:hover .perm-col { background: var(--c9-sky-100); }
.perm-matrix .form-check-input { width: 1.15em; height: 1.15em; cursor: pointer; }
.perm-matrix .form-check-input:checked { background-color: var(--c9-sky-700); border-color: var(--c9-sky-700); }
.form-check-input:checked { background-color: var(--c9-sky-700); border-color: var(--c9-sky-700); }
/* Keep wide tables inside their own scroller. Without this, mobile Chrome widens the
   whole page to fit the table and zooms everything out. */
.table-responsive { contain: paint; }

/* ---------- Step 4: public pages + applicant portal ---------- */
.public-body { background: var(--c9-grey-100); min-height: 100vh; display: flex; flex-direction: column; }
.public-bar { background: var(--c9-grey-900); padding: .7rem 0; border-bottom: 3px solid var(--c9-sky); }
.public-brand { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-weight: 800; letter-spacing: .05em; font-size: 1.15rem; }
.public-brand:hover { color: #fff; }
.public-brand small { font-weight: 500; letter-spacing: .18em; font-size: .62rem; text-transform: uppercase; color: var(--c9-grey-400); margin-left: .25rem; }
.public-bar .navbar-nav .nav-link { color: var(--c9-grey-200); font-weight: 500; }
.public-bar .navbar-nav .nav-link:hover, .public-bar .navbar-nav .nav-link.active { color: #fff; }
.public-bar .navbar-nav .nav-link.active { box-shadow: inset 0 -2px 0 var(--c9-sky); }
.public-bar .navbar-nav .nav-link.disabled { color: var(--c9-grey-400); }
.public-bar .navbar-toggler { border-color: rgba(255,255,255,.3); }
.public-main { flex: 1; padding: 2rem 0 3rem; }
.public-card { max-width: 480px; margin: 0 auto; background: #fff; border-radius: 1rem; padding: 2rem 1.75rem; box-shadow: 0 16px 40px rgba(21,25,29,.08); border-top: 4px solid var(--c9-sky); }
@media (max-width: 575.98px) { .public-card { padding: 1.5rem 1.15rem; border-radius: .75rem; } .public-main { padding-top: 1rem; } }
.public-footer { background: var(--c9-grey-950); color: var(--c9-grey-400); padding: 1.25rem 0; text-align: center; }
.public-footer a { color: var(--c9-grey-200); }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.portal-container { max-width: 1140px; }
.portal-hero { background: linear-gradient(120deg, var(--c9-grey-900), var(--c9-grey-800) 60%, #275a73); color: var(--c9-grey-200); border-radius: 1rem; padding: 1.75rem; }
.portal-hero h1 { color: #fff; }
.portal-hero .eyebrow { color: var(--c9-sky); }
.checklist li a { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px dashed var(--c9-grey-200); color: var(--c9-grey-800); text-decoration: none; }
.checklist li:last-child a { border-bottom: 0; }
.checklist li a:hover { color: var(--c9-sky-700); }
.empty-state { text-align: center; color: var(--c9-grey-600); padding: 1.5rem 1rem; }
.empty-state i { font-size: 2rem; color: var(--c9-grey-400); display: block; margin-bottom: .5rem; }

.profile-nav .list-group-item { border-left: 0; border-right: 0; font-size: .95rem; }
.profile-nav .list-group-item.active { background: var(--c9-sky-100); color: var(--c9-grey-900); border-color: var(--c9-grey-200); box-shadow: inset 3px 0 0 var(--c9-sky-700); }
.profile-nav .opt { color: var(--c9-grey-600); font-size: .75rem; }
.profile-items { display: grid; gap: .75rem; }
.profile-item { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; border: 1px solid var(--c9-grey-200); border-radius: .6rem; padding: .85rem 1rem; background: var(--c9-grey-50); }
.profile-item dl { display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; }
.profile-item dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c9-grey-600); font-weight: 600; }
.profile-item dd { margin: 0; color: var(--c9-grey-900); font-weight: 500; }
.add-item-form { background: #fff; border: 1px dashed var(--c9-grey-400); border-radius: .6rem; padding: 1rem; }

.portal-landing { padding: 1rem 0 2rem; }
.landing-steps { list-style: none; counter-reset: s; padding: 0; margin: 0; background: #fff; border-radius: 1rem; padding: 1.5rem; box-shadow: 0 16px 40px rgba(21,25,29,.08); }
.landing-steps li { counter-increment: s; position: relative; padding: .75rem 0 .75rem 3.25rem; border-bottom: 1px dashed var(--c9-grey-200); }
.landing-steps li:last-child { border-bottom: 0; }
.landing-steps li::before { content: counter(s); position: absolute; left: 0; top: .75rem; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--c9-grey-800); color: var(--c9-sky); display: grid; place-items: center; font-weight: 800; }
.landing-steps strong { display: block; color: var(--c9-grey-900); }
.landing-steps span { font-size: .92rem; color: var(--c9-grey-600); }
@media (max-width: 420px) { .public-brand small { display: none; } }

/* ---------- Step 5: documents, applying, tracker, applications ---------- */
.doc-list { display: grid; gap: .75rem; }
.doc-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; background: var(--c9-grey-100); color: var(--c9-grey-600); flex-shrink: 0; }
.doc-icon.has { background: #e6f6ec; color: #146c43; }
.doc-actions input[type=file] { max-width: 240px; }
@media (max-width: 575.98px) { .doc-actions, .doc-actions form:first-child { width: 100%; } .doc-actions input[type=file] { max-width: none; } }

.campaign-card.selected { border-color: var(--c9-sky-700); box-shadow: 0 0 0 .2rem rgba(79,195,247,.35); }
.campaign-card details summary { cursor: pointer; color: var(--c9-sky-700); }

.tracker { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(8, 1fr); position: relative; }
.tracker::before { content: ""; position: absolute; top: 17px; left: 6%; right: 6%; height: 3px; background: var(--c9-grey-200); }
.tracker li { position: relative; text-align: center; font-size: .78rem; color: var(--c9-grey-600); }
.tracker .dot { position: relative; z-index: 1; width: 36px; height: 36px; margin: 0 auto .4rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
                background: #fff; border: 3px solid var(--c9-grey-200); color: var(--c9-grey-600); }
.tracker li.done .dot { background: var(--c9-sky-700); border-color: var(--c9-sky-700); color: #fff; }
.tracker li.current .dot { background: var(--c9-sky); border-color: var(--c9-sky-700); color: var(--c9-grey-950); box-shadow: 0 0 0 4px rgba(79,195,247,.3); }
.tracker li.current .lbl { color: var(--c9-grey-900); font-weight: 700; }
@media (max-width: 767.98px) {
  .tracker { grid-template-columns: 1fr; gap: .25rem; }
  .tracker::before { top: 0; bottom: 0; left: 17px; right: auto; width: 3px; height: auto; }
  .tracker li { display: flex; align-items: center; gap: .75rem; text-align: left; font-size: .9rem; }
  .tracker .dot { margin: 0; flex-shrink: 0; }
}

.status-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.status-chips .chip { display: inline-flex; gap: .4rem; align-items: center; padding: .35rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--c9-grey-200);
                      color: var(--c9-grey-700); text-decoration: none; font-size: .85rem; }
.status-chips .chip strong { color: var(--c9-grey-900); }
.status-chips .chip:hover, .status-chips .chip.active { border-color: var(--c9-sky-700); background: var(--c9-sky-100); }

.applicant-head { border-left: 4px solid var(--c9-sky); }
.applicant-photo { width: 96px; height: 116px; border-radius: .6rem; overflow: hidden; background: var(--c9-grey-100); display: grid; place-items: center; flex-shrink: 0; border: 1px solid var(--c9-grey-200); }
.applicant-photo img { width: 100%; height: 100%; object-fit: cover; }
.applicant-photo i { font-size: 2.5rem; color: var(--c9-grey-400); }
.detail-list dt { font-weight: 600; color: var(--c9-grey-600); }
.detail-list dd { color: var(--c9-grey-900); }

/* ---------- Step 6: screening ---------- */
.decision-card { border-top: 3px solid var(--c9-sky-700); }
.decision-card .btn-group .btn { flex: 1 1 auto; }
.doc-check form { margin: 0; }
.action-needed h3 { color: #664d03; }
.stat-link { text-decoration: none; color: inherit; display: block; height: 100%; } .stat-link:hover .stat-tile { border-color: var(--c9-sky-700); }

/* ---------- Step 7: assessments ---------- */
.option-rows .option-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.option-rows .option-row .form-check-input { margin: 0; flex-shrink: 0; width: 1.25rem; height: 1.25rem; }
.rule-row { padding: .5rem 0; border-bottom: 1px dashed var(--c9-grey-200); }
.question-picker { max-height: 420px; overflow-y: auto; border: 1px solid var(--c9-grey-200); border-radius: .5rem; padding: .25rem .75rem; background: #fff; }
.picker-cat { position: sticky; top: 0; z-index: 1; background: var(--c9-grey-50); margin: 0 -.75rem; padding: .35rem .75rem; font-size: .75rem;
              font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--c9-grey-600); border-bottom: 1px solid var(--c9-grey-200); }
.picker-item { padding: .35rem 0 .35rem 1.75rem; border-bottom: 1px solid var(--c9-grey-100); }
.picker-item:last-child { border-bottom: 0; }
.assess-block { border-left: 4px solid var(--c9-sky); }
.assess-facts li { display: flex; gap: .6rem; align-items: baseline; padding: .25rem 0; }
.assess-facts i { color: var(--c9-sky-700); }

/* Exam */
.exam-mode .public-bar .navbar-nav { display: none; }            /* fewer ways to wander off mid-test */
@media (min-width: 992px) { .exam-mode #portalNav { justify-content: flex-end; } }
.question-card .q-hint { margin-left: 2.5rem; }
.exam-bar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
            background: #fff; border: 1px solid var(--c9-grey-200); border-radius: .75rem; padding: .75rem 1rem; margin-bottom: 1rem;
            box-shadow: 0 6px 18px rgba(21,25,29,.08); }
.exam-timer { font-variant-numeric: tabular-nums; font-size: 1.35rem; font-weight: 700; padding: .3rem .9rem; border-radius: 999px;
              background: var(--c9-sky-100); color: var(--c9-sky-700); white-space: nowrap; transition: background .3s, color .3s; }
.exam-timer.warn { background: #fff3cd; color: #664d03; }
.exam-timer.danger { background: #f8d7da; color: #842029; animation: c9pulse 1s ease-in-out infinite; }
@keyframes c9pulse { 50% { opacity: .65; } }
@media (prefers-reduced-motion: reduce) { .exam-timer.danger { animation: none; } }
.exam-nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.exam-nav-item { width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: .5rem; border: 1px solid var(--c9-grey-200);
                 background: #fff; color: var(--c9-grey-700); text-decoration: none; font-size: .85rem; font-weight: 600; }
.exam-nav-item.done { background: var(--c9-sky-700); border-color: var(--c9-sky-700); color: #fff; }
.exam-nav-item.error { background: #f8d7da; border-color: #dc3545; color: #842029; }
.exam-nav-item:focus-visible { outline: 3px solid var(--c9-sky); outline-offset: 2px; }
.question-card { scroll-margin-top: 6rem; min-width: 0; }
.question-card .q-num { flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--c9-grey-100);
                        font-size: .85rem; color: var(--c9-grey-700); }
.exam .option-row { display: flex; align-items: flex-start; gap: .75rem; padding: .7rem .9rem; margin: 0 0 .5rem 2.5rem; border: 1px solid var(--c9-grey-200);
                    border-radius: .6rem; cursor: pointer; transition: border-color .15s, background .15s; }
.exam .option-row:hover { border-color: var(--c9-sky); }
.exam .option-row:has(input:checked) { border-color: var(--c9-sky-700); background: var(--c9-sky-100); }
.exam .option-row:has(input:focus-visible) { outline: 3px solid var(--c9-sky); outline-offset: 1px; }
.exam .option-row .form-check-input { margin-top: .15rem; flex-shrink: 0; width: 1.2rem; height: 1.2rem; }
.exam .option-row label { flex: 1; cursor: pointer; }
.exam .clear-answer { margin-left: 2.5rem; }
@media (max-width: 575.98px) {
  .exam .option-row, .exam .clear-answer, .question-card .q-hint { margin-left: 0; }
  .exam-timer { font-size: 1.1rem; }
  .exam-bar { padding: .6rem .75rem; }
}

/* ---------- Step 8: interviews ---------- */
.panel-picker { max-height: 460px; overflow-y: auto; }
.panel-picker label { cursor: pointer; }
.score-scale { display: flex; flex-wrap: wrap; gap: .3rem; }
.score-scale .btn { min-width: 2.4rem; font-variant-numeric: tabular-nums; }
.score-scale .btn-check:checked + .btn { background: var(--c9-sky-700); border-color: var(--c9-sky-700); color: #fff; }
.score-sheet fieldset[disabled] .score-scale .btn { opacity: .75; }
.interview-result .display-6 { font-size: 2rem; color: var(--c9-grey-900); }
.interview-invite { border: 1px solid var(--c9-sky); background: var(--c9-sky-100); border-radius: .75rem; padding: 1rem 1.25rem; }
.interview-invite dt { color: var(--c9-grey-600); font-weight: 600; }

/* ---------- Step 9: approvals ---------- */
.approval-steps { padding: .5rem 1rem; position: relative; }
.approval-steps li { display: flex; gap: .85rem; padding: .7rem 0; position: relative; }
.approval-steps li:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 2.6rem; bottom: -.4rem; width: 2px; background: var(--c9-grey-200); }
.approval-steps .dot { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem;
                       background: #fff; border: 2px solid var(--c9-grey-200); color: var(--c9-grey-600); font-weight: 700; z-index: 1; }
.approval-steps li.done .dot { background: var(--c9-sky-700); border-color: var(--c9-sky-700); color: #fff; }
.approval-steps li.done:not(:last-child)::before { background: var(--c9-sky-700); }
.approval-steps li.current .dot { background: var(--c9-sky-100); border-color: var(--c9-sky-700); color: var(--c9-sky-700); box-shadow: 0 0 0 4px rgba(79,195,247,.25); }
.approval-steps li.stopped .dot { background: #f8d7da; border-color: #dc3545; color: #842029; }
.step-edit-row { padding: .75rem 0; border-bottom: 1px dashed var(--c9-grey-200); }

/* ---------- Step 10: appointments, personnel, dashboard ---------- */
.pipeline li a { display: grid; grid-template-columns: 11rem 1fr 3.5rem; align-items: center; gap: .75rem; padding: .3rem .25rem; border-radius: .4rem;
                 color: inherit; text-decoration: none; }
.pipeline li a:hover, .pipeline li a:focus-visible { background: var(--c9-grey-50); }
.pl-label { font-size: .875rem; color: var(--c9-grey-700); }
.pl-track { height: 12px; background: var(--c9-grey-100); border-radius: 4px; overflow: hidden; }
.pl-bar { display: block; height: 100%; background: var(--c9-sky-700); border-radius: 0 4px 4px 0; min-width: 0; }
.pl-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--c9-grey-900); }
@media (max-width: 575.98px) { .pipeline li a { grid-template-columns: 7.5rem 1fr 2.5rem; gap: .5rem; } .pl-label { font-size: .8rem; } }
.welcome-banner { display: flex; gap: .9rem; align-items: center; background: var(--c9-sky-100); border: 1px solid var(--c9-sky); border-radius: .75rem; padding: .9rem 1rem; }
.welcome-banner i { font-size: 2rem; color: var(--c9-sky-700); }
.appointment-card dt { color: var(--c9-grey-600); font-weight: 600; }
@media (max-width: 575.98px) {
  .row > .col-6 > .stat-tile, .row > .col-6 > .stat-link .stat-tile { flex-direction: column; align-items: flex-start; gap: .5rem; padding: .85rem; }
  .row > .col-6 .stat-value { font-size: 1.4rem; }
  .row > .col-6 .stat-value.money { font-size: 1.05rem; }
}

/* ---------- Phase 2 Step 4: duty roster ---------- */
.roster-wrap { max-height: 75vh; }
.roster-table { min-width: 980px; font-size: .85rem; }
.roster-table thead th { position: sticky; top: 0; z-index: 2; }
.roster-rowhead { position: sticky; left: 0; z-index: 1; background: #fff; min-width: 170px; max-width: 200px; }
thead .roster-rowhead { z-index: 3; background: var(--bs-table-bg, #f8f9fa); }
.roster-cell { min-width: 120px; padding: .35rem; }
.roster-today { background: var(--c9-sky-100); }
.roster-short { box-shadow: inset 0 -3px 0 #f0ad4e; }
.roster-chip { display: flex; align-items: center; gap: .3rem; background: var(--c9-grey-100); border-radius: .35rem; padding: .1rem .35rem; margin-bottom: .2rem; }
.roster-chip.relief { background: #fff3cd; border: 1px dashed #c69500; }
.roster-chip span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-chip-x { border: 0; background: none; color: var(--c9-grey-600); line-height: 1; padding: 0 .15rem; font-size: 1rem; }
.btn-chip-x:hover, .btn-chip-x:focus-visible { color: #b02a37; }
.roster-gap { color: #8a5a00; font-size: .78rem; font-weight: 600; }
.roster-add summary { font-size: .78rem; color: var(--c9-sky-700); cursor: pointer; list-style: none; }
.roster-add summary::-webkit-details-marker { display: none; }
.roster-add[open] { background: #fff; border: 1px solid var(--c9-grey-200); border-radius: .4rem; padding: .35rem; margin-top: .2rem; }
.roster-legend { display: inline-block; width: 14px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: .25rem; }
.roster-legend.short { box-shadow: inset 0 -3px 0 #f0ad4e; background: var(--c9-grey-100); }
.roster-legend.relief { background: #fff3cd; border: 1px dashed #c69500; }

/* ---- Inspections (Phase 2 Step 6) ---- */
.insp-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: .5rem; border: 1px solid var(--bs-border-color); }
.insp-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .5rem; border: 1px solid var(--bs-border-color); background: #f1f3f5; }
.insp-item .btn-group .btn, .insp-guard .btn-group .btn { min-width: 3.5rem; }

/* ---- Incidents & complaints (Phase 2 Step 7) ---- */
.case-timeline .list-group-item { border-left: 0; border-right: 0; }
.case-timeline .bi { font-size: 1.1rem; }

/* ---- Training (Phase 2 Step 8) ---- */
.enrol-list { max-height: 320px; overflow-y: auto; padding-bottom: .5rem; }

/* ---- Charts & reports (Phase 2 Step 9) ---- */
.chart { display: block; max-width: 100%; height: auto; overflow: visible; font-family: inherit; }
.chart-axis { stroke: #c8d1da; stroke-width: 1; }
.chart-grid { stroke: #e6eaee; stroke-width: 1; }
.chart-target { stroke: #8a96a3; stroke-width: 1; stroke-dasharray: 4 4; }
.chart-label, .chart-value, .chart-tick { font-size: 12px; fill: #52514e; }
.chart-value { fill: #1f2933; font-weight: 600; }
.chart-tick { font-size: 11px; fill: #6b7580; }
.chart-bar { fill: #2a78d6; }
.chart-line { fill: none; stroke: #2a78d6; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: #2a78d6; stroke: #fff; stroke-width: 2; opacity: 0; }
.chart-cross { stroke: #8a96a3; stroke-width: 1; opacity: 0; }
.chart-hit { cursor: default; outline: none; }
.chart-hit:hover .chart-bar, .chart-hit:focus .chart-bar { fill: #1c5cab; }
.chart-pt:hover .chart-dot, .chart-pt:focus .chart-dot, .chart-pt:hover .chart-cross, .chart-pt:focus .chart-cross { opacity: 1; }
.chart-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.chart-table summary { cursor: pointer; color: #52514e; }
.chart-tip { position: fixed; z-index: 1080; pointer-events: none; background: #1f2933; color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.flag-list .badge { font-weight: 500; }
@media print {
  .sidebar, .topbar, .admin-sidebar, .no-print, nav.settings-tabs, .chart-table summary, form.no-print { display: none !important; }
  .main-col { margin-left: 0 !important; }
  .content { padding: 0 !important; }
  .site-footer, footer { display: none !important; }
  .card { break-inside: avoid; box-shadow: none !important; }
  .chart-table[open] summary { display: none; }
}
.report-card { transition: box-shadow .15s, transform .15s; }
.report-card:hover, .report-card:focus { box-shadow: 0 6px 20px rgba(31,41,51,.12); transform: translateY(-1px); }
.print-head { display: none; }
@media print { .print-head { display: block; } .report-table { font-size: 10pt; } }

/* Vehicle tally */
.photo-capture img { display: block; width: 100%; max-height: 180px; object-fit: cover; border-radius: .5rem; border: 1px solid var(--c9-grey-200); margin-bottom: .4rem; }
.tally-form .btn-check + .btn { min-width: 7.5rem; }
.tally-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .5rem; border: 1px solid var(--c9-grey-200); background: #f3f5f7; }
.plate-big { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 2rem; font-weight: 800; letter-spacing: .06em; }
.gate-alert { display: flex; gap: 1rem; align-items: center; border-radius: .75rem; padding: 1rem 1.25rem; margin-bottom: 1rem; color: #fff; }
.gate-alert > i { font-size: 2.4rem; line-height: 1; }
.gate-alert strong { display: block; font-size: 1.35rem; letter-spacing: .02em; }
.gate-alert span { display: block; opacity: .95; }
.gate-alert-danger { background: #b02a37; }
.gate-alert-success { background: #146c43; }
.gate-alert-big strong { font-size: 1.6rem; }
.cam-panel { position: relative; max-width: 480px; border-radius: .75rem; overflow: hidden; background: #000; }
.cam-panel video { display: block; width: 100%; height: auto; }
.cam-frame { position: absolute; inset: 15%; border: 3px solid rgba(255,255,255,.85); border-radius: .75rem; pointer-events: none; }
.cam-stop { position: absolute; right: .5rem; bottom: .5rem; }
@media (max-width: 575.98px) { .gate-alert strong { font-size: 1.1rem; } .gate-alert-big strong { font-size: 1.25rem; } .plate-big { font-size: 1.6rem; } }
.plate-cmp .plate-big { font-size: clamp(1.05rem, 5vw, 2rem); white-space: nowrap; }

/* Personnel verification (Phase 5) */
.verify-photo { width: 120px; height: 150px; object-fit: cover; border-radius: .6rem; border: 1px solid var(--c9-grey-200); background: var(--c9-grey-100); flex-shrink: 0; display: grid; place-items: center; text-align: center; }
.verify-result .alert strong { letter-spacing: .02em; }
