/* ETERE / La Strada — restaurant ops console */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=JetBrains+Mono:wght@400;500&display=swap&subset=greek,greek-ext,latin,latin-ext');

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:root {
  /* Neutrals */
  --ink-900: #0E1116;
  --ink-800: #1A1F26;
  --ink-700: #2A3038;
  --ink-600: #475160;
  --ink-500: #6B7585;
  --ink-400: #9099A8;
  --ink-300: #C7CCD3;
  --ink-200: #E2E5EA;
  --ink-150: #ECEEF2;
  --ink-100: #F2F4F7;
  --ink-50:  #F8F9FB;
  --paper:   #FFFFFF;

  /* Sidebar — warm espresso instead of pure black. Plays nicer with
     the terracotta brand and gives the white-tile Etere logo a richer
     surround. The base hue is a deep coffee with a slight terracotta
     undertone; the secondary tone is just a step lighter for cards. */
  --side-bg: #1F1610;
  --side-bg-2: #2A1F17;
  --side-line: #3A2C22;
  --side-ink: #F2EBE2;
  --side-mute: #A89B8B;
  --side-active: #FFFFFF;

  /* Status */
  --good: #1E7E4F;
  --good-bg: #E8F4ED;
  --warn: #B27212;
  --warn-bg: #FBF1DC;
  --bad: #B0392E;
  --bad-bg: #FBEAE7;
  --info: #2C5DAA;
  --info-bg: #E8EFF9;

  /* Restaurant accents — both branches lean terracotta now (per the
     current brand direction). Etere keeps a warm yellow as its
     secondary accent (matching the floral-tile motif), Strada uses a
     deeper terracotta-rust as its secondary so the two are still
     distinguishable at a glance even with the same primary. */
  --etere: #B4592A;        /* terracotta */
  --etere-2: #E8B547;      /* warm yellow — highlights, dot, hover */
  --etere-soft: #FBEFE3;
  --etere-paper: #FBF7F2;  /* cream content bg */
  --etere-edge: #E9DBC9;

  --strada: #A04E22;       /* deeper terracotta-rust */
  --strada-2: #D58454;     /* lighter terracotta — secondary */
  --strada-soft: #FBEFE3;
  --strada-paper: #FBF7F2;
  --strada-edge: #E9DBC9;

  --bg: var(--paper);
  --accent: var(--etere);
  --accent-2: var(--etere-2);
  --accent-soft: var(--etere-soft);
  --paper-tinted: var(--etere-paper);
  --accent-edge: var(--etere-edge);
}

body.theme-strada {
  --accent: var(--strada);
  --accent-2: var(--strada-2);
  --accent-soft: var(--strada-soft);
  --paper-tinted: var(--strada-paper);
  --accent-edge: var(--strada-edge);
}

.serif { font-family: 'Cormorant Garamond', 'GFS Didot', Georgia, serif; font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.tabular { font-variant-numeric: tabular-nums; }

/* ==================== Layout ==================== */

.main { display: flex; flex-direction: column; min-width: 0; }

.role-switch {
  display: flex; gap: 0;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  padding: 3px;
}
.role-switch button {
  font-family: inherit;
  font-size: 12px;
  background: transparent;
  border: none;
  color: var(--ink-500);
  padding: 5px 11px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 500;
}
.role-switch button.is-active {
  background: var(--ink-900);
  color: #fff;
}

.date-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-700);
  cursor: pointer;
}

.icon-btn {
  width: 34px; height: 34px;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--ink-600);
  cursor: pointer;
}

/* ==================== Page wrapper ==================== */

.page {
  padding: 28px 32px 60px;
  max-width: 1500px;
  width: 100%;
}

.page-head {
  display: flex; align-items: flex-end; gap: 24px;
  margin-bottom: 24px;
}
.page-head > div:first-child { flex: 1; min-width: 0; }
.page-head .ttl {
  font-family: 'Cormorant Garamond', 'GFS Didot', Georgia, serif;
  font-size: 38px;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink-900);
}
.page-head .ttl em { font-style: italic; color: var(--accent); }
.page-head .sub {
  margin-top: 10px;
  color: var(--ink-500);
  font-size: 13px;
}
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }

/* ==================== Buttons ==================== */

.btn {
  font-family: inherit;
  font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--ink-200);
  background: var(--paper);
  color: var(--ink-800);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.btn:hover { background: var(--ink-50); }
.btn-primary {
  background: var(--ink-900);
  color: #fff;
  border-color: var(--ink-900);
}
.btn-primary:hover { background: var(--ink-700); }
.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-accent:hover { background: color-mix(in oklab, var(--accent), black 10%); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-600); }
.btn-ghost:hover { background: var(--ink-100); }
.btn-sm { padding: 5px 9px; font-size: 12px; border-radius: 6px; }

/* ==================== Cards ==================== */

.card {
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  overflow: hidden;
}
.card-h {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ink-150);
}
.card-h h3 {
  margin: 0;
  font-size: 14px; font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.005em;
}
.card-h .more { margin-left: auto; }
.card-b { padding: 18px; }

/* KPI card */
.kpi {
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  padding: 16px 18px 18px;
  position: relative;
  overflow: hidden;
}
.kpi .label {
  font-size: 11.5px;
  color: var(--ink-500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}
.kpi .value {
  font-family: 'Cormorant Garamond', 'GFS Didot', Georgia, serif;
  font-size: 34px;
  font-weight: 400;
  margin-top: 6px;
  letter-spacing: -0.01em;
  color: var(--ink-900);
}
.kpi .delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px;
  margin-top: 6px;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}
.kpi .delta.up { color: var(--good); }
.kpi .delta.down { color: var(--bad); }
.kpi.is-accent { background: linear-gradient(165deg, var(--accent-soft), var(--paper) 60%); border-color: var(--accent-edge); }
.kpi.is-accent .label { color: color-mix(in oklab, var(--accent), black 15%); }

.kpi .spark {
  position: absolute; right: 14px; top: 14px;
  height: 30px; width: 90px; opacity: 0.75;
}

/* ==================== Tables ==================== */

table.t {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
table.t thead th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  color: var(--ink-500);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 14px;
  background: var(--ink-50);
  border-bottom: 1px solid var(--ink-200);
  border-top: 1px solid var(--ink-200);
  white-space: nowrap;
}
table.t thead th:first-child { border-left: 1px solid var(--ink-200); }
table.t thead th:last-child { border-right: 1px solid var(--ink-200); }
table.t tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ink-150);
  color: var(--ink-800);
  vertical-align: middle;
}
table.t tbody tr:hover td { background: color-mix(in oklab, var(--accent-soft), white 60%); }
table.t tbody tr.is-selected td { background: var(--accent-soft); }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }
table.t td.muted { color: var(--ink-500); }
table.t .name { font-weight: 500; color: var(--ink-900); }

/* Chips / pills */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink-100);
  color: var(--ink-700);
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip-good { background: var(--good-bg); color: var(--good); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-bad { background: var(--bad-bg); color: var(--bad); }
.chip-info { background: var(--info-bg); color: var(--info); }
.chip-accent { background: var(--accent-soft); color: color-mix(in oklab, var(--accent), black 20%); }
.chip-outline { background: transparent; border-color: var(--ink-200); color: var(--ink-600); }
.chip .dt { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Department dot */
.dept-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

/* Money */
.money { font-variant-numeric: tabular-nums; font-weight: 500; }
.money.is-cash { color: var(--ink-900); }
.money.is-bank { color: var(--info); }
.money.is-negative { color: var(--bad); }
.money.dim { color: var(--ink-500); font-weight: 400; }

/* KPI value can also reflect a negative total */
.kpi .value.is-negative { color: var(--bad); }

/* ==================== Inputs ==================== */

.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 11.5px; color: var(--ink-600);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.field input, .field select, .field textarea {
  font-family: inherit;
  font-size: 13.5px;
  padding: 8px 11px;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-900);
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), white 80%);
}
.field .req { color: var(--bad); margin-left: 2px; }

.seg {
  display: inline-flex;
  background: var(--ink-100);
  border-radius: 8px;
  padding: 3px;
  gap: 0;
}
.seg button {
  font-family: inherit;
  font-size: 12.5px;
  background: transparent;
  border: none;
  color: var(--ink-600);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}
.seg button.is-active {
  background: var(--paper);
  color: var(--ink-900);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* ==================== Schedule grid ==================== */

.sched-wrap { overflow: visible; }
/* The grid is its own scroll box (both axes) so long staff lists stay put:
   the header row and the name column pin via position:sticky, and editing a
   cell can restore this element's scroll instead of the whole window. */
.sched {
  display: grid;
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  background: var(--paper);
  max-height: calc(100vh - 250px);
  overflow: auto;
  overscroll-behavior: contain;
}

/* Search box above the grid — filter the week's staff by name or role. */
.sched-search { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sched-search input {
  font: inherit; font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-900);
  min-width: 280px;
}
.sched-search input:focus {
  outline: 0; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), white 80%);
}
.sched-search .cnt { font-size: 12.5px; color: var(--ink-500); }
.sched .h, .sched .c, .sched .e {
  border-bottom: 1px solid var(--ink-150);
  border-right: 1px solid var(--ink-150);
  padding: 10px 12px;
  font-size: 13px;
}
.sched .h {
  background: var(--ink-50);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-500);
  font-weight: 500;
  border-bottom: 1px solid var(--ink-200);
  position: sticky;
  top: 0;
  z-index: 2;
}
/* Top-left corner pins on both axes and sits above everything. */
.sched .h:first-child { left: 0; z-index: 3; }
.sched .h .day-num {
  font-family: 'Cormorant Garamond', 'GFS Didot', Georgia, serif;
  font-size: 19px;
  color: var(--ink-900);
  text-transform: none;
  letter-spacing: -0.01em;
  display: block;
  margin-top: 2px;
  font-weight: 400;
}
.sched .h.is-today { background: var(--accent-soft); }
.sched .h.is-today .day-num { color: var(--accent); }
.sched .e {
  background: var(--paper);
  display: flex; align-items: center; gap: 9px;
  position: sticky;
  left: 0;
  z-index: 1;
}
.sched .e .pic {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink-150);
  color: var(--ink-700);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  flex: 0 0 26px;
}
.sched .e .nm { font-weight: 500; color: var(--ink-900); }
.sched .e .dp { font-size: 11px; color: var(--ink-500); }
.sched .c {
  cursor: pointer;
  position: relative;
  min-height: 56px;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.sched .c:hover { background: var(--accent-soft); }
.sched .c.is-edit { background: var(--paper); box-shadow: inset 0 0 0 2px var(--accent); padding: 4px; }
.sched .c.rest { background: repeating-linear-gradient(135deg, var(--ink-50), var(--ink-50) 6px, var(--ink-100) 6px, var(--ink-100) 12px); color: var(--ink-500); font-style: italic; }
.sched .c.closing { color: var(--bad); }
.sched .c .shift { font-weight: 500; color: var(--ink-900); }
.sched .c .note { font-size: 10.5px; color: var(--ink-500); display: block; margin-top: 2px; }
.sched .c .ck {
  font-size: 11px; color: var(--accent);
  padding: 1px 5px; border-radius: 4px; background: var(--accent-soft);
  font-weight: 600; letter-spacing: 0.02em;
}
.sched .c.is-dept-row { background: var(--ink-50); padding: 6px 12px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-500); cursor: default; }
.sched .e.is-dept-row { background: var(--ink-50); padding: 6px 12px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-500); cursor: default; }

