/* Eightyniners Staff Portal — styles. Brand green from the group logo (#2B4039); grainy green wallpapers from the Assets folder. */

:root {
  --brand: #2b4039;
  --brand-2: #3d5a50;
  --brand-tint: #e3ebe7;
  --brand-ink: #ffffff;
  --accent: #806375;
  --gold: #b8913f;
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #1d2824;
  --ink-soft: #5d6a65;
  --ink-faint: #8b958f;
  --line: #e6e0d6;
  --line-strong: #d3cabc;
  --ok: #2f7a55;
  --ok-bg: #e2f1e8;
  --warn: #9a6a12;
  --warn-bg: #fbefd6;
  --bad: #a63d3d;
  --bad-bg: #f8e1df;
  --info-bg: #e6eef6;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(29, 40, 36, .05), 0 8px 24px -12px rgba(29, 40, 36, .18);
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --tabbar-h: 68px;
  --emerald: #1e6b59;
  --mint: #43a07a;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --brand: #8fb5a6;
    --brand-2: #a9c9bc;
    --brand-tint: #22322c;
    --brand-ink: #10201a;
    --accent: #c9a6b8;
    --gold: #d8b56a;
    --bg: #121a17;
    --surface: #1a2420;
    --surface-2: #1f2a26;
    --ink: #eef1ec;
    --ink-soft: #aab6b0;
    --ink-faint: #7f8b85;
    --line: #2c3833;
    --line-strong: #3b4a44;
    --ok: #7cc9a0;
    --ok-bg: #1d3328;
    --warn: #e2b866;
    --warn-bg: #3a2f18;
    --bad: #ec9a92;
    --bad-bg: #3d2222;
    --info-bg: #1f2b36;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --brand: #8fb5a6;
  --brand-2: #a9c9bc;
  --brand-tint: #22322c;
  --brand-ink: #10201a;
  --accent: #c9a6b8;
  --gold: #d8b56a;
  --bg: #121a17;
  --surface: #1a2420;
  --surface-2: #1f2a26;
  --ink: #eef1ec;
  --ink-soft: #aab6b0;
  --ink-faint: #7f8b85;
  --line: #2c3833;
  --line-strong: #3b4a44;
  --ok: #7cc9a0;
  --ok-bg: #1d3328;
  --warn: #e2b866;
  --warn-bg: #3a2f18;
  --bad: #ec9a92;
  --bad-bg: #3d2222;
  --info-bg: #1f2b36;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}


* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font: 600 28px/1.15 var(--font-display); letter-spacing: -.01em; }
h2 { font: 600 20px/1.25 var(--font-display); }
h3 { font-size: 15px; font-weight: 600; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- layout ---------- */
.app { min-height: 100dvh; }
.sidebar { display: none; }
.main { padding: 16px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  color: #fff;
  background: linear-gradient(rgba(4, 16, 12, .35), rgba(4, 16, 12, .45)), url('/img/bg/green4-1200.jpg') 40% 55% / cover, #0b2a20;
}
.topbar .wordmark { height: 26px; width: auto; }
.topbar .who { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.16); color: #fff; font-weight: 600; font-size: 13px; border: 0; cursor: pointer;
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-faint); text-decoration: none; font-size: 11px; font-weight: 500; position: relative;
}
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a[aria-current='page'] { color: var(--brand); }
.tabbar a[aria-current='page']::before {
  content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand);
}
.badge-dot {
  position: absolute; top: 8px; left: calc(50% + 8px); min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; line-height: 17px; text-align: center; font-weight: 600;
}

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 248px 1fr; }
  .topbar, .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh;
    color: #fff; padding: 26px 16px 18px;
    background: linear-gradient(180deg, rgba(5, 18, 14, .25) 0%, rgba(5, 18, 14, .55) 100%), url('/img/bg/green2-700.jpg') center 30% / cover, #0f2e26;
  }
  .sidebar .logo { width: 150px; margin: 4px 10px 28px; }
  .sidebar nav { display: flex; flex-direction: column; gap: 2px; }
  .sidebar nav .group { margin: 18px 12px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
  .sidebar nav a {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
    color: rgba(255,255,255,.82); text-decoration: none; font-weight: 500; font-size: 14px; position: relative;
  }
  .sidebar nav a svg { width: 20px; height: 20px; opacity: .9; }
  .sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
  .sidebar nav a[aria-current='page'] { background: rgba(255,255,255,.14); color: #fff; }
  .sidebar nav a .count { margin-left: auto; background: #fff; color: var(--brand); border-radius: 9px; padding: 0 7px; font-size: 11px; font-weight: 600; }
  .sidebar .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.07); }
  .sidebar .me .avatar { flex: none; }
  .sidebar .me .name { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
  .sidebar .me .role { font-size: 11.5px; opacity: .7; }
  .main { padding: 36px 40px 60px; }
}

/* ---------- cards & grid ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head a { font-size: 13px; font-weight: 500; text-decoration: none; }
.grid { display: grid; gap: 14px; }
.grid > .card + .card { margin-top: 0; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .grid-home { grid-template-columns: 1.35fr 1fr; align-items: start; } }
.stack { display: grid; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }
.empty { text-align: center; padding: 26px 12px; color: var(--ink-soft); }
.empty svg { width: 34px; height: 34px; opacity: .45; margin: 0 auto 8px; display: block; }

/* ---------- today hero ---------- */
.hero {
  color: #fff; border: 0; position: relative; overflow: hidden; min-height: 176px;
  background: linear-gradient(100deg, rgba(4, 18, 12, .82) 0%, rgba(4, 18, 12, .55) 50%, rgba(4, 18, 12, .1) 100%), url('/img/bg/green1-1200.jpg') 65% 55% / cover, #0b2a20;
}
.hero .eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.hero .shift-big { font: 600 34px/1.1 var(--font-display); margin: 6px 0 4px; }
.hero .meta { opacity: .85; font-size: 14px; }
.hero .chip-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .pill { background: rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }


/* ---------- week strip ---------- */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(64px, 1fr); gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.day {
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px; text-align: center; background: var(--surface-2);
}
.day .dow { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.day .dnum { font-weight: 600; font-size: 17px; margin: 1px 0 5px; }
.day.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.day.ph { background: var(--brand-tint); }

/* ---------- shift chip ---------- */
.shift {
  /* Equal square cells, coloured like the Monthly Schedule workbook. */
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; padding: 0; border-radius: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em; line-height: 1;
  color: #1d2824; background: #eee; white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .04);
}
.shift.none { background: transparent; color: var(--ink-faint); box-shadow: none; }

/* ---------- pills & status ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--ink-soft); border: 1px solid transparent; white-space: nowrap;
}
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--ink-soft); }
.pill.brand { background: var(--brand-tint); color: var(--brand); }

/* ---------- balance rings ---------- */
.rings { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px 8px; }
.ring { text-align: center; }
.ring svg { width: 84px; height: 84px; display: block; margin: 0 auto 6px; }
.ring .val { font: 600 20px/1 var(--font); fill: var(--ink); }
.ring .of { font-size: 10px; fill: var(--ink-faint); }
.ring .label { font-size: 12.5px; font-weight: 500; }
.ring .sub { font-size: 11px; color: var(--ink-faint); }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 2px; }
.item .body { flex: 1; min-width: 0; }
.item .title { font-weight: 500; }
.item .sub { font-size: 12.5px; color: var(--ink-soft); }
.item-link { text-decoration: none; color: inherit; border-radius: 10px; }
.item-link:hover .title { color: var(--brand); }
.icon-circle { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); flex: none; }
.icon-circle svg { width: 19px; height: 19px; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 38px; padding: 0; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .label { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.field .hint { font-size: 12px; color: var(--ink-faint); }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 13px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 84px; padding: 11px 13px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.input.sm { height: 36px; border-radius: 10px; font-size: 14px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 6px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-grid { display: grid; gap: 0 14px; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }

.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--ink-soft); cursor: pointer;
}
.segmented button[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.alert { padding: 11px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 14px; }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.info { background: var(--info-bg); color: var(--ink); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- auth ---------- */
.auth {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: linear-gradient(rgba(3, 14, 10, .1), rgba(3, 14, 10, .3)), url('/img/bg/green1-2400.jpg') 60% center / cover, #0b2a20;
}
@media (max-width: 700px), (orientation: portrait) {
  .auth { background-image: linear-gradient(rgba(3, 14, 10, .1), rgba(3, 14, 10, .3)), url('/img/bg/green5-1000.jpg'); background-position: center; }
}

.auth-card {
  width: 100%; max-width: 400px; border-radius: 24px; padding: 30px 26px 26px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .3); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7);
}
.auth-card .logo { width: 150px; margin: 0 auto 22px; }
.auth-card h1 { font-size: 24px; text-align: center; }
.auth-card .lead { text-align: center; color: var(--ink-soft); margin: 6px 0 22px; font-size: 14px; }
.auth-foot { text-align: center; color: rgba(255,255,255,.85); text-shadow: 0 1px 8px rgba(0,0,0,.5); font-size: 12px; margin-top: 18px; }

/* ---------- month nav ---------- */
.monthnav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.monthnav .label { min-width: 132px; text-align: center; font-weight: 600; color: var(--ink); font-size: 14px; }
.monthnav button { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 9px; cursor: pointer; display: grid; place-items: center; color: var(--ink-soft); }
.monthnav button:hover { background: var(--surface-2); color: var(--ink); }
.monthnav svg { width: 18px; height: 18px; }

/* ---------- my calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { text-align: center; font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; padding-bottom: 2px; }
.cal .cell {
  min-height: 74px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 6px;
  display: flex; flex-direction: column; gap: 4px; position: relative;
}
.cal .cell.blank { background: transparent; border-color: transparent; }
.cal .cell .d { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.cal .cell.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal .cell.today .d { color: var(--brand); }
.cal .cell.ph { background: var(--brand-tint); }
.cal .cell .shift { align-self: center; }
.cal .cell .loc { font-size: 10.5px; color: var(--ink-faint); text-align: center; }
.cal .cell .ph-tag { font-size: 9.5px; color: var(--brand); font-weight: 600; line-height: 1.15; }
@media (max-width: 520px) {
  .cal { gap: 4px; }
  .cal .cell { min-height: 62px; padding: 4px; border-radius: 9px; }
  .cal .cell .shift { width: 28px; height: 28px; font-size: 9.5px; border-radius: 7px; }
  .cal .cell .ph-tag { display: none; }
  .cal .cell .loc { font-size: 9px; }
}

/* ---------- team grid ---------- */
.grid-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-height: 72vh; }
table.team { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
table.team th, table.team td { padding: 5px 3px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.team thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; font-weight: 500; color: var(--ink-faint); }
table.team thead th .n { display: block; color: var(--ink); font-weight: 600; font-size: 13px; }
table.team th.name, table.team td.name {
  position: sticky; left: 0; background: var(--surface); z-index: 1; text-align: left; padding: 6px 12px; min-width: 150px;
  border-right: 1px solid var(--line); font-size: 13px;
}
table.team thead th.name { z-index: 3; }
table.team td.name .t { display: block; font-size: 11px; color: var(--ink-faint); }
table.team .col-today { background: color-mix(in srgb, var(--brand) 9%, var(--surface)); }
table.team thead th.col-today .n { color: var(--brand); }
table.team .col-ph { background: var(--brand-tint); }
table.team .col-wknd { background: var(--surface-2); }
table.team tr.me td { background-image: linear-gradient(color-mix(in srgb, var(--gold) 10%, transparent), color-mix(in srgb, var(--gold) 10%, transparent)); }
table.team .shift { width: 32px; height: 32px; font-size: 10.5px; }
table.team td { padding: 3px 2px; }
table.team td.cellbtn { cursor: pointer; }
table.team td.cellbtn:hover { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 6px; }
table.team td.dirty { box-shadow: inset 0 0 0 2px var(--gold); border-radius: 6px; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; color: var(--ink-soft); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- paint palette (roster editor) ---------- */
.palette { display: flex; flex-wrap: wrap; gap: 6px; }
.palette button { border: 2px solid transparent; border-radius: 9px; padding: 0; background: none; cursor: pointer; }
.palette button[aria-pressed='true'] { border-color: var(--ink); }
.palette .shift { width: 40px; height: 40px; font-size: 12px; border-radius: 9px; }
.sticky-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom)); z-index: 20;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-top: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
@media (min-width: 900px) { .sticky-bar { bottom: 16px; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-faint); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: var(--surface-2); }
table.data .r { text-align: right; }

