/* Whipped Rota – design tokens follow the Whipped Desserts brand: hot pink, sunshine yellow, ink black, Poppins. */
:root {
  --pink: #F61C96;
  --pink-strong: #D60F7F;
  --pink-soft: #FFE8F4;
  --pink-glow: rgba(246, 28, 150, .28);
  --yellow: #FFE000;
  --yellow-soft: #FFF8C2;
  --ink: #141116;
  --ink-2: #3B3540;
  --muted: #7A7280;
  --bg: #FBF7FA;
  --surface: #FFFFFF;
  --surface-2: #F6F0F4;
  --line: #EDE4EA;
  --green: #12A150;
  --green-soft: #E4F7EC;
  --orange: #E86A00;
  --orange-soft: #FFF0E0;
  --red: #E0243A;
  --red-soft: #FDE7EA;
  --sidebar: #141116;
  --sidebar-ink: #F6F1F5;
  --shadow-sm: 0 1px 2px rgba(20, 17, 22, .06);
  --shadow: 0 6px 24px -8px rgba(20, 17, 22, .14), 0 1px 2px rgba(20, 17, 22, .05);
  --shadow-lg: 0 24px 60px -20px rgba(20, 17, 22, .35);
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pink-soft: #3A1029; --pink-glow: rgba(246, 28, 150, .4);
    --yellow-soft: #3A3410;
    --ink: #F5F0F4; --ink-2: #D9D1D7; --muted: #A59BA9;
    --bg: #0F0C10; --surface: #1A161C; --surface-2: #231E26; --line: #2E2832;
    --green-soft: #0E2E1C; --orange-soft: #33200C; --red-soft: #3A1218;
    --sidebar: #0A080B;
    --shadow: 0 8px 28px -10px rgba(0, 0, 0, .6); --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --pink-soft: #3A1029; --pink-glow: rgba(246, 28, 150, .4);
  --yellow-soft: #3A3410;
  --ink: #F5F0F4; --ink-2: #D9D1D7; --muted: #A59BA9;
  --bg: #0F0C10; --surface: #1A161C; --surface-2: #231E26; --line: #2E2832;
  --green-soft: #0E2E1C; --orange-soft: #33200C; --red-soft: #3A1218;
  --sidebar: #0A080B;
  --shadow: 0 8px 28px -10px rgba(0, 0, 0, .6); --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--pink); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- boot / splash ---------- */