.sched .c input.cell-edit {
  width: 100%;
  border: none;
  outline: none;
  font: inherit;
  background: transparent;
  font-size: 13px;
  padding: 4px;
  font-variant-numeric: tabular-nums;
}

/* ==================== Hours bulk grid ==================== */

.hours-grid {
  display: grid;
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper);
}
.hours-grid .hh, .hours-grid .hc, .hours-grid .he, .hours-grid .ht {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ink-150);
  border-right: 1px solid var(--ink-150);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.hours-grid .hh { background: var(--ink-50); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-500); font-weight: 500; }
.hours-grid .he { background: var(--paper); display: flex; align-items: center; gap: 9px; font-size: 13px; position: sticky; left: 0; }
.hours-grid .he .pic { width: 24px; height: 24px; border-radius: 50%; background: var(--ink-150); display: grid; place-items: center; font-size: 10.5px; font-weight: 600; color: var(--ink-700); }
.hours-grid .hc { text-align: center; cursor: text; position: relative; }
.hours-grid .hc input {
  width: 100%; border: none; outline: none; background: transparent; font: inherit;
  text-align: center; font-variant-numeric: tabular-nums; padding: 0;
}
.hours-grid .hc.has-val { background: color-mix(in oklab, var(--accent-soft), white 50%); }
.hours-grid .hc.is-warn { background: var(--warn-bg); }
.hours-grid .ht { background: var(--ink-50); font-weight: 600; color: var(--ink-900); text-align: center; }
.hours-grid .he.is-dept { background: var(--ink-100); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-700); font-weight: 600; }
.hours-grid .hc.is-dept { background: var(--ink-100); }
.hours-grid .ht.is-dept { background: var(--ink-100); color: var(--ink-700); }

/* ==================== Modal ==================== */

.scrim {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(14, 17, 22, 0.36);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  padding: 20px;
}
.modal {
  background: var(--paper);
  border-radius: 14px;
  width: 640px;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--ink-200);
  box-shadow: 0 20px 60px rgba(14,17,22,0.18);
}
.modal-h {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--ink-150);
  display: flex; align-items: center;
}
.modal-h h2 {
  margin: 0;
  font-family: 'Cormorant Garamond', 'GFS Didot', Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.modal-h .x { margin-left: auto; cursor: pointer; color: var(--ink-500); }
.modal-b { padding: 22px; }
.modal-f {
  padding: 14px 22px;
  border-top: 1px solid var(--ink-150);
  display: flex; gap: 8px; justify-content: flex-end;
  background: var(--ink-50);
}

/* ==================== Charts ==================== */

.chart-svg { width: 100%; display: block; }

/* Alerts */
.alert {
  display: flex; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  background: var(--paper);
  align-items: flex-start;
}
.alert + .alert { margin-top: 8px; }
.alert .ico-wrap {
  width: 28px; height: 28px; border-radius: 7px;
  display: grid; place-items: center; flex: 0 0 28px;
}
.alert.is-warn .ico-wrap { background: var(--warn-bg); color: var(--warn); }
.alert.is-bad .ico-wrap { background: var(--bad-bg); color: var(--bad); }
.alert.is-info .ico-wrap { background: var(--info-bg); color: var(--info); }
.alert .body { flex: 1; }
.alert .body .ttl { font-weight: 500; font-size: 13px; color: var(--ink-900); }
.alert .body .sub { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.alert .actions { display: flex; gap: 6px; align-items: center; }

/* Misc */
.divider {
  height: 1px;
  background: var(--ink-150);
  margin: 16px 0;
}

.grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.gap-sm { gap: 6px; }
.spacer { flex: 1; }

.pill-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  margin-bottom: 14px;
}
.pill-toolbar .seg, .pill-toolbar .field { margin: 0; }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-500);
  font-size: 13px;
}
.empty .big {
  font-family: 'Cormorant Garamond', 'GFS Didot', Georgia, serif;
  font-size: 22px;
  color: var(--ink-700);
  margin-bottom: 4px;
}

/* Tip distribution bars */
.tip-row {
  display: grid;
  grid-template-columns: 28px 1.4fr 1fr 80px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-150);
  font-size: 13px;
}
.tip-row .pic {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink-150); color: var(--ink-700);
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 600;
}
.tip-row .bar {
  height: 8px; background: var(--ink-100); border-radius: 4px; position: relative; overflow: hidden;
}
.tip-row .bar > i {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 4px;
}
.tip-row .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 5px; border: 2px solid var(--paper-tinted); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-300); }

/* Toast */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink-900); color: #fff; padding: 12px 16px; border-radius: 10px;
  display: flex; align-items: center; gap: 10px; min-width: 260px;
  box-shadow: 0 8px 30px rgba(14,17,22,0.25);
  animation: toast-in 0.25s ease;
  font-size: 13px;
}
.toast.is-good .dot-c { background: #4ADE80; }
.toast.is-info .dot-c { background: var(--accent-2); }
.toast.is-warn .dot-c { background: #F59E0B; }
.toast.is-bad .dot-c { background: #F87171; }
.toast .dot-c { width: 8px; height: 8px; border-radius: 50%; background: #4ADE80; flex: 0 0 8px; }
.toast .x { margin-left: auto; opacity: 0.5; cursor: pointer; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Notification dropdown */
.notif-pop { position: absolute; top: 44px; right: 0; width: 340px; background: var(--paper); border: 1px solid var(--ink-200); border-radius: 12px; box-shadow: 0 12px 40px rgba(14,17,22,0.16); z-index: 30; overflow: hidden; }
.notif-pop .ph { padding: 12px 14px; border-bottom: 1px solid var(--ink-150); font-size: 12px; font-weight: 600; color: var(--ink-700); display: flex; justify-content: space-between; align-items: center; }
.notif-pop .it { padding: 12px 14px; border-bottom: 1px solid var(--ink-150); display: flex; gap: 10px; cursor: pointer; }
.notif-pop .it:hover { background: var(--ink-50); }
.notif-pop .it .dt { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: 0 0 8px; }

/* Print/responsive minimums */
@media (max-width: 1100px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}


/* ===== Tips module ===== */
.tip-subnav {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  padding: 4px 8px 4px 4px;
  margin-bottom: 14px;
}
.tip-subnav-tabs { display: flex; gap: 2px; }
.tip-subnav-tabs button {
  background: transparent; border: 0; padding: 8px 14px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--ink-600); cursor: pointer;
  border-radius: 7px;
  letter-spacing: -0.005em;
}
.tip-subnav-tabs button:hover { background: var(--ink-50); color: var(--ink-900); }
.tip-subnav-tabs button.is-active {
  background: var(--accent); color: var(--paper);
}
.tip-subnav-meta { font-size: 11px; color: var(--ink-500); padding-right: 10px; }

.pda-badge {
  display: inline-block; min-width: 22px; padding: 2px 6px;
  background: var(--ink-900); color: var(--paper);
  border-radius: 5px; font-family: 'JetBrains Mono', monospace;
  font-weight: 600; font-size: 12px; text-align: center;
  letter-spacing: 0.02em;
}

.alert-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--ink-150);
}
.alert-row:first-child { border-top: 0; }
.alert-dot {
  width: 26px; height: 26px; border-radius: 7px;
  display: grid; place-items: center; flex: 0 0 26px;
}
.alert-dot.is-warn { background: var(--warn-bg); color: var(--warn); }
.alert-dot.is-bad  { background: var(--bad-bg);  color: var(--bad);  }
.alert-dot.is-info { background: var(--info-bg); color: var(--info); }

.summary-row {
  display: flex; justify-content: space-between;
  padding: 5px 0; font-size: 13px;
}

.audit-row {
  display: grid; grid-template-columns: 50px 1fr; gap: 8px;
  padding: 4px 0; font-size: 12px;
  border-top: 1px solid var(--ink-100);
}
.audit-row:first-child { border-top: 0; }

.pill-search {
  height: 28px; padding: 0 10px;
  border: 1px solid var(--ink-200); border-radius: 6px;
  font-family: inherit; font-size: 13px; background: var(--paper);
}
.pill-search:focus { outline: 0; border-color: var(--accent); }

.cell-edit {
  border: 1px solid transparent; background: transparent;
  padding: 4px 6px; border-radius: 4px;
  font-family: inherit; font-size: 13px; color: inherit;
}
.cell-edit:hover:not(:disabled) { border-color: var(--ink-200); background: var(--paper); }
.cell-edit:focus { outline: 0; border-color: var(--accent); background: var(--paper); }
.cell-edit:disabled { color: var(--ink-500); cursor: not-allowed; }

/* =====================================================================
   Additional rules added for the Spring Boot / Thymeleaf port.
   These extend, never replace, the design tokens above.
   ===================================================================== */

/* =====================================================================
   Login page — split layout: terracotta hero (left) + form panel (right).
   Stacks vertically under 880px. Brand colours come from the theme tokens
   (--etere / --strada), so it switches automatically if a strada-themed
   wrapper is ever applied.
   ===================================================================== */

.login-body { margin: 0; background: var(--paper); }

/* ---------------------------------------------------------------------------
   Auth pages — one calm, centered card on a soft warm canvas.
   Shared by login, forgot-password and set-password (all use .login-shell
   + .login-card + .login-form). Kept deliberately light: hairline border,
   soft shadow, generous whitespace, minimal chrome.
   --------------------------------------------------------------------------- */
.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(90% 60% at 50% -10%, var(--accent-soft), transparent 62%),
    var(--paper-tinted);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(14, 17, 22, 0.04), 0 12px 34px rgba(14, 17, 22, 0.07);
  padding: 34px 32px 26px;
}

/* Brand block — small mark + name, centered */
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.login-brand-mark svg { display: block; border-radius: 10px; }
.login-brand .mark {
  font-family: 'Cormorant Garamond', 'GFS Didot', Georgia, serif;
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--ink-900);
}
.login-brand .sub {
  margin-top: 4px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-500);
}

