/* Pharmacist Scheduler look and feel: navy and white, quiet greys, colour only where it carries meaning.
   Loaded after tw.css, so everything here wins. Change the values under :root to re-tint the whole site. */
:root {
    --navy: #12284c;
    --navy-deep: #0b1c38;
    --navy-soft: #1f3d6d;
    --accent: #0b5cab;
    --ink: #1b2a3f;
    --muted: #5b6b80;
    --page: #f3f5f8;
    --line: #dde3ec;
    --surface-alt: #eef2f7;
}

body { background: var(--page); color: var(--ink); }

/* ---- top bar and navigation ---- */
.app-header { background: var(--navy); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }
.app-header h1 { font-weight: 600; letter-spacing: 0.01em; }
.nav-btn { min-width: 0; color: #d6deeb; border-radius: 6px; border-bottom: 3px solid transparent; transition: background 0.15s, color 0.15s; }
.nav-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-btn.is-active { background: rgba(255, 255, 255, 0.14); color: #fff; border-bottom-color: #6cc4e8; }
.nav-badge { background: #e8590c; }
#auth-status { color: #d6deeb; }

/* ---- buttons ---- */
.btn { display: inline-block; font-weight: 600; padding: 0.5rem 0.9rem; border-radius: 6px; border: 1px solid transparent; transition: background 0.15s, border-color 0.15s; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-deep); }
.btn-primary.is-dirty { background: #b45309; }
.btn-primary.is-dirty:hover { background: #92400e; }
.btn-secondary { background: #fff; color: var(--navy); border-color: #b9c5d6; }
.btn-secondary:hover { background: var(--surface-alt); border-color: var(--navy); }
.btn:disabled { opacity: 0.6; }

/* the original tool's blue buttons, links and toggles, re-tinted to navy */
.bg-blue-600, .bg-blue-500 { background-color: var(--navy); }
.hover\:bg-blue-700:hover, .hover\:bg-blue-600:hover { background-color: var(--navy-deep); }
.text-blue-700 { color: var(--navy); }
.text-blue-600, .text-blue-500 { color: var(--accent); }
.hover\:text-blue-800:hover { color: var(--navy); }
.rounded-lg { border-radius: 6px; }
.mini-btn { border-color: #b9c5d6; color: var(--navy); background: #f5f7fb; border-radius: 6px; }
.mini-btn:hover { background: #e7ecf4; }

/* ---- cards and tables ---- */
main .shadow-lg { box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 2px 6px rgba(16, 24, 40, 0.06); border: 1px solid var(--line); border-radius: 10px; }
h2, h3, h4 { color: var(--navy); }
.text-gray-800, .text-gray-900 { color: var(--ink); }
.bg-gray-50 { background-color: #f7f9fc; }
.bg-gray-100 { background-color: var(--surface-alt); }
.bg-stone-200 { background-color: #c6ccd6; }            /* a pharmacist's set day off */
.hover\:bg-blue-50:hover { background-color: #e6eef9; }

#scheduleGridAndSummaryScrollContainer table thead th.pharmacist-header-cell,
#scheduleGridAndSummaryScrollContainer table thead th.date-header-cell,
#staffingSummaryTableContainer table thead th.summary-header-cell,
#staffingSummaryTableContainer table thead th.date-header-cell { background-color: var(--surface-alt) !important; color: var(--navy); }
#scheduleGridAndSummaryScrollContainer table tbody tr.group-header-row td.group-name-cell,
#scheduleGridAndSummaryScrollContainer table tbody tr.group-header-row td.group-header-scrollable-part { background-color: #dfe6f0; color: var(--navy); }

/* ---- shift colours (same meaning as the Excel schedule) ---- */
.shift-clin { background-color: #cfe0f3; }
.shift-pm { background-color: #ffe770; }
.shift-pto { background-color: #55b4e9; color: #06283f; }
.shift-sn { background-color: #e03131; color: #fff; font-weight: 600; }
.shift-on { background-color: #f8b133; }
.shift-sick { background-color: #f6c6c6; }
.shift-avail { background-color: #cfeee5; }
.shift-train { background-color: #d9f99d; }
.shift-offsite { background-color: #d9a8f5; }
.shift-muted { background-color: #e5e8ee; color: #5b6b80; }
.schedule-cell.shift-clin:hover { background-color: #b9d0ec; }
.schedule-cell.shift-pm:hover { background-color: #fbd944; }
.schedule-cell.shift-pto:hover { background-color: #3aa3de; }
.schedule-cell.shift-sn:hover { background-color: #c42424; }
.schedule-cell.shift-on:hover { background-color: #eea013; }
.schedule-cell.shift-sick:hover { background-color: #efb0b0; }
.schedule-cell.shift-avail:hover { background-color: #b7e3d7; }
.schedule-cell.shift-train:hover { background-color: #c5ee76; }
.schedule-cell.shift-offsite:hover { background-color: #cb8eef; }
.pill.shift-plain { background-color: #eef2f7; border: 1px solid var(--line); }

/* ---- sign-in and test bar ---- */
.test-banner { background: #fff4d6; color: #6b4a00; border-bottom: 1px solid #e9c46a; }
.test-banner select { border-color: #cfa94a; }

/* ---- weekend groups: a heavier line where the next weekend group starts ---- */
#scheduleGridTableContainer tr.weekend-group-start > td { border-top: 2px solid #7c8aa0; }

/* ---- coverage table docked under the schedule (column widths are copied from the grid) ---- */
#scheduleGridAndSummaryScrollContainer, #coverageScrollContainer { scrollbar-gutter: stable; }
.coverage-table { table-layout: fixed; border-collapse: collapse; }
.coverage-table th, .coverage-table td { border: 1px solid #d1d5db; text-align: center; padding: 1px 2px !important; line-height: 1.25; overflow: hidden; white-space: nowrap; }
.coverage-table th { background: var(--surface-alt); color: var(--navy); font-weight: 600; }
.coverage-table .cov-name { position: sticky; left: 0; z-index: 5; background: #fff; text-align: left; padding-left: 0.75rem !important; font-weight: 500; text-overflow: ellipsis; }
.coverage-table th.cov-name { background: var(--surface-alt); }

/* ---- schedule checks side panel ---- */
.checks-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(780px, 100vw); background: #fff; border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(16, 24, 40, 0.2); z-index: 35; display: flex; flex-direction: column; overflow: hidden; }
.checks-drawer.hidden { display: none; }
.ck-head { padding: 1rem 1.25rem 0; border-bottom: 1px solid var(--line); }
.ck-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.ck-title { font-size: 1.15rem; font-weight: 700; color: var(--navy); }
.ck-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 0.75rem; }
.ck-stat { border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.6rem; background: #f8fafc; }
.ck-stat b { display: block; font-size: 1.35rem; line-height: 1.2; color: var(--navy); font-variant-numeric: tabular-nums; }
.ck-stat span { display: block; font-size: 0.72rem; line-height: 1.2; color: #5b6b80; }
.ck-stat.bad { background: #fff5f5; border-color: #f5c2c2; }
.ck-stat.bad b { color: #c42424; }
.ck-stat.warn b { color: #b45309; }
.ck-stat.good b { color: #157347; }
.ck-tabs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.25rem; }
.ck-tab { padding: 0.45rem 0.75rem; font-size: 0.85rem; font-weight: 600; color: #5b6b80; background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer; }
.ck-tab:hover { color: var(--navy); }
.ck-tab.active { color: var(--navy); border-bottom-color: var(--navy); }
.ck-tab-count { display: inline-block; margin-left: 0.35rem; padding: 0 0.4rem; border-radius: 999px; background: #fde2e2; color: #b42323; font-size: 0.72rem; }
.ck-toggle { margin-left: auto; margin-bottom: 0.4rem; padding: 0.25rem 0.7rem; font-size: 0.78rem; border-radius: 999px; border: 1px solid #b9c5d6; background: #fff; color: var(--navy); cursor: pointer; }
.ck-toggle.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.ck-body { flex: 1; overflow: auto; padding: 0 1.25rem 1.25rem; }
.ck-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.85rem; }
.ck-table th { position: sticky; top: 0; z-index: 2; background: #fff; padding: 0.7rem 0.5rem 0.4rem; border-bottom: 2px solid var(--line); text-align: center; font-size: 0.75rem; font-weight: 600; color: var(--navy); white-space: nowrap; }
.ck-table th small { display: block; font-size: 0.68rem; font-weight: 400; color: #5b6b80; }
.ck-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid #eef1f6; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ck-table th.ck-name, .ck-table td.ck-name { text-align: left; }
.ck-table td.ck-name { font-weight: 500; color: var(--ink); border-left: 3px solid transparent; }
.ck-table tr.row-short td.ck-name { border-left-color: #e03131; }
.ck-table tr:not(.ck-section):hover td { background-color: #f4f7fb; }
.ck-table tr.ck-section td { text-align: left; padding: 0.45rem 0.65rem; background: var(--surface-alt); color: var(--navy); font-weight: 700; font-size: 0.8rem; border-top: 0.6rem solid #fff; border-bottom: 0; }
.ck-section-note { float: right; font-weight: 600; color: #5b6b80; }
.ck-section-note.bad { color: #c42424; }
.ck-section-note.good { color: #157347; }
.ck-table .ck-total { border-left: 2px solid var(--line); }
.ck-count { font-weight: 600; }
.ck-count sup { font-size: 0.68rem; margin-left: 1px; }
.ck-of { color: #94a3b8; font-size: 0.78rem; }
.ck-table td.is-ok .ck-count { color: #157347; }
.ck-table td.is-short { background: #fff5f5; }
.ck-table td.is-short .ck-count { color: #c42424; }
.ck-table td.is-over { background: #fff8eb; }
.ck-table td.is-over .ck-count { color: #b45309; }
.ck-table td.sn-off { background: #fed7aa; font-weight: 600; }
.ck-table td.ev-high { background: #fed7aa; }
.ck-table td.ev-low { background: #e0f2fe; }
.gap-chip { display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.4rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; }
.gap-short { background: #fde2e2; color: #b42323; }
.gap-over { background: #fde9c8; color: #92400e; }
.ck-tag { margin-left: 0.35rem; font-size: 0.7rem; font-weight: 400; color: #94a3b8; }
.ck-muted { color: #c3cbd8; }
.ck-empty { padding: 1.5rem 0.5rem !important; color: #5b6b80; }
.ck-note { margin-top: 0.75rem; font-size: 0.75rem; color: #5b6b80; }
.ck-ok { margin-top: 1rem; font-size: 0.9rem; color: #157347; }
.ck-subhead { margin-top: 1rem; font-size: 0.85rem; font-weight: 700; color: var(--navy); }
.ck-list { margin-top: 0.75rem; padding-left: 1.25rem; list-style: disc; font-size: 0.85rem; color: var(--ink); }
.ck-list li { margin-bottom: 0.3rem; }
.ck-list.bad { color: #b42323; }
@media (max-width: 640px) { .ck-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#checksBtn.has-warnings { border-color: #e03131; color: #b42323; }

/* ---- tallies above the grid ---- */
#shiftTally { display: inline-flex; gap: 0.4rem; align-items: center; }
.tally { display: inline-block; font-size: 0.8rem; padding: 0.35rem 0.7rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); white-space: nowrap; }
.tally b { margin-left: 0.25rem; }
.tally.tally-open b { color: #c42424; }
.tally.tally-done { border-color: #86d7a5; background: #effaf3; }
.tally.tally-done b { color: #157347; }

/* ---- short-staffed days ---- */
.coverage-table tr.cov-short-row td { background: #fbfcfe; }
.coverage-table td.cov-short-on { background: #fde68a !important; color: #7a4b00; font-weight: 600; }
.cov-short-btn { display: block; width: 100%; color: #9aa7b8; }
.cov-short-on .cov-short-btn { color: #7a4b00; font-weight: 600; }
.cov-short-btn:hover { color: var(--navy); }
.coverage-table td.cov-collapsed { background: repeating-linear-gradient(135deg, #fde68a, #fde68a 4px, #fff7d1 4px, #fff7d1 8px); color: #7a4b00; }
.short-tag { font-size: 0.62rem; font-weight: 700; line-height: 1.1; color: #7a4b00; background: #fde68a; border-radius: 3px; padding: 0 3px; margin-top: 1px; display: inline-block; }

/* ---- one zoom control: everything in the schedule and coverage tables scales from --grid-zoom ---- */
:root { --grid-zoom: 1; }
#scheduleGridTableContainer, #detailedCountsTableContainer { font-size: calc(14px * var(--grid-zoom)); }
.zoom-font { font-size: 1em; line-height: 1.35; }
.zoom-pad { padding: 0.3em; }
.zoom-name-col { min-width: 9em; }
.zoom-date-col { min-width: 6.2em; }
#scheduleGridTableContainer .text-xs { font-size: 0.82em; line-height: 1.3; }
#scheduleGridTableContainer .px-3 { padding-left: 0.8em; padding-right: 0.8em; }
#scheduleGridTableContainer .py-2 { padding-top: 0.5em; padding-bottom: 0.5em; }
#scheduleGridTableContainer .px-2 { padding-left: 0.5em; padding-right: 0.5em; }
#scheduleGridTableContainer .py-1 { padding-top: 0.25em; padding-bottom: 0.25em; }
#scheduleGridTableContainer .w-12 { width: 3.2em; }
#scheduleGridTableContainer .w-20 { width: 5.4em; }
#scheduleGridTableContainer .mr-2 { margin-right: 0.5em; }
.coverage-table.zoom-font { font-size: 0.86em; }
.short-tag { font-size: 0.7em; }
.zoom-step { width: 1.7rem; height: 1.7rem; line-height: 1; border: 1px solid #b9c5d6; border-radius: 6px; background: #fff; color: var(--navy); font-weight: 700; }
.zoom-step:hover { background: var(--surface-alt); }

/* ---- whole-schedule printout (landscape; only ever visible when printing) ---- */
#printArea .print-grid { color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#printArea .print-grid * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#printArea .print-grid.cols-14 { font-size: 8pt; }
#printArea .print-grid.cols-21 { font-size: 7pt; }
#printArea .print-grid.cols-42 { font-size: 5.4pt; }
#printArea .print-grid .print-page { break-after: page; page-break-after: always; }
#printArea .print-grid .print-page:last-child { break-after: auto; page-break-after: auto; }
#printArea .print-grid .pg-title { font-size: 10pt; margin: 0 0 4px; text-align: left; }
#printArea .print-grid .pg-printed { float: right; font-size: 7pt; color: #555; }
#printArea .print-grid table { width: 100%; border-collapse: collapse; table-layout: fixed; page-break-inside: auto; break-inside: auto; font-size: inherit; margin: 0; }
#printArea .print-grid table.pg-coverage { margin-top: 6px; }
#printArea .print-grid col.pg-name { width: 15%; }
#printArea .print-grid.cols-42 col.pg-name { width: 10.5%; }
#printArea .print-grid tr { break-inside: avoid; page-break-inside: avoid; }
#printArea .print-grid th, #printArea .print-grid td { border: 0.5pt solid #7b8794; height: auto; padding: 1.5pt 1pt; text-align: center; vertical-align: middle; font-size: inherit; line-height: 1.15; overflow: hidden; }
#printArea .print-grid th { background: #e3e9f1; color: #12284c; font-weight: 600; }
#printArea .print-grid .pg-name-cell { text-align: left; padding-left: 3pt; white-space: nowrap; font-weight: 600; }
#printArea .print-grid .pg-dayoff { font-weight: 400; color: #0b5cab; font-size: 0.85em; }
#printArea .print-grid tr.pg-group td { background: #cfd8e5; color: #12284c; font-weight: 700; text-align: left; padding-left: 3pt; }
#printArea .print-grid tr.pg-weekend-group-start td { border-top: 1.5pt solid #4b5a70; }
#printArea .print-grid .pg-weekend { background: #eceff3; }
#printArea .print-grid .pg-dayoff-cell { background: #c6ccd6; }
#printArea .print-grid .short-tag { font-size: 0.8em; }

/* ---- hiding wins over the button and bar layouts defined in this file ---- */
.btn.hidden, .mini-btn.hidden, #shiftTally.hidden, .selection-bar.hidden { display: none; }

/* ---- selecting several cells and the bar that acts on them ---- */
.schedule-cell { -webkit-user-select: none; user-select: none; }
.schedule-cell.cell-selected { box-shadow: inset 0 0 0 2px var(--navy), inset 0 0 0 100px rgba(18, 40, 76, 0.16); }
.mini-btn.is-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.selection-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 34; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; max-width: calc(100vw - 24px); padding: 0.55rem 0.9rem; background: var(--navy); color: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, 0.35); font-size: 0.85rem; }
.selection-bar select { color: #111827; background: #fff; border-radius: 6px; padding: 0.3rem 0.4rem; font-weight: 600; }
.sel-btn { border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 6px; padding: 0.3rem 0.65rem; font-weight: 600; color: #fff; }
.sel-btn:hover { background: rgba(255, 255, 255, 0.14); }
.sel-btn.is-disabled { opacity: 0.45; }
.sel-btn.sel-done { background: #fff; color: var(--navy); border-color: #fff; }
.sel-keys { flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 0.75rem; padding-top: 0.45rem; border-top: 1px solid rgba(255, 255, 255, 0.2); font-size: 0.75rem; color: rgba(255, 255, 255, 0.85); }
.sel-key { white-space: nowrap; }
.shift-key-hint { display: flex; flex-wrap: wrap; gap: 0.3rem 0.7rem; margin-top: 0.6rem; font-size: 0.75rem; color: #5b6b80; }
.shift-key-hint:empty { display: none; }
.shift-key-hint .sel-key kbd { background: var(--surface-alt); border: 1px solid #b9c5d6; }
.sel-key kbd { display: inline-block; min-width: 1.3rem; margin-right: 0.3rem; padding: 0 0.3rem; border-radius: 4px; background: #fff; color: var(--navy); font-family: inherit; font-weight: 700; text-align: center; }

/* ---- holidays: gold on the schedule, and the roster page ---- */
.holiday-tag { display: inline-block; font-size: 0.7em; font-weight: 700; line-height: 1.15; color: #5b3d00; background: #ffd24d; border-radius: 3px; padding: 0 4px; white-space: nowrap; }
#scheduleGridAndSummaryScrollContainer table thead th.date-header-cell.holiday-head { background-color: #ffe9a6 !important; }
.schedule-cell.holiday-col { border-left: 2px solid #e0a800; border-right: 2px solid #e0a800; }
.schedule-cell.holiday-col:not([class*="shift-"]):not(.bg-stone-200) { background-color: #fff7da; }
.coverage-table th.holiday-head { background: #ffe9a6; }
#printArea .print-grid th.pg-holiday { background: #ffe9a6; }
.hol-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.hol-card { border: 1px solid #9aa7b8; border-radius: 8px; overflow: hidden; background: #fff; padding-bottom: 0.5rem; }
.hol-card.hol-past { opacity: 0.7; }
.hol-title { background: #cfd8e5; color: var(--navy); font-weight: 700; text-align: center; padding: 0.45rem 0.5rem; }
.hol-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.hol-table th { background: #e9edf3; text-align: left; padding: 0.3rem 0.6rem; font-weight: 700; border-bottom: 1px solid #9aa7b8; }
.hol-table td { padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.hol-table td.hol-shift { width: 34%; font-weight: 600; }
.hol-table tr.hol-evening td { background: #fff9c9; }
.hol-table tr.hol-evening td.hol-shift { background: #fff200; }
.hol-table tr.hol-me td { box-shadow: inset 3px 0 0 var(--navy); }
.hol-select { width: 100%; padding: 0.25rem 0.4rem; border: 1px solid #b9c5d6; border-radius: 6px; background: #fff; }
.hol-card .mini-btn { margin-right: 0.6rem; }
.hol-card .mini-btn:disabled { opacity: 0.5; }

/* ---- a darker line where each two-week pay period starts ---- */
#scheduleGridTableContainer th.pp-start, .schedule-cell.pp-start, .coverage-table .pp-start { border-left: 2px solid #55647a; }
#printArea .print-grid .pg-pp { border-left: 1.5pt solid #333; }

.btn-danger { background: #fff; color: #b42323; border-color: #e3a1a1; }
.btn-danger:hover { background: #fdecec; border-color: #b42323; }
