/* =========================================================================
   NURSE-360 – stylesheet
   Palette taken from the ward: scrub teal for action, a deep ink sidebar,
   a cool mint-grey page, and a strict traffic-light for competency validity.
   ========================================================================= */
:root {
    --n-ink: #16323a;          /* sidebar, headings */
    --n-ink-2: #21444d;
    --n-scrub: #2c6e6a;        /* primary action */
    --n-scrub-dark: #235955;
    --n-wash: #eef4f2;         /* page background */
    --n-line: #d6e2df;
    --n-text: #1e2b2f;
    --n-muted: #5d6f74;
    --n-ok: #2f7d4f;
    --n-warn: #9a6412;
    --n-warn-bg: #fdf1dc;
    --n-alert: #b42318;
    --n-alert-bg: #fde8e6;
    --n-pending: #5b4a9e;
    --n-pending-bg: #ece9f8;

    --bs-body-font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-color: var(--n-text);
    --bs-body-bg: var(--n-wash);
    --bs-primary: var(--n-scrub);
    --bs-primary-rgb: 44, 110, 106;
    --bs-link-color: var(--n-scrub-dark);
    --bs-link-color-rgb: 35, 89, 85;
    --bs-link-hover-color: var(--n-ink);
    --bs-border-color: var(--n-line);
    --sidebar-w: 256px;
}