/* Heading */
.login-card-title {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  text-align: center;
  margin: 0 0 4px;
}
.login-card-lede {
  font-size: 13.5px;
  color: var(--ink-600);
  text-align: center;
  margin: 0 0 22px;
}

.login-error {
  background: var(--bad-bg);
  color: var(--bad);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}
.login-info {
  background: var(--info-bg);
  color: var(--info);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* Form */
.login-form .field { margin-bottom: 16px; }
.login-form .field label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-700);
  margin-bottom: 6px;
}
.login-form .field-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.login-form .field-hint {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}
.login-form .field-hint:hover { text-decoration: underline; }

.login-form .field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink-900);
  font-family: inherit;
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.login-form .field input::placeholder { color: var(--ink-400); }
.login-form .field input:hover { border-color: var(--ink-300); }
.login-form .field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent-soft), transparent 30%);
}

/* Password field with an inline show/hide toggle */
.login-form .pw-wrap { position: relative; display: flex; align-items: center; }
.login-form .pw-wrap input { padding-right: 86px; }
.login-form .pw-toggle {
  position: absolute;
  right: 6px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: var(--ink-500);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
}
.login-form .pw-toggle:hover { color: var(--accent); background: var(--accent-soft); }

.login-submit {
  width: 100%;
  height: 46px;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 14.5px;
}

.login-card-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--ink-150);
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-600);
}
.login-card-foot .muted { display: block; color: var(--ink-500); font-size: 12px; margin-top: 2px; }

/* No-branch fallback page */
.no-branch-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px;
  background: var(--paper-tinted);
}
.no-branch-card {
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  max-width: 420px;
}
.no-branch-card .ttl {
  font-family: 'Cormorant Garamond', 'GFS Didot', Georgia, serif;
  font-size: 28px;
  margin: 0 0 8px;
}
.no-branch-card .sub { color: var(--ink-500); margin-bottom: 18px; }

/* Form-validation hints used by the new-employee modal */
.help { font-size: 11px; color: var(--ink-500); margin-top: 4px; }

/* Step indicator for the schedule wizard */
.steps {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.steps .step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ink-100);
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 500;
}
.steps .step.is-active {
  background: var(--accent);
  color: #fff;
}
.steps .step .num {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper);
  color: inherit;
  font-size: 11px;
}
.steps .step.is-active .num { background: rgba(255,255,255,0.18); color: #fff; }
.steps a.step { text-decoration: none; cursor: pointer; transition: background .15s ease, color .15s ease; }
.steps a.step:hover { background: var(--ink-150); color: var(--ink-700); }

/* Live password-strength meter + rule checklist (fragments/password-rules) */
.pw-meter { margin: 10px 0 4px; }
.pw-bar {
  height: 6px; border-radius: 999px; background: var(--ink-150);
  overflow: hidden;
}
.pw-bar-fill {
  display: block; height: 100%; width: 0;
  background: var(--ink-300);
  border-radius: 999px;
  transition: width .2s ease, background .2s ease;
}
.pw-strength { font-size: 11.5px; color: var(--ink-500); margin-top: 6px; }
.pw-checklist {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px;
}
.pw-checklist li {
  font-size: 11.5px; color: var(--ink-500);
  display: flex; align-items: center; gap: 6px;
  transition: color .15s ease;
}
.pw-checklist li.is-ok { color: #1E7B7E; }
.pw-checklist .pw-ic {
  display: inline-grid; place-items: center;
  width: 14px; height: 14px; font-size: 11px; font-weight: 700;
}
@media (max-width: 560px) {
  .pw-checklist { grid-template-columns: 1fr; }
}

/* Schedule list status pills already use the chip helper; no extra rules */

/* Income page right-rail card */
.right-rail {
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.right-rail h4 {
  margin: 0; font-size: 13px; color: var(--ink-700); font-weight: 600;
  letter-spacing: 0.02em;
}

/* Radio-list block (used by tips per-employee selector and similar) */
.list-pick {
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  background: var(--paper);
  max-height: 380px;
  overflow-y: auto;
}
.list-pick .row {
  padding: 10px 14px;
  border-top: 1px solid var(--ink-150);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.list-pick .row:first-child { border-top: 0; }
.list-pick .row.is-active { background: var(--accent-soft); }
.list-pick .row:hover { background: var(--ink-50); }

/* Department checkbox card grid (schedule wizard step 2) */
.dept-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.dept-card {
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  padding: 14px;
}
.dept-card h4 { margin: 0 0 8px; font-size: 13px; }
.dept-card label {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 4px; font-size: 13px; cursor: pointer;
}
.dept-card label:hover { background: var(--ink-50); border-radius: 6px; }

/* Drop the default browser underline on link-styled controls */
.tip-subnav-tabs a, .tip-subnav-tabs a:hover, .tip-subnav-tabs a:visited { text-decoration: none; }
.list-pick .row, .list-pick .row:hover, .list-pick .row:visited { text-decoration: none; }
.seg a, .seg a:hover, .seg a:visited { text-decoration: none; }

/* =====================================================================
   UI polish pass — fix right-side gap, filters, subnav links/underlines
   ===================================================================== */

/* Center the page so the empty space splits evenly on wide screens */
.page { margin: 0 auto; }

/* Native <select> inside the .btn toolbar looks ugly with the browser
   chevron — replace with our own caret and unify spacing/typography. */
select.btn,
select.btn-sm {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-500) 50%),
    linear-gradient(135deg, var(--ink-500) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink-800);
}
select.btn:focus,
select.btn-sm:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), white 80%);
}
.pill-toolbar select.btn,
.pill-toolbar select.btn-sm { background-color: var(--paper); }

/* Tips subnav: design used <button>, our templates use <a>. Mirror the
   button rules onto <a> so the tabs look the same. */
.tip-subnav-tabs a {
  display: inline-block;
  background: transparent;
  border: 0;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-600);
  cursor: pointer;
  border-radius: 7px;
  letter-spacing: -0.005em;
  text-decoration: none;
}
.tip-subnav-tabs a:hover { background: var(--ink-50); color: var(--ink-900); }
.tip-subnav-tabs a.is-active { background: var(--accent); color: var(--paper); }

/* Segment switchers (Schedule list status filter, Expenses category
   filter): same treatment for <a> elements. */
.seg a {
  display: inline-block;
  font-family: inherit;
  font-size: 12.5px;
  background: transparent;
  border: none;
  color: var(--ink-600);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
}
.seg a.is-active {
  background: var(--paper);
  color: var(--ink-900);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* Belt-and-suspenders: force NO underline on every link inside the
   chrome (sidebar, topbar, sub-nav, segments, lists, KPI cards, …). */
a, a:hover, a:visited, a:active { text-decoration: none; color: inherit; }
.btn, .btn:hover, .btn:visited { text-decoration: none; }

/* Re-apply the muted accent to body links inside cards (so anchors
   render in colour where the design wants them to). */
.card a:not(.btn):not(.is-active),
.alert a:not(.btn) { color: var(--accent); }

/* Schedule list "Άνοιγμα" / "Δείτε" links should look like buttons */
table.t a.btn { color: var(--ink-800); }
table.t a.btn:hover { color: var(--ink-900); }

/* Filter toolbar tightening */
.pill-toolbar { padding: 6px 8px; }
.pill-toolbar select.btn-sm { padding: 5px 28px 5px 11px; font-size: 12px; }

/* Let pages breathe wider on big screens (was capped at 1500px) */
.page { max-width: none; }

/* =====================================================================
   Tips · Νέα Καταχώρηση polish
   ===================================================================== */

/* Inline inputs that should blend into table cells */
.t input.t-input,
.t select.t-input,
.t input[type=number].t-input,
.t input[type=text].t-input {
  font-family: inherit;
  font-size: 13px;
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 8px;
  border-radius: 6px;
  width: 100%;
  color: var(--ink-900);
}
.t input.t-input:hover,
.t select.t-input:hover { border-color: var(--ink-200); background: var(--paper); }
.t input.t-input:focus,
.t select.t-input:focus {
  outline: 0;
  border-color: var(--accent);
  background: var(--paper);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), white 80%);
}
.t input.t-input.num { text-align: right; font-variant-numeric: tabular-nums; font-family: 'JetBrains Mono', monospace; }
.t select.t-input { padding-right: 26px; appearance: none; -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-500) 50%),
    linear-gradient(135deg, var(--ink-500) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
/* In the schedule-import modal the assignment selects should look like real
   dropdowns (visible border + paper bg), not the subtle inline-edit style —
   so an unfocused row doesn't read as plain text next to a focused one. */
.tip-import .t select.t-input {
  border-color: var(--ink-200);
  background-color: var(--paper);
}
.tip-import .t select.t-input:hover { border-color: var(--ink-300); }
.tip-import .t tbody td { vertical-align: middle; }

/* Toolbar above the form */
.tip-toolbar {
  display: flex; align-items: center; gap: 14px;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 14px;
}
.tip-toolbar .field { flex-direction: row; align-items: center; gap: 10px; }
.tip-toolbar .field label { color: var(--ink-500); margin: 0; }
.tip-toolbar .field input { width: 140px; }
.tip-toolbar .spacer { flex: 1; }

/* Section card with toolbar inside header */
.card-h.with-meta { padding: 12px 18px 12px 18px; }
.card-h .meta {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-500);
}

/* Participant row pic */
.t .who {
  display: flex; align-items: center; gap: 10px;
}
.t .who .pic {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink-150); color: var(--ink-700);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; flex: 0 0 28px;
}

/* Sticky right rail on the new-tip page */
.tip-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 360px);
  gap: 18px;
  align-items: start;
}
.tip-grid > aside { position: sticky; top: 90px; }

/* Rebuild summary block (replaces inline styles) */
.summary-block {
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  padding: 18px;
}
.summary-block h4 {
  margin: 0 0 10px;
  font-family: 'Cormorant Garamond', 'GFS Didot', Georgia, serif;
  font-size: 18px; font-weight: 500;
  color: var(--ink-900);
}
.summary-block + .summary-block { margin-top: 14px; }
.summary-block .summary-row { padding: 6px 0; border-top: 1px solid var(--ink-100); }
.summary-block .summary-row:first-of-type { border-top: 0; }
.summary-block .summary-row b { font-variant-numeric: tabular-nums; }