/* ---------- sheet / modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 22, 19, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--surface);
  border-radius: 22px 22px 0 0; padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); animation: up .2s ease;
}
.sheet.wide { max-width: 980px; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 4px auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
@media (min-width: 640px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { border-radius: 22px; padding: 22px 26px 24px; }
  .sheet .grab { display: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-size: 14px; z-index: 60;
  box-shadow: var(--shadow); animation: up .2s ease; max-width: calc(100% - 32px);
}
@media (min-width: 900px) { .toast { bottom: 28px; } }

.date-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.date-chip { display: inline-flex; flex-direction: column; align-items: center; padding: 5px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); line-height: 1.15; }
.date-chip b { font-size: 15px; }
.date-chip span { font-size: 10.5px; color: var(--ink-faint); text-transform: uppercase; }

.secret { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 20px; letter-spacing: .03em; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 14px; text-align: center; margin: 10px 0; user-select: all; }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; height: 120px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- payslip ---------- */
.payslip {
  background: #fff; color: #1d2824; border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow);
  max-width: 820px; margin: 0 auto; overflow: hidden;
}
.payslip .ps-head { background: linear-gradient(95deg, rgba(3, 20, 18, .85) 0%, rgba(3, 20, 18, .5) 60%, rgba(3, 20, 18, .15) 100%), url('/img/bg/green3-1200.jpg') 40% 40% / cover, #0b2a20; color: #fff; padding: 26px 30px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.payslip .ps-head img { height: 58px; width: auto; }
.payslip .ps-head .ttl { text-align: right; }
.payslip .ps-head .ttl .k { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.payslip .ps-head .ttl .v { font: 600 26px/1.1 'Playfair Display', Georgia, serif; }
.payslip .ps-body { padding: 26px 30px 30px; }
.payslip .ps-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; padding-bottom: 20px; border-bottom: 1px solid #e6e0d6; }
@media (min-width: 640px) { .payslip .ps-meta { grid-template-columns: repeat(4, 1fr); } }
.payslip .ps-meta .k { font-size: 11px; color: #8b958f; text-transform: uppercase; letter-spacing: .06em; }
.payslip .ps-meta .v { font-weight: 500; font-size: 14px; }
.payslip .ps-cols { display: grid; gap: 22px; margin-top: 22px; }
@media (min-width: 640px) { .payslip .ps-cols { grid-template-columns: 1fr 1fr; gap: 34px; } }
.payslip h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #2b4039; }
.payslip .line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed #e6e0d6; font-size: 14px; }
.payslip .line .note { display: block; font-size: 11.5px; color: #8b958f; }
.payslip .line.total { border-bottom: 0; border-top: 1px solid #1d2824; margin-top: 4px; font-weight: 600; }
.payslip .nett { margin-top: 26px; background: #f3efe7; border-radius: 14px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.payslip .nett .k { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #5d6a65; }
.payslip .nett .v { font: 600 32px/1 'Playfair Display', Georgia, serif; color: #2b4039; }
.payslip .ps-foot { margin-top: 22px; font-size: 11.5px; color: #8b958f; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.payslip .notes { margin-top: 16px; font-size: 13px; color: #5d6a65; background: #faf8f4; border-radius: 10px; padding: 10px 14px; }

.money-hidden { filter: blur(7px); user-select: none; transition: filter .2s; cursor: pointer; }

/* ---------- payslip editor ---------- */
.lines { display: grid; gap: 8px; }
.line-row { display: grid; grid-template-columns: 1fr 120px 36px; gap: 8px; align-items: center; }
.line-row .lbl { font-size: 14px; }
.line-row .note-input { grid-column: 1 / -1; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.totals div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.totals .k { font-size: 11.5px; color: var(--ink-faint); }
.totals .v { font-weight: 600; font-size: 17px; }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  .sidebar, .topbar, .tabbar, .no-print, .toast { display: none !important; }
  .app { display: block; }
  .main { padding: 0 !important; max-width: none; }
  .payslip { box-shadow: none; border: 0; max-width: none; }
  .payslip .ps-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .payslip .nett { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .money-hidden { filter: none; }
}
svg.inline { width: 15px; height: 15px; vertical-align: -3px; display: inline-block; }
.alert.row svg { width: 20px; height: 20px; flex: none; }
.grid > *, .stack > * { min-width: 0; }
.main { width: 100%; }
.payslip .ps-head .brand img { height: 40px; width: auto; }
.payslip .ps-head .brand .co { font-size: 11.5px; opacity: .75; margin-top: 6px; letter-spacing: .02em; }
.payslip .nett .v { white-space: nowrap; }
@media (max-width: 480px) {
  .payslip .ps-head, .payslip .ps-body { padding-left: 18px; padding-right: 18px; }
  .payslip .ps-head .brand img { height: 30px; }
  .payslip .ps-head .ttl .v { font-size: 21px; }
  .payslip .nett { padding: 14px 16px; }
  .payslip .nett .v { font-size: 25px; }
}

@media (max-width: 480px) { .payslip .ps-head .brand .co { display: none; } }

/* ---------- avatars, docs, team ---------- */
.avatar-img, .avatar-ph { border-radius: 50%; flex: none; display: inline-grid; place-items: center; object-fit: cover; background: var(--brand-tint); color: var(--brand); font-weight: 600; }
.sidebar .avatar-ph, .topbar .avatar-ph { background: rgba(255,255,255,.16); color: #fff; }
.who a, .sidebar .me { text-decoration: none; }
table.team td.name .who-cell { display: flex; align-items: center; gap: 9px; }
.doc-link { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; text-decoration: none; color: var(--ink); max-width: 100%; }
.doc-link svg { width: 15px; height: 15px; color: var(--brand); flex: none; }
.doc-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.team-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.person { display: flex; gap: 14px; align-items: center; padding: 14px; cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit; }
.person:hover { border-color: var(--brand); }
.person .n { font-weight: 600; line-height: 1.25; }
.person .t { font-size: 12.5px; color: var(--ink-soft); }
.person .c { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.section-title svg { width: 15px; height: 15px; }
.private-note { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink-soft); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.private-note svg { width: 16px; height: 16px; flex: none; color: var(--brand); }
.photo-edit { position: relative; display: inline-block; }
.photo-edit button { position: absolute; right: -2px; bottom: -2px; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--surface); background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photo-edit button svg { width: 16px; height: 16px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--ink-faint); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.branch-text { font-family: var(--font-display); font-weight: 600; color: var(--ink); letter-spacing: .01em; }
.branch-head { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; min-height: 40px; }
.branch-head picture, .branch-head img { display: block; }
.auth-card picture { display: block; }
.auth-card .logo { width: 170px; }
.sidebar .logo { width: 128px; }
.hero .branch-ico { position: absolute; right: 18px; bottom: 16px; height: 44px; width: auto; opacity: .85; z-index: 1; }

/* ---------- org chart (tree) ---------- */
.tree-wrap { overflow-x: auto; padding: 6px 0 18px; }
.tree { display: inline-block; min-width: 100%; text-align: center; }
.tree ul { display: flex; justify-content: center; padding: 22px 0 0; margin: 0; position: relative; }
.tree li { list-style: none; position: relative; padding: 22px 8px 0; display: flex; flex-direction: column; align-items: center; }
.tree li::before, .tree li::after { content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid var(--line-strong); }
.tree li::after { right: auto; left: 50%; border-left: 2px solid var(--line-strong); }
.tree li:only-child::before, .tree li:only-child::after { border-top: 0; }
.tree li:only-child::before { display: none; }
.tree li:first-child::before, .tree li:last-child::after { border-top: 0; }
.tree li:last-child::before { border-right: 2px solid var(--line-strong); border-radius: 0 8px 0 0; }
.tree li:first-child::after { border-radius: 8px 0 0 0; }
.tree li:only-child::after { border-radius: 0; }
.tree ul ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid var(--line-strong); transform: translateX(-1px); }
.tree ul.roots { padding-top: 0; gap: 28px; }
.tree ul.roots > li { padding-top: 0; }
.tree ul.roots > li::before, .tree ul.roots > li::after { display: none; }
.leaf-stack { display: flex; flex-direction: column; gap: 8px; position: relative; }
.leaf-stack .person + .person::before { content: ''; position: absolute; top: -9px; left: 50%; height: 8px; border-left: 2px solid var(--line-strong); }
.tree .person { margin: 0; }

/* Equal-size name boxes everywhere (text is fitted inside) */
.person { width: 200px; height: 84px; padding: 10px 12px; gap: 10px; position: relative; overflow: hidden; }
.team-grid .person { width: 100%; }
.person .ptext { min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1px; text-align: left; }
.person .n, .person .t { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.person .n { font-size: 13px; font-weight: 600; line-height: 1.2; -webkit-line-clamp: 2; }
.person .t { font-size: 11px; line-height: 1.25; color: var(--ink-soft); -webkit-line-clamp: 2; }
.person .c { font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person.lead { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent), var(--shadow); }

/* Phones: the same tree as an indented outline */
@media (max-width: 720px) {
  .tree-wrap { overflow: visible; }
  .tree { display: block; text-align: left; }
  .tree ul { display: block; padding: 0 0 0 18px; margin-left: 20px; border-left: 2px solid var(--line-strong); }
  .tree ul.roots { padding: 0; margin: 0; border: 0; }
  .tree ul.roots > li + li { margin-top: 18px; }
  .tree li { display: block; padding: 10px 0 0; }
  .tree li::before { display: block !important; content: ''; position: absolute; top: 52px; left: -18px; width: 16px; height: 0; border: 0; border-top: 2px solid var(--line-strong); border-radius: 0; }
  .tree li::after, .tree ul ul::before { display: none; }
  .tree ul.roots > li::before { display: none !important; }
  .tree .person { width: 100%; max-width: 360px; }
  .leaf-stack .person + .person::before { display: none; }
}
table.team tr.locum td { background-color: color-mix(in srgb, var(--gold) 6%, var(--surface)); }
table.team tr.locum td.name { font-style: italic; }
table.team tr.locum-first td { border-top: 2px dashed var(--line-strong); }
.main { min-width: 0; }
/* Each top-level tree (Dr Isaura's, then the Managing Director's) sits on its own band. */
@media (min-width: 721px) {
  .tree ul.roots { flex-direction: column; align-items: center; gap: 40px; }
  .tree ul.roots > li + li { padding-top: 34px; border-top: 1px dashed var(--line); }
}

/* ---------- password show/hide ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 48px; }
.pw-eye {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent;
  color: var(--ink-faint); display: grid; place-items: center; cursor: pointer;
}
.pw-eye:hover, .pw-eye[aria-pressed='true'] { color: var(--brand); background: var(--surface-2); }
.pw-eye svg { width: 19px; height: 19px; }
.pw-match[data-state='ok'] { color: var(--ok); }
.pw-match[data-state='bad'] { color: var(--bad); }

/* Location under each shift (My shifts, next two weeks) */
.cal .cell .loc, .day .loc { font-size: 10px; font-weight: 600; letter-spacing: .04em; color: var(--brand); text-align: center; line-height: 1; }
.day .loc { margin-top: 4px; }
.legend .loc-code { font-size: 11px; color: var(--brand); letter-spacing: .04em; }

/* Small, even chevrons on list rows (More page, payslips, etc.) */
.item > svg, .item-link > svg { width: 18px; height: 18px; flex: none; color: var(--ink-faint); }

/* ---------- Phase 2: clock in / out ---------- */
.clock-card { text-align: center; }
.clock-now { font-family: var(--font-display, inherit); font-size: 52px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.clock-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.clock-steps > div { border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.clock-steps > div.done { background: var(--ok-bg); border-color: transparent; }
.clock-steps .k { font-size: 12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.clock-steps .v { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.clock-btn { font-size: 17px; padding: 14px 18px; }
.tiny-pill { font-size: 11px; padding: 1px 8px; }
.date-box { width: 44px; flex: none; text-align: center; line-height: 1.1; }
.date-box span { display: block; font-size: 11px; color: var(--ink-faint); text-transform: uppercase; }
.date-box b { font-size: 18px; }
.selfie-wrap { position: relative; width: min(300px, 80vw); aspect-ratio: 1; margin: 0 auto 10px; border-radius: 50%; overflow: hidden; background: var(--surface-2); }
.selfie-wrap video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.selfie-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--brand, #2B4039) 70%, transparent); pointer-events: none; }
.att-thumb { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; vertical-align: middle; cursor: zoom-in; background: var(--surface-2); }
.auto-tag { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ok); background: var(--ok-bg); border-radius: 6px; padding: 1px 5px; margin-left: 6px; vertical-align: middle; }
.ps-employer { margin-top: 10px; font-size: 12px; color: #5d6a65; }
.late-txt { color: var(--bad); font-weight: 600; }
.hero .hero-clock { background: #fff; color: var(--brand); border-color: transparent; font-weight: 600; }
[hidden] { display: none !important; }

/* Theme-aware images (logos): .only-light / .only-dark */
.only-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .only-light { display: none !important; }
  :root:not([data-theme='light']) .only-dark { display: block !important; }
}
:root[data-theme='dark'] .only-light { display: none !important; }
:root[data-theme='dark'] .only-dark { display: block !important; }
/* Larger text option */
:root[data-text='large'] body { font-size: 17px; }
:root[data-text='large'] .small { font-size: 15px; }
:root[data-text='large'] .tiny { font-size: 13.5px; }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-pick button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px; cursor: pointer; display: grid; gap: 8px; justify-items: center; font-size: 13.5px; color: var(--ink); }
.theme-pick button[aria-pressed='true'] { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.theme-pick .sw { width: 100%; aspect-ratio: 16/10; border-radius: 9px; border: 1px solid var(--line); overflow: hidden; display: grid; grid-template-rows: 28% 1fr; }
.theme-pick .sw.light { background: #f4f1ec; } .theme-pick .sw.light i { background: #2b4039; }
.theme-pick .sw.dark { background: #121a17; } .theme-pick .sw.dark i { background: #1f3a30; }
.theme-pick .sw.auto { background: linear-gradient(135deg, #f4f1ec 50%, #121a17 50%); } .theme-pick .sw.auto i { background: #2b4039; }
.theme-pick .sw b { margin: 8px; border-radius: 5px; background: rgba(127,127,127,.25); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
