/* SMPW Angeles City scheduler – colours taken from the SMPW logo */
:root {
  --brand-900: #082f6b;
  --brand-700: #0b4fa3;
  --brand-600: #1565c0;
  --brand-500: #1e88e5;
  --brand-300: #4fc3f7;
  --brand-100: #e3f2fd;
  --brand-50: #f1f8ff;

  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #dde4ee;
  --text: #13233b;
  --muted: #5b6b82;

  --ok: #1b8a4b;
  --ok-bg: #e3f6ea;
  --warn: #b26a00;
  --warn-bg: #fff3dc;
  --bad: #c62828;
  --bad-bg: #fdecec;
  --empty-bg: #f1f3f6;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 38, 76, .06), 0 4px 16px rgba(16, 38, 76, .06);
  --sidebar-w: 248px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }
small { font-size: .8rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.block { display: block; }
.grow { flex: 1; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.boot, .noscript { padding: 40px; text-align: center; color: var(--muted); }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); border-color: #c5d0de; text-decoration: none; }
.btn:focus-visible, .icon-btn:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(30, 136, 229, .35); outline-offset: 1px;
}
.btn-primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #a82020; }
.btn-ghost-danger { color: var(--bad); }
.btn-ghost-danger:hover { background: var(--bad-bg); border-color: #f2c4c4; }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn .ico { width: 16px; height: 16px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; position: relative;
  width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: rgba(0, 0, 0, .06); }
.file-btn { position: relative; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 30;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--brand-900), var(--brand-700));
  color: #e8f1ff; padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 8px 18px; }