/* tfoot totals inside .t — reads as one summary block, not per-row bars */
.t tfoot td {
  border-top: 0;
  background: var(--ink-50);
  font-weight: 600;
  color: var(--ink-900);
  padding-top: 11px;
  padding-bottom: 11px;
}
.t tfoot tr:first-child td { border-top: 1.5px solid var(--ink-200); }
/* Right-aligned summary labels: readable, not a faded grey */
.t tfoot td.foot-label { color: var(--ink-600); font-weight: 500; }

/* Empty narrow column for checkbox */
.t .checkbox-col { width: 38px; text-align: center; }
.t .checkbox-col input { transform: scale(1.1); cursor: pointer; }

/* =====================================================================
   Kill all italics — they were used as accent decoration in the design,
   but the user wants the underlying weight/colour treatment without
   the italic slant.
   ===================================================================== */
em, i { font-style: normal; }
.page-head .ttl em { font-style: normal; color: var(--accent); font-weight: 500; }
.sched .c.rest { font-style: normal; }

/* =====================================================================
   Modal close button + auxiliary-role number field polish
   ===================================================================== */

/* Bigger, more visible close X */
.modal-h .x {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-500);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}
.modal-h .x:hover {
  background: var(--ink-100);
  color: var(--ink-900);
}

/* Hide x-cloak elements until Alpine initialises */
[x-cloak] { display: none !important; }

/* Highlight the auxiliary-number field so users notice it appearing */
.aux-number-field {
  background: var(--accent-soft);
  border: 1px dashed var(--accent-edge);
  border-radius: 10px;
  padding: 10px 12px;
}
.aux-number-field input {
  background: var(--paper);
}

/* Compact −/＋ number stepper — replaces the browser's tiny spin arrows. */
.num-stepper {
  display: inline-flex;
  align-items: stretch;
  width: max-content;
  border: 1px solid var(--ink-200);
  border-radius: 9px;
  overflow: hidden;
  background: var(--paper);
}
.num-stepper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), white 80%);
}
.num-stepper input[type="number"] {
  width: 62px;
  border: 0;
  outline: 0;
  padding: 6px 0;
  text-align: center;
  background: transparent;
  color: var(--ink-900);
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  -moz-appearance: textfield;
}
.num-stepper input[type="number"]:focus { box-shadow: none; }
.num-stepper input[type="number"]::-webkit-outer-spin-button,
.num-stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.num-stepper button {
  width: 40px;
  border: 0;
  background: var(--ink-50);
  color: var(--ink-700);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  user-select: none;
  transition: background .12s, color .12s;
}
.num-stepper button:hover { background: var(--accent-soft); color: var(--accent); }
.num-stepper button:active { background: var(--accent); color: #fff; }
.num-stepper .step-down { border-right: 1px solid var(--ink-200); }
.num-stepper .step-up { border-left: 1px solid var(--ink-200); }
body.theme-dark .num-stepper input[type="number"] { background: transparent; }
body.theme-dark .num-stepper button { background: var(--ink-100); }

/* ===================== Audit "Ιστορικό" drawer ===================== */
.audit-scrim {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20, 18, 14, 0.38);
  display: flex; justify-content: flex-end;
  animation: audit-fade .12s ease;
}
@keyframes audit-fade { from { opacity: 0; } to { opacity: 1; } }
.audit-drawer {
  width: 420px; max-width: 92vw; height: 100%;
  background: var(--paper);
  border-left: 1px solid var(--ink-200);
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.14);
  display: flex; flex-direction: column;
  animation: audit-slide .16s ease;
}
@keyframes audit-slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.audit-drawer-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--ink-150);
}
.audit-drawer-h h2 { margin: 0; font-size: 16px; }
.audit-drawer-h .x {
  cursor: pointer; font-size: 22px; line-height: 1; color: var(--ink-500);
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px;
}
.audit-drawer-h .x:hover { background: var(--ink-50); color: var(--ink-900); }
.audit-drawer-b { overflow-y: auto; padding: 12px 18px 24px; flex: 1; }
.audit-empty { color: var(--ink-500); font-size: 13px; text-align: center; padding: 40px 0; }
.audit-list { list-style: none; margin: 0; padding: 0; }
.audit-item { padding: 12px 0; border-bottom: 1px solid var(--ink-100); }
.audit-item:last-child { border-bottom: 0; }
.audit-item-top { display: flex; align-items: center; gap: 8px; }
.audit-actor { font-weight: 600; font-size: 13.5px; color: var(--ink-900); }
.audit-action {
  font-size: 11px; padding: 1px 8px; border-radius: 999px;
  background: var(--ink-100); color: var(--ink-700);
}
.audit-action.act-CREATE, .audit-action.act-PUBLISH { background: var(--accent-soft); color: var(--accent); }
.audit-action.act-DELETE, .audit-action.act-REJECT { background: color-mix(in oklab, var(--bad), white 82%); color: var(--bad); }
.audit-summary { font-size: 13px; color: var(--ink-800); margin-top: 4px; }
.audit-changes { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.audit-changes li {
  font-size: 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}
.audit-chg-label { color: var(--ink-500); }
.audit-chg-from { color: var(--ink-600); text-decoration: line-through; }
.audit-arrow { color: var(--ink-400); }
.audit-chg-to { color: var(--ink-900); font-weight: 600; }
.audit-at { font-size: 11.5px; color: var(--ink-500); margin-top: 6px; }
@media (max-width: 560px) { .audit-drawer { width: 100vw; } }

/* =====================================================================
   Wizard week-picker (Πρόγραμμα → Νέο)
   ===================================================================== */
.week-month-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 22px 0 10px;
}
.week-month-header h3 {
  margin: 0;
  font-family: 'Cormorant Garamond', 'GFS Didot', Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--ink-900);
  letter-spacing: -0.005em;
}
.week-month-header .meta {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.week-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.week-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(14, 17, 22, 0.06);
}
.week-card:active { transform: translateY(1px); }
.week-card .num {
  font-family: 'Cormorant Garamond', 'GFS Didot', Georgia, serif;
  font-size: 30px;
  line-height: 1;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}
.week-card .num small { font-size: 13px; color: var(--ink-500); margin-left: 4px; font-family: inherit; }
.week-card .range {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--ink-600);
  font-variant-numeric: tabular-nums;
}
.week-card .badge {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}
.week-card .badge.is-published { background: var(--good-bg); color: var(--good); }
.week-card .badge.is-draft { background: var(--warn-bg); color: var(--warn); }
.week-card .badge.is-archived { background: var(--ink-100); color: var(--ink-500); }
.week-card.is-existing { border-style: dashed; }
.week-card.is-current { border-color: var(--accent); background: var(--accent-soft); }
.week-card.is-current .num { color: var(--accent); }

.week-pager {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 22px;
  padding: 14px 18px;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  font-size: 13px;
}
.week-pager .info { color: var(--ink-500); }

/* =====================================================================
   Hours grid: make the cell input look obviously typeable
   ===================================================================== */
.hours-grid .hc input[type=text],
.hours-grid .hc input[type=number] {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  padding: 6px 4px;
  border-radius: 6px;
  transition: background 0.1s, border-color 0.1s;
}
.hours-grid .hc input:hover { border-color: var(--ink-200); background: var(--paper); }
.hours-grid .hc input:focus {
  outline: 0;
  border-color: var(--accent);
  background: var(--paper);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), white 80%);
}
.hours-grid .hc input::placeholder { color: var(--ink-300); }

/* =====================================================================
   Dashboard greeting hero
   ===================================================================== */
.dashboard-greeting {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 24px;
  padding: 28px 32px;
  background: linear-gradient(165deg, var(--accent-soft), var(--paper) 70%);
  border: 1px solid var(--accent-edge);
  border-radius: 16px;
}
.dashboard-greeting-text { flex: 1; min-width: 0; }
.dashboard-greeting .hello {
  font-family: 'Cormorant Garamond', 'GFS Didot', Georgia, serif;
  font-size: 40px;
  line-height: 1.1;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}
.dashboard-greeting .hello em {
  font-style: normal;
  color: var(--accent);
  font-weight: 500;
}
.dashboard-greeting .meta {
  margin-top: 8px;
  color: var(--ink-500);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.dashboard-greeting-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .dashboard-greeting { flex-direction: column; align-items: stretch; padding: 22px 24px; }
  .dashboard-greeting .hello { font-size: 32px; }
}

/* =====================================================================
   Dashboard greeting — playful pass
   ===================================================================== */
.dashboard-greeting-emoji {
  font-size: 64px;
  line-height: 1;
  flex: 0 0 auto;
  filter: drop-shadow(0 4px 14px rgba(180, 89, 42, 0.18));
  animation: greeting-bounce 2.4s ease-in-out infinite;
  user-select: none;
}
@keyframes greeting-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.dashboard-greeting .wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave-hand 2.6s ease-in-out infinite;
}
@keyframes wave-hand {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%           { transform: rotate(14deg); }
  20%           { transform: rotate(-8deg); }
  30%           { transform: rotate(14deg); }
  40%           { transform: rotate(-4deg); }
  50%           { transform: rotate(10deg); }
}

.dashboard-greeting .playful {
  margin-top: 6px;
  font-size: 15px;
  color: var(--ink-700);
  font-weight: 500;
}

/* Reduce motion if the user prefers it */
@media (prefers-reduced-motion: reduce) {
  .dashboard-greeting-emoji,
  .dashboard-greeting .wave { animation: none; }
}

@media (max-width: 900px) {
  .dashboard-greeting-emoji { font-size: 48px; }
}

/* =====================================================================
   Pagination + search bar
   ===================================================================== */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  font-size: 13px;
  color: var(--ink-700);
}
.pagination-info b { font-weight: 500; color: var(--ink-900); }
.pagination-pages { display: flex; align-items: center; gap: 6px; }

/* Search input shared style */
.search-input {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  padding: 0 11px;
  height: 32px;
  min-width: 220px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.search-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), white 80%);
}
.search-input input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink-900);
  padding: 0;
}
.search-input input::placeholder { color: var(--ink-400); }
.search-input .clear {
  margin-left: 6px;
  color: var(--ink-400);
  text-decoration: none;
  font-size: 16px;
  line-height: 1;
}
.search-input .clear:hover { color: var(--ink-800); }

