/* Copyright (c) 2026 Adab LLC. All rights reserved. Proprietary and confidential. */
/* MyShifts design system
   Layout: dark brand bar + pill tabs, one working column of cards; the master grid scrolls inside its own frame.
   Color: ink navy for structure, teal for action, and shift colors that read at a glance
   (sunrise amber = Day/Morning, dusk rose = Evening, indigo = Night). */
:root {
  --bg: #f2f5f7;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --surface-3: #e4eaee;
  --line: #dbe2e7;
  --line-strong: #c6d0d7;
  --fg: #0f2230;
  --muted: #5b6b77;
  --ink: #0e2733;          /* header and strong surfaces */
  --ink-2: #163847;
  --on-ink: #f3f8fa;
  --on-ink-muted: #a8bfc8;
  --accent: #0b7c79;       /* actions */
  --accent-hover: #086664;
  --accent-soft: #dcf2ef;
  --accent-fg: #ffffff;
  --accent-bright: #3fd1c0; /* small highlights on ink */
  --day: #c77700;  --day-soft: #fff0d3;  --day-solid: #f2a20f;
  --eve: #b23f75;  --eve-soft: #fbe2ee;  --eve-solid: #d9578f;
  --night: #3f4fc0; --night-soft: #e2e5fb; --night-solid: #5263d9;
  --ok: #17824a;   --ok-soft: #dcf2e5;
  --leave: #4d7a2a; --leave-soft: #e6f2d9; --leave-solid: #8fbf5a; /* Annual leave & Personal day */
  --warn: #a96300; --warn-soft: #fff0d6;
  --bad: #c0352c;  --bad-soft: #fde2df;
  --on-shift: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 34, 48, .06);
  --shadow: 0 1px 2px rgba(15, 34, 48, .05), 0 8px 24px rgba(15, 34, 48, .07);
  --shadow-lg: 0 18px 50px rgba(15, 34, 48, .18);
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b141a; --surface: #121e26; --surface-2: #182630; --surface-3: #1f303b; --line: #263842; --line-strong: #345060;
    --fg: #e7f0f4; --muted: #95a9b4; --ink: #08161d; --ink-2: #10242e; --on-ink: #eef6f8; --on-ink-muted: #8eabb6;
    --accent: #2fb8ad; --accent-hover: #46cbbf; --accent-soft: #123a38; --accent-fg: #04201d; --accent-bright: #5fe0d0;
    --day: #f5b440; --day-soft: #3a2a0d; --day-solid: #f2a20f;
    --eve: #f08cbb; --eve-soft: #3b1729; --eve-solid: #d9578f;
    --night: #9eaaff; --night-soft: #1f2650; --night-solid: #5263d9;
    --leave: #b5dd8a; --leave-soft: #22301a; --leave-solid: #6f9a45;
    --ok: #6fd69a; --ok-soft: #12301f; --warn: #f5b862; --warn-soft: #3a2a10; --bad: #ff8d84; --bad-soft: #3b1715;
    --on-shift: #0b141a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .3); --shadow-lg: 0 18px 50px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b141a; --surface: #121e26; --surface-2: #182630; --surface-3: #1f303b; --line: #263842; --line-strong: #345060;
  --fg: #e7f0f4; --muted: #95a9b4; --ink: #08161d; --ink-2: #10242e; --on-ink: #eef6f8; --on-ink-muted: #8eabb6;
  --accent: #2fb8ad; --accent-hover: #46cbbf; --accent-soft: #123a38; --accent-fg: #04201d; --accent-bright: #5fe0d0;
  --day: #f5b440; --day-soft: #3a2a0d; --day-solid: #f2a20f;
  --eve: #f08cbb; --eve-soft: #3b1729; --eve-solid: #d9578f;
  --night: #9eaaff; --night-soft: #1f2650; --night-solid: #5263d9;
  --leave: #b5dd8a; --leave-soft: #22301a; --leave-solid: #6f9a45;
  --ok: #6fd69a; --ok-soft: #12301f; --warn: #f5b862; --warn-soft: #3a2a10; --bad: #ff8d84; --bad-soft: #3b1715;
  --on-shift: #0b141a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .3); --shadow-lg: 0 18px 50px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; line-height: 1.15; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 4vw, 2rem); font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0; }
