/* Walk-in Tracker - interface styles (loaded after Bootstrap) */

@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #13242b;
  --ink-2: #485b64;
  --ink-3: #74858d;
  --paper: #f1f4f5;
  --surface: #ffffff;
  --line: #d9e1e4;
  --line-soft: #e8edef;
  --peacock: #0c5a68;
  --peacock-deep: #083e48;
  --peacock-tint: #e2eff1;
  --marigold: #f0ab1c;
  --ok: #1a7439;
  --ok-bg: #e2f3e7;
  --warn: #855200;
  --warn-bg: #fff0cc;
  --bad: #b3261e;
  --bad-bg: #fde8e6;
  --muted-bg: #e9edef;
  --radius: 10px;
  --sidebar-w: 248px;

  --bs-body-font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-body-font-size: 0.9375rem;
  --bs-primary: #0c5a68;
  --bs-primary-rgb: 12, 90, 104;
  --bs-link-color: #0c5a68;
  --bs-link-color-rgb: 12, 90, 104;
  --bs-link-hover-color: #083e48;
  --bs-link-hover-color-rgb: 8, 62, 72;
  --bs-border-color: var(--line);
  --bs-border-radius: 8px;
  --bs-secondary-color: var(--ink-2);
}

body { font-feature-settings: "tnum" 1, "lnum" 1; -webkit-text-size-adjust: 100%; }
h1, h2, h3, h4 { letter-spacing: -0.01em; }
a { text-underline-offset: 2px; }
.ic { flex: none; vertical-align: -3px; }

:focus-visible { outline: 3px solid rgba(12, 90, 104, .45); outline-offset: 2px; }