/* =====================================================================
   Open Sans-only typography pass.
   Wins over every earlier font-family / font-weight / font-style rule
   thanks to source order + element/wildcard targeting.
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500&display=swap&subset=greek,greek-ext,latin,latin-ext');

html, body, button, input, select, textarea, table, th, td, h1, h2, h3, h4, h5, h6,
.serif, .mono, .ttl, .kpi .value, .brand-mark, .modal-h h2, .topbar h1,
.sched .h .day-num, .week-card .num, .week-month-header h3,
.dashboard-greeting .hello, .summary-block h4 {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  letter-spacing: 0 !important;
}

/* Single weight everywhere; no italic anywhere. */
body, h1, h2, h3, h4, h5, h6, b, strong, em, i, th, label,
.brand-mark, .ttl, .kpi .value, .nav-item, .name, .modal-h h2,
.dashboard-greeting .hello, .week-card .num, .summary-block h4,
.page-head .ttl em, .topbar h1 {
  font-weight: 400 !important;
  font-style: normal !important;
}

/* The few interactive elements that benefit from a touch more weight
   (buttons, active states) get 500 — still no real "bold". */
.btn, .btn-primary, .btn-accent, .nav-item.is-active, .chip,
.tip-subnav-tabs a.is-active, .seg button.is-active, .seg a.is-active {
  font-weight: 500 !important;
  font-style: normal !important;
}

/* Tabular numbers stay tabular even with Open Sans */
.tabular, .num, .money, .kpi .value, .pagination-pages,
.t .num, .week-card .range, .summary-row, .audit-row, .pda-badge,
input[inputmode="decimal"], .hours-grid .ht, .hours-grid .hc input {
  font-variant-numeric: tabular-nums !important;
}

/* =====================================================================
   Dark mode token swap.
   Toggle by adding `theme-dark` to <body>.
   ===================================================================== */
body.theme-dark {
  --ink-900: #ECEEF2;
  --ink-800: #DDE0E5;
  --ink-700: #B5BBC4;
  --ink-600: #8E95A1;
  --ink-500: #707682;
  --ink-400: #5A606B;
  --ink-300: #3F454F;
  --ink-200: #2D323B;
  --ink-150: #252A33;
  --ink-100: #1E222A;
  --ink-50:  #181C23;
  --paper:   #14181F;

  --good-bg: #1B3A2A;
  --warn-bg: #3A2E18;
  --bad-bg:  #3A1E1B;
  --info-bg: #1A2942;

  --etere-soft:  #3B2418;
  --etere-paper: #1A1410;
  --etere-edge:  #4A3022;

  --strada-soft:  #122F30;
  --strada-paper: #0F1A1A;
  --strada-edge:  #1F4244;

  --bg: var(--paper);
}

/* Cards / modals: a bit lighter than page bg for separation */
body.theme-dark .card,
body.theme-dark .modal,
body.theme-dark .kpi,
body.theme-dark .alert,
body.theme-dark .pill-toolbar,
body.theme-dark .summary-block,
body.theme-dark .tip-subnav,
body.theme-dark .tip-toolbar,
body.theme-dark .week-card,
body.theme-dark .pagination-bar,
body.theme-dark .login-card,
body.theme-dark .no-branch-card,
body.theme-dark .right-rail,
body.theme-dark .list-pick {
  background: var(--ink-100);
  border-color: var(--ink-200);
}

body.theme-dark table.t thead th { background: var(--ink-100); border-color: var(--ink-200); }
body.theme-dark table.t tbody td { border-bottom-color: var(--ink-150); color: var(--ink-800); }
body.theme-dark table.t tbody tr:hover td {
  background: color-mix(in oklab, var(--accent-soft), transparent 70%);
}

body.theme-dark .field input,
body.theme-dark .field select,
body.theme-dark .field textarea,
body.theme-dark .search-input,
body.theme-dark .seg,
body.theme-dark .role-switch {
  background: var(--ink-100);
  border-color: var(--ink-200);
  color: var(--ink-900);
}
body.theme-dark .field input::placeholder,
body.theme-dark .search-input input::placeholder { color: var(--ink-400); }

body.theme-dark .btn { background: var(--ink-100); color: var(--ink-800); border-color: var(--ink-200); }
body.theme-dark .btn:hover { background: var(--ink-150); }
body.theme-dark .btn-primary { background: var(--ink-200); color: var(--ink-900); border-color: var(--ink-200); }
body.theme-dark .btn-primary:hover { background: var(--ink-300); }
body.theme-dark .btn-ghost { background: transparent; color: var(--ink-600); }
body.theme-dark .btn-ghost:hover { background: var(--ink-100); }
body.theme-dark .seg button.is-active,
body.theme-dark .seg a.is-active { background: var(--ink-200); color: var(--ink-900); }

body.theme-dark .login-shell { background: linear-gradient(155deg, var(--ink-50), var(--paper) 65%); }
body.theme-dark .dashboard-greeting {
  background: linear-gradient(165deg, color-mix(in oklab, var(--accent-soft), transparent 30%), var(--paper) 80%);
}

body.theme-dark .toast { background: var(--ink-200); color: var(--ink-900); }
body.theme-dark .empty .big { color: var(--ink-700); }
body.theme-dark .week-card.is-current { background: color-mix(in oklab, var(--accent-soft), transparent 50%); }

/* Theme toggle button in the topbar */
.theme-toggle {
  width: 34px; height: 34px;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--ink-700);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.theme-toggle:hover { background: var(--ink-50); color: var(--ink-900); }
body.theme-dark .theme-toggle { background: var(--ink-100); color: var(--ink-700); }
body.theme-dark .theme-toggle:hover { color: var(--ink-900); }

/* =====================================================================
   Switch typography to Google Sans Medium (500) everywhere.
   Last-write-wins overrides the earlier Open Sans rules.
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&display=swap&subset=greek,greek-ext,latin,latin-ext');

html, body, button, input, select, textarea, table, th, td, h1, h2, h3, h4, h5, h6,
.serif, .mono, .ttl, .kpi .value, .brand-mark, .modal-h h2, .topbar h1,
.sched .h .day-num, .week-card .num, .week-month-header h3,
.dashboard-greeting .hello, .summary-block h4 {
  font-family: 'Google Sans', 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  letter-spacing: 0 !important;
}

body, h1, h2, h3, h4, h5, h6, b, strong, em, i, th, label,
.brand-mark, .ttl, .kpi .value, .nav-item, .name, .modal-h h2,
.dashboard-greeting .hello, .week-card .num, .summary-block h4,
.page-head .ttl em, .topbar h1,
.btn, .btn-primary, .btn-accent, .nav-item.is-active, .chip,
.tip-subnav-tabs a.is-active, .seg button.is-active, .seg a.is-active {
  font-weight: 500 !important;
  font-style: normal !important;
}

/* =====================================================================
   Dark mode polish — fix backgrounds the original rules missed
   ===================================================================== */

/* Body / page tinted background */
body.theme-dark { background: var(--paper); color: var(--ink-900); }

/* Date pill / role chip / icon buttons in the top bar */
body.theme-dark .date-pill,
body.theme-dark .icon-btn,
body.theme-dark .role-switch {
  background: var(--ink-100);
  color: var(--ink-700);
  border-color: var(--ink-200);
}

/* Login + no-branch shells (full-page bg gradients) */
body.theme-dark .login-shell { background: var(--paper); }
body.theme-dark .no-branch-shell { background: var(--paper); }

/* =====================================================================
   Force Google Sans Medium on every descendant — browser defaults for
   <input>, <select>, <p>, etc. were resetting to 400.
   ===================================================================== */
body, body * {
  font-weight: 500 !important;
  font-style: normal !important;
}

/* Numbers stay tabular */
.tabular, .num, .money, .kpi .value, .pagination-pages,
.t .num, .week-card .range, .summary-row, .audit-row, .pda-badge,
input[inputmode="decimal"], .hours-grid .ht, .hours-grid .hc input {
  font-variant-numeric: tabular-nums !important;
}

/* Dashboard greeting: in dark mode the date was sitting on a dark
   gradient with too-dark ink. Lighten it. */
body.theme-dark .dashboard-greeting .meta { color: var(--ink-700); }
body.theme-dark .dashboard-greeting .playful { color: var(--ink-800); }

/* =====================================================================
   Switch typography to Ubuntu Medium (500). Google Sans had patchy
   Greek glyph rendering for some letters (ω, etc.). Ubuntu ships
   first-class Greek + Greek-extended subsets.
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap&subset=greek,greek-ext,latin,latin-ext');

html, body, button, input, select, textarea, table, th, td, h1, h2, h3, h4, h5, h6,
.serif, .mono, .ttl, .kpi .value, .brand-mark, .modal-h h2, .topbar h1,
.sched .h .day-num, .week-card .num, .week-month-header h3,
.dashboard-greeting .hello, .summary-block h4, body, body * {
  font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  letter-spacing: 0 !important;
}

/* =====================================================================
   New-employee modal redesign
   ===================================================================== */
.modal.modal-wide { width: 760px; }

.form-section {
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
  background: var(--paper);
}
.form-section + .form-section { margin-top: 0; }
.form-section h4 {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-700);
}
.form-section .section-hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--ink-500);
}

/* Numbered step badge for visual rhythm in the form */
.form-section .step-num {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin-right: 8px;
}

/* Sticky footer inside modal-b for tall modals */
.modal-sticky-footer {
  position: sticky;
  bottom: 0;
  padding: 14px 22px;
  margin: 0 -22px -22px;
  background: color-mix(in oklab, var(--paper), white 0%);
  border-top: 1px solid var(--ink-150);
  display: flex; gap: 8px; justify-content: flex-end;
  z-index: 2;
}
body.theme-dark .modal-sticky-footer { background: var(--ink-100); }

/* Room option styling — full vs available */
.room-option-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-500);
}
.help-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 6px;
  font-size: 12px; color: var(--ink-500);
}
.help-row .chip { font-size: 10.5px; padding: 1px 6px; }

/* Form-section textareas — make them full-width and roomy */
.form-section textarea,
.form-section .field textarea {
  width: 100%;
  min-height: 84px;
  padding: 10px 12px;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-900);
  font: inherit;
  font-size: 13.5px;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.form-section textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), white 80%);
}
body.theme-dark .form-section textarea { background: var(--ink-100); border-color: var(--ink-200); }

/* =====================================================================
   Button colour overrides — explicit so :visited links don't turn dark
   from the global "a, a:visited { color: inherit }" reset.
   ===================================================================== */
