/* ==========================================================================
   Duty Roster — design tokens
   ========================================================================== */
:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #f7f9f8;
  --surface-3: #eef2f0;
  --border: #e2e8e5;
  --border-strong: #cdd6d2;
  --text: #0f1d19;
  --text-2: #33443e;
  --muted: #62716b;

  --primary: #0f766e;
  --primary-hover: #0b5f58;
  --primary-ink: #ffffff;
  --primary-soft: #e3f3f1;
  --primary-ring: rgba(15, 118, 110, .22);

  --danger: #b42318;
  --danger-soft: #fef0ee;
  --danger-border: #f6cbc5;
  --warn: #93600a;
  --warn-soft: #fff7e0;
  --warn-border: #f3dc9b;
  --ok: #067647;
  --ok-soft: #e9f7ef;
  --ok-border: #b4e3c8;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(16, 32, 26, .05);
  --shadow: 0 1px 2px rgba(16, 32, 26, .04), 0 2px 8px -2px rgba(16, 32, 26, .08);
  --shadow-lg: 0 10px 30px -12px rgba(16, 32, 26, .22);
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  overflow-x: clip;
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; color: var(--text); letter-spacing: -.015em; }
h1 { font-size: 1.65rem; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 1.1rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
code { font-family: var(--mono); font-size: .85em; background: var(--surface-3); padding: .1em .35em; border-radius: 4px; }
::selection { background: var(--primary-soft); }

:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; border-radius: 4px; }

/* ==========================================================================
   Header
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: .65rem 16px;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 1rem; color: var(--text); display: flex; align-items: center; gap: .55rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; color: #fff;
  background: linear-gradient(135deg, #14968c 0%, #0f766e 55%, #0b5a54 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 6px -2px rgba(15, 118, 110, .6);
  display: grid; place-items: center; font-size: .78rem; font-weight: 800; letter-spacing: .02em;
}
.topbar nav { margin-left: auto; display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.topbar nav > a:not(.btn) {
  color: var(--text-2); font-weight: 550; font-size: .9rem; padding: .4rem .7rem; border-radius: 8px;
}
.topbar nav > a:not(.btn):hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.topbar nav > a.active { color: var(--primary); background: var(--primary-soft); }
.topbar.wide .topbar-inner { max-width: none; }
.nav-user { color: var(--muted); font-size: .88rem; padding: 0 .4rem; }

/* ==========================================================================
   Layout
   ========================================================================== */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 16px 4rem; width: 100%; flex: 1 0 auto; }
.container.narrow { max-width: 460px; padding-top: 3rem; }
.container.wide { max-width: none; }
.page-head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.page-head p { margin: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: .35rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 1.25rem 1.35rem; margin-bottom: 1.1rem;
}
.card > h2:first-child, .card > h3:first-child { margin-bottom: .85rem; }
.card > h2:first-child + .muted, .card > h2:first-child + p.muted { margin-top: -.5rem; }
.grid { display: grid; gap: 1.1rem; }
.grid > .card { margin-bottom: 0; }
.grid + .card, .grid + .grid { margin-top: 1.1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 160px; }
.row > .shrink { flex: 0 0 auto; }
.stack > * + * { margin-top: .75rem; }

/* ==========================================================================
   Forms
   ========================================================================== */
label { display: block; font-weight: 600; font-size: .83rem; margin-bottom: .3rem; color: var(--text-2); }
.field { margin-bottom: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=tel], input[type=search], select, textarea {
  width: 100%; min-height: 40px; padding: .5rem .7rem;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: #fff; color: var(--text); font: inherit; font-size: .93rem;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input::placeholder, textarea::placeholder { color: #9aa7a2; }
input:hover, select:hover, textarea:hover { border-color: #b9c5c0; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring);
}
input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2362716b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center;
}
input[type=color] { width: 100%; height: 40px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 3px; background: #fff; cursor: pointer; }
textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; font-size: .9rem; color: var(--text); cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 0; flex: 0 0 auto; }
.hint { font-size: .8rem; color: var(--muted); margin-top: .3rem; line-height: 1.45; }
.error-text { color: var(--danger); font-size: .82rem; margin-top: .25rem; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 40px; padding: .5rem 1rem; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: .9rem; font-weight: 600; letter-spacing: -.005em;
  cursor: pointer; white-space: nowrap; text-decoration: none; box-shadow: var(--shadow-xs);
  transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .08s var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: #b9c5c0; text-decoration: none; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--primary); border-color: var(--primary); color: var(--primary-ink);
  box-shadow: 0 1px 2px rgba(11, 95, 88, .3), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-ink); }