/* ---------- buttons & forms ---------- */
.btn { font-weight: 600; border-radius: 8px; }
.btn-primary {
  --bs-btn-bg: var(--peacock); --bs-btn-border-color: var(--peacock);
  --bs-btn-hover-bg: var(--peacock-deep); --bs-btn-hover-border-color: var(--peacock-deep);
  --bs-btn-active-bg: var(--peacock-deep); --bs-btn-active-border-color: var(--peacock-deep);
  --bs-btn-disabled-bg: #6f9aa2; --bs-btn-disabled-border-color: #6f9aa2;
}
.btn-outline-primary {
  --bs-btn-color: var(--peacock); --bs-btn-border-color: var(--peacock);
  --bs-btn-hover-bg: var(--peacock); --bs-btn-hover-border-color: var(--peacock);
  --bs-btn-active-bg: var(--peacock-deep); --bs-btn-active-border-color: var(--peacock-deep);
}
.btn-outline-secondary { --bs-btn-color: var(--ink-2); --bs-btn-border-color: #b9c5ca; --bs-btn-hover-bg: var(--ink-2); --bs-btn-hover-border-color: var(--ink-2); background: var(--surface); }
.btn-icon { padding: .4rem .55rem; color: var(--ink); border: 0; }
.btn[aria-busy="true"] { pointer-events: none; opacity: .75; }
.btn[aria-busy="true"]::after { content: ""; display: inline-block; width: .9em; height: .9em; margin-left: .5em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-control, .form-select { border-color: #bdc9ce; }
.form-control:focus, .form-select:focus { border-color: var(--peacock); box-shadow: 0 0 0 .2rem rgba(12, 90, 104, .18); }
.form-label { font-weight: 600; margin-bottom: .3rem; }
.form-text { color: var(--ink-2); }
.form-check-input:checked { background-color: var(--peacock); border-color: var(--peacock); }
.req::after { content: " *"; color: var(--bad); }

/* ---------- shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
/* Bootstrap makes .offcanvas-lg transparent on wide screens; the menu keeps its own colour. */
.app-shell .sidebar.offcanvas-lg { background-color: var(--peacock-deep) !important; color: #d5e6e9; }
@media (min-width: 992px) {
  .sidebar { width: var(--sidebar-w); flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
@media (max-width: 991.98px) { .sidebar.offcanvas-lg { --bs-offcanvas-width: 280px; --bs-offcanvas-bg: var(--peacock-deep); overflow-y: auto; } }
.sidebar-brand { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.15rem .5rem; color: #fff; font-size: 1.02rem; line-height: 1.2; }
.sidebar-brand small { display: block; font-weight: 400; color: #a9c8cd; font-size: .78rem; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; flex: none; background:
  linear-gradient(var(--marigold), var(--marigold)) 7px 7px / 6px 16px no-repeat,
  linear-gradient(#fff, #fff) 17px 7px / 6px 16px no-repeat, var(--peacock); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); }
.sidebar-nav { padding: 0 .6rem 1.5rem; }
.nav-group { font-size: .74rem; font-weight: 600; color: #8fb4ba; padding: .75rem .6rem .2rem; }
.sidebar .nav-link { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: #d5e6e9; padding: .34rem .6rem; border-radius: 7px; font-weight: 500; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-link.active { background: #fff; color: var(--peacock-deep); font-weight: 700; }
.nav-count { background: var(--marigold); color: #2b1d00; border-radius: 999px; font-size: .74rem; font-weight: 700; padding: .05rem .5rem; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: .6rem; padding: .6rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1020; min-height: 56px; }
.page-title { font-size: 1.12rem; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-user { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink); border: 1px solid var(--line); background: var(--surface); padding: .32rem .6rem; font-weight: 600; }
.content { padding: 1.25rem; flex: 1; }
@media (max-width: 575.98px) { .content { padding: .9rem .75rem; } .topbar { padding: .5rem .75rem; } }

.main-staff { min-height: 100vh; }
.main-staff .content { max-width: 720px; width: 100%; margin: 0 auto; padding-bottom: 5.5rem; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .45rem; font-size: .76rem; font-weight: 600; color: var(--ink-2); text-decoration: none; border-top: 3px solid transparent; }
.tabbar a.active { color: var(--peacock); border-top-color: var(--peacock); }
.tab-ic { position: relative; display: inline-flex; }
.tab-count { position: absolute; top: -6px; left: 14px; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .68rem; line-height: 18px; text-align: center; }

.page-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 2000; background: linear-gradient(90deg, var(--marigold) 0 40%, transparent 40%) 0 0 / 250% 100%; animation: slide 1.1s linear infinite; }
@keyframes slide { from { background-position: 100% 0; } to { background-position: -60% 0; } }
@media (prefers-reduced-motion: reduce) { .page-progress, .btn[aria-busy="true"]::after { animation-duration: 3s; } }

/* ---------- panels, cards, filters ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .8rem 1rem; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { font-size: 1rem; font-weight: 700; margin: 0; }
.panel-head p { margin: 0; color: var(--ink-2); font-size: .86rem; }
.panel-body { padding: 1rem; }
.panel-foot { padding: .7rem 1rem; border-top: 1px solid var(--line-soft); }

.filters { display: flex; flex-wrap: wrap; gap: .6rem .75rem; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1.1rem; }
.filters .f { display: flex; flex-direction: column; min-width: 140px; }
.filters .f-wide { min-width: 220px; flex: 1 1 220px; max-width: 340px; }
.filters label { font-size: .78rem; font-weight: 600; color: var(--ink-2); margin-bottom: .15rem; }
.filters .f-actions { flex-direction: row; gap: .5rem; margin-left: auto; }
@media (max-width: 575.98px) { .filters .f { flex: 1 1 46%; min-width: 0; } .filters .f-wide, .filters .f-actions { flex: 1 1 100%; max-width: none; } .filters .f-actions .btn { flex: 1; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1.1rem; }
.kpis-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 992px) { .kpis-4 { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .95rem; }
.kpi .k-label { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.kpi .k-value { font-size: 1.65rem; font-weight: 700; line-height: 1.15; margin-top: .15rem; letter-spacing: -0.02em; }
.kpi .k-note { font-size: .8rem; color: var(--ink-2); margin-top: .15rem; }
.kpi-lead { background: var(--peacock-deep); border-color: var(--peacock-deep); color: #fff; }
.kpi-lead .k-label, .kpi-lead .k-note { color: #b9d6da; }
.kpi-attn { border-color: #e3b1ad; background: #fffafa; }
.kpi-attn .k-value { color: var(--bad); }

.notice { display: flex; gap: .65rem; align-items: flex-start; border-radius: var(--radius); padding: .7rem .9rem; margin-bottom: 1.1rem; border: 1px solid; }
.notice-warn { background: var(--warn-bg); border-color: #e9cf8c; color: #4d3000; }
.notice-info { background: var(--peacock-tint); border-color: #b9d6da; color: var(--peacock-deep); }
.notice-bad { background: var(--bad-bg); border-color: #efb8b3; color: #6d1510; }
.notice ul { margin: .2rem 0 0; padding-left: 1.1rem; }
.notice a { color: inherit; font-weight: 600; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { --bs-table-bg: transparent; margin: 0; font-size: .9rem; }
.table > thead > tr > th { font-size: .78rem; font-weight: 700; color: var(--ink-2); background: #f6f8f9; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: bottom; padding: .55rem .7rem; }
.table > tbody > tr > td { padding: .5rem .7rem; vertical-align: middle; border-color: var(--line-soft); }
.table > tbody > tr:hover > td { background: #f8fafb; }
.table > tfoot > tr > td { padding: .55rem .7rem; font-weight: 700; background: #f6f8f9; border-top: 2px solid var(--line); }
.num { text-align: right; white-space: nowrap; }
th.num .sort-link { justify-content: flex-end; }
.sort-link { color: inherit; text-decoration: none; display: inline-flex; gap: .2rem; }
.sort-link:hover { color: var(--peacock); text-decoration: underline; }
.sort-link.active { color: var(--peacock-deep); }
.na { color: var(--ink-3); }
.sub { display: block; font-size: .78rem; color: var(--ink-2); }
.nowrap { white-space: nowrap; }
.table-count { font-size: .84rem; color: var(--ink-2); margin: 0; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.page-link { color: var(--peacock); }
.active > .page-link { background: var(--peacock); border-color: var(--peacock); }
.row-closed td { color: var(--ink-3); }
.code { font-weight: 600; color: var(--ink-2); }
.table td > a:not(.btn) { white-space: nowrap; }

.st { display: inline-block; font-size: .76rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; white-space: nowrap; }
.st-ok { background: var(--ok-bg); color: var(--ok); }
.st-warn { background: var(--warn-bg); color: var(--warn); }
.st-bad { background: var(--bad-bg); color: var(--bad); }
.st-muted { background: var(--muted-bg); color: var(--ink-2); }
.st-info { background: var(--peacock-tint); color: var(--peacock-deep); }
.conv { font-weight: 700; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--ink-2); }
.empty-state h2 { font-size: 1.1rem; color: var(--ink); }

/* ---------- charts ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.1rem; margin-bottom: 1.1rem; }
.chart-grid .panel { margin: 0; }
@media (min-width: 992px) { .chart-grid-2 { grid-template-columns: 1fr 1fr; } }
.chart-box { position: relative; height: 240px; }
.chart-box-tall { height: 300px; }

/* ---------- sign in ---------- */
.guest-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; background: linear-gradient(160deg, var(--peacock-deep) 0 46%, var(--paper) 46%); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 14px; padding: 1.75rem 1.5rem; border: 1px solid var(--line); box-shadow: 0 18px 40px -18px rgba(8, 62, 72, .5); }
.login-card h1 { font-size: 1.35rem; font-weight: 700; margin: .9rem 0 .2rem; }
.login-card .lead-text { color: var(--ink-2); margin-bottom: 1.2rem; }
.setup-card { max-width: 620px; }
.check-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.check-list li { display: flex; gap: .5rem; padding: .3rem 0; border-bottom: 1px solid var(--line-soft); }

/* ---------- live walk-in entry (staff phone screen) ---------- */
.entry-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .75rem; }
.entry-head .form-select, .entry-head .form-control { width: auto; flex: 1 1 150px; font-weight: 600; }
.sync { font-size: .8rem; font-weight: 600; color: var(--ink-2); margin-left: auto; }
.sync.is-waiting { color: var(--warn); }
.sync.is-off { color: var(--bad); }

.count-band { background: var(--peacock-deep); color: #fff; border-radius: 14px; padding: 1rem 1.1rem .9rem; margin-bottom: .9rem; }
.count-main { display: flex; align-items: baseline; gap: .6rem; }
.count-main b { font-size: 3.4rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.count-main span { color: #b9d6da; font-weight: 600; }
.count-rest { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-top: .8rem; padding-top: .7rem; border-top: 1px solid rgba(255,255,255,.18); }
.count-rest div { line-height: 1.15; }
.count-rest b { display: block; font-size: 1.3rem; font-weight: 700; }
.count-rest span { font-size: .76rem; color: #b9d6da; font-weight: 600; }

.tap-title { font-weight: 700; margin: 0 0 .1rem; }
.tap-help { color: var(--ink-2); font-size: .86rem; margin: 0 0 .55rem; }
.tap-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; margin-bottom: .55rem; }
.tap { appearance: none; border: 2px solid var(--peacock); background: var(--surface); color: var(--peacock-deep); border-radius: 14px; min-height: 74px; font-size: 1.9rem; font-weight: 800; line-height: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: transform .06s, background-color .12s; }
.tap small { font-size: .72rem; font-weight: 600; color: var(--ink-2); }
.tap:active, .tap.is-hit { background: var(--marigold); border-color: #b97f06; transform: scale(.97); }
.tap:disabled { opacity: .45; }
.more-row { display: flex; gap: .5rem; margin-bottom: 1.1rem; }
.more-row .form-control { max-width: 150px; font-size: 1.05rem; }
.entry-locked { background: var(--warn-bg); border: 1px solid #e9cf8c; border-radius: var(--radius); padding: .8rem .9rem; margin-bottom: 1rem; color: #4d3000; }

.list-title { display: flex; align-items: baseline; justify-content: space-between; margin: 1.1rem 0 .45rem; }
.list-title h2 { font-size: 1rem; font-weight: 700; margin: 0; }
.list-title span { font-size: .82rem; color: var(--ink-2); }
.wk { display: flex; align-items: center; gap: .6rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .55rem .65rem; margin-bottom: .45rem; }
.wk-n { flex: none; width: 46px; height: 46px; border-radius: 10px; background: var(--peacock-tint); color: var(--peacock-deep); font-weight: 800; font-size: 1.25rem; display: grid; place-items: center; }
.wk-info { flex: 1; min-width: 0; line-height: 1.25; }
.wk-info b { font-weight: 700; white-space: nowrap; }
.wk-info small { display: block; color: var(--ink-2); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-actions { display: flex; gap: .35rem; flex: none; }
.wk-actions .btn { padding: .5rem .65rem; font-size: .88rem; min-height: 44px; }
.btn-bought { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-bought:hover, .btn-bought:active { background: #135c2c !important; border-color: #135c2c !important; color: #fff !important; }
.btn-notbought { background: var(--surface); border-color: var(--bad); color: var(--bad); }
.btn-notbought:hover, .btn-notbought:active { background: var(--bad) !important; border-color: var(--bad) !important; color: #fff !important; }
.wk.is-done { background: #fafcfc; }
.wk.is-done .wk-n { background: var(--muted-bg); color: var(--ink-2); }
.wk-edit { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 8px; min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.reason-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.reason-grid .btn { display: flex; align-items: center; text-align: left; font-weight: 600; min-height: 48px; font-size: .9rem; line-height: 1.2; }
.reason-grid .btn-check:checked + .btn { background: var(--peacock); border-color: var(--peacock); color: #fff; }
@media (max-width: 380px) { .reason-grid { grid-template-columns: 1fr; } .wk-actions .btn { padding: .5rem .5rem; } }
.bill-row { display: flex; gap: .5rem; margin-bottom: .45rem; }
.bill-row .form-control { font-weight: 700; letter-spacing: .02em; }
.fix-list { display: flex; flex-direction: column; }
.fix-item { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; padding: .9rem 1.1rem; border-top: 1px solid var(--line); }
.fix-what { flex: 1 1 280px; min-width: 0; }
.fix-title { font-weight: 700; }
.fix-problem { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-top: .4rem; }
.fix-typed { font-size: .9rem; overflow-wrap: anywhere; }
.fix-form { display: flex; gap: .5rem; flex: 0 1 340px; min-width: 0; }
.fix-form .form-control { flex: 1; min-width: 0; font-weight: 700; }
@media (max-width: 575.98px) { .fix-item { padding: .85rem .8rem; } .fix-form { flex: 1 1 100%; } }
.paper-box summary { font-weight: 600; color: var(--peacock-deep); cursor: pointer; padding: .4rem 0; }
.undo-toast { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 1080; background: var(--ink); color: #fff; border-radius: 999px; padding: .5rem .6rem .5rem 1rem; display: flex; align-items: center; gap: .75rem; font-weight: 600; box-shadow: 0 8px 24px -8px rgba(0,0,0,.5); max-width: calc(100vw - 24px); white-space: nowrap; }
.undo-toast button { background: var(--marigold); color: #2b1d00; border: 0; border-radius: 999px; padding: .3rem .8rem; font-weight: 700; }

/* ---------- misc ---------- */
.dl-grid { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
.dl-grid dt { color: var(--ink-2); font-weight: 600; }
.dl-grid dd { margin: 0; }
.map-table select { min-width: 190px; }
.preview-cells td, .preview-cells th { font-size: .8rem; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.progress { height: 12px; background: var(--muted-bg); }
.progress-bar { background: var(--peacock); }
.diff-old { color: var(--bad); text-decoration: line-through; }
.diff-new { color: var(--ok); font-weight: 600; }
.day-checks { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.heat { display: grid; gap: 2px; overflow-x: auto; font-size: .76rem; }
.heat-row { display: flex; gap: 2px; align-items: center; }
.heat-name { flex: none; width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: .5rem; font-weight: 600; font-size: .82rem; }
.heat-cell { flex: none; width: 26px; height: 24px; border-radius: 4px; display: grid; place-items: center; font-weight: 700; color: #fff; }
.heat-head .heat-cell { background: none; color: var(--ink-2); font-weight: 600; }
.hc-submitted { background: #2f9654; }
.hc-late { background: #d99a14; color: #2b1d00; }
.hc-missing { background: #c9372e; }
.hc-due { background: #cfd8dc; color: var(--ink-2); }
.hc-closed { background: #eef1f2; color: #a3b0b6; }
.hc-none { background: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .82rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: .3rem; }
@media print {
  .sidebar, .topbar, .filters, .tabbar, .pager .pagination { display: none !important; }
  .content { padding: 0; } body { background: #fff; }
}