a.btn, a.btn:hover, a.btn:visited, a.btn:active,
button.btn { color: var(--ink-800); }

a.btn-primary, a.btn-primary:hover, a.btn-primary:visited, a.btn-primary:active,
button.btn-primary { color: #fff; }

a.btn-accent, a.btn-accent:hover, a.btn-accent:visited, a.btn-accent:active,
button.btn-accent { color: #fff; }

a.btn-ghost, a.btn-ghost:hover, a.btn-ghost:visited, a.btn-ghost:active,
button.btn-ghost { color: var(--ink-600); }

/* In dark mode, .btn (default) text colour follows the dark surface */
body.theme-dark a.btn, body.theme-dark button.btn,
body.theme-dark a.btn:visited { color: var(--ink-800); }
body.theme-dark a.btn-accent, body.theme-dark button.btn-accent,
body.theme-dark a.btn-accent:visited { color: #fff; }

/* =====================================================================
   Payroll grid
   ===================================================================== */
.payroll-wrap {
  overflow-x: auto;
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  background: var(--paper);
}
.payroll-grid {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  min-width: 100%;
}
.payroll-grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--ink-50);
  border-bottom: 1px solid var(--ink-200);
  padding: 6px 4px;
  font-weight: 500;
  color: var(--ink-500);
  text-align: center;
  white-space: nowrap;
  font-size: 11px;
}
.payroll-grid thead th.row-label-h {
  text-align: left;
  padding: 6px 12px;
  min-width: 220px;
  position: sticky;
  left: 0;
  z-index: 3;
}
.payroll-grid thead th.total-h {
  background: var(--ink-100);
  color: var(--ink-700);
  position: sticky;
  right: 0;
}
.payroll-grid td {
  padding: 0;
  border-bottom: 1px solid var(--ink-150);
  border-right: 1px solid var(--ink-150);
  text-align: center;
  vertical-align: middle;
  background: var(--paper);
}
.payroll-grid td.row-label {
  text-align: left;
  padding: 6px 12px;
  font-weight: 500;
  color: var(--ink-900);
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--paper);
  white-space: nowrap;
  border-right: 1px solid var(--ink-200);
}
.payroll-grid tr.is-cash td.row-label,
.payroll-grid tr.is-cash td { background: var(--ink-50); }
.payroll-grid tr.is-dept-header td {
  background: var(--accent-soft);
  color: color-mix(in oklab, var(--accent), black 25%);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
  padding: 6px 12px;
  text-align: left;
}
.payroll-grid td.total-cell {
  background: var(--ink-100);
  font-weight: 500;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  padding: 6px 10px;
  position: sticky;
  right: 0;
  border-left: 1px solid var(--ink-200);
}

/* Editable cell input */
.payroll-grid input.cell {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 4px;
  font: inherit;
  font-size: 12.5px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-family: 'Ubuntu', monospace;
  color: var(--ink-900);
  border-radius: 4px;
}
.payroll-grid input.cell:hover { border-color: var(--ink-200); background: var(--paper); }
.payroll-grid input.cell:focus {
  outline: 0;
  border-color: var(--accent);
  background: var(--paper);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent), white 80%);
}

/* Totals footer */
.payroll-grid tfoot td {
  background: var(--ink-100);
  font-weight: 500;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  padding: 8px 8px;
}
.payroll-grid tfoot td.row-label { background: var(--ink-100); }

/* Today highlight */
.payroll-grid thead th.is-today,
.payroll-grid td.is-today { background: color-mix(in oklab, var(--accent-soft), white 40%); }
body.theme-dark .payroll-grid thead th.is-today,
body.theme-dark .payroll-grid td.is-today { background: color-mix(in oklab, var(--accent-soft), transparent 50%); }

/* Tips: PDA-owner rows tinted in the participants table */
[x-cloak] { display: none !important; }
tr.is-pda-owner > td {
  background: color-mix(in oklab, var(--accent-soft), white 35%);
}
tr.is-pda-owner > td:first-child {
  box-shadow: inset 3px 0 0 var(--accent-700);
}
body.theme-dark tr.is-pda-owner > td {
  background: color-mix(in oklab, var(--accent-soft), transparent 60%);
}
/* PDA owner selects: already-taken employees are greyed out + italic */
select option.is-taken,
select option:disabled {
  color: var(--ink-400);
  background: var(--ink-100);
  font-style: italic;
}
body.theme-dark select option.is-taken,
body.theme-dark select option:disabled {
  color: var(--ink-500);
  background: rgba(255, 255, 255, 0.04);
}

/* =====================================================================
   Responsive / mobile pass.
   Adds:
     - Horizontal table scrolling inside cards on small screens
     - Stacking grid-cols-N, page-head, pagination, modal footers
     - Tighter padding on small screens
   (Top-bar / bottom-tab navigation lives in its own section below.)
   ===================================================================== */

/* Visual hide-* utilities */
.hide-sm { /* hidden below 768px */ }

/* ==================== Tablet (≤ 1024px) ==================== */
@media (max-width: 1024px) {
  .page { padding: 22px 20px 48px; }
  .page-head .ttl { font-size: 30px; }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .modal.modal-wide { width: 100%; max-width: 720px; }
}

/* ==================== Mobile / drawer breakpoint (≤ 900px) ==================== */
@media (max-width: 900px) {
  .date-pill { font-size: 11px; padding: 5px 8px; }
  .icon-btn, .theme-toggle { width: 32px; height: 32px; }

  /* Page wrapper — less padding, no max-width constraints */
  .page { padding: 18px 14px 48px; }

  /* Page head — stack actions under title */
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 18px;
  }
  .page-head .ttl { font-size: 26px; }
  .page-head .actions {
    margin-left: 0;
    flex-wrap: wrap;
  }
  .page-head .actions .btn { flex: 1 1 auto; justify-content: center; }

  /* Dashboard greeting */
  .dashboard-greeting {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 20px;
    margin-bottom: 18px;
  }
  .dashboard-greeting .hello { font-size: 26px; }
  .dashboard-greeting-emoji { font-size: 44px; align-self: flex-start; }
  .dashboard-greeting-actions { flex-wrap: wrap; }
  .dashboard-greeting-actions .btn { flex: 1 1 auto; justify-content: center; }

  /* KPI/grid stacks */
  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 { grid-template-columns: 1fr; gap: 12px; }
  .kpi { padding: 14px 16px 16px; }
  .kpi .value { font-size: 28px; }
  .kpi .spark { display: none; }

  /* Inline grids in dashboard / tips per-employee etc. — collapse to 1col.
     Schedule/payroll grids are excluded because they live inside their own
     scroll wrappers (.sched-wrap, .payroll-wrap). */
  [style*="grid-template-columns:1.2fr"],
  [style*="grid-template-columns: 1.2fr"],
  [style*="grid-template-columns:1.6fr"],
  [style*="grid-template-columns: 1.6fr"],
  [style*="grid-template-columns: 280px 1fr"],
  [style*="grid-template-columns:280px 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Pill toolbar / filter bar — wrap and full-width controls */
  .pill-toolbar {
    flex-wrap: wrap;
    padding: 10px;
    gap: 8px;
  }
  .pill-toolbar .search-input { min-width: 0; flex: 1 1 100%; }
  .pill-toolbar select.btn,
  .pill-toolbar select.btn-sm,
  .pill-toolbar .btn { flex: 1 1 calc(50% - 4px); }
  .pill-toolbar .spacer { display: none; }
  .pill-toolbar .chip { margin-left: auto; }

  /* Tip subnav */
  .tip-subnav { flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; }
  .tip-subnav-tabs { flex-wrap: wrap; justify-content: center; }
  .tip-subnav-meta { text-align: center; padding-right: 0; }

  /* Table: enable horizontal scroll inside the wrapping card.
     Both direct-child tables and tables nested in .card-b get covered,
     so pages like me/home and me/schedule (which use .card-b > table.t)
     scroll cleanly without needing template wrappers. */
  .card { overflow: hidden; }
  .card:has(> table.t),
  .card:has(.t-scroll),
  .card-b:has(> table.t),
  .t-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table.t { min-width: 640px; }
  table.t thead th,
  table.t tbody td { padding: 10px 12px; }

  /* Pagination bar */
  .pagination-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
  }
  .pagination-pages { width: 100%; justify-content: space-between; }

  /* Forms — stack any inline form rows */
  .grid-cols-2,
  .form-section .grid-cols-2 { grid-template-columns: 1fr; }

  /* Modals — full screen feel, stick to edges */
  .scrim { padding: 0; align-items: flex-end; }
  .modal,
  .modal.modal-wide {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    border-radius: 14px 14px 0 0;
    border: 0;
  }
  .modal-h { padding: 14px 16px 12px; }
  .modal-h h2 { font-size: 20px; }
  .modal-b { padding: 16px; }
  .modal-f {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .modal-f .btn { flex: 1 1 auto; justify-content: center; }
  .modal-sticky-footer {
    padding: 12px 16px;
    margin: 0 -16px -16px;
    flex-wrap: wrap;
  }
  .modal-sticky-footer .btn { flex: 1 1 auto; justify-content: center; }
  .form-section { padding: 14px; }

  /* Tip-grid: collapse the right-rail aside under the main column */
  .tip-grid {
    grid-template-columns: 1fr;
  }
  .tip-grid > aside { position: static; }

  /* Schedule grid — already wrapped in .sched-wrap, keep min-width */
  .sched { min-width: 720px; }

  /* Hours grid — needs horizontal scroll like sched-wrap. .hours-wrap is
     the scroll container; the inner .hours-grid keeps its computed width
     (220 + 7×80 + 110 ≈ 890px) so columns don't squash. */
  .hours-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .hours-grid { min-width: 890px; }

  /* Tips toolbar (date + retention + status pills) wraps and the inputs
     stack on mobile so the chip indicators don't get truncated. */
  .tip-toolbar { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .tip-toolbar .field { flex: 1 1 calc(50% - 4px); }
  .tip-toolbar .field input { width: 100%; }
  .tip-toolbar .spacer { display: none; }

  /* Income / general: any inline-flex date filter label wraps cleanly */
  .pill-toolbar label[style*="display:flex"],
  .pill-toolbar label[style*="display: flex"] {
    flex: 1 1 100%;
    margin: 0;
  }

  /* Generic safety: any element using inline display:flex collapses to
     full-width inside the pill-toolbar so it doesn't push siblings off. */
  .pill-toolbar > * { min-width: 0; }

  /* Investment edit modal grid stacks per-investor amount fields */
  .investment-form .grid-cols-2 { grid-template-columns: 1fr; }

  /* "Current occupants" list rows in rooms/form — keep readable */
  .card-b > div[style*="border-top:1px solid"] {
    flex-wrap: wrap;
  }

  /* Long inline tables (me/home, me/schedule) — let the th/td shrink
     since these are 7-column day tables, not data tables. */
  .card-b > table.t { min-width: 560px; }

  /* Tip-grid PDA summary inline cards wrap nicely */
  .tip-grid .card > div[style*="display:flex"] { flex-wrap: wrap; }

  /* Hide chip with role on cramped header */
  .hide-sm { display: none !important; }

  /* Toast — full width */
  .toast-wrap { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; width: 100%; }

  /* Week grid cards smaller */
  .week-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
  .week-card { padding: 12px 14px; }
  .week-card .num { font-size: 24px; }

  /* Steps wizard wraps */
  .steps { flex-wrap: wrap; gap: 6px; }
  .steps .step { font-size: 11px; padding: 5px 10px; }

  /* Department cards single column */
  .dept-cards { grid-template-columns: 1fr; }

  /* Login card edges */
  .login-shell { padding: 16px; }
  .login-card { padding: 28px 24px 24px; }

  /* Inline grids using 240px+ minmax — drop to 1fr if cramped */
  .week-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ==================== Small mobile (≤ 480px) ==================== */
@media (max-width: 480px) {
  .page { padding: 14px 10px 40px; }
  .date-pill { display: none; }
  .page-head .ttl { font-size: 22px; }
  .kpi .value { font-size: 24px; }
  .week-grid { grid-template-columns: 1fr 1fr; }
  table.t { font-size: 12.5px; min-width: 560px; }
  table.t thead th,
  table.t tbody td { padding: 8px 10px; }
  .modal-h h2 { font-size: 18px; }
  .form-section h4 { font-size: 10.5px; }
  .form-section .step-num { width: 20px; height: 20px; font-size: 11px; }
  .login-card { padding: 24px 20px; }
  .login-card-title { font-size: 20px; }
}

/* ====================================================================
   Mobile: cards instead of horizontal-scroll tables (≤ 640px)
   Two opt-in patterns, so a phone user sees whole rows + their actions
   without scrolling each row sideways:
     .t-cards  — generic data tables: each <tr> becomes a card, each <td>
                 a "label → value" line. Labels are copied from <thead>
                 into td[data-label] by labelizeCardTables() in app.js.
     .t-week   — the 7-column week grid: each day <td> stacks vertically
                 as its own block; the .day-h header (hidden on desktop)
                 names the day.
   ==================================================================== */

/* Day header inside week-grid cells is mobile-only */
.t-week td .day-h { display: none; }

@media (max-width: 640px) {
  /* ---- Generic card tables ---- */
  table.t-cards { display: block; min-width: 0 !important; }
  table.t-cards thead { display: none; }
  table.t-cards tbody, table.t-cards tfoot { display: block; }
  table.t-cards tr {
    display: block;
    border: 1px solid var(--ink-200);
    border-radius: 12px;
    background: var(--paper);
    padding: 2px 2px;
    margin-bottom: 10px;
  }
  table.t-cards tfoot tr { background: var(--ink-50); }
  table.t-cards td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 9px 13px !important;
    border: 0 !important;
    text-align: right;
    font-size: 13.5px;
    min-width: 0;
    white-space: normal;
  }
  table.t-cards td + td { border-top: 1px solid var(--ink-100) !important; }
  table.t-cards td::before {
    content: attr(data-label);
    flex: 0 0 40%;
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink-500);
  }
  /* Label-less cells (actions, spanning message rows, tfoot totals) go full width */
  table.t-cards td[data-label=""]::before,
  table.t-cards td:not([data-label])::before,
  table.t-cards td[colspan]::before { content: none; }
  table.t-cards td[data-label=""] { justify-content: flex-end; }
  table.t-cards td[colspan] { justify-content: center; text-align: center; }
  /* The horizontal-scroll wrapper is unnecessary once rows are cards */
  .card:has(> table.t-cards),
  .card-b:has(> table.t-cards),
  .t-scroll:has(> table.t-cards) { overflow: visible; }

  /* ---- Week grid → vertical day cards ---- */
  table.t-week { display: block; min-width: 0 !important; }
  table.t-week thead { display: none; }
  table.t-week tbody, table.t-week tr { display: block; }
  table.t-week td {
    display: block !important;
    width: 100%;
    border: 1px solid var(--ink-200) !important;
    border-radius: 12px;
    padding: 12px 14px !important;
    margin-bottom: 10px;
    min-height: 0 !important;
    background: var(--paper);
  }
  table.t-week td.is-today { border-color: var(--accent) !important; }
  table.t-week td .day-h {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
  }
  table.t-week td .day-h .dname { font-weight: 600; font-size: 14px; color: var(--ink-900); }
  table.t-week td .day-h .ddate { font-size: 13px; color: var(--ink-500); }
  /* Rest / out-of-window days: compact, muted, header inline with the mark */
  table.t-week td.is-rest {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px !important;
    margin-bottom: 6px;
    background: var(--ink-50);
    border-color: var(--ink-150) !important;
  }
  table.t-week td.is-rest .day-h { margin-bottom: 0; display: contents; }
}

