:root {
  --ink: #0E2B2D;
  --ink-2: #163C3E;
  --teal: #12605F;
  --teal-2: #1D7A76;
  --glow: #5CF2D6;
  --mist: #EEF5F3;
  --card: #FFFFFF;
  --line: #D6E6E2;
  --text: #13292B;
  --muted: #5E7775;
  --amber: #B8741A;
  --amber-bg: #FBF0DE;
  --red: #B9423A;
  --red-bg: #FBE7E5;
  --green: #1C7F55;
  --green-bg: #E2F4EC;
  --blue-bg: #E3F1F6;
  --radius-lg: 22px;
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --brand: "Cinzel", "Trajan Pro", Georgia, serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--glow); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { animation: pulse 1.4s ease-in-out infinite; border-radius: 16px; }
@keyframes pulse { 50% { opacity: .5; } }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(32px + var(--safe-t)) 20px calc(24px + var(--safe-b));
  background:
    radial-gradient(70% 45% at 50% 0%, rgba(29,122,118,.10), transparent 70%),
    radial-gradient(60% 40% at 50% 100%, rgba(92,242,214,.08), transparent 70%),
    var(--mist);
}
.brand-block { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 26px; }
.brand-mark { width: 112px; height: 112px; display: block; filter: drop-shadow(0 10px 18px rgba(18,96,95,.18)); }
.brand-block .wordmark { margin-top: 10px; }
.brand-block.small .brand-mark { width: 76px; height: 76px; }
.brand-block.small .wordmark { font-size: 24px; }
.wordmark { font-family: var(--brand); font-weight: 700; color: var(--teal); letter-spacing: .04em; font-size: 32px; margin: 0; line-height: 1.1; }
.tagline { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--teal-2); letter-spacing: .2em; text-transform: uppercase; font-size: 10.5px; font-weight: 600; margin: 8px 0 0; }
.tagline i { width: 1px; height: 11px; background: currentColor; opacity: .5; }
.auth-card {
  width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 20px;
  padding: 26px 24px 20px; box-shadow: 0 1px 2px rgba(14,43,45,.04), 0 18px 40px -18px rgba(14,43,45,.18);
}
.auth-card h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: -.01em; }
.auth-card .lead { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.auth-badge { display: inline-block; font-size: 11px; font-weight: 800; color: var(--ink); background: var(--glow); border-radius: 999px; padding: 3px 10px; margin-bottom: 10px; }
.auth-alt { text-align: center; margin: 14px 0 0; font-size: 13.5px; }
.auth-alt .link, .auth-alt a.link { text-decoration: none; }
.auth-switch { width: 100%; max-width: 400px; margin-top: 14px; }
.auth-switch .btn { width: 100%; background: transparent; }
.auth-switch .btn svg { width: 18px; height: 18px; }
.login-foot { text-align: center; font-size: 12px; color: var(--muted); margin: 22px 0 0; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  transition: border-color .15s;
  appearance: none;
}
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
textarea.input { min-height: 88px; resize: vertical; }
.input:focus { border-color: var(--teal-2); outline: none; box-shadow: 0 0 0 3px rgba(29,122,118,.15); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { background: var(--red-bg); color: var(--red); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 13px 22px; font-weight: 700; font-size: 15px;
  background: var(--teal); color: #fff; transition: transform .08s, background .15s, opacity .15s;
  min-height: 48px; text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--teal); border: 1.5px solid var(--line); }
.btn.soft { background: var(--mist); color: var(--teal); }
.btn.danger { background: var(--red); }
.btn.amber { background: var(--amber); }
.btn.sm { min-height: 36px; padding: 7px 14px; font-size: 13px; }
.btn.glow { background: var(--glow); color: var(--ink); }
.btn.on-dark { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.18); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; color: inherit; }
.icon-btn:hover { background: rgba(0,0,0,.05); }
.link { background: none; border: 0; padding: 0; color: var(--teal); font-weight: 700; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; padding-bottom: calc(84px + var(--safe-b)); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: rgba(238,245,243,.92); backdrop-filter: blur(10px);
}
.topbar .mark { width: 38px; height: 38px; flex: none; border-radius: 11px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; }
.topbar .mark img { width: 28px; height: 28px; display: block; }
.topbar .who { flex: 1; min-width: 0; }
.topbar .who b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .who span { font-size: 12px; color: var(--muted); }
.page { max-width: 760px; margin: 0 auto; padding: 4px 16px 24px; }
.page h1 { font-size: 24px; letter-spacing: -.01em; margin: 8px 0 14px; }
.page h2 { font-size: 16px; margin: 22px 0 10px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  background: #fff; border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + var(--safe-b));
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 6px 0; border-radius: 12px;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--teal); }
.tabbar a.on svg { stroke-width: 2.2; }