b, strong { font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.wrap { max-width: 1200px; margin: 0 auto; padding-inline: 16px; }
main.wrap { padding-block: 24px 72px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1 1 220px; min-width: 0; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.eyebrow { font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--ink); color: var(--on-ink); box-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.top > .wrap:first-child { display: flex; align-items: center; gap: 14px; padding-block: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; flex-wrap: wrap; row-gap: 6px; }
.brand b { display: inline-flex; align-items: center; gap: 9px; font-family: var(--f-display); font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; color: var(--on-ink); }
.brand b i { font-style: normal; color: var(--accent-bright); }
.logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(140deg, var(--accent-bright), var(--accent)); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); flex: none; }
.logo svg { width: 18px; height: 18px; stroke: #04201d; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.brand .unit-name { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; color: var(--on-ink); font-weight: 600; font-size: .95rem; }
.brand .unit-name > span:not(.unit-chip) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--on-ink); }
.brand .unit-name .muted { color: var(--on-ink-muted) !important; }
.brand select { width: auto; min-width: 0; max-width: 100%; flex: 1 1 auto; background: var(--ink-2); color: var(--on-ink); border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px; padding: 6px 10px; font-weight: 700; text-overflow: ellipsis; }
.top .unit-chip { background: var(--accent-bright); color: #04201d; }
.who { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.who b { color: var(--on-ink); }
.who .muted { color: var(--on-ink-muted); }
.top .avatar { background: rgba(255, 255, 255, .12); color: var(--on-ink); }
.top .btn { background: transparent; color: var(--on-ink); border-color: rgba(255, 255, 255, .22); }
.top .btn:hover { background: rgba(255, 255, 255, .08); }
.tabs-bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-block: 8px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; border: 0; background: none; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: .95rem; cursor: pointer; transition: background .15s, color .15s; }
.tab:hover { background: var(--surface-2); color: var(--fg); }
.tab[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.tab .ico { width: 17px; height: 17px; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: .72rem; display: inline-grid; place-items: center; font-weight: 800; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); min-width: 0; }
.card > h2 + p, .card h2 + p, .card h3 + p { margin-top: 4px; }
.card.stack, .card .stack { gap: 14px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; letter-spacing: .02em; background: var(--accent-soft); color: var(--accent); flex: none; }
.unit-chip { display: inline-grid; place-items: center; min-width: 34px; padding: 2px 8px; border-radius: 7px; background: var(--ink); color: var(--on-ink); font-family: var(--f-mono); font-size: .76rem; font-weight: 600; letter-spacing: .02em; vertical-align: 2px; }
.scope { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.role-tag { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .03em; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--muted); vertical-align: 1px; }

/* ---------- buttons & form controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: .95rem; cursor: pointer; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); box-shadow: 0 1px 0 rgba(0, 0, 0, .08), 0 4px 12px color-mix(in srgb, var(--accent) 28%, transparent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: var(--surface); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.sm { padding: 6px 12px; font-size: .86rem; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn[aria-busy="true"] { opacity: .65; pointer-events: none; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; font-weight: 700; color: var(--fg); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], input[type=date], select, textarea {
  width: 100%; min-width: 0; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 10px 12px; font-weight: 400; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
textarea { min-height: 72px; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: 9px; font-weight: 700; font-size: .88rem; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.err { color: var(--bad); font-size: .9rem; font-weight: 700; }
.copyrow { display: flex; gap: 8px; align-items: center; }
.copyrow input { font-family: var(--f-mono); font-size: .78rem; }

/* ---------- pills, dots, status ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; line-height: 1.5; }
.pill.D, .pill.M { background: var(--day-soft); color: var(--day); }
.pill.E { background: var(--eve-soft); color: var(--eve); }
.pill.N { background: var(--night-soft); color: var(--night); }
.pill.L { background: var(--leave-soft); color: var(--leave); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.neutral { background: var(--surface-3); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.D, .dot.M { background: var(--day-solid); } .dot.L { background: var(--leave-solid); } .dot.E { background: var(--eve-solid); } .dot.N { background: var(--night-solid); }
.banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; padding: 14px 16px; border-radius: var(--r); background: var(--accent-soft); color: var(--fg); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.steps { display: flex; gap: 6px; flex-wrap: wrap; counter-reset: step; }
.step { position: relative; padding: 6px 12px 6px 30px; border-radius: 999px; border: 1px solid var(--line); font-size: .84rem; font-weight: 700; color: var(--muted); background: var(--surface); counter-increment: step; }
.step::before { content: counter(step); position: absolute; left: 7px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; background: var(--surface-3); color: var(--muted); }
.step.done { color: var(--accent); border-color: transparent; background: var(--accent-soft); }
.step.done::before { content: "✓"; background: var(--accent); color: var(--accent-fg); }
.step.now { color: var(--accent-fg); background: var(--accent); border-color: var(--accent); }
.step.now::before { background: rgba(255, 255, 255, .25); color: var(--accent-fg); }
.oklist { color: var(--ok); font-size: .88rem; font-weight: 700; margin-top: 6px; }
.warnlist { margin: 6px 0 0; padding-left: 18px; color: var(--warn); font-size: .86rem; font-weight: 600; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.card.stat { padding: 16px 18px; }
.stat .v { font-family: var(--f-display); font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat .l { font-size: .84rem; color: var(--muted); }
.req .stats .stat, .card .stats .stat:not(.card) { background: var(--surface-2); border-radius: var(--r); padding: 12px 14px; }

/* ---------- staff calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: center; font-weight: 800; padding-bottom: 2px; }
.day { min-height: 74px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; min-width: 0; text-align: left; }
.day .n { font-family: var(--f-mono); font-size: .76rem; color: var(--muted); font-weight: 600; }
.day.past { opacity: .5; }
.day.today { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.day.today .n { color: var(--accent); font-weight: 800; }
.day .chip { border-radius: 6px; padding: 3px 6px; font-size: .74rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day .chip.D, .day .chip.M { background: var(--day-soft); color: var(--day); box-shadow: inset 3px 0 0 var(--day-solid); }
.day .chip.E { background: var(--eve-soft); color: var(--eve); box-shadow: inset 3px 0 0 var(--eve-solid); }
.day .chip.N { background: var(--night-soft); color: var(--night); box-shadow: inset 3px 0 0 var(--night-solid); }
.day .chip.L { background: var(--leave-soft); color: var(--leave); box-shadow: inset 3px 0 0 var(--leave-solid); }
.day .chip.X { background: repeating-linear-gradient(135deg, var(--surface-3) 0 5px, transparent 5px 10px); color: var(--muted); }
.day .chip.A { background: var(--accent-soft); color: var(--accent); }
.day .flag { font-size: .68rem; color: var(--warn); font-weight: 800; }
button.day { cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, transform .05s; }
button.day:hover { border-color: var(--accent); }
button.day:active { transform: scale(.98); }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.item { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.item:first-child { border-top: 0; }
.date-block { width: 56px; text-align: center; border-radius: 12px; background: var(--surface-2); padding: 6px 0; flex: none; border: 1px solid var(--line); }
.date-block b { display: block; font-family: var(--f-display); font-size: 1.35rem; font-weight: 800; line-height: 1.05; }
.date-block span { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 800; }
.mgr-list { display: flex; flex-direction: column; }
.mgr-list .item { padding: 10px 0; }
table.plain { width: 100%; border-collapse: collapse; font-size: .92rem; }
.plain th, .plain td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.plain th { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 800; }
.plain tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.plain input, .plain select { max-width: 170px; padding: 7px 10px; }
.tbl-wrap { overflow-x: auto; }

/* ---------- requests ---------- */
.req { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); }
.req .swapline { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.side { background: var(--surface-2); border-radius: var(--r); padding: 10px 12px; min-width: 0; font-weight: 600; }
.side .eyebrow { margin-bottom: 2px; }
.arrow { font-family: var(--f-mono); color: var(--accent); font-size: 1.2rem; font-weight: 700; text-align: center; }
@media (max-width: 560px) { .req .swapline { grid-template-columns: 1fr; } .arrow { transform: rotate(90deg); } }
.timeline { font-size: .8rem; color: var(--muted); display: flex; flex-direction: column; gap: 3px; border-left: 2px solid var(--line-strong); padding-left: 12px; }

/* ---------- inbox ---------- */
.note { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.note:first-child { border-top: 0; }
.note .mark { width: 9px; height: 9px; border-radius: 50%; margin-top: 8px; flex: none; background: transparent; }
.note.unread .mark { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.note.unread p:first-child { font-weight: 700; }
.note .k { font-weight: 800; }
.note.ok .k, .note.pub .k { color: var(--ok); }
.note.bad .k, .note.denied .k { color: var(--bad); }

/* ---------- empty & loading ---------- */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty h3 { color: var(--fg); margin-bottom: 6px; font-size: 1.1rem; }
.empty .btn { margin-top: 14px; }
.loading { display: grid; place-items: center; min-height: 40vh; color: var(--muted); }
.spin { width: 24px; height: 24px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; }
@media (prefers-reduced-motion: no-preference) { .spin { animation: sp .8s linear infinite; } @keyframes sp { to { transform: rotate(360deg); } } }

/* ---------- master grid ---------- */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); align-items: center; font-weight: 600; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }
.grid-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); max-height: 75vh; box-shadow: var(--shadow-sm); }
table.grid { border-collapse: separate; border-spacing: 0; font-size: .82rem; }
.grid th, .grid td { border-bottom: 1px solid var(--line); padding: 0; text-align: center; }
.grid thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 8px 2px 6px; font-weight: 700; border-bottom: 2px solid var(--line-strong); }
.grid thead th span { display: block; font-size: .64rem; color: var(--muted); text-transform: uppercase; font-weight: 800; letter-spacing: .04em; }
.grid thead th b { font-family: var(--f-mono); font-size: .86rem; }
.grid .name { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 8px 12px; min-width: 190px; border-right: 1px solid var(--line); white-space: nowrap; font-weight: 700; font-size: .9rem; }
.grid thead .name { z-index: 4; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.grid .name small { display: block; color: var(--muted); font-size: .74rem; font-weight: 400; }
.grid .wk { border-left: 2px solid var(--line-strong); }
.grid .we { background: var(--surface-2); }
.grid thead th.we { background: var(--surface-2); }
.grid tr.role-h th { background: var(--ink); color: var(--on-ink); font-family: var(--f-display); font-size: .98rem; font-weight: 700; padding: 9px 12px; letter-spacing: -.01em; }
.grid tr.role-h td { background: var(--ink); }
.grid tr.team-h th { background: var(--surface-2); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 12px; font-weight: 800; }
.grid tr.team-h td { background: var(--surface-2); }
.grid tr.cntrow th, .grid tr.cntrow td { font-family: var(--f-mono); font-size: .72rem; padding: 5px 1px; background: var(--surface); }
.grid tr.cntrow th { font-family: var(--f-body); padding: 5px 12px; font-weight: 700; }
.grid tr.cntrow:last-child th, .grid tr.cntrow:last-child td { border-bottom: 2px solid var(--line-strong); }
.grid tbody tr:not(.role-h):not(.team-h):not(.cntrow):hover th.name { background: var(--surface-2); }
.grid td.c { width: 36px; min-width: 36px; height: 42px; position: relative; }
.cell { width: 30px; height: 30px; margin: 4px 3px; border-radius: 8px; border: 1px dashed transparent; background: transparent; cursor: pointer; font-family: var(--f-mono); font-weight: 700; font-size: .8rem; position: relative; transition: transform .05s, border-color .15s; }
.cell:hover:not(:disabled):not(.on) { border-color: var(--line-strong); background: var(--surface-2); }
.cell.on:hover:not(:disabled) { filter: brightness(1.08); }
.cell:disabled { cursor: default; }
.cell.s-D, .cell.s-M { background: var(--day-solid); color: #3a2400; border: 0; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); }
.cell.s-E { background: var(--eve-solid); color: var(--on-shift); border: 0; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); }
.cell.s-N { background: var(--night-solid); color: #fff; border: 0; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); }
.cell.s-L { background: var(--leave-soft); color: var(--leave); border: 1.5px solid var(--leave-solid); }
.cell.warn { outline: 2px solid var(--bad); outline-offset: 1px; }
.cell::after { content: ""; position: absolute; left: 5px; right: 5px; bottom: -5px; height: 3px; border-radius: 2px; }
.av-D .cell::after, .av-M .cell::after { background: var(--day-solid); }
.av-E .cell::after { background: var(--eve-solid); }
.av-N .cell::after { background: var(--night-solid); }
.av-A .cell::after { background: var(--accent); }
.av-X .cell:not(.on) { background: repeating-linear-gradient(135deg, var(--line) 0 3px, transparent 3px 7px); }
.cnt.under { color: var(--bad); font-weight: 800; }
.cnt.full { color: var(--ok); }
.cnt.over { color: var(--warn); font-weight: 800; }
.tot { font-family: var(--f-mono); padding: 0 12px !important; white-space: nowrap; font-weight: 700; }

/* ---------- auth ---------- */
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; min-height: calc(100vh - 48px); align-items: stretch; margin-inline: -16px; margin-block: -24px -72px; }
.auth-hero { background: radial-gradient(120% 90% at 0% 0%, var(--ink-2), var(--ink)); color: var(--on-ink); padding: 28px 24px; display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; }
.auth-hero .brand b { font-size: 1.45rem; }
.auth-hero h2 { font-size: clamp(1.6rem, 4.5vw, 2.5rem); font-weight: 800; letter-spacing: -.025em; color: var(--on-ink); max-width: 16ch; }
.auth-hero h2 em { font-style: normal; color: var(--accent-bright); }
.auth-hero p { color: var(--on-ink-muted); max-width: 42ch; }
.auth-hero ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.auth-hero li { display: flex; gap: 10px; align-items: flex-start; color: var(--on-ink); font-weight: 600; }
.auth-hero li .ico { color: var(--accent-bright); margin-top: 2px; }
.hero-strip { display: flex; gap: 6px; margin-top: auto; }
.hero-strip span { flex: 1; height: 34px; border-radius: 8px; display: grid; place-items: center; font-family: var(--f-mono); font-weight: 700; font-size: .78rem; }
.hero-strip .D { background: var(--day-solid); color: #3a2400; } .hero-strip .E { background: var(--eve-solid); color: #fff; } .hero-strip .N { background: var(--night-solid); color: #fff; } .hero-strip .o { background: rgba(255, 255, 255, .08); color: var(--on-ink-muted); }
.auth { width: 100%; max-width: 460px; margin: 0 auto; padding: 32px 16px 48px; display: flex; flex-direction: column; gap: 18px; justify-content: center; }
.auth h1 { font-size: clamp(1.7rem, 5vw, 2.2rem); }
.auth form.card { display: flex; flex-direction: column; gap: 14px; padding: 22px; box-shadow: var(--shadow); }
.auth .btn.primary { padding-block: 12px; font-size: 1rem; }
@media (min-width: 900px) {
  .auth-wrap { grid-template-columns: minmax(380px, 1.05fr) minmax(0, 1fr); min-height: calc(100vh - 0px); }
  .auth-hero { padding: 48px 56px; gap: 22px; }
  .auth { padding: 48px 40px; }
}
@media (max-width: 899px) { .auth-hero .hero-strip, .auth-hero ul { display: none; } .auth-hero { padding-block: 22px; } }

/* ---------- modal & toast ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(8, 20, 28, .55); backdrop-filter: blur(3px); }
.modal { width: 100%; max-width: 540px; max-height: 90vh; overflow: auto; background: var(--surface); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.modal h2 { font-size: 1.35rem; }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; max-width: calc(100% - 32px); background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: 12px; font-weight: 700; box-shadow: var(--shadow-lg); border-left: 4px solid var(--accent-bright); }
@media (prefers-reduced-motion: no-preference) { .toast { animation: up .22s ease-out; } @keyframes up { from { transform: translate(-50%, 12px); opacity: 0; } } .modal { animation: pop .18s ease-out; } @keyframes pop { from { transform: scale(.97); opacity: 0; } } }

/* ---------- small screens ---------- */
@media (max-width: 600px) {
  body { font-size: 15.5px; }
  .card { padding: 16px; border-radius: 14px; }
  .day { min-height: 60px; padding: 4px; border-radius: 8px; }
  .day .chip { font-size: .66rem; padding: 2px 4px; }
  .day .chip .chip-long { display: none; }
  .cal { gap: 4px; }
  .who > div:nth-child(2) .muted { display: none; }
  .stat .v { font-size: 1.45rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .card.stat { padding: 14px; }
  .grid .name { min-width: 124px; max-width: 136px; padding: 6px 8px; font-size: .84rem; overflow: hidden; text-overflow: ellipsis; }
  .grid .name small { overflow: hidden; text-overflow: ellipsis; }
  .grid .name .role-tag { display: none; }
  .grid tr.role-h th, .grid tr.team-h th { white-space: normal; }
  .grid tr.role-h th { font-size: .88rem; padding: 8px; }
  .grid td.c { width: 34px; min-width: 34px; }
}

/* ---------- footer ---------- */
.site-foot { text-align: center; color: var(--muted); font-size: .82rem; padding-block: 0 28px; }
.site-foot a { color: var(--muted); font-weight: 700; }
.auth .agree { font-size: .82rem; color: var(--muted); }
.auth .agree a { color: var(--accent); font-weight: 700; }

/* ---------- shift editor ---------- */
.shift-table td { white-space: nowrap; }
.shift-table input[type=text] { min-width: 130px; }
.shift-table input[id$="-short"] { min-width: 56px; }
.shift-table input.mil { min-width: 84px; max-width: 96px; font-family: var(--f-mono); letter-spacing: .04em; }
.shift-table input[type=number] { min-width: 76px; max-width: 96px; }

/* ---------- master schedule cell menu ---------- */
.cellmenu { position: fixed; z-index: 60; min-width: 210px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.cellmenu .cm-h { font-size: .75rem; font-weight: 800; color: var(--muted); padding: 4px 8px 6px; white-space: nowrap; }
.cellmenu .cm-sep { font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.cellmenu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 6px 8px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg); font: inherit; font-size: .88rem; text-align: left; cursor: pointer; }
.cellmenu button:hover, .cellmenu button:focus-visible { background: var(--surface-2); outline: none; }
.cellmenu button[aria-checked="true"] { background: var(--accent-soft); }
.cellmenu button b { flex: none; width: 28px; height: 26px; display: grid; place-items: center; border-radius: 7px; font-family: var(--f-mono); font-size: .8rem; background: var(--surface-3); }
.cellmenu button small { color: var(--muted); font-family: var(--f-mono); font-size: .74rem; }
.cellmenu .k-D b { background: var(--day-solid); color: #3a2400; }
.cellmenu .k-E b { background: var(--eve-solid); color: var(--on-shift); }
.cellmenu .k-N b { background: var(--night-solid); color: #fff; }
.cellmenu .k-L b { background: var(--leave-soft); color: var(--leave); box-shadow: inset 0 0 0 1.5px var(--leave-solid); }

/* ---------- printed schedule ---------- */
#printout { display: none; }
@media print {
  @page { size: landscape; margin: 10mm; }
  body > *:not(#printout) { display: none !important; }
  body { background: #fff !important; }
  #printout { display: block; color: #111; font-family: var(--f-body); font-size: 8.5pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #printout .pp { break-after: page; }
  #printout .pp:last-child { break-after: auto; }
  #printout header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; border-bottom: 2px solid #0e2733; padding-bottom: 6px; margin-bottom: 8px; }
  #printout .brand { font-family: var(--f-display); font-weight: 800; color: #0b7c79; font-size: 9pt; letter-spacing: .04em; text-transform: uppercase; }
  #printout h1 { font-family: var(--f-display); font-size: 15pt; margin: 0; color: #0e2733; }
  #printout .sub, #printout .meta { color: #444; font-size: 8.5pt; }
  #printout .meta { text-align: right; }
  #printout table { width: 100%; border-collapse: collapse; table-layout: fixed; }
  #printout th, #printout td { border: 1px solid #c9d3d8; padding: 2px 1px; text-align: center; vertical-align: middle; }
  #printout thead th { background: #eef3f5; font-weight: 600; font-size: 7.5pt; line-height: 1.2; }
  #printout thead th b { font-size: 8.5pt; }
  #printout th.nm { width: 150px; text-align: left; padding: 2px 6px; font-weight: 700; }
  #printout th.nm small { display: block; font-weight: 400; color: #555; font-size: 7pt; }
  #printout th.nm i { font-weight: 400; color: #8a5a00; font-size: 7pt; }
  #printout .tot { width: 50px; font-weight: 700; }
  #printout td.we, #printout th.we { background: #f6f8f9; }
  #printout tr { break-inside: avoid; }
  #printout tr.ph th { background: #0e2733; color: #fff; text-align: left; padding: 3px 6px; font-size: 8.5pt; letter-spacing: .03em; }
  #printout tr.cnt th, #printout tr.cnt td { background: #fbfcfc; font-size: 7.5pt; color: #333; }
  #printout tr.cnt th.nm { font-weight: 600; }
  #printout td.short { color: #b3261e; font-weight: 800; }
  #printout .pc { display: inline-block; min-width: 18px; padding: 1px 3px; border-radius: 4px; font-family: var(--f-mono); font-size: 8pt; border: 1px solid transparent; }
  #printout .pc.D, #printout .pc.M { background: #fde7b8; border-color: #e2a530; }
  #printout .pc.E { background: #f8d4e4; border-color: #d9578f; }
  #printout .pc.N { background: #d9ddfa; border-color: #5263d9; }
  #printout .pc.x { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: #b3261e; opacity: .7; }
  #printout .pc.L { background: #fff; border-color: #6f9a45; color: #3f6a1f; }
  #printout .legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 7.5pt; color: #333; }
  #printout .legend .pc { margin-right: 4px; }
  #printout footer { margin-top: 6px; font-size: 7pt; color: #666; }
}

/* ---------- call-outs / absences (crossed-out shifts) ---------- */
.cell.x { opacity: .55; text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--bad); }
.cell.x::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(to top right, transparent calc(50% - 1px), var(--bad) calc(50% - 1px), var(--bad) calc(50% + 1px), transparent calc(50% + 1px)); }
.day .chip.x { text-decoration: line-through; opacity: .6; }
.flag.bad { color: var(--bad); }
.cellmenu .k-X b { background: var(--bad-soft); color: var(--bad); }

/* ---------- master schedule: week & day views ---------- */
.daynav { gap: 6px; }
.daynav input[type="date"] { width: auto; min-height: 34px; padding: 4px 8px; }
.daynav b { font-family: var(--f-display); font-size: 1.02rem; }
.grid-wrap.week .grid td.c { width: auto; min-width: 64px; }
.grid-wrap.week .cell { width: calc(100% - 8px); min-width: 44px; }
.dayboard { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.dshift { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.dcount { font-family: var(--f-mono); font-weight: 800; font-size: .85rem; }
.dcount.under { color: var(--bad); } .dcount.full { color: var(--ok); } .dcount.over { color: var(--warn); }
.dlist { display: flex; flex-direction: column; gap: 4px; }
.dperson { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-sm); background: var(--surface-2); }
.dperson.x .grow > b { text-decoration: line-through; text-decoration-color: var(--bad); opacity: .65; }
.dfree { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.addchip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; border: 1px dashed var(--line-strong); background: transparent; color: var(--fg); border-radius: var(--r-sm); padding: 5px 9px; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; text-align: left; }
.addchip:hover { border-color: var(--accent); background: var(--accent-soft); }
.addchip small { font-weight: 400; color: var(--muted); font-size: .72rem; }
@media (max-width: 600px) { .dayboard { grid-template-columns: 1fr; } }