/* ==================== Universal table/form polish ==================== */

/* Treat any plain table inside a .card as scrollable on overflow */
.card { max-width: 100%; }

/* Long content in cells shouldn't blow out widths */
table.t td { word-break: break-word; }
table.t td .name { word-break: normal; }
/* …but numeric cells must never split a "128,70 €" across two lines. */
table.t td.num, table.t th.num,
table.t td.tabular, table.t td .money, table.t td .tabular { word-break: normal; white-space: nowrap; }

/* Ensure focus rings are visible across all interactive elements */
.btn:focus-visible,
.icon-btn:focus-visible,
.theme-toggle:focus-visible,
.date-pill:focus-visible,
.role-switch button:focus-visible,
.seg button:focus-visible,
.tip-subnav-tabs a:focus-visible,
.nav-item:focus-visible,
.rest-toggle button:focus-visible {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), white 80%);
}

/* Disabled state for buttons + form controls */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: var(--ink-50);
  color: var(--ink-500);
  cursor: not-allowed;
}

/* Table: standard empty/loading helper rows for consistency */
table.t .row-empty td,
table.t .row-loading td,
table.t .row-error td {
  padding: 36px 20px;
  text-align: center;
  color: var(--ink-500);
  font-size: 13px;
}
table.t .row-empty .big,
table.t .row-loading .big,
table.t .row-error .big {
  display: block;
  font-size: 18px;
  color: var(--ink-700);
  margin-bottom: 4px;
  font-weight: 500;
}
table.t .row-error td { color: var(--bad); }

/* Loading spinner helper (used by HTMX hx-indicator) */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--ink-200);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinner-rot 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spinner-rot { to { transform: rotate(360deg); } }
.htmx-request .spinner-on-busy,
.htmx-indicator { display: none; }
.htmx-request.htmx-indicator,
.htmx-request .htmx-indicator { display: inline-block; }

/* Prevent any accidental horizontal page overflow */
html, body { overflow-x: hidden; max-width: 100%; }

/* Allow tables (inside their wrappers) to scroll horizontally despite the
   global overflow-x: hidden — the wrapper itself handles its own scroll.
   Only cards that directly wrap a data table get scroll; other cards keep
   their original overflow: hidden so corners stay clipped. */
.card:has(> table.t) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.t-scroll,
.sched-wrap,
.payroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Wide-screen safety: still cap page so very wide monitors don't dilute */
@media (min-width: 1600px) {
  .page { max-width: 1600px; }
}

/* =====================================================================
   Tips · primary action bar (sticky-top step navigation + save buttons)
   Sits between the toolbar and the main editor so the user always has
   access to "Save Draft / Finalize / Continue" without scrolling.
   ===================================================================== */
.tip-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 64px;
  z-index: 4;
  background: color-mix(in oklab, var(--paper-tinted), white 30%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--accent-edge);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(14, 17, 22, 0.04);
}
.tip-action-bar-left {
  display: flex; align-items: center; gap: 10px;
  min-width: 0; flex: 1 1 auto;
}
.tip-action-bar-right {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
.tip-action-bar-hint {
  color: var(--ink-500);
  font-size: 13px;
}
body.theme-dark .tip-action-bar {
  background: color-mix(in oklab, var(--ink-50), var(--paper) 60%);
  border-color: var(--ink-200);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* Mobile: stop the action bar from sticking (the topbar already takes
   most of the small viewport's vertical real estate) and let the buttons
   wrap full-width. */
@media (max-width: 900px) {
  .tip-action-bar {
    position: static;
    top: auto;
    flex-direction: column;
    align-items: stretch;
  }
  .tip-action-bar-right {
    margin-left: 0;
    justify-content: stretch;
  }
  .tip-action-bar-right .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Department / GROUP participant row — visually distinct from per-employee
   rows so the user immediately reads it as a group. */
table.t tr.is-group-row > td {
  background: color-mix(in oklab, var(--accent-soft), white 40%);
}
table.t tr.is-group-row > td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}
table.t tr.is-group-row .who .pic {
  background: var(--accent-soft);
  color: color-mix(in oklab, var(--accent), black 20%);
}
body.theme-dark table.t tr.is-group-row > td {
  background: color-mix(in oklab, var(--accent-soft), transparent 60%);
}

/* =====================================================================
   Row-action dropdown menu (kebab "⋯" button → menu)
   Used inside table rows to consolidate per-row actions behind a single
   trigger. The popover is rendered via Alpine x-teleport into <body>
   with position:fixed, so it never gets clipped by overflow:hidden cards
   or horizontally-scrolling table wrappers.
   ===================================================================== */
.row-actions {
  position: relative;
  display: inline-block;
}
.row-actions-btn {
  width: 30px;
  height: 28px;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-700);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  font-family: inherit;
  letter-spacing: 0.04em;
}
.row-actions-btn:hover {
  background: var(--ink-50);
  color: var(--ink-900);
  border-color: var(--ink-300);
}
.row-actions-btn:focus-visible {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), white 80%);
}
.row-actions-btn[aria-expanded="true"] {
  background: var(--ink-100);
  border-color: var(--ink-300);
}
body.theme-dark .row-actions-btn { background: var(--ink-100); }
body.theme-dark .row-actions-btn:hover { background: var(--ink-150); }