.btn-danger { color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover { background: var(--danger-soft); border-color: #eeada4; color: var(--danger); }
.btn-sm { min-height: 32px; padding: .3rem .7rem; font-size: .84rem; border-radius: 7px; }
.btn-link {
  background: none; border: none; color: var(--primary); padding: .25rem .35rem; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .88rem; border-radius: 6px;
}
.btn-link:hover { background: var(--primary-soft); }
.inline { display: inline; }

/* ==========================================================================
   Feedback
   ========================================================================== */
.alert {
  position: relative; padding: .85rem 1rem .85rem 1.15rem; border-radius: var(--radius);
  margin-bottom: 1.1rem; border: 1px solid; font-size: .92rem; line-height: 1.5;
}
.alert::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: currentColor; opacity: .55; }
.alert-ok { background: var(--ok-soft); border-color: var(--ok-border); color: #05603a; }
.alert-error { background: var(--danger-soft); border-color: var(--danger-border); color: #7a1a12; }
.alert-warn { background: var(--warn-soft); border-color: var(--warn-border); color: #6b4700; }
.alert ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.alert li + li { margin-top: .1rem; }

.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 650; letter-spacing: .01em; line-height: 1.5; vertical-align: middle;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2);
}
.badge-ok { background: var(--ok-soft); border-color: var(--ok-border); color: var(--ok); }
.badge-ok::before, .badge-warn::before, .badge-danger::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-warn { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn); }
.badge-danger { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }
.badge-count { background: var(--danger); border-color: var(--danger); color: #fff; min-width: 1.4rem; justify-content: center; padding: .05rem .4rem; }

/* ==========================================================================
   Tabs (segmented)
   ========================================================================== */
.tabs {
  display: inline-flex; gap: .2rem; padding: .25rem; margin-bottom: 1.25rem; max-width: 100%;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 12px; overflow-x: auto;
}
.tabs a {
  padding: .45rem .95rem; color: var(--muted); font-weight: 600; font-size: .88rem;
  border-radius: 9px; white-space: nowrap; transition: background .15s var(--ease), color .15s var(--ease);
}
.tabs a:hover { color: var(--text); text-decoration: none; background: rgba(255, 255, 255, .6); }
.tabs a.active { color: var(--primary); background: var(--surface); box-shadow: var(--shadow); }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; margin: 0 -.35rem; padding: 0 .35rem; }
table.list { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
table.list th, table.list td { text-align: left; padding: .7rem .65rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list th {
  font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  background: var(--surface-2); border-bottom-color: var(--border);
}
table.list th:first-child { border-top-left-radius: 8px; }
table.list th:last-child { border-top-right-radius: 8px; }
table.list tbody tr { transition: background .12s var(--ease); }
table.list tbody tr:not(.edit-row):hover { background: #fafcfb; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.muted { font-variant-numeric: tabular-nums; }

table.rules-table td { white-space: nowrap; padding: .45rem .5rem; border-bottom: 0; }
table.rules-table td:first-child { padding-left: 0; }
table.rules-table tbody tr:hover { background: transparent; }
.field-narrow { max-width: 220px; }
tr.edit-row > td { background: var(--surface-2); padding: 1.1rem 1rem; border-bottom: 2px solid var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
tr.edit-row form { margin: 0; }
.edit-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

details.edit > summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: .88rem; list-style: none; padding: .2rem .35rem; border-radius: 6px; display: inline-block; }
details.edit > summary:hover { background: var(--primary-soft); }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit[open] { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem; margin: .25rem 0; }

/* ==========================================================================
   Unit cards, empty states, sharing
   ========================================================================== */
.unit-card { display: block; color: inherit; position: relative; transition: border-color .15s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease); }
.unit-card:hover { text-decoration: none; color: inherit; border-color: #9fd3cd; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.unit-card h2 { display: flex; align-items: center; gap: .5rem; }
.unit-card .meta { font-size: .86rem; color: var(--muted); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty p { margin-bottom: 1rem; }
.share { display: flex; gap: .5rem; flex-wrap: wrap; }
.share input { flex: 1 1 260px; font-family: var(--mono); font-size: .82rem; background: var(--surface-2); color: var(--text-2); }

/* ==========================================================================
   Shift chips & legend
   ========================================================================== */
.legend { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem; padding: .28rem .7rem .28rem .3rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: .84rem; font-weight: 600;
  cursor: pointer; color: var(--text-2); box-shadow: var(--shadow-xs);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.chip .sw {
  width: 24px; height: 24px; border-radius: 999px; color: #fff; display: grid; place-items: center;
  font-size: .72rem; font-weight: 750; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .12);
}
.chip small { font-weight: 500; }
.chip.selected { border-color: var(--primary); background: var(--primary-soft); color: var(--text); box-shadow: 0 0 0 3px var(--primary-ring); }

/* ==========================================================================
   Roster grid
   ========================================================================== */
.roster-scroll {
  overflow: auto; max-height: 75vh; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow);
}
table.roster { border-collapse: separate; border-spacing: 0; font-size: .8rem; font-variant-numeric: tabular-nums; }
table.roster th, table.roster td {
  border-right: 1px solid #edf1ef; border-bottom: 1px solid #edf1ef;
  padding: 2px; text-align: center; min-width: 36px; height: 34px;
}
table.roster thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2); padding: .35rem .15rem;
  font-weight: 650; line-height: 1.1; color: var(--text-2); border-bottom: 1px solid var(--border);
}
table.roster thead th .dow { display: block; font-size: .64rem; color: var(--muted); font-weight: 550; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
table.roster th.weekend, table.roster td.weekend { background-color: #f6f8f7; }
table.roster thead th.weekend { background-color: #eef2f0; }
table.roster thead th.today { background: var(--primary); color: #fff; }
table.roster thead th.today .dow { color: rgba(255, 255, 255, .8); }
table.roster .name {
  position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left;
  padding: .3rem .75rem; min-width: 190px; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 600; color: var(--text); border-right: 1px solid var(--border);
}
table.roster tbody .name { box-shadow: 1px 0 0 var(--border); }
table.roster thead .name { z-index: 3; background: var(--surface-2); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.roster .name small { display: block; font-size: .7rem; line-height: 1.2; font-weight: 500; }
table.roster .name .muted { font-weight: 500; }
table.roster .total { font-weight: 700; min-width: 48px; background: var(--surface-2); color: var(--text-2); }
table.roster tbody tr:hover .name { background: #fafcfb; }
table.roster tfoot td, table.roster tfoot th { background: var(--surface-2); font-size: .74rem; height: 28px; color: var(--text-2); }
table.roster tfoot tr:first-child td, table.roster tfoot tr:first-child th { border-top: 2px solid var(--border); }
table.roster tfoot .name { background: var(--surface-2); font-weight: 650; }
table.roster tfoot td.short { background: var(--danger-soft); color: var(--danger); font-weight: 800; }
table.roster tfoot td.over { background: var(--warn-soft); color: var(--warn); font-weight: 800; }
.cell {
  display: grid; place-items: center; width: 100%; height: 100%; min-height: 28px; border-radius: 6px;
  font-weight: 750; font-size: .76rem; letter-spacing: .02em; color: #fff; cursor: pointer; user-select: none;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .12);
  transition: transform .08s var(--ease), filter .12s var(--ease);
}
.cell:hover { filter: brightness(1.08); }
.cell.empty { color: #b4bfba; font-weight: 400; box-shadow: none; background: transparent; }
.cell.empty:hover { background: var(--surface-3); }
.readonly .cell { cursor: default; }
.readonly .cell:hover { filter: none; }
tr.inactive .name { color: var(--muted); text-decoration: line-through; }
tr.highlight td, tr.highlight th { background-color: var(--primary-soft) !important; }
tr.highlight .name { box-shadow: inset 3px 0 0 var(--primary); }
.save-state { font-size: .83rem; color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; }
.save-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.save-state.error { color: var(--danger); font-weight: 600; }
.save-state.error::before { background: var(--danger); }

/* ==========================================================================
   Public "my shifts" list
   ========================================================================== */
.my-shifts { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.my-shifts li { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.my-shifts .sw { width: 34px; height: 34px; border-radius: 9px; color: #fff; display: grid; place-items: center; font-weight: 750; flex: 0 0 auto; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .12); }
.my-shifts li.past { opacity: .5; }
.my-shifts li.today { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); background: #fff; }

/* ==========================================================================
   Landing & auth
   ========================================================================== */
.hero {
  text-align: center; padding: 4.5rem 16px 3.5rem; margin: -1.5rem calc(50% - 50vw) 2.25rem;
  background:
    radial-gradient(60rem 22rem at 50% -6rem, rgba(20, 150, 140, .16), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 650; color: var(--primary);
  background: var(--primary-soft); border: 1px solid #bfe3de; padding: .25rem .7rem; border-radius: 999px; margin-bottom: 1.1rem;
}
.hero h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); line-height: 1.12; letter-spacing: -.035em; max-width: 760px; margin: 0 auto .9rem; }
.hero p { font-size: 1.08rem; color: var(--muted); max-width: 600px; margin: 0 auto 1.75rem; }
.hero .row { justify-content: center; }
.hero .btn { min-height: 46px; padding: .6rem 1.3rem; font-size: .96rem; }
.feature-icon {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; margin-bottom: .85rem;
  background: var(--primary-soft); color: var(--primary);
}
.feature-icon svg { width: 22px; height: 22px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin-bottom: 1.25rem; text-align: center; }
.auth-brand .brand-mark { width: 44px; height: 44px; border-radius: 12px; font-size: 1rem; }
.auth-card { padding: 1.75rem; }
.auth-card h1 { font-size: 1.4rem; }

.hide-mobile { }
.show-mobile { display: none; }

/* ==========================================================================
   Brand layer — header, banners, stats, landing
   ========================================================================== */
:root {
  --brand-900: #073b37;
  --brand-800: #0b4f4a;
  --brand-700: #0f766e;
  --brand-500: #14b8a6;
  --accent: #f5b400;
  --accent-hover: #e0a300;
  --accent-ink: #2b1d00;
  --ghana-red: #ce1126;
  --ghana-gold: #fcd116;
  --ghana-green: #006b3f;
}

.icon { width: 1.05em; height: 1.05em; flex: 0 0 auto; vertical-align: -.15em; }

/* Ghana flag stripe above the header */
.flag-stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--ghana-red) 0 33.33%, var(--ghana-gold) 33.33% 66.66%, var(--ghana-green) 66.66% 100%);
}

/* Dark branded header */
.topbar {
  background: linear-gradient(100deg, var(--brand-900) 0%, var(--brand-800) 45%, #0d625c 100%);
  border-bottom: 0;
  box-shadow: 0 6px 20px -12px rgba(7, 59, 55, .7);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.topbar .brand, .topbar .brand:hover { color: #fff; }
.topbar .brand-mark {
  background: linear-gradient(135deg, var(--ghana-gold), var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.topbar nav > a:not(.btn) { color: rgba(255, 255, 255, .78); }
.topbar nav > a:not(.btn):hover { background: rgba(255, 255, 255, .1); color: #fff; }
.topbar nav > a.active { background: rgba(255, 255, 255, .16); color: #fff; }
.topbar .nav-user { color: rgba(255, 255, 255, .7); }

/* Buttons for dark surfaces and the gold accent */
.btn-on-dark {
  background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); color: #fff; box-shadow: none;
}
.btn-on-dark:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .45); color: #fff; }
.btn-accent {
  background: linear-gradient(180deg, #ffc62e, var(--accent)); border-color: #e6a800; color: var(--accent-ink);
  box-shadow: 0 1px 2px rgba(120, 80, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn-accent:hover { background: var(--accent-hover); border-color: #d19700; color: var(--accent-ink); }
.btn-primary { background: linear-gradient(180deg, #13867d, var(--primary)); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-lg { min-height: 48px; padding: .65rem 1.35rem; font-size: 1rem; border-radius: 10px; }

.eyebrow-text { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); margin-bottom: .3rem; }
.eyebrow-text.center { text-align: center; }

/* Tabs with icons */
.tabs a { display: inline-flex; align-items: center; gap: .45rem; }
.tabs a .icon { opacity: .75; }
.tabs a.active .icon { opacity: 1; }

/* Avatars */
.avatar {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto; display: grid; place-items: center;
  font-weight: 800; font-size: .95rem; letter-spacing: .02em; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 4px 10px -4px rgba(0, 0, 0, .35);
}
.avatar-lg { width: 60px; height: 60px; border-radius: 16px; font-size: 1.3rem; }
.avatar-0 { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.avatar-1 { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.avatar-2 { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.avatar-3 { background: linear-gradient(135deg, #fbbf24, #d97706); }
.avatar-4 { background: linear-gradient(135deg, #fb7185, #be123c); }
.avatar-5 { background: linear-gradient(135deg, #34d399, #047857); }

/* Dashboard stat tiles */
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 1.5rem; }
.stat {
  display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; right: -24px; top: -24px; width: 90px; height: 90px; border-radius: 50%; background: var(--tone-soft); opacity: .6; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--tone-soft); color: var(--tone); position: relative; z-index: 1; }
.stat-icon .icon { width: 22px; height: 22px; }
.stat-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .82rem; color: var(--muted); font-weight: 550; }
.stat-teal { --tone: #0f766e; --tone-soft: #dcf3ef; }
.stat-blue { --tone: #2563eb; --tone-soft: #e1ebff; }
.stat-violet { --tone: #6d28d9; --tone-soft: #ede7ff; }
.stat-amber { --tone: #b45309; --tone-soft: #fff0cc; }
.stat-slate { --tone: #475569; --tone-soft: #eef1f4; }

/* Unit cards */
.unit-card { padding: 1.1rem 1.2rem 0; overflow: hidden; }
.unit-card-head { display: flex; align-items: center; gap: .9rem; padding-bottom: 1rem; }
.unit-card-head h2 { margin: 0 0 .1rem; font-size: 1.08rem; }
.unit-card-foot {
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; margin: 0 -1.2rem; padding: .7rem 1.2rem;
  background: var(--surface-2); border-top: 1px solid var(--border); font-size: .84rem; color: var(--muted); font-weight: 550;
}
.unit-card-foot span { display: inline-flex; align-items: center; gap: .35rem; }
.unit-card-go { margin-left: auto; color: var(--primary); transition: transform .2s var(--ease); }
.unit-card:hover .unit-card-go { transform: translateX(4px); }

/* Unit banner */
.unit-hero {
  position: relative; overflow: hidden; border-radius: 18px; margin-bottom: 1.25rem; color: #fff;
  background:
    radial-gradient(40rem 16rem at 110% -20%, rgba(252, 209, 22, .22), transparent 60%),
    radial-gradient(30rem 14rem at -10% 120%, rgba(20, 184, 166, .35), transparent 60%),
    linear-gradient(120deg, var(--brand-900), var(--brand-700));
  box-shadow: 0 18px 40px -24px rgba(7, 59, 55, .8);
}
.unit-hero::before {
  content: ""; position: absolute; inset: 0; opacity: .08; pointer-events: none;
  background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 18px 18px;
}
.unit-hero-main { position: relative; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.4rem 1.5rem 1.1rem; }
.unit-hero h1 { color: #fff; margin: 0 0 .25rem; font-size: 1.75rem; }
.unit-hero p { margin: 0; color: rgba(255, 255, 255, .8); font-size: .92rem; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.unit-hero-actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.unit-hero-stats {
  position: relative; display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; padding: .75rem 1.5rem;
  background: rgba(0, 0, 0, .16); border-top: 1px solid rgba(255, 255, 255, .1); font-size: .86rem; color: rgba(255, 255, 255, .78);
}
.unit-hero-stats strong { color: #fff; font-size: 1rem; margin-right: .2rem; }

/* Empty states */
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: inline-grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: .9rem; }
.empty-icon .icon { width: 28px; height: 28px; }

/* Landing */
.hero-split {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; text-align: left;
  padding-inline: max(16px, calc(50vw - 600px)); padding-top: 4.5rem; padding-bottom: 4.5rem;
  background:
    radial-gradient(50rem 26rem at 85% 10%, rgba(252, 209, 22, .16), transparent 60%),
    radial-gradient(50rem 30rem at 10% 0%, rgba(20, 184, 166, .18), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}
.hero-split h1 { margin: 0 0 1rem; max-width: none; font-size: clamp(2.1rem, 4.4vw, 3.3rem); }
.hero-split p { margin: 0 0 1.75rem; max-width: 540px; }
.hero-split .row { justify-content: flex-start; }
.text-gradient { background: linear-gradient(90deg, var(--brand-700), #14b8a6 60%, #d99a00); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-points { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; color: var(--text-2); font-size: .9rem; font-weight: 550; }
.hero-points li { display: inline-flex; align-items: center; gap: .4rem; }
.hero-points .icon { color: var(--ok); }

.hero-preview { position: relative; }
.preview-window {
  background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(7, 59, 55, .45), 0 10px 20px -12px rgba(0, 0, 0, .15);
  transform: perspective(1200px) rotateY(-6deg) rotateX(3deg);
}
.preview-bar { display: flex; align-items: center; gap: .4rem; padding: .7rem .9rem; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: .8rem; color: var(--text-2); }
.preview-bar span { width: 10px; height: 10px; border-radius: 50%; background: #e2e8e5; }
.preview-bar span:nth-child(1) { background: #f87171; }
.preview-bar span:nth-child(2) { background: #fbbf24; }
.preview-bar span:nth-child(3) { background: #34d399; }
.preview-bar strong { margin-left: .5rem; }
.preview-grid { border-collapse: separate; border-spacing: 4px; padding: .5rem .6rem; width: 100%; font-size: .75rem; }
.preview-grid th { text-align: center; font-weight: 650; color: var(--muted); font-size: .68rem; padding: .2rem 0; border-radius: 6px; }
.preview-grid th small { display: block; color: var(--text); font-size: .74rem; }
.preview-grid th.today { background: var(--primary); color: rgba(255, 255, 255, .8); }
.preview-grid th.today small { color: #fff; }
.preview-grid td span { display: grid; place-items: center; height: 26px; border-radius: 6px; color: #fff; font-weight: 750; font-size: .72rem; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .12); }
.preview-grid .pname { width: 1%; font-weight: 600; color: var(--text-2); white-space: nowrap; padding-right: .4rem; }
.preview-foot { display: flex; align-items: center; gap: .45rem; padding: .6rem .9rem; border-top: 1px solid var(--border); font-size: .8rem; color: var(--ok); font-weight: 600; background: var(--ok-soft); }
.dot-ok { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.preview-chip {
  position: absolute; display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 999px;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: .8rem; font-weight: 650; color: var(--text);
}
.preview-chip .icon { color: var(--primary); }
.preview-chip-a { left: -18px; top: -16px; }
.preview-chip-b { right: -10px; bottom: -18px; }

.section { padding: 1rem 0 2rem; }
.section-title { text-align: center; font-size: clamp(1.4rem, 2.6vw, 1.9rem); letter-spacing: -.025em; margin: 0 auto 1.75rem; max-width: 640px; }
.step { position: relative; }
.step-num {
  position: absolute; top: 1rem; right: 1.1rem; font-size: 2.4rem; font-weight: 800; line-height: 1;
  color: var(--surface-3); letter-spacing: -.04em;
}
.cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding: 1.75rem 2rem; border-radius: 18px; color: #fff; margin: 1rem 0 0;
  background: radial-gradient(30rem 12rem at 100% 0%, rgba(252, 209, 22, .25), transparent 60%), linear-gradient(120deg, var(--brand-900), var(--brand-700));
  box-shadow: 0 18px 40px -24px rgba(7, 59, 55, .8);
}
.cta-band h2 { color: #fff; font-size: 1.4rem; margin: 0 0 .25rem; }
.cta-band p { margin: 0; color: rgba(255, 255, 255, .8); }

/* Auth */
.auth-brand .brand-mark { background: linear-gradient(135deg, var(--ghana-gold), var(--accent)); color: var(--accent-ink); }
.auth-card { border-top: 4px solid var(--primary); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.site-footer-inner { max-width: 1200px; margin: 0 auto; padding: 1.1rem 16px; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; font-size: .85rem; }
.site-footer .brand { font-size: .92rem; }
.site-footer .brand-mark { width: 24px; height: 24px; border-radius: 6px; font-size: .62rem; }

/* ==========================================================================
   Components — sections, staff, roster cards, toasts, today card
   ========================================================================== */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.section-head h2 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.section-head-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.count-pill { font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.search-input {
  width: 240px !important; min-height: 34px !important; padding: .35rem .7rem .35rem 2rem !important; font-size: .87rem !important;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2362716b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat .6rem center;
}
.small-line { font-size: .84rem; }

/* Add-staff panel with a segmented switch */
.add-panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1.1rem; }
.segmented { display: inline-flex; gap: .2rem; padding: .2rem; background: var(--surface-3); border-radius: 10px; margin-bottom: 1rem; }
.segmented button { border: 0; background: transparent; font: inherit; font-size: .85rem; font-weight: 600; color: var(--muted); padding: .35rem .85rem; border-radius: 8px; cursor: pointer; }
.segmented button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow); }

/* People */
.person { display: inline-flex; align-items: center; gap: .65rem; }
.person-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; display: inline-grid; place-items: center;
  color: #fff; font-size: .72rem; font-weight: 750; letter-spacing: .02em; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}

/* Share card */
.share-card { display: flex; gap: 1rem; align-items: flex-start; }
.share-card .feature-icon { margin: 0; flex: 0 0 auto; }
.share-card-body { flex: 1; min-width: 0; }
.share-card-body h2 { margin-bottom: .2rem; }

/* Roster cards */
.roster-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.roster-card { display: block; color: inherit; margin: 0; transition: border-color .15s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease); }
.roster-card:hover { text-decoration: none; color: inherit; border-color: #9fd3cd; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.roster-card.is-current { border-color: #9fd3cd; box-shadow: 0 0 0 3px var(--primary-ring), var(--shadow); }
.roster-card-top { display: flex; gap: .85rem; align-items: flex-start; margin-bottom: 1rem; }
.roster-card-top h3 { margin: 0 0 .15rem; font-size: 1rem; line-height: 1.3; }
.roster-card-badges { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .45rem; }
.roster-date {
  flex: 0 0 auto; width: 50px; border-radius: 10px; overflow: hidden; text-align: center; border: 1px solid var(--border); background: #fff; box-shadow: var(--shadow-xs);
}
.roster-date span { display: block; background: var(--primary); color: #fff; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: .15rem 0; }
.roster-date strong { display: block; font-size: 1.25rem; line-height: 1.6; }
.coverage-label { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); font-weight: 550; margin-bottom: .35rem; }
.coverage-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.coverage-bar span { display: block; height: 100%; border-radius: 999px; }
.text-ok { color: var(--ok); } .text-warn { color: var(--warn); } .text-danger { color: var(--danger); }
.bg-ok { background: linear-gradient(90deg, #22c55e, #059669); }
.bg-warn { background: linear-gradient(90deg, #fbbf24, #d97706); }
.bg-danger { background: linear-gradient(90deg, #fb7185, #dc2626); }

/* Toasts */
.toast-stack { position: fixed; top: 76px; right: 16px; z-index: 50; display: grid; gap: .5rem; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: .6rem; padding: .8rem .9rem; border-radius: 12px; background: #0f1d19; color: #fff;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .45); font-size: .9rem; line-height: 1.45;
  animation: toast-in .35s var(--ease) both;
}
.toast.leaving { animation: toast-out .25s var(--ease) both; }
.toast-icon { width: 22px; height: 22px; border-radius: 50%; background: #22c55e; display: grid; place-items: center; flex: 0 0 auto; }
.toast-icon .icon { width: 14px; height: 14px; stroke-width: 3; }
.toast-close { margin-left: auto; background: none; border: 0; color: rgba(255, 255, 255, .6); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 .2rem; }
.toast-close:hover { color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* "On duty today" (public roster) */
.today-card {
  border-radius: 18px; overflow: hidden; margin-bottom: 1.1rem; color: #fff;
  background: radial-gradient(30rem 12rem at 100% 0%, rgba(252, 209, 22, .22), transparent 60%), linear-gradient(120deg, var(--brand-900), var(--brand-700));
  box-shadow: 0 18px 40px -24px rgba(7, 59, 55, .8);
}
.today-card-head { padding: 1.1rem 1.3rem .6rem; }
.today-card-head h2 { color: #fff; font-size: 1.35rem; margin: 0; }
.today-shifts { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); padding: .4rem 1.1rem 1.1rem; }
.today-shift { background: #fff; color: var(--text); border-radius: 12px; padding: .8rem .9rem; box-shadow: var(--shadow); }
.today-shift-title { display: flex; align-items: center; gap: .6rem; padding-bottom: .6rem; margin-bottom: .5rem; border-bottom: 1px solid var(--border); }
.today-shift-title .sw { width: 30px; height: 30px; border-radius: 9px; color: #fff; display: grid; place-items: center; font-weight: 750; font-size: .8rem; }
.today-shift-title small { display: block; color: var(--muted); font-size: .76rem; }
.today-count { margin-left: auto; font-weight: 800; font-size: 1.1rem; color: var(--text-2); }
.today-person { display: flex; align-items: center; gap: .55rem; padding: .25rem 0; font-size: .9rem; font-weight: 550; }
.today-person .person-avatar { width: 26px; height: 26px; font-size: .64rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero-split { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-preview { max-width: 560px; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  h1 { font-size: 1.4rem; }
  .hide-mobile { display: none; }
  .show-mobile { display: inline; }
  .container { padding-top: 1.1rem; }
  .card { padding: 1rem; border-radius: var(--radius); }
  .page-head .actions { margin-left: 0; width: 100%; }
  .tabs { display: flex; }
  table.roster .name { min-width: 130px; max-width: 150px; }
  table.rules-table td { white-space: nowrap; padding: .45rem .5rem; border-bottom: 0; }
table.rules-table td:first-child { padding-left: 0; }
table.rules-table tbody tr:hover { background: transparent; }
.field-narrow { max-width: 220px; }
tr.edit-row > td { padding: .75rem .5rem; }
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero-split { grid-template-columns: 1fr; gap: 2.5rem; padding-top: 2.5rem; padding-bottom: 3rem; }
  .preview-window { transform: none; }
  .preview-chip-a { left: 8px; top: -34px; }
  .preview-chip-b { right: 8px; }
  .unit-hero-main { padding: 1.1rem; }
  .unit-hero-actions { margin-left: 0; width: 100%; }
  .unit-hero-stats { padding: .7rem 1.1rem; gap: .3rem 1rem; }
  .cta-band { padding: 1.4rem; }
  .search-input { width: 100% !important; }
  .section-head-actions { width: 100%; }
  .roster-cards { grid-template-columns: 1fr; }
  .toast-stack { top: 70px; }
}

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

/* ==========================================================================
   Print
   ========================================================================== */
@media print {
  body { background: #fff; font-size: 11px; }
  .topbar, .no-print, .tabs, .flag-stripe, .site-footer, .unit-hero-actions { display: none !important; }
  .container { padding: 0; max-width: none; }
  .card, .roster-scroll { border: 0; box-shadow: none; padding: 0; }
  .roster-scroll { overflow: visible; max-height: none; }
  table.roster th, table.roster td { min-width: 0; height: 20px; padding: 1px; }
  table.roster .name { position: static; min-width: 0; }
  table.roster thead th { position: static; }
  .cell { min-height: 0; border-radius: 3px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: landscape; margin: 10mm; }
}