body { font-size: .9375rem; }
h1, h2, h3 { color: var(--n-ink); letter-spacing: -.01em; }
:focus-visible { outline: 3px solid #7fb9b4; outline-offset: 2px; }
.skip-link { position: absolute; left: 8px; top: 8px; z-index: 2000; background: #fff; padding: 8px 12px; border-radius: 6px; }

/* ---- Bootstrap overrides ---------------------------------------------- */
.btn-primary { --bs-btn-bg: var(--n-scrub); --bs-btn-border-color: var(--n-scrub); --bs-btn-hover-bg: var(--n-scrub-dark);
    --bs-btn-hover-border-color: var(--n-scrub-dark); --bs-btn-active-bg: var(--n-ink); --bs-btn-disabled-bg: var(--n-scrub); --bs-btn-disabled-border-color: var(--n-scrub); }
.btn-outline-primary { --bs-btn-color: var(--n-scrub-dark); --bs-btn-border-color: var(--n-scrub); --bs-btn-hover-bg: var(--n-scrub);
    --bs-btn-hover-border-color: var(--n-scrub); --bs-btn-active-bg: var(--n-scrub-dark); }
.progress { height: .9rem; background: #dde8e5; }
.progress-bar { background: var(--n-scrub); font-size: .7rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--n-scrub); box-shadow: 0 0 0 .2rem rgba(44,110,106,.2); }
.form-check-input:checked { background-color: var(--n-scrub); border-color: var(--n-scrub); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--n-scrub); }
.page-link { color: var(--n-scrub-dark); }
.active > .page-link, .page-link.active { background: var(--n-scrub); border-color: var(--n-scrub); }
.table { --bs-table-bg: transparent; }
.table thead th { font-size: .78rem; font-weight: 600; color: var(--n-muted); border-bottom-width: 1px; white-space: nowrap; }

/* ---- Shell ------------------------------------------------------------ */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-content { flex: 1; padding: 1.5rem clamp(1rem, 3vw, 2rem); max-width: 1400px; width: 100%; }
.app-footer { padding: 1rem 2rem; font-size: .78rem; color: var(--n-muted); }

.sidebar { width: var(--sidebar-w); background: var(--n-ink); color: #e6f0ee; flex-shrink: 0; }
/* Bootstrap 5.3 forces .offcanvas-lg (and its .offcanvas-body) to a transparent background on screens
   >= 992px with !important. Without this override the dark panel vanishes on desktop and the light
   menu text sits on the pale page background. Two classes + !important out-rank Bootstrap's rule. */
.sidebar.offcanvas-lg, .sidebar.offcanvas-lg .offcanvas-body { background-color: var(--n-ink) !important; }
@media (min-width: 992px) {
    .sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
}
@media (max-width: 991.98px) {
    .sidebar.offcanvas-lg { --bs-offcanvas-width: 280px; background: var(--n-ink); }
}
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.1rem .9rem; }
.brand-link { display: flex; gap: .7rem; align-items: center; color: #fff; text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
    border: 2px solid #8fcfc6; color: #fff; font-weight: 700; font-size: .78rem; letter-spacing: -.02em; }
.brand-name { display: block; font-weight: 700; letter-spacing: .02em; }
.brand-sub { display: block; font-size: .72rem; color: #c3dad5; line-height: 1.2; max-width: 160px; }

/* Role band: the one bold element. Its colour deepens with seniority so a glance
   at any screen tells you whose view you are looking at. */
.role-band { margin: 0 .8rem .8rem; padding: .6rem .8rem; border-radius: 8px; border-left: 5px solid;
    background: rgba(255,255,255,.06); line-height: 1.25; }
.role-band .role-name { display: block; color: #fff; font-weight: 600; font-size: .9rem; }
.role-band .role-scope { display: block; font-size: .75rem; color: #c8ddd8; }
.role-band.level-0 { border-color: #9aa9ad; }
.role-band.level-1 { border-color: #7fd1c4; }
.role-band.level-2 { border-color: #5fb8e8; }
.role-band.level-3 { border-color: #8f9cf2; }
.role-band.level-4 { border-color: #c38ae8; }
.role-band.level-5 { border-color: #eeaa55; }
.role-band.level-6 { border-color: #f07c6c; }

.sidebar-nav { padding: 0 .6rem 1.5rem; display: block; }
.nav-section { font-size: .72rem; color: #b5d0ca; padding: 1rem .7rem .35rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.sidebar .nav-link { display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; border-radius: 6px; color: #f4f9f8; font-size: .9rem; font-weight: 500; }
.sidebar .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; color: #a9e0d8; }
.sidebar .nav-link:hover { background: var(--n-ink-2); color: #fff; }
.sidebar .nav-link.active { background: #fff; color: var(--n-ink); font-weight: 600; }
.sidebar .nav-link.active i { color: var(--n-scrub); }
.sidebar .nav-link.disabled { color: #a3bdb7; }
.sidebar .nav-link.disabled i { color: #8fb0a9; }
/* Collapsible menu groups */
.sidebar-nav > ul > li + li { margin-top: 2px; }
.nav-group-btn { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .7rem; border: 0; border-radius: 6px;
    background: none; color: #f4f9f8; font-size: .9rem; font-weight: 600; text-align: left; }
.nav-group-btn > i:first-child { font-size: 1.05rem; width: 1.2rem; text-align: center; color: #a9e0d8; }
.nav-group-btn:hover { background: var(--n-ink-2); color: #fff; }
.nav-group-btn:focus-visible { outline: 2px solid #a9e0d8; outline-offset: 1px; }
.nav-group.has-active > .nav-group-btn, .nav-group-btn:not(.collapsed) { background: rgba(255,255,255,.07); }
.nav-chevron { margin-left: auto; font-size: .8rem; transition: transform .2s; color: #b5d0ca; }
.nav-group-btn:not(.collapsed) .nav-chevron { transform: rotate(180deg); }
.nav-sub { margin: 2px 0 6px; padding-left: .9rem; border-left: 1px solid rgba(169,224,216,.25); margin-left: 1.3rem; }
.sidebar .nav-link.nav-sublink { padding: .4rem .6rem; font-size: .86rem; font-weight: 500; }
.sidebar .nav-link.nav-sublink i { font-size: .95rem; }
@media (prefers-reduced-motion: reduce) { .nav-chevron { transition: none; } .nav-sub.collapsing { transition: none; } }
.sidebar .soon { margin-left: auto; font-size: .66rem; padding: .05rem .4rem; border-radius: 4px; border: 1px solid #6f9089; color: #b5d0ca; }

.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem; padding: .6rem clamp(1rem, 3vw, 2rem);
    background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--n-line); }
.topbar-search { position: relative; flex: 1; max-width: 460px; }
.topbar-search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--n-muted); }
.topbar-search .form-control { padding-left: 2.2rem; background: var(--n-wash); border-color: transparent; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.btn-icon { border: 0; background: transparent; color: var(--n-ink); padding: .35rem .55rem; }
.btn-icon:hover { background: var(--n-wash); }
.bell-count { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
    background: var(--n-alert); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.user-chip { display: flex; align-items: center; gap: .55rem; border: 0; padding: .25rem .5rem; }
.user-chip:hover { background: var(--n-wash); }

/* ---- Notifications ------------------------------------------------------ */
.notif-menu { width: min(360px, 92vw); max-height: 70vh; overflow-y: auto; }
.notif-item { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: .6rem 1rem; border-left: 3px solid transparent; }
.notif-item:hover { background: var(--n-wash); }
.notif-item.unread { background: #f4faf8; border-left-color: var(--n-scrub); }
.notif-item.unread.notif-warning { border-left-color: var(--n-warn); }
.notif-item.unread.notif-danger { border-left-color: var(--n-alert); }
.notif-title { display: block; font-weight: 600; font-size: .88rem; }
.notif-msg { display: block; font-size: .82rem; color: var(--n-muted); }
.notif-time { display: block; font-size: .72rem; color: #8a9ba0; margin-top: 2px; }
.notif-row { border-bottom: 1px solid var(--n-line); padding: .85rem 1.2rem; }

/* ---- Page furniture ----------------------------------------------------- */
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-start; margin-bottom: 1.25rem; }
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.page-sub { color: var(--n-muted); margin: .2rem 0 0; }
.section-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .75rem; }
.panel { background: #fff; border: 1px solid var(--n-line); border-radius: 10px; padding: 1.1rem 1.2rem; }
.panel-title { font-size: .95rem; font-weight: 700; margin-bottom: .75rem; }
.form-narrow { max-width: 720px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filter-bar .form-control, .filter-bar .form-select { width: auto; flex: 1 1 170px; max-width: 280px; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--n-wash) 70%, transparent); padding: 1rem 0; margin-top: .5rem; }
.action-strip { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.action-strip form { margin: 0; }
.row-inactive td { color: #8a9ba0; }
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover { color: var(--n-scrub); }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: .45rem 0; border-bottom: 1px solid #edf2f1; }
.list-plain li:last-child { border-bottom: 0; }
.dl-grid { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: .35rem 1rem; }
.dl-grid dt { font-weight: 500; color: var(--n-muted); }
.dl-grid dd { margin: 0; }
.empty-state { max-width: 520px; margin: 3rem auto; text-align: center; }
.empty-state i { font-size: 3rem; color: var(--n-scrub); }
.callout { padding: .7rem .9rem; border-radius: 8px; font-size: .88rem; }
.callout-warn { background: var(--n-warn-bg); color: #5d3d08; }

/* Stats: a plain row of numbers separated by rules – no card chrome. */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: #fff; border: 1px solid var(--n-line); border-radius: 10px; }
.stat { padding: 1rem 1.2rem; border-right: 1px solid var(--n-line); }
.stat:last-child { border-right: 0; }
.stat-value { display: block; font-size: 1.8rem; font-weight: 700; color: var(--n-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { display: block; font-size: .8rem; color: var(--n-muted); margin-top: .2rem; }
.stat-warn .stat-value { color: var(--n-warn); }
.stat-alert .stat-value { color: var(--n-alert); }
@media (max-width: 575.98px) { .stat { border-right: 0; border-bottom: 1px solid var(--n-line); } }

.ward-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.ward-chip { background: #fff; border: 1px solid var(--n-line); border-radius: 999px; padding: .35rem .8rem; font-size: .85rem; color: var(--n-text); text-decoration: none; }
.ward-chip span { color: var(--n-muted); margin-left: .3rem; }
.ward-chip:hover { border-color: var(--n-scrub); }

/* Status pills – the traffic light used for every validity state. */
.status-pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.st-ok { background: #e3f3e8; color: var(--n-ok); }
.st-warn { background: var(--n-warn-bg); color: var(--n-warn); }
.st-alert { background: var(--n-alert-bg); color: var(--n-alert); }
.st-pending { background: var(--n-pending-bg); color: var(--n-pending); }
.st-muted { background: #eceff0; color: #5f6d71; }

.award-line { display: flex; gap: .6rem; align-items: flex-start; }
.award-line > i { color: #b8860b; font-size: 1.2rem; }
.badge-award { display: inline-flex; gap: .3rem; align-items: center; background: #fff6de; color: #7a5a06; border-radius: 999px; padding: .15rem .6rem; font-size: .78rem; font-weight: 600; }

/* ---- Avatars ------------------------------------------------------------ */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: #d7e8e4; color: var(--n-ink); font-weight: 700; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar-md { width: 44px; height: 44px; font-size: .9rem; }
.avatar-lg { width: 88px; height: 88px; font-size: 1.6rem; }

/* ---- Profile ------------------------------------------------------------ */
.profile-head { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; margin-bottom: 1.2rem; }
.profile-progress { min-width: 200px; display: grid; gap: .25rem; }
.profile-tabs { border-bottom: 0; flex-wrap: nowrap; overflow-x: auto; }
.profile-tabs .nav-link { color: var(--n-muted); white-space: nowrap; }
.profile-tabs .nav-link.active { color: var(--n-ink); font-weight: 600; border-color: var(--n-line) var(--n-line) #fff; }
.timeline { list-style: none; padding-left: 1rem; border-left: 2px solid var(--n-line); margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem .8rem; }
.timeline li::before { content: ""; position: absolute; left: -1.43rem; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--n-scrub); }

/* ---- Roles matrix / audit ---------------------------------------------- */
.matrix-wrap { max-height: 70vh; }
.matrix thead th { position: sticky; top: 0; background: #fff; z-index: 2; }
.matrix .perm-col { min-width: 260px; position: sticky; left: 0; background: #fff; z-index: 1; }
.matrix-group th { background: var(--n-wash) !important; font-size: .8rem; color: var(--n-ink); }
.perm-scroll { max-height: 420px; overflow-y: auto; }
.diff-old { background: #fff4f3; }
.diff-new { background: #f0f9f3; }
.font-mono-lite { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85rem; }

/* ---- Sign-in ------------------------------------------------------------ */
.auth-body { background: var(--n-ink); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-intro { color: #d7e6e3; padding: clamp(2rem, 6vw, 5rem); display: flex; flex-direction: column; justify-content: center; }
.auth-brand { display: flex; align-items: center; gap: .8rem; color: #fff; font-size: 1.6rem; font-weight: 700; letter-spacing: .02em; }
.auth-brand .brand-mark { width: 52px; height: 52px; font-size: .95rem; }
.auth-tagline { font-size: 1.25rem; color: #fff; margin: 1.2rem 0 2rem; max-width: 26ch; line-height: 1.35; }
.lifecycle { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: .1rem; }
.lifecycle li { counter-increment: step; display: flex; align-items: center; gap: .8rem; padding: .35rem 0; color: #cfe0dc; }
.lifecycle li::before { content: counter(step); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid #5e8d86; font-size: .75rem; color: #8fcfc6; }
.auth-hospital { margin-top: 2rem; color: #86a7a0; font-size: .85rem; }
.auth-card { background: #fff; padding: clamp(2rem, 6vw, 5rem); display: flex; flex-direction: column; justify-content: center; }
.auth-card > * { width: 100%; max-width: 400px; margin-left: auto; margin-right: auto; }
@media (max-width: 767.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-intro { padding: 2rem 1.5rem 1rem; }
    .auth-intro .lifecycle, .auth-intro .auth-hospital { display: none; }
    .auth-tagline { margin-bottom: 0; }
    .auth-card { border-radius: 16px 16px 0 0; padding: 2rem 1.5rem; }
}

/* ---- Mobile tweaks ------------------------------------------------------ */
@media (max-width: 575.98px) {
    .page-title { font-size: 1.25rem; }
    .filter-bar .form-control, .filter-bar .form-select { max-width: none; flex-basis: 100%; }
    .topbar-search { max-width: none; }
}

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

/* ---- Print: tables and reports print cleanly ---------------------------- */
@media print {
    .sidebar, .topbar, .app-footer, .no-print, .filter-bar, .sticky-actions, .btn, form button { display: none !important; }
    .app-content { padding: 0; max-width: none; }
    .panel { border: 0; padding: 0; }
    body { background: #fff; }
    a { color: inherit; text-decoration: none; }
}

/* =========================================================================
   Phase 1 – Recruitment
   ========================================================================= */
.sub-nav { --bs-nav-underline-link-active-color: var(--n-ink); border-bottom: 1px solid var(--n-line); }
.sub-nav .nav-link { color: var(--n-muted); }
.sub-nav .nav-link.active { border-bottom-color: var(--n-scrub); font-weight: 600; }
.st-stage { background: #e6f0ef; color: var(--n-scrub-dark); }

/* Stage colours – a cool-to-warm progression along the pipeline. */
.stage-applied     { --stage: #7a8f94; }
.stage-shortlisted { --stage: #4f8fa8; }
.stage-interviewed { --stage: #3f7c8f; }
.stage-selected    { --stage: #2c6e6a; }
.stage-offered     { --stage: #b7791f; }
.stage-joined      { --stage: #2f7d4f; }
.stage-declined    { --stage: #a3565a; }

.pipeline-strip { display: flex; flex-wrap: wrap; gap: .4rem; }
.pipeline-step { flex: 1 1 110px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--n-line);
    border-top: 4px solid var(--stage); border-radius: 8px; padding: .5rem .7rem; color: var(--n-text); text-decoration: none; font-size: .82rem; }
.pipeline-step .n { font-size: 1.35rem; font-weight: 700; color: var(--n-ink); font-variant-numeric: tabular-nums; }
.pipeline-step:hover { border-color: var(--stage); }

/* Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.kanban-col { background: #e6eeec; border-radius: 10px; display: flex; flex-direction: column; min-height: 320px; transition: background-color .15s; }
.kanban-col.can-drop { outline: 2px dashed #9dbdb8; outline-offset: -3px; }
.kanban-col.drag-over { background: #d3e6e2; }
.kanban-head { display: flex; justify-content: space-between; align-items: center; padding: .6rem .8rem; font-weight: 600; font-size: .88rem;
    border-top: 4px solid var(--stage); border-radius: 10px 10px 0 0; color: var(--n-ink); }
.kanban-count { background: #fff; border-radius: 999px; padding: 0 .5rem; font-size: .78rem; }
.kanban-cards { padding: 0 .5rem .6rem; display: grid; gap: .5rem; align-content: start; }
.kanban-card { position: relative; background: #fff; border-radius: 8px; padding: .6rem .7rem; box-shadow: 0 1px 0 #cfdcd9; display: grid; gap: .15rem; cursor: grab; }
.kanban-card[draggable="false"] { cursor: default; }
.kanban-card.is-dragging { opacity: .5; }
.kanban-card.is-saving { opacity: .6; pointer-events: none; }
.kanban-name { font-weight: 600; color: var(--n-ink); text-decoration: none; padding-right: 1.8rem; }
.kanban-name:hover { text-decoration: underline; }
.kanban-meta { font-size: .76rem; color: var(--n-muted); }
.kanban-foot { display: flex; justify-content: space-between; font-size: .74rem; color: var(--n-muted); margin-top: .2rem; }
.kanban-move { position: absolute; top: .35rem; right: .35rem; }
.kanban-move .btn { padding: 0 .35rem; line-height: 1.3; }
.kanban-empty { color: #8a9ba0; font-size: .8rem; text-align: center; margin: .5rem 0 0; }

/* Candidate stepper – the pipeline is a real sequence, so numbered. */
.stepper { list-style: none; counter-reset: step; display: flex; flex-wrap: wrap; gap: .25rem; padding: 0; margin: 0 0 1rem; }
.stepper li { counter-increment: step; flex: 1 1 120px; display: flex; align-items: center; gap: .45rem; padding: .45rem .6rem; font-size: .84rem;
    background: #fff; border: 1px solid var(--n-line); border-radius: 6px; color: var(--n-muted); }
.stepper li::before { content: counter(step); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
    border: 1px solid currentColor; font-size: .72rem; flex-shrink: 0; }
.stepper li.done { color: var(--n-ok); border-color: #bfe0cb; }
.stepper li.done::before { content: "✓"; background: var(--n-ok); color: #fff; border-color: var(--n-ok); }
.stepper li.current { color: #fff; background: var(--n-scrub); border-color: var(--n-scrub); font-weight: 600; }
.stepper li.declined { color: #fff; background: #a3565a; border-color: #a3565a; }
.stepper li.declined::before { content: "×"; }
.move-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; background: #fff; border: 1px solid var(--n-line); border-radius: 10px; padding: .6rem .8rem; }
.move-bar .form-select { width: auto; }
.move-bar .form-control { flex: 1 1 220px; }
.convert-box { background: var(--n-wash); border-radius: 10px; padding: 1rem 1.1rem; }
.score-table input { min-width: 70px; }

/* =========================================================================
   Phase 2 – Training
   ========================================================================= */
/* Calendar */
.cal-head { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--n-line); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow { font-size: .75rem; font-weight: 600; color: var(--n-muted); padding: .4rem .5rem; border-bottom: 1px solid var(--n-line); }
.cal-day { min-height: 104px; border-right: 1px solid #edf2f1; border-bottom: 1px solid #edf2f1; padding: .3rem; display: flex; flex-direction: column; gap: .2rem; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-out { background: #f7faf9; }
.cal-num { font-size: .78rem; color: var(--n-muted); }
.cal-today .cal-num { background: var(--n-scrub); color: #fff; border-radius: 999px; width: 1.6rem; text-align: center; font-weight: 600; }
.cal-item { display: block; font-size: .74rem; line-height: 1.25; padding: .2rem .35rem; border-radius: 4px; text-decoration: none; color: var(--n-ink);
    border-left: 3px solid var(--n-scrub); background: #e6f0ef; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item.cat-induction { border-left-color: #b7791f; background: var(--n-warn-bg); }
.cal-item.is-cancelled { text-decoration: line-through; opacity: .6; }
.cal-time { font-weight: 600; }
.cal-legend { display: flex; gap: .5rem; padding: .6rem 1rem; border-top: 1px solid var(--n-line); }
.cal-legend .cal-item { display: inline-block; }
@media (max-width: 767.98px) {
    .cal-day { min-height: 64px; }
    .cal-item { font-size: 0; padding: 0; height: 6px; border-left-width: 0; background: var(--n-scrub); }
    .cal-item.cat-induction { background: #b7791f; }
    .cal-legend .cal-item { font-size: .74rem; height: auto; padding: .2rem .35rem; }
}

/* Projected QR screen */
.bare-body { background: var(--n-ink); color: #fff; min-height: 100vh; }
.qr-screen { min-height: 100vh; display: flex; flex-direction: column; padding: 1.5rem 2rem; }
.qr-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.qr-top h1 { color: #fff; font-size: clamp(1.4rem, 3vw, 2.2rem); margin: 0; }
.qr-top p { color: #a9c6c0; margin: .3rem 0 0; }
.qr-actions { display: flex; gap: .5rem; }
.qr-actions form { margin: 0; }
.qr-main { flex: 1; display: grid; grid-template-columns: 1fr minmax(240px, 320px); gap: 2rem; align-items: center; margin-top: 1rem; }
.qr-code-box { text-align: center; }
.qr-frame { background: #fff; display: inline-grid; place-items: center; padding: 1rem; border-radius: 16px; width: min(62vh, 80vw); aspect-ratio: 1; }
.qr-frame img, .qr-frame #qr-js img, .qr-frame canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.qr-timer { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-top: 1rem; font-size: 1.1rem; }
.ring { width: 34px; height: 34px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,.2); stroke-width: 4; }
.ring-fg { fill: none; stroke: #8fcfc6; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.qr-hint { color: #cfe0dc; max-width: 46ch; margin: .8rem auto 0; }
.qr-link { color: #6f8e88; word-break: break-all; }
.qr-side { background: rgba(255,255,255,.06); border-radius: 14px; padding: 1.2rem; align-self: stretch; }
.qr-side h2 { color: #fff; font-size: 1rem; margin: 1rem 0 .5rem; }
.qr-count { font-size: 1rem; color: #a9c6c0; }
.qr-count strong { font-size: 3rem; color: #fff; line-height: 1; }
.qr-side li { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.qr-side li span { color: #a9c6c0; font-size: .85rem; }
@media (max-width: 991.98px) { .qr-main { grid-template-columns: 1fr; } }

/* Attendance confirm / scanner */
.attend-card { max-width: 440px; margin: 1.5rem auto; background: #fff; border: 1px solid var(--n-line); border-radius: 14px; padding: 1.6rem; text-align: center; }
.auth-card .attend-card { border: 0; padding: 0; margin: 0 auto; }
.attend-icon { font-size: 3rem; color: var(--n-scrub); }
.scanner-wrap { max-width: 460px; }
.scanner-box { width: 100%; border-radius: 12px; overflow: hidden; background: #000; min-height: 260px; }

/* Tests */
.question-text { font-weight: 600; font-size: 1rem; color: var(--n-ink); display: flex; gap: .6rem; float: none; width: 100%; margin-bottom: .6rem; }
.q-num { flex-shrink: 0; display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--n-wash); font-size: .8rem; }
.option { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--n-line); border-radius: 8px; margin-bottom: .4rem; cursor: pointer; }
.option:hover { border-color: var(--n-scrub); }
.option:has(input:checked) { border-color: var(--n-scrub); background: #eef6f4; }
.option input { margin-top: .2rem; flex-shrink: 0; }
.result-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 1.1rem 1.3rem; border-radius: 12px; color: #fff; }
.result-banner.is-pass { background: var(--n-ok); }
.result-banner.is-fail { background: #a3565a; }
.result-banner.is-neutral { background: var(--n-ink-2); }
.result-score { font-size: 2rem; font-weight: 700; }
.result-pct { font-size: 1.3rem; opacity: .9; }
.review.is-wrong { border-left: 4px solid #a3565a; }
.review.is-right { border-left: 4px solid var(--n-ok); }
.opt-right { color: var(--n-ok); font-weight: 600; }
.opt-wrong { color: #a3565a; text-decoration: line-through; }
.topic-list .list-group-item.active { background: var(--n-scrub); border-color: var(--n-scrub); }

/* Public verification pages */
.public-body { background: var(--n-wash); min-height: 100vh; }
.public-wrap { max-width: 520px; margin: 0 auto; padding: 2rem 1rem; }
.public-brand { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.5rem; color: var(--n-ink); }
.public-brand .brand-mark { border-color: var(--n-scrub); color: var(--n-scrub); }
.verify-card { background: #fff; border-radius: 14px; padding: 1.6rem; text-align: center; border-top: 6px solid; }
.verify-card > i { font-size: 3rem; }
.verify-ok { border-color: var(--n-ok); }
.verify-ok > i { color: var(--n-ok); }
.verify-bad { border-color: var(--n-alert); }
.verify-bad > i { color: var(--n-alert); }

/* =========================================================================
   Phase 3 – Competency & privileging
   ========================================================================= */
.sig-box { position: relative; border: 1px dashed #9dbdb8; border-radius: 8px; background: #fff; }
.sig-box canvas { display: block; width: 100%; height: 170px; touch-action: none; border-radius: 8px; }
.sig-clear { position: absolute; top: .4rem; right: .4rem; }
.sig-missing .sig-box { border-color: var(--n-alert); border-style: solid; }
.sig-missing .form-text { color: var(--n-alert); }
.sig-img { max-width: 220px; max-height: 80px; border-bottom: 1px solid var(--n-line); background: #fff; }
.step-list { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.step-list li { counter-increment: step; display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--n-line); border-radius: 8px; margin-bottom: .4rem; }
.step-list li::before { content: counter(step); flex-shrink: 0; display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--n-wash); font-size: .75rem; }
.step-list label { flex: 1; cursor: pointer; }
.step-list .done { color: var(--n-ok); }
.step-list .missed { color: var(--n-alert); }
.bucket-links { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.bucket-links a { text-decoration: none; }

/* Privileged card (screen) – sized and styled like a physical ID card. */
.priv-card { max-width: 460px; background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--n-line); box-shadow: 0 2px 0 #cfdcd9; }
.priv-card-head { background: var(--n-ink); color: #fff; padding: .8rem 1rem; display: flex; justify-content: space-between; align-items: center; }
.priv-card-head strong { display: block; }
.priv-card-head span { font-size: .75rem; color: #a9c6c0; }
.priv-card-body { display: grid; grid-template-columns: 92px 1fr; gap: 1rem; padding: 1rem; }
.priv-photo { width: 92px; height: 112px; border-radius: 8px; object-fit: cover; background: #d7e8e4; display: grid; place-items: center; font-size: 1.8rem; font-weight: 700; color: var(--n-ink); }
.priv-name { font-size: 1.15rem; font-weight: 700; color: var(--n-ink); margin: 0; }
.priv-meta { font-size: .82rem; color: var(--n-muted); margin: 0; }
.priv-list { list-style: none; padding: 0 1rem 1rem; margin: 0; display: grid; gap: .3rem; }
.priv-list li { display: flex; justify-content: space-between; gap: .5rem; font-size: .88rem; padding: .35rem .55rem; background: #eef6f4; border-radius: 6px; }
.priv-list li span { color: var(--n-muted); font-size: .78rem; }
.priv-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1rem; border-top: 1px dashed var(--n-line); font-size: .78rem; color: var(--n-muted); }
.priv-foot img { width: 84px; height: 84px; }
.priv-stamp { font-weight: 700; padding: .15rem .5rem; border-radius: 4px; font-size: .75rem; }
.priv-stamp.ok { background: #e3f3e8; color: var(--n-ok); }
.priv-stamp.bad { background: var(--n-alert-bg); color: var(--n-alert); }
.priv-stamp.wait { background: var(--n-warn-bg); color: var(--n-warn); }
.severity-major, .severity-sentinel { background: var(--n-alert-bg); color: var(--n-alert); }
.severity-moderate { background: var(--n-warn-bg); color: var(--n-warn); }
.severity-minor, .severity-near_miss { background: #eceff0; color: #5f6d71; }
.action-needed { display: flex; flex-wrap: wrap; gap: .5rem; }
.action-needed a { background: #fff; border: 1px solid var(--n-line); border-left: 4px solid var(--n-warn); border-radius: 8px; padding: .55rem .8rem;
    text-decoration: none; color: var(--n-text); font-size: .9rem; }
.action-needed a strong { color: var(--n-ink); font-size: 1.05rem; margin-right: .2rem; }
.action-needed a:hover { border-color: var(--n-warn); }

/* =========================================================================
   Phase 4 – Performance
   ========================================================================= */
.kpi-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .6rem; }
.kpi-card { display: flex; flex-direction: column; gap: .15rem; background: #fff; border: 1px solid var(--n-line); border-top: 4px solid #9aa9ad;
    border-radius: 10px; padding: .8rem 1rem; text-decoration: none; color: var(--n-text); }
.kpi-card.is-on { border-top-color: var(--n-ok); }
.kpi-card.is-off { border-top-color: var(--n-alert); }
.kpi-card.is-selected { box-shadow: 0 0 0 2px var(--n-scrub); }
.kpi-name { font-size: .82rem; color: var(--n-muted); }
.kpi-value { font-size: 1.7rem; font-weight: 700; color: var(--n-ink); font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-meta { font-size: .76rem; color: var(--n-muted); }
.kpi-table td { font-variant-numeric: tabular-nums; }
.cell-on { color: var(--n-ok); }
.cell-off { color: var(--n-alert); font-weight: 600; background: #fff6f5; }
.kpi-entry-row { border-bottom: 1px solid #edf2f1; padding-bottom: .8rem; }

.criterion { border: 1px solid var(--n-line); border-radius: 10px; padding: .8rem 1rem; margin-bottom: .7rem; }
.criterion legend { float: none; width: auto; font-size: .95rem; font-weight: 600; color: var(--n-ink); padding: 0 .3rem; margin: 0; display: flex; gap: .5rem; align-items: baseline; }
.score-scale { display: flex; gap: .4rem; }
.score-scale label { position: relative; cursor: pointer; }
.score-scale input { position: absolute; opacity: 0; inset: 0; }
.score-scale span { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 2px solid var(--n-line); font-weight: 600; background: #fff; }
.score-scale label.is-suggested span { border-style: dashed; border-color: #9dbdb8; }
.score-scale input:checked + span { background: var(--n-scrub); border-color: var(--n-scrub); color: #fff; }
.score-scale input:focus-visible + span { outline: 3px solid #7fb9b4; outline-offset: 2px; }
.appraisal-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; padding: .8rem 1rem; background: var(--n-wash); border-radius: 10px; }
.appraisal-total strong { font-size: 1.5rem; color: var(--n-ink); }
.score-dot { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; font-weight: 600; font-size: .85rem; background: var(--n-wash); }
.score-dot.s5, .score-dot.s4 { background: #e3f3e8; color: var(--n-ok); }
.score-dot.s2, .score-dot.s1 { background: var(--n-alert-bg); color: var(--n-alert); }

.star-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; }
.star-card { background: #fff; border: 1px solid var(--n-line); border-radius: 14px; padding: 1.2rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.star-card.is-latest { border: 2px solid #d9a13a; background: linear-gradient(#fffaf0, #fff 60%); }
.star-label { font-size: .75rem; font-weight: 600; color: #8a5a00; background: #fff1d6; padding: .15rem .6rem; border-radius: 999px; margin-top: .4rem; }
.star-citation { font-size: .88rem; color: var(--n-text); margin: 0; }
.award-icon { font-size: 1.4rem; color: #b8860b; }

/* =========================================================================
   Phase 5 – JD library
   ========================================================================= */
.jd-version { font-size: .9rem; font-weight: 600; color: var(--n-scrub); background: #e6f0ef; border-radius: 6px; padding: .1rem .45rem; vertical-align: middle; }
.jd-doc { max-width: 820px; }
.jd-resp { padding-left: 1.3rem; }
.jd-resp li { padding: .45rem 0; border-bottom: 1px solid #edf2f1; }
.jd-resp li:last-child { border-bottom: 0; }
.clause-chip { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .02em; color: var(--n-scrub-dark); background: #e6f0ef;
    border: 1px solid #c5dcd8; border-radius: 4px; padding: .05rem .4rem; margin: 0 .25rem .2rem 0; }
.ack-box { background: var(--n-warn-bg); border-left: 4px solid var(--n-warn); border-radius: 8px; padding: .8rem 1rem; }
.ack-form { margin-top: 1.2rem; padding: 1rem; background: var(--n-wash); border-radius: 10px; }

.resp-row { display: grid; grid-template-columns: 1.6rem 1fr 180px auto; gap: .5rem; align-items: start; padding: .5rem 0; border-bottom: 1px solid #edf2f1; transition: background-color .3s; }
.resp-row.flash { background: #eef6f4; }
.resp-num { font-weight: 600; color: var(--n-muted); padding-top: .45rem; text-align: right; }
.resp-tools { display: flex; gap: .2rem; }
@media (max-width: 767.98px) { .resp-row { grid-template-columns: 1.4rem 1fr; } .resp-codes, .resp-tools { grid-column: 2; } }
.clause-ref { max-height: 75vh; overflow-y: auto; position: sticky; top: 4.5rem; }
.clause-pick { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .3rem .4rem; border-radius: 6px; font-size: .8rem; color: var(--n-text); }
.clause-pick:hover { background: var(--n-wash); }
.clause-pick strong { color: var(--n-scrub-dark); }

.diff-list { list-style: none; padding: 0; margin: 0 0 .8rem; font-size: .92rem; }
.diff-list li { display: flex; gap: .6rem; padding: .45rem .6rem; border-radius: 6px; margin-bottom: .25rem; }
.d-mark { font-weight: 700; width: 1rem; flex-shrink: 0; text-align: center; }
.d-add { background: #e9f6ee; } .d-add .d-mark { color: var(--n-ok); }
.d-rem { background: #fdeeec; text-decoration: line-through; color: #7d2a24; } .d-rem .d-mark { color: var(--n-alert); text-decoration: none; }
.d-chg { background: #fdf6e7; } .d-chg .d-mark { color: var(--n-warn); }
.d-same { color: var(--n-muted); }
.diff-words ins { background: #c9ecd5; text-decoration: none; border-radius: 2px; }
.diff-words del { background: #f8cfca; border-radius: 2px; }
.diff-legend { font-weight: 600; padding: .1rem .45rem; border-radius: 4px; margin-right: .3rem; }
.diff-legend.add { background: #e9f6ee; color: var(--n-ok); } .diff-legend.rem { background: #fdeeec; color: var(--n-alert); } .diff-legend.chg { background: #fdf6e7; color: var(--n-warn); }

/* =========================================================================
   Phase 6 – Reports & NABH
   ========================================================================= */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .7rem; }
.hub-card { display: flex; gap: .8rem; align-items: flex-start; background: #fff; border: 1px solid var(--n-line); border-radius: 10px; padding: .9rem 1rem; text-decoration: none; color: var(--n-text); }
.hub-card:hover { border-color: var(--n-scrub); }
.hub-card > i { font-size: 1.5rem; color: var(--n-scrub); line-height: 1; }
.ready-dot { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; font-size: .78rem; font-weight: 700; }
.ready-dot.ok { background: #e3f3e8; color: var(--n-ok); }
.ready-dot.gap { background: var(--n-alert-bg); color: var(--n-alert); }
.readiness td { white-space: nowrap; }