/* Menu — teleported into <body>, uses position:fixed coords from JS */
.row-actions-menu {
  position: fixed;
  z-index: 70;
  min-width: 200px;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(14, 17, 22, 0.18);
  padding: 4px;
  display: flex;
  flex-direction: column;
  animation: row-actions-in 0.12s ease;
}
@keyframes row-actions-in {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: none; }
}
body.theme-dark .row-actions-menu {
  background: var(--ink-100);
  border-color: var(--ink-200);
}

.row-actions-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--ink-800);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  width: 100%;
  white-space: nowrap;
}
.row-actions-item:hover { background: var(--ink-50); color: var(--ink-900); }
.row-actions-item:focus-visible {
  outline: 0;
  background: var(--ink-100);
  color: var(--ink-900);
}
.row-actions-item.is-accent { color: color-mix(in oklab, var(--accent), black 8%); }
.row-actions-item.is-accent:hover { background: var(--accent-soft); }
.row-actions-item.is-danger { color: var(--bad); }
.row-actions-item.is-danger:hover { background: var(--bad-bg); color: var(--bad); }

.row-actions-item form {
  margin: 0;
  display: contents;
}

.row-actions-divider {
  height: 1px;
  background: var(--ink-150);
  margin: 4px 6px;
}

/* Forms inside menu items shouldn't add their own padding */
.row-actions-menu form { margin: 0; }
.row-actions-menu form > .row-actions-item { width: 100%; }

body.theme-dark .row-actions-item:hover { background: var(--ink-150); }

/* =====================================================================
   Navigation redesign — horizontal top bar (desktop) + bottom tab bar
   with a full-menu sheet (mobile). Replaces the old left sidebar.
   ===================================================================== */

/* Inline-SVG icon helper (sprite in fragments/icons.html) */
.ic {
  width: 18px; height: 18px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic-sm { width: 14px; height: 14px; stroke-width: 2; }

/* ---- Top bar ---- */
.topnav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  height: 60px; padding: 0 18px;
  background: var(--paper);
  border-bottom: 1px solid var(--ink-200);
}
.tn-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-900); flex: 0 0 auto; }
.tn-mark { display: inline-flex; }
.tn-mark svg { display: block; border-radius: 8px; }
.tn-brand-text { font-family: 'Cormorant Garamond', 'GFS Didot', Georgia, serif; font-size: 19px; letter-spacing: .01em; white-space: nowrap; }
.tn-nav { display: flex; align-items: center; gap: 2px; margin-left: 12px; }
.tn-title { display: none; }
.tn-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Dropdown menus */
.tn-menu { position: relative; }
.tn-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink-700);
  background: transparent; border: 0; border-radius: 9px; padding: 8px 12px; cursor: pointer;
  white-space: nowrap;
}
.tn-trigger:hover { background: var(--ink-50); color: var(--ink-900); }
.tn-trigger.is-active { color: var(--accent); }
.tn-caret { opacity: .65; transition: transform .15s ease; }
.tn-menu.is-open .tn-caret { transform: rotate(180deg); }
.tn-drop {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 232px;
  background: var(--paper); border: 1px solid var(--ink-200); border-radius: 12px;
  box-shadow: 0 12px 34px rgba(14, 17, 22, .12);
  padding: 6px; display: none; z-index: 60;
}
.tn-drop-right { left: auto; right: 0; }
.tn-menu.is-open .tn-drop { display: block; }
.tn-drop-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: 8px; text-decoration: none;
  color: var(--ink-700); font: inherit; font-size: 13.5px;
  background: transparent; border: 0; cursor: pointer; text-align: left;
}
.tn-drop-item:hover { background: var(--ink-50); color: var(--ink-900); }
.tn-drop-item.is-active { background: var(--accent-soft); color: var(--accent); }
.tn-drop-item .ic { color: var(--ink-500); }
.tn-drop-item.is-active .ic { color: var(--accent); }
.tn-drop-item.is-logout { color: var(--bad); }
.tn-drop-item.is-logout .ic { color: var(--bad); }
.tn-drop-item.is-logout:hover { background: var(--bad-bg); }
.tn-drop-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-500); padding: 6px 10px 4px; }
.tn-drop form { margin: 0; }

.tn-user-head { padding: 6px 10px 10px; border-bottom: 1px solid var(--ink-150); margin-bottom: 4px; }
.tn-user-head .name { font-weight: 600; color: var(--ink-900); font-size: 14px; }
.tn-user-head .role { font-size: 11px; color: var(--ink-500); text-transform: uppercase; letter-spacing: .08em; }
.tn-avatar-btn { padding: 5px 8px 5px 6px; gap: 6px; }
.tn-avatar-btn .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex: 0 0 auto;
}
.tn-branch .tn-trigger { border: 1px solid var(--ink-200); font-weight: 500; }

/* ---- Bottom tab bar (mobile) ---- */
.bottomnav { display: none; }
.bn-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 2px; text-decoration: none; background: transparent; border: 0; cursor: pointer;
  color: var(--ink-500); font: inherit; font-size: 10.5px;
}
.bn-tab .ic { width: 22px; height: 22px; }
.bn-tab.is-active { color: var(--accent); }
.bn-tab span { line-height: 1; }

/* ---- Full-menu bottom sheet (mobile) ---- */
.menu-backdrop {
  position: fixed; inset: 0; background: rgba(14, 17, 22, .45);
  z-index: 45; opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.menu-backdrop.is-open { opacity: 1; pointer-events: auto; }
.menu-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 46;
  transform: translateY(100%); transition: transform .25s ease;
}
.menu-sheet.is-open { transform: translateY(0); }
.ms-panel {
  background: var(--paper); border-radius: 16px 16px 0 0;
  max-height: 85dvh; display: flex; flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .3);
}
.ms-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--ink-150); }
.ms-title { font-weight: 600; font-size: 16px; color: var(--ink-900); }
.ms-close { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--ink-500); cursor: pointer; padding: 0 4px; }
.ms-body { overflow-y: auto; padding: 10px 12px calc(18px + env(safe-area-inset-bottom)); }
.ms-group { margin-bottom: 8px; }
.ms-group form { margin: 0; }
.ms-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-500); padding: 8px 8px 4px; }
.ms-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 10px; border-radius: 10px; text-decoration: none;
  color: var(--ink-800); font: inherit; font-size: 14.5px;
  background: transparent; border: 0; cursor: pointer; text-align: left;
}
.ms-item:hover { background: var(--ink-50); }
.ms-item.is-active { background: var(--accent-soft); color: var(--accent); }
.ms-item .ic { color: var(--ink-500); width: 20px; height: 20px; }
.ms-item.is-active .ic { color: var(--accent); }
.ms-item.is-logout { color: var(--bad); }
.ms-item.is-logout .ic { color: var(--bad); }
.ms-branch { display: flex; gap: 6px; padding: 2px 6px 4px; }
.ms-branch-btn { flex: 1; padding: 9px; border: 1px solid var(--ink-200); border-radius: 9px; background: var(--paper); font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-700); }
.ms-branch-btn.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---- Dark mode ---- */
body.theme-dark .topnav,
body.theme-dark .tn-drop,
body.theme-dark .ms-panel { background: var(--ink-50); border-color: var(--ink-200); }
body.theme-dark .bottomnav { background: var(--ink-50); border-top-color: var(--ink-200); }
body.theme-dark .ms-branch-btn { background: var(--ink-100); border-color: var(--ink-200); }

/* ---- Responsive switch: top-bar nav (desktop) ↔ bottom tabs (mobile) ---- */
@media (max-width: 900px) {
  .topnav { height: 54px; padding: 0 12px; gap: 6px; }
  .tn-nav { display: none; }
  .tn-brand-text { display: none; }
  .tn-title {
    display: block; flex: 1; min-width: 0;
    font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .tn-title b { font-weight: 600; color: var(--ink-900); }
  .tn-branch, .date-pill { display: none; }
  .tn-right { gap: 4px; }
  .tn-avatar-btn .tn-caret { display: none; }

  .bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    justify-content: space-around;
    background: var(--paper); border-top: 1px solid var(--ink-200);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  /* Room for the fixed bar so it never covers page content */
  .main { padding-bottom: 72px; }
}


/* =====================================================================
   Tips date picker — custom month calendar that highlights days which
   have a published schedule (accent tint + dot). Replaces the native
   <input type=date> in tips/new so specific days can be coloured.
   ===================================================================== */
.datecal { position: relative; }
.datecal-field {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 13.5px; color: var(--ink-900);
  padding: 8px 12px; border: 1px solid var(--ink-200); border-radius: 8px;
  background: var(--paper); cursor: pointer; min-width: 210px;
}
.datecal-field:hover { border-color: var(--ink-300); }
.datecal-field.is-open { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), white 80%); }
.datecal-field .ic { color: var(--ink-500); }
.datecal-field .is-placeholder { color: var(--ink-400); }
.datecal-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  width: 292px; padding: 12px;
  background: var(--paper); border: 1px solid var(--ink-200); border-radius: 12px;
  box-shadow: 0 12px 34px rgba(14, 17, 22, .14);
}
.datecal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.datecal-title { font-weight: 600; font-size: 14px; color: var(--ink-900); }
.datecal-nav {
  width: 30px; height: 30px; border: 1px solid var(--ink-200); border-radius: 8px;
  background: var(--paper); cursor: pointer; font-size: 16px; color: var(--ink-700); line-height: 1;
}
.datecal-nav:hover { background: var(--ink-50); border-color: var(--ink-300); }
.datecal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.datecal-dow { margin-bottom: 4px; }
.datecal-dow span { text-align: center; font-size: 11px; color: var(--ink-500); padding: 4px 0; }
.datecal-day {
  position: relative; aspect-ratio: 1 / 1; border: 0; border-radius: 8px;
  background: transparent; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink-800);
  display: flex; align-items: center; justify-content: center;
}
.datecal-day:hover:not(:disabled) { background: var(--ink-100); }
.datecal-day.is-empty { visibility: hidden; cursor: default; }
.datecal-day.is-today { font-weight: 700; }
.datecal-day.has-sched { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.datecal-day.has-sched::after {
  content: ""; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.datecal-day.is-sel { background: var(--accent); color: #fff; }
.datecal-day.is-sel::after { background: #fff; }
.datecal-legend { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 11.5px; color: var(--ink-500); }
.datecal-legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
body.theme-dark .datecal-pop,
body.theme-dark .datecal-field,
body.theme-dark .datecal-nav { background: var(--ink-50); border-color: var(--ink-200); }