.splash { min-height: 100vh; display: grid; place-items: center; }
.splash .brand { transform: scale(1.4); }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--pink-soft); border-top-color: var(--pink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(140deg, #FF4FB0, var(--pink) 55%, #B80C6C); color: #fff;
  box-shadow: 0 6px 16px -6px var(--pink-glow), inset 0 1px 0 rgba(255,255,255,.35);
  font-size: 20px; font-style: italic; letter-spacing: -.04em;
}
.brand-name { font-size: 20px; font-style: italic; letter-spacing: -.03em; color: inherit; }
.brand-chip { font-size: 10px; font-style: normal; letter-spacing: .12em; text-transform: uppercase; background: var(--yellow); color: #141116; padding: 3px 7px; border-radius: 999px; font-weight: 700; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.shell > div { min-width: 0; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--sidebar); color: var(--sidebar-ink);
  display: flex; flex-direction: column; padding: 22px 14px; gap: 22px;
}
.sidebar .brand { padding: 0 8px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: #BDB3BB;
  text-decoration: none; font-weight: 500; font-size: 14.5px; transition: background .15s, color .15s; position: relative;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: linear-gradient(90deg, rgba(246,28,150,.22), rgba(246,28,150,.06)); color: #fff; }
.nav-link.active::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--pink); }
.nav-link .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.05); }
.sidebar-foot .who { min-width: 0; }
.sidebar-foot .who b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who span { font-size: 12px; color: #9C929B; text-transform: capitalize; }

.main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 48px; max-width: 1280px; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { font-size: 26px; font-weight: 700; }
.topbar .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.topbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.mobile-head { display: none; }
.tabbar { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main { padding: 12px 16px calc(var(--tabbar-h) + var(--safe-b) + 24px); }
  .mobile-head {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  }
  .mobile-head .brand-mark { width: 32px; height: 32px; font-size: 17px; border-radius: 10px; }
  .mobile-head .brand-name { font-size: 18px; }
  .topbar h1 { font-size: 22px; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 30; left: 10px; right: 10px;
    bottom: calc(var(--safe-b) + 10px); height: var(--tabbar-h); border-radius: 22px; padding: 6px;
    background: color-mix(in srgb, var(--sidebar) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-lg);
  }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #A99FA8; text-decoration: none; font-size: 10.5px; font-weight: 600; border-radius: 16px; position: relative; }
  .tab.active { color: #fff; background: rgba(246, 28, 150, .22); }
  .tab.active svg { color: var(--pink); }
  .tab .dot { position: absolute; top: 8px; right: calc(50% - 18px); width: 8px; height: 8px; background: var(--yellow); border-radius: 50%; box-shadow: 0 0 0 2px var(--sidebar); }
}

/* ---------- primitives ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card h2 { font-size: 16px; font-weight: 700; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: transform .08s, background .15s, box-shadow .15s, border-color .15s; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: color-mix(in srgb, var(--pink) 35%, var(--line)); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--pink); border-color: var(--pink); color: #fff; box-shadow: 0 8px 20px -10px var(--pink-glow); }
.btn.primary:hover { background: var(--pink-strong); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.icon { width: 42px; padding: 0; }
.btn.sm.icon { width: 34px; }
.btn.block { width: 100%; }
.btn.lg { height: 54px; font-size: 16px; border-radius: 16px; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.pink { background: var(--pink-soft); color: var(--pink); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.orange { background: var(--orange-soft); color: var(--orange); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.yellow { background: var(--yellow-soft); color: #7A6400; }
:root[data-theme="dark"] .pill.yellow { color: var(--yellow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.yellow { color: var(--yellow); } }
.pill .live { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--yellow); color: #141116; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }

.avatar { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; flex: none; }
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 12px; }
.avatar.lg { width: 52px; height: 52px; border-radius: 16px; font-size: 20px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; }
.input, select.input, textarea.input {
  height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  outline: none; transition: border-color .15s, box-shadow .15s; width: 100%; min-width: 0;
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; min-height: 80px; }
.input:focus { border-color: var(--pink); box-shadow: 0 0 0 4px var(--pink-soft); }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.seg { display: inline-flex; background: var(--surface-2); padding: 4px; border-radius: 12px; gap: 2px; }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.err { color: var(--red); font-size: 13px; font-weight: 500; min-height: 0; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at -10% -10%, #FF5DB8 0%, transparent 55%), radial-gradient(800px 500px at 110% 110%, #FFE000 0%, transparent 45%), linear-gradient(150deg, #E2117F, #9E0A5C 60%, #141116);
}
.auth-hero h2 { font-size: clamp(30px, 4vw, 46px); font-weight: 800; letter-spacing: -.03em; max-width: 12ch; }
.auth-hero p { opacity: .85; max-width: 36ch; }
.auth-hero .blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .18; background: #fff; }
.auth-hero .brand-mark { background: #fff; color: var(--pink); }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 28px; font-weight: 700; margin-bottom: 6px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 22px 70px; min-height: 0; border-radius: 0 0 32px 32px; }
  .auth-hero h2 { font-size: 30px; margin-top: 26px; }
  .auth-hero p { display: none; }
  .auth-panel { margin-top: -50px; align-items: start; }
  .auth-card { background: var(--surface); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-lg); }
}

/* ---------- home ---------- */
.hero-card {
  position: relative; overflow: hidden; border-radius: 28px; padding: 24px; color: #fff;
  background: radial-gradient(500px 260px at 100% 0%, rgba(255,224,0,.45), transparent 60%), linear-gradient(140deg, #FF3DA8, var(--pink) 45%, #A50A63);
  box-shadow: 0 24px 50px -24px var(--pink-glow);
}
.hero-card.off { background: radial-gradient(500px 260px at 100% 0%, rgba(246,28,150,.35), transparent 60%), linear-gradient(140deg, #2A2230, #141116); }
.hero-card .greet { font-size: 14px; opacity: .85; }
.hero-card h2 { font-size: 26px; font-weight: 700; margin: 4px 0 14px; }
.hero-card .timer { font-size: 54px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.hero-card .meta { display: flex; gap: 18px; flex-wrap: wrap; margin: 14px 0 20px; font-size: 14px; }
.hero-card .meta div { display: flex; align-items: center; gap: 6px; opacity: .92; }
.clock-btn {
  height: 58px; border-radius: 18px; border: 0; padding: 0 26px; font-size: 17px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px; background: #fff; color: var(--pink); box-shadow: 0 12px 28px -12px rgba(0,0,0,.45);
  transition: transform .1s;
}
.clock-btn:active { transform: scale(.97); }
.clock-btn.out { background: var(--yellow); color: #141116; }
.hero-card .deco { position: absolute; right: -40px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid rgba(255,255,255,.12); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
@media (max-width: 520px) { .stat-grid { grid-template-columns: 1fr 1fr; } .stat .value { font-size: 22px; } }
.stat { padding: 16px 18px; }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 12.5px; color: var(--muted); }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pink), #FF7BC4); }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list-item .main-txt { flex: 1; min-width: 0; }
.list-item .main-txt b { display: block; font-weight: 600; font-size: 14.5px; }
.list-item .main-txt span { font-size: 13px; color: var(--muted); }
.day-badge { width: 48px; text-align: center; border-radius: 12px; padding: 6px 0; background: var(--surface-2); flex: none; }
.day-badge b { display: block; font-size: 18px; line-height: 1.1; }
.day-badge span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.day-badge.today { background: var(--pink); color: #fff; }
.day-badge.today span { color: rgba(255,255,255,.85); }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 6px; }

/* ---------- week toolbar ---------- */
.week-nav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.week-nav .label { padding: 0 10px; font-weight: 600; font-size: 14px; min-width: 150px; text-align: center; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- rota grid ---------- */
.rota-wrap { overflow-x: auto; }
.rota { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 920px; }
.rota th, .rota td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; }
.rota th:last-child, .rota td:last-child { border-right: 0; }
.rota thead th { padding: 12px 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; background: var(--surface); position: sticky; top: 0; }
.rota thead th b { display: block; font-size: 15px; color: var(--ink); }
.rota thead th.today b { color: var(--pink); }
.rota thead th.today { box-shadow: inset 0 -3px 0 var(--pink); }
.rota .who { padding: 12px 12px; width: 180px; min-width: 160px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.rota .who .row { gap: 10px; }
.rota .who b { font-size: 14px; display: block; }
.rota .who small { color: var(--muted); font-size: 12px; }
.rota td.cell { padding: 5px; min-width: 92px; height: 64px; position: relative; }
.rota td.cell.today { background: color-mix(in srgb, var(--pink-soft) 45%, transparent); }
.rota tfoot td { padding: 10px 8px; font-size: 12.5px; text-align: center; color: var(--muted); font-weight: 600; background: var(--surface-2); border-bottom: 0; }
.rota tfoot td b { color: var(--ink); font-size: 14px; display: block; }
.rota tbody tr:hover .who, .rota tbody tr:hover td.cell { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.shift-chip {
  display: block; width: 100%; text-align: left; border: 0; cursor: pointer; border-radius: 10px; padding: 7px 9px; margin-bottom: 4px;
  background: color-mix(in srgb, var(--c, var(--pink)) 14%, var(--surface)); border-left: 4px solid var(--c, var(--pink));
  font-size: 12px; font-weight: 600; line-height: 1.3; transition: transform .1s, box-shadow .15s; color: var(--ink);
  white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.01em; padding: 6px 7px;
}
.shift-chip:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.shift-chip small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.shift-chip[disabled] { cursor: default; transform: none; box-shadow: none; }
.add-cell { width: 100%; height: 100%; min-height: 50px; border: 1.5px dashed transparent; border-radius: 10px; background: transparent; color: transparent; cursor: pointer; display: grid; place-items: center; transition: all .15s; }
td.cell:hover .add-cell, .add-cell:focus-visible { border-color: var(--line); color: var(--pink); background: var(--surface); }
.add-cell.small { min-height: 26px; height: 26px; }
.hours-bar { height: 4px; border-radius: 4px; background: var(--surface-2); margin-top: 6px; overflow: hidden; width: 100%; }
.hours-bar i { display: block; height: 100%; background: var(--c, var(--pink)); }

/* mobile day view */
.day-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.day-strip::-webkit-scrollbar { display: none; }
.day-pill { flex: none; width: 56px; padding: 8px 0; border-radius: 16px; text-align: center; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.day-pill span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.day-pill b { font-size: 18px; }
.day-pill small { display: block; font-size: 10.5px; color: var(--muted); }
.day-pill.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.day-pill.on span, .day-pill.on small { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.day-pill.today:not(.on) { border-color: var(--pink); }
.desktop-only { display: block; }
.mobile-only { display: none; }
@media (max-width: 900px) { .desktop-only { display: none; } .mobile-only { display: block; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; }
table.data tfoot td { font-weight: 700; background: var(--surface-2); }
.diff-pos { color: var(--red); font-weight: 600; }
.diff-neg { color: var(--orange); font-weight: 600; }

/* entries */
.entry { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; }
.entry .times { font-weight: 600; font-variant-numeric: tabular-nums; }
.entry .sub { font-size: 12.5px; color: var(--muted); }
.entry .acts { display: flex; gap: 6px; align-items: center; }
.person-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.person-head .tot { margin-left: auto; text-align: right; font-size: 13px; color: var(--muted); }
.person-head .tot b { display: block; font-size: 17px; color: var(--ink); }

/* team */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.member { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.member .top { display: flex; gap: 12px; align-items: center; }
.member .top b { font-size: 15.5px; }
.member .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; }
.member .facts div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.member .facts span { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.member.inactive { opacity: .6; }

/* ---------- sheet / modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(15, 10, 16, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fade .18s ease; }
.sheet { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 26px; box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 22px 6px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sheet-head h2 { font-size: 19px; font-weight: 700; }
.sheet-body { padding: 12px 22px 8px; }
.sheet-foot { display: flex; gap: 10px; padding: 14px 22px 22px; position: sticky; bottom: 0; background: var(--surface); }
.sheet-foot .btn { flex: 1; }
.calc-box { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 14px; background: var(--pink-soft); color: var(--pink); font-weight: 600; }
.calc-box b { font-size: 22px; }
@media (max-width: 600px) {
  .overlay { place-items: end center; padding: 0; }
  .sheet { max-width: none; border-radius: 26px 26px 0 0; max-height: 92vh; animation: up .26s cubic-bezier(.2, .9, .3, 1); padding-bottom: var(--safe-b); }
  .sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 5px; background: var(--line); margin: 10px auto 0; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes up { from { transform: translateY(100%); } }

/* toast */
.toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 24px); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (max-width: 900px) { .toasts { bottom: calc(var(--tabbar-h) + var(--safe-b) + 22px); } }
.toast { pointer-events: auto; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; animation: pop .2s ease; max-width: 90vw; }
.toast.error { background: var(--red); color: #fff; }
.toast.ok svg { color: #4ADE80; }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; background: var(--yellow-soft); margin-bottom: 16px; font-size: 14px; }
.banner.pink { background: var(--pink-soft); }
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 300; background: var(--ink); color: var(--bg); text-align: center; font-size: 13px; padding: 6px; font-weight: 600; }

.fade-in { animation: fadeup .3s ease both; }
@keyframes fadeup { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