/* ---------- Cards & lists ---------- */
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 16px; }
.card + .card { margin-top: 10px; }
.stack > * + * { margin-top: 10px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stats > div { background: #fff; padding: 12px 14px; }
.stats b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stats span { font-size: 12px; color: var(--muted); }
@media (min-width: 560px) { .stats.four { grid-template-columns: repeat(4, 1fr); } .stats.three { grid-template-columns: repeat(3, 1fr); } }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--mist); color: var(--teal); white-space: nowrap; }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.blue { background: var(--blue-bg); color: #1F6B86; }
.pill.grey { background: #EDF0EF; color: #5F6A69; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.seg { display: inline-flex; background: #E2EEEB; border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--teal); box-shadow: 0 1px 3px rgba(14,43,45,.12); }

.navrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0; }
.navrow .label { font-weight: 700; text-align: center; flex: 1; }
.navrow .icon-btn { background: #fff; border: 1px solid var(--line); }

.day {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.day + .day { margin-top: 10px; }
.day-head { display: flex; gap: 12px; align-items: center; padding: 14px; width: 100%; background: none; border: 0; text-align: left; }
.date-chip { width: 48px; flex: none; text-align: center; border-radius: 12px; background: var(--mist); padding: 6px 0; }
.date-chip b { display: block; font-size: 18px; line-height: 1.1; }
.date-chip span { font-size: 11px; color: var(--muted); font-weight: 700; }
.day-main { flex: 1; min-width: 0; }
.day-main .t { font-weight: 700; font-variant-numeric: tabular-nums; }
.day-main .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.day-hours { text-align: right; font-variant-numeric: tabular-nums; }
.day-hours b { display: block; font-size: 17px; }
.day-hours span { font-size: 11px; color: var(--muted); }
.day-body { border-top: 1px solid var(--line); padding: 14px; background: #FBFDFC; font-size: 14px; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.task:last-child { border-bottom: 0; }
.task .st { flex: none; margin-top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.task .st.progress { background: var(--amber); }
.task .st.blocked { background: var(--red); }
.task .tt { flex: 1; }
.task .th { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; font-size: 14px; margin: 10px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.para-label { font-size: 12px; font-weight: 700; color: var(--muted); margin: 12px 0 2px; }
.para { margin: 0; white-space: pre-wrap; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

.banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; margin-bottom: 12px; }
.banner.amber { background: var(--amber-bg); color: #7A4C0E; }
.banner.blue { background: var(--blue-bg); color: #18566C; }
.banner.red { background: var(--red-bg); color: var(--red); }
.banner .grow { flex: 1; }

/* ---------- Shift panel (the signature element) ---------- */
.panel {
  position: relative; overflow: hidden;
  background: var(--ink);
  color: #E6F4F1;
  border-radius: var(--radius-lg);
  padding: 18px 18px 20px;
  isolation: isolate;
}
.panel::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' fill='none' stroke='%232FA596' stroke-width='1'%3E%3Cpath d='M0 40h40l20 20h50M110 60v40l20 20h30M20 160v-40l20-20h30M90 0v20l-20 20M160 90h-30l-15-15'/%3E%3Ccircle cx='110' cy='60' r='3'/%3E%3Ccircle cx='70' cy='100' r='3'/%3E%3Ccircle cx='130' cy='120' r='3'/%3E%3C/svg%3E");
  mask-image: radial-gradient(80% 70% at 50% 40%, #000 20%, transparent 80%);
}
.panel::after {
  content: ""; position: absolute; z-index: -1; width: 340px; height: 340px; left: 50%; top: 10px; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(92,242,214,.16), transparent 62%);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.panel-head .shiftname { font-weight: 700; color: #fff; }
.panel-head .date { color: #9CC4BF; }
.ring-wrap { position: relative; width: 268px; max-width: 100%; margin: 6px auto 0; aspect-ratio: 1; }
.ring-wrap svg { width: 100%; height: 100%; display: block; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-bottom: 14px; }
.ring-center .big { font-size: 48px; font-weight: 800; letter-spacing: -.03em; color: #fff; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-center .big small { font-size: 20px; font-weight: 700; color: #8FB9B3; margin-left: 2px; }
.ring-center .cap { font-size: 13px; color: #9CC4BF; margin-top: 8px; }
.ring-center .state { margin-top: 10px; }
.ring-ends { display: flex; justify-content: space-between; font-size: 12px; color: #9CC4BF; margin: -26px 18px 0; position: relative; }
.ring-ends b { color: #fff; display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.ring-ends div:last-child { text-align: right; }
.panel-actions { display: grid; gap: 10px; margin-top: 18px; }
.panel-actions.two { grid-template-columns: 1fr 1.3fr; }
.panel-note { text-align: center; font-size: 13px; color: #9CC4BF; margin-top: 12px; }
.panel .pill { background: rgba(255,255,255,.1); color: #CFE9E4; }
.panel .pill.amber { background: rgba(232,163,61,.18); color: #F3C47E; }
.panel .pill.green { background: rgba(92,242,214,.14); color: var(--glow); }
.panel .pill.blue { background: rgba(130,200,230,.16); color: #A9DBF0; }

/* ---------- KPI ---------- */
.score {
  display: flex; align-items: center; gap: 18px;
}
.score .n { font-size: 64px; font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--teal); font-variant-numeric: tabular-nums; }
.score .n small { font-size: 20px; color: var(--muted); font-weight: 700; }
.score .g { font-weight: 800; font-size: 18px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; margin: 12px 0; font-size: 14px; }
.bar-row .w { font-size: 12px; color: var(--muted); }
.bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: #E3EEEB; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--teal-2); }
.bar i.amber { background: var(--amber); }
.bar i.red { background: var(--red); }

/* leaderboard */
.lb { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.lb th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lb td { padding: 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb tr:last-child td { border-bottom: 0; }
.lb tr.click { cursor: pointer; }
.lb tr.click:hover td { background: #F6FAF9; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.minibar { width: 80px; height: 6px; border-radius: 999px; background: #E3EEEB; display: inline-block; vertical-align: middle; margin-left: 8px; overflow: hidden; }
.minibar i { display: block; height: 100%; background: var(--teal-2); }

/* ---------- Admin ---------- */
.counts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.count { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.count b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.count span { font-size: 12px; color: var(--muted); font-weight: 600; }
.count.hero { grid-column: 1 / -1; background: var(--ink); color: #fff; border-color: var(--ink); display: flex; align-items: center; justify-content: space-between; }
.count.hero span { color: #9CC4BF; }
.count.hero .of { font-size: 16px; color: #8FB9B3; font-weight: 700; }
@media (min-width: 640px) { .counts { grid-template-columns: repeat(4, 1fr); } .count.hero { grid-column: span 2; } }

.shift-group { margin-top: 18px; }
.shift-group h3 { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; margin: 0 0 8px; }
.shift-group h3 span { font-weight: 600; color: var(--muted); font-size: 12px; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); width: 100%; text-align: left; }
.person + .person { margin-top: 8px; }
.avatar { width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--mist); color: var(--teal); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.person .pm { flex: 1; min-width: 0; }
.person .pm b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .pm span { font-size: 12px; color: var(--muted); }
.person .pr { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.person .pr .pill { margin-bottom: 3px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px; }
.toolbar .field { margin: 0; flex: 1 1 140px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 13px; color: var(--muted); }
.chip.on { border-color: var(--teal); background: var(--teal); color: #fff; }
.cred { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 16px; margin: 12px 0; font-variant-numeric: tabular-nums; }
.cred div { display: flex; justify-content: space-between; padding: 6px 0; }
.cred div + div { border-top: 1px solid rgba(255,255,255,.12); }
.cred span { color: #9CC4BF; }
.cred b { font-size: 17px; letter-spacing: .02em; }

/* desktop admin layout */
.side { display: none; }
@media (min-width: 980px) {
  .shell.admin { display: grid; grid-template-columns: 240px 1fr; padding-bottom: 0; }
  .shell.admin .side {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
    background: var(--ink); color: #CFE9E4; padding: 20px 14px;
  }
  .side .brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 24px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.07); }
  .side .brand-tile { width: 44px; height: 44px; flex: none; border-radius: 13px; background: #fff; display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 6px 16px rgba(0,0,0,.25); }
  .side .brand-tile img { width: 34px; height: 34px; display: block; }
  .side .brand b { font-family: var(--brand); color: #fff; font-size: 17px; letter-spacing: .04em; display: block; line-height: 1.2; }
  .side .brand span { font-size: 11px; color: #8FB9B3; }
  .side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #CFE9E4; text-decoration: none; font-weight: 600; font-size: 14px; }
  .side a svg { width: 20px; height: 20px; }
  .side a:hover { background: rgba(255,255,255,.06); }
  .side a.on { background: rgba(92,242,214,.12); color: var(--glow); }
  .side .grow { flex: 1; }
  .shell.admin .tabbar { display: none; }
  .shell.admin .topbar .mark, .shell.admin .topbar .gear { display: none; }
  .shell.admin .page { max-width: 1080px; padding: 8px 32px 40px; }
}

/* ---------- Sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(9,28,30,.5); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease; }
.sheet {
  background: var(--mist); width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto;
  border-radius: 22px 22px 0 0; padding: 8px 18px calc(22px + var(--safe-b));
  animation: up .24s cubic-bezier(.2,.8,.2,1);
}
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: #C3D6D2; margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; font-size: 19px; }
@media (min-width: 700px) { .scrim { align-items: center; } .sheet { border-radius: 22px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.task-edit { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.task-edit .top { display: flex; gap: 8px; }
.task-edit .top .input { flex: 1; }
.task-edit .bottom { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.task-edit .bottom .seg { flex: 1; }
.task-edit .bottom .seg button { flex: 1; padding: 6px 8px; font-size: 12px; }
.task-edit .hrs { width: 84px; }
.sticky-foot { position: sticky; bottom: calc(-22px - var(--safe-b)); background: var(--mist); padding: 12px 0 calc(4px); margin-top: 8px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .22s; z-index: 90; max-width: calc(100% - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--red); }

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

/* ---------- Payroll ---------- */
.pay-head { padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.pay-head span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.pay-head b { display: block; font-size: 36px; font-weight: 800; letter-spacing: -.03em; color: var(--teal); line-height: 1.15; }
.pay-head small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pay-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.pay-line:last-child { border-bottom: 0; }
.pay-line small { display: block; font-size: 12px; color: var(--muted); }
.pay-line b { white-space: nowrap; }
.pay-line.minus b { color: var(--red); }
.pay-line.plus b { color: #1F6B86; }
.pay-line.total { border-bottom-style: solid; }
.pay-line.total span { font-weight: 800; }
.pay-line.total b { font-size: 17px; }
.topbar a.avatar { width: 36px; height: 36px; font-size: 13px; }

/* ---------- Departments & awards ---------- */
.dep-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-bottom: 4px; scrollbar-width: none; }
.dep-chips::-webkit-scrollbar { display: none; }
.dep-chips .chip { white-space: nowrap; flex: none; }
.dept-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .dept-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .dept-grid { grid-template-columns: repeat(3, 1fr); } }
.dept { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.dept:hover { border-color: var(--teal-2); }
.dept-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dept-top span { font-size: 12px; color: var(--muted); }
.dept-score { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--teal); }
.dept-score small { font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: 0; }
.dept-meta { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 2px 8px; font-size: 12px; margin: 2px 0 0; }
.dept-meta dt { color: var(--muted); } .dept-meta dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.dept-best { display: flex; align-items: center; gap: 6px; font-size: 13px; border-top: 1px dashed var(--line); padding-top: 8px; }
.dept-best svg { width: 16px; height: 16px; color: var(--amber); flex: none; }

.award { position: relative; overflow: hidden; background: var(--ink); color: #E6F4F1; border-radius: var(--radius-lg); padding: 16px 18px 18px; margin-bottom: 6px; isolation: isolate; }
.award::after { content: ""; position: absolute; z-index: -1; width: 280px; height: 280px; right: -80px; top: -110px; background: radial-gradient(circle, rgba(232,163,61,.22), transparent 65%); }
.award-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #F3C47E; font-weight: 700; }
.award-head svg { width: 20px; height: 20px; }
.award-head .pill { margin-left: auto; background: rgba(255,255,255,.1); color: #CFE9E4; }
.award-win { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.award-av { width: 56px; height: 56px; flex: none; border-radius: 18px; display: grid; place-items: center; font-weight: 800; font-size: 19px; color: var(--ink); background: linear-gradient(135deg, #F3C47E, #E8A33D); box-shadow: 0 0 0 3px rgba(243,196,126,.25); }
.award-win b { display: block; font-size: 21px; color: #fff; letter-spacing: -.01em; line-height: 1.2; }
.award-win span { font-size: 13px; color: #9CC4BF; }
.award-score { margin-left: auto; font-size: 30px; font-weight: 800; color: #fff; }
.award-score small { font-size: 13px; color: #8FB9B3; }
.award-none { margin: 12px 0 0; font-size: 14px; color: #9CC4BF; }
.award-deps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; margin-top: 16px; background: rgba(255,255,255,.1); border-radius: 12px; overflow: hidden; }
.award-deps div { background: var(--ink-2); padding: 10px 12px; position: relative; }
.award-deps span { display: block; font-size: 11px; color: #8FB9B3; font-weight: 600; }
.award-deps b { display: block; font-size: 14px; color: #fff; padding-right: 26px; }
.award-deps i { position: absolute; right: 10px; bottom: 10px; font-style: normal; font-size: 12px; font-weight: 800; color: var(--glow); }
.dep-row { display: flex; gap: 8px; margin-bottom: 8px; }
.dep-row .input { flex: 1; }