.brand:hover { text-decoration: none; }
.brand img { width: 46px; height: 46px; border-radius: 50%; background: #fff; }
.brand strong { display: block; font-size: 1.15rem; letter-spacing: .04em; }
.brand small { display: block; color: #b9d4f5; font-size: .72rem; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: #d4e5fb; font-weight: 500;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: rgba(255, 255, 255, .16); color: #fff; }
.sidebar nav a .badge { margin-left: auto; }
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .15); padding-top: 12px; display: grid; gap: 10px; }
.sidebar-foot .btn { background: transparent; color: #d4e5fb; border-color: rgba(255, 255, 255, .25); }
.sidebar-foot .btn:hover { background: rgba(255, 255, 255, .1); }
.me { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.me strong { display: block; font-size: .9rem; color: #fff; }
.me small { color: #b9d4f5; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-300); color: var(--brand-900); font-weight: 700; font-size: .85rem;
}
.avatar.sm { width: 30px; height: 30px; font-size: .75rem; background: var(--brand-100); color: var(--brand-700); }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: #ff5252; color: #fff; font-size: .72rem; font-weight: 700;
}
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.demo-banner {
  background: var(--warn-bg); color: #7a4a00; text-align: center; font-size: .8rem; padding: 4px 16px;
  border-bottom: 1px solid #f3dfb5;
}
.view { padding: 24px 28px 48px; max-width: 1280px; width: 100%; }
.scrim { display: none; }

/* ---------- Layout helpers ---------- */
.page-title { font-size: 1.5rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head .page-title { margin: 0; }
.actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 16px; }
.page-head .actions { margin: 0; flex-wrap: wrap; }
.actions.wrap { flex-wrap: wrap; }
.actions.left { justify-content: flex-start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.align-start { align-items: start; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; min-width: 0;
}
.card.flush { padding: 0; }
.pad { padding: 16px 20px; margin: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.section-title { margin: 18px 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.notice {
  background: var(--brand-50); border: 1px solid #cfe3fa; color: #123e72;
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: .9rem; margin-bottom: 16px;
}
.hint { color: var(--muted); font-size: .85rem; margin: 8px 0 0; }
.warn-text { color: var(--warn); font-size: .9rem; font-weight: 500; }
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600;
  background: var(--brand-100); color: var(--brand-700); vertical-align: middle;
}

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); border-top: 4px solid var(--brand-500);
}
.kpi.good { border-top-color: var(--ok); }
.kpi.warn { border-top-color: #f0a020; }
.kpi.bad { border-top-color: var(--bad); }
.kpi-value { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.kpi-label { font-weight: 600; font-size: .85rem; }
.kpi-sub { color: var(--muted); font-size: .8rem; }

/* ---------- Lists ---------- */
.shift-list, .simple-list, .team-list, .notif-list { list-style: none; margin: 0; padding: 0; }
.shift-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.shift-row[data-open] { cursor: pointer; border-radius: var(--radius-sm); }
.shift-row[data-open]:hover { background: var(--surface-2); }
.shift-row:last-child { border-bottom: 0; }
.shift-row strong, .shift-row small { display: block; }
.shift-row small { color: var(--muted); }
.shift-row.is-past { opacity: .7; }
.shift-row .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.chev { color: var(--muted); font-size: 1.4rem; }
.date-badge {
  width: 48px; flex: none; text-align: center; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid #cfe3fa; background: #fff;
}
.date-badge span { display: block; background: var(--brand-600); color: #fff; font-size: .68rem; font-weight: 600; text-transform: uppercase; padding: 1px 0; }
.date-badge strong { display: block; font-size: 1.15rem; padding: 2px 0; }
.simple-list li { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.simple-list li:last-child { border-bottom: 0; }
.simple-list li small { display: block; color: var(--muted); }
.simple-list.compact li { padding: 6px 0; }
.simple-list .clickable { cursor: pointer; border-radius: var(--radius-sm); padding-inline: 8px; }
.simple-list .clickable:hover { background: var(--surface-2); }
.team-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.team-list small { display: block; color: var(--muted); }
.notif-list li { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; justify-content: space-between; align-items: baseline; }
.notif-list li:last-child { border-bottom: 0; }
.notif-list li.unread { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand-500); }
.notif-list a { color: var(--text); }
.notif-list small { color: var(--muted); white-space: nowrap; }

/* ---------- Pills & status ---------- */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pill-full { background: #dbeafe; color: var(--brand-700); }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-low { background: var(--warn-bg); color: var(--warn); }
.pill-empty { background: var(--bad-bg); color: var(--bad); }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.status-approved { background: var(--ok-bg); color: var(--ok); }
.status-pending { background: var(--warn-bg); color: var(--warn); }
.status-inactive, .status-declined { background: var(--empty-bg); color: var(--muted); }
.chip {
  display: inline-block; padding: 1px 7px; margin: 1px; border-radius: 6px; font-size: .75rem;
  background: rgba(255, 255, 255, .8); border: 1px solid rgba(0, 0, 0, .08);
}
.chip-me { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.dot-full { background: #bcd9fb; }
.dot-ok { background: #bfe8cf; }
.dot-low { background: #ffe0a3; }
.dot-empty { background: #f8d0d0; }
.status-card { border-left: 4px solid #f0a020; }
.profile-status { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }

/* ---------- Schedule ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.loc-select select { font-size: 1rem; font-weight: 600; padding: 9px 12px; min-width: 260px; }
.week-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.week-label { font-weight: 600; margin-left: 6px; }
.loc-banner {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px;
}
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.schedule {
  width: 100%; border-collapse: separate; border-spacing: 4px; min-width: 760px; table-layout: fixed;
}
.schedule th { font-size: .8rem; font-weight: 600; color: var(--muted); padding: 6px 4px; text-align: center; }
.schedule thead th span { display: block; color: var(--text); font-size: .9rem; }
.schedule thead th.today { background: var(--brand-600); border-radius: var(--radius-sm); }
.schedule thead th.today span, .schedule thead th.today small { color: #fff; }
.schedule .slot-col { width: 136px; text-align: left; white-space: nowrap; }
.cell { padding: 0; border-radius: var(--radius-sm); vertical-align: top; height: 86px; }
.cell button {
  width: 100%; height: 100%; min-height: 86px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; font: inherit; color: inherit; cursor: pointer; padding: 6px; text-align: left;
  display: flex; flex-direction: column; gap: 3px;
}
.cell button:hover { border-color: var(--brand-500); }
.cell-count { font-weight: 700; font-size: .8rem; }
.cell-names { display: flex; flex-wrap: wrap; }
.cell-open { margin-top: auto; font-size: .72rem; font-weight: 600; color: var(--brand-600); }
.cell-full { background: #e3effd; }
.cell-ok { background: var(--ok-bg); }
.cell-low { background: var(--warn-bg); }
.cell-empty { background: #fbeaea; }
.cell-mine button { border-color: var(--brand-600); box-shadow: inset 0 0 0 1px var(--brand-600); }
.cell-past { opacity: .55; }
.cell-off { background: repeating-linear-gradient(45deg, #f3f5f8, #f3f5f8 6px, #eceff3 6px, #eceff3 12px); text-align: center; color: #aab4c3; }
.cell-off span { display: block; padding-top: 30px; }
.cell-closed { background: #eceff3; text-align: center; color: var(--muted); padding: 8px 4px; font-size: .78rem; }
.cell-closed span { display: block; font-weight: 700; }

/* ---------- Shift modal ---------- */
.shift-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.shift-loc { font-weight: 700; font-size: 1.05rem; }
.shift-when { color: var(--muted); }
.assign-row { display: flex; gap: 8px; }
.assign-row select { flex: 1; min-width: 0; }

/* ---------- Location cards ---------- */
.loc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.loc-card {
  display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.loc-card:hover { border-color: var(--brand-500); text-decoration: none; }
.loc-card small { color: var(--muted); }
.bar { height: 8px; background: var(--empty-bg); border-radius: 4px; overflow: hidden; flex: 1; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-500), var(--brand-300)); }
.bar-row { display: flex; align-items: center; gap: 8px; }
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.loc-grid .card { margin: 0; }
.loc-detail.inactive { opacity: .65; }
.facts { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 8px 0; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.closure-form { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.closure-form input[name=reason] { flex: 1; min-width: 140px; }

/* ---------- Tables ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table small { color: var(--muted); }
.data-table .row-actions { white-space: nowrap; text-align: right; }
.data-table .row-actions .btn + .btn { margin-left: 4px; }
.directory td:nth-child(3) { min-width: 280px; }

/* ---------- Forms ---------- */
input, select, textarea {
  font: inherit; color: inherit; width: 100%;
  padding: 8px 10px; border: 1px solid #c9d3e0; border-radius: var(--radius-sm); background: #fff;
}
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; margin: 0; accent-color: var(--brand-600); }
.form { display: grid; gap: 14px; }
.form label, .field { display: grid; gap: 4px; align-content: start; font-size: .88rem; font-weight: 500; }
[hidden] { display: none !important; }
.field-label { font-size: .88rem; font-weight: 500; }
.form label.inline, label.inline { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.form fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px 16px; margin: 0; display: grid; gap: 12px; }
.form legend { font-weight: 700; padding: 0 6px; color: var(--brand-700); }
.form .hint { margin: 0; }
.radio-row { display: flex; gap: 18px; padding-top: 6px; }
.radio-col { display: grid; gap: 8px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.avail-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.consent { align-items: flex-start !important; }
.consent input { margin-top: 4px; }
.form-error { background: var(--bad-bg); color: var(--bad); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0; font-weight: 500; }
.grid-name { display: grid; grid-template-columns: minmax(0, 2fr) 72px minmax(0, 2fr); gap: 16px; }
.mi { text-align: center; text-transform: uppercase; }
.form-section-title { margin: 12px 0 0; color: var(--brand-700); font-size: 1.05rem; border-top: 1px solid var(--border); padding-top: 18px; }
.privacy { background: var(--brand-50); border-color: #cfe3fa; }
.privacy-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.status-card.info { border-left-color: var(--brand-500); }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin-bottom: 8px; }

/* ---------- Modal & toast ---------- */
.modal {
  border: 0; border-radius: var(--radius); padding: 0; width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(8, 47, 107, .3); color: var(--text);
}
.modal-wide { width: min(860px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(8, 25, 52, .45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 16px 18px 18px; }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 1000; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { background: #1c2a40; color: #fff; padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow); transition: opacity .4s, transform .4s; font-size: .92rem; }
.toast-success { background: #146c3c; }
.toast-error { background: #b3261e; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- Auth / apply ---------- */
.auth-page { display: grid; grid-template-columns: 1fr 1.1fr; min-height: 100vh; }
.auth-hero {
  background: radial-gradient(circle at 30% 20%, #1e88e5, #0b4fa3 55%, #082f6b);
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 32px;
}
.auth-logo { width: min(260px, 60vw); border-radius: 50%; background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); margin-bottom: 20px; }
.auth-hero h1 { font-size: 2rem; margin-bottom: 4px; }
.auth-hero p { color: #d4e5fb; margin: 0 0 18px; max-width: 420px; }
.auth-hero .muted { color: #b9d4f5; }
.auth-cta { margin-bottom: 16px; }
.auth-cta .btn-primary { background: #fff; color: var(--brand-700); border-color: #fff; }
.auth-cta .btn-primary:hover { background: var(--brand-100); }
.auth-panel { margin: 32px; align-self: center; max-height: calc(100vh - 64px); overflow-y: auto; }
.auth-panel h3 { margin: 18px 0 8px; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.profile-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.profile-pick {
  display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font: inherit; color: inherit;
}
.profile-pick:hover { border-color: var(--brand-500); background: var(--brand-50); }
.profile-pick strong { display: block; font-size: .9rem; }
.profile-pick small { display: block; color: var(--muted); }
.more-vols { margin-top: 14px; }
.more-vols summary { cursor: pointer; color: var(--brand-600); font-weight: 500; margin-bottom: 8px; }
.apply-page { max-width: 920px; margin: 0 auto; padding: 24px 16px 60px; }
.apply-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.apply-head h1 { margin: 0; }
.apply-head p { margin: 0; }
.apply-logo { width: 64px; height: 64px; border-radius: 50%; }
.back-link { width: 100%; }

/* ---------- Directory ---------- */

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(8, 25, 52, .45); z-index: 20; }
  .main { margin-left: 0; }
  .topbar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 10;
    background: var(--brand-700); color: #fff; padding: 8px 8px; padding-top: max(8px, env(safe-area-inset-top));
  }
  .topbar .icon-btn:hover { background: rgba(255, 255, 255, .12); }
  .topbar-title { flex: 1; font-weight: 600; }
  .topbar .bell { color: #fff; }
  .topbar .bell .badge { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; font-size: .65rem; }
  .view { padding: 16px 16px 40px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { padding: 32px 16px; }
  .auth-logo { width: 160px; }
  .auth-panel { margin: 16px; max-height: none; }
  .loc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .grid-2, .grid-3, .filters { grid-template-columns: 1fr; }
  .avail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loc-select, .loc-select select { width: 100%; min-width: 0; }
  .page-title { font-size: 1.3rem; }
  .card { padding: 14px; }
  .facts { grid-template-columns: 1fr; gap: 0 0; }
  .facts dd { margin-bottom: 8px; }
  .shift-row .row-actions { width: 100%; padding-left: 60px; }
  .modal { max-height: calc(100vh - 16px); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 1.5rem; }
  .schedule .slot-col { width: 78px; white-space: normal; position: sticky; left: 0; z-index: 1; background: var(--bg); }
}

@media print {
  .sidebar, .topbar, .demo-banner, .actions, .page-head .actions, #toasts { display: none !important; }
  .main { margin: 0; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}
