/* =========================================================================
   HERO Card — design system
   Navy (trust, industrial) + safety orange (action). S/I/C semantic colours.
   ========================================================================= */
:root {
  color-scheme: light;
  --navy-950: #071629; --navy-900: #0B2545; --navy-800: #13315C; --navy-700: #1D4373;
  --orange: #F2620F; --orange-600: #DB5307; --orange-50: #FFF2EA;
  --bg: #F3F5F9; --surface: #FFFFFF; --surface-2: #F7F9FC; --sunken: #EEF2F7;
  --ink: #0E1726; --ink-2: #3C4A5E; --muted: #6B7A90; --line: #E3E8EF; --line-2: #D3DAE4;
  --s: #12925A; --s-bg: #E5F6EE; --s-ink: #0B6B41;
  --i: #D93636; --i-bg: #FDECEC; --i-ink: #A51F1F;
  --c: #2F6FDB; --c-bg: #E8F0FD; --c-ink: #1F51A8;
  --warn: #C27803;
  --shadow-sm: 0 1px 2px rgba(14, 23, 38, .06), 0 1px 1px rgba(14, 23, 38, .04);
  --shadow: 0 1px 2px rgba(14, 23, 38, .05), 0 8px 24px -8px rgba(14, 23, 38, .12);
  --shadow-lg: 0 24px 48px -16px rgba(7, 22, 41, .35);
  --r-sm: 10px; --r: 14px; --r-lg: 20px;
  --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0A1322; --surface: #111C2E; --surface-2: #15223A; --sunken: #0D1828;
    --ink: #E8EEF7; --ink-2: #B6C2D3; --muted: #8494AB; --line: #1F2D44; --line-2: #2A3B57;
    --s: #2BB673; --s-bg: rgba(43, 182, 115, .14); --s-ink: #5FD69B;
    --i: #F05252; --i-bg: rgba(240, 82, 82, .15); --i-ink: #FF8A8A;
    --c: #4F8BF0; --c-bg: rgba(79, 139, 240, .16); --c-ink: #8DB4FA;
    --orange-50: rgba(242, 98, 15, .14);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A1322; --surface: #111C2E; --surface-2: #15223A; --sunken: #0D1828;
  --ink: #E8EEF7; --ink-2: #B6C2D3; --muted: #8494AB; --line: #1F2D44; --line-2: #2A3B57;
  --s: #2BB673; --s-bg: rgba(43, 182, 115, .14); --s-ink: #5FD69B;
  --i: #F05252; --i-bg: rgba(240, 82, 82, .15); --i-ink: #FF8A8A;
  --c: #4F8BF0; --c-bg: rgba(79, 139, 240, .16); --c-ink: #8DB4FA;
  --orange-50: rgba(242, 98, 15, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; 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; font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.015em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--sunken); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.ic { flex: none; display: inline-block; vertical-align: middle; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; display: flex; justify-content: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- boot ---------- */
.boot { min-height: 100dvh; display: grid; place-items: center; background: var(--navy-900); }
.boot img { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 14.5px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; user-select: none;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .6; pointer-events: none; }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 15.5px; border-radius: 14px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--navy-900); color: #fff; box-shadow: 0 6px 16px -6px rgba(11, 37, 69, .55); }
.btn-primary:hover { background: var(--navy-800); }
:root[data-theme="dark"] .btn-primary { background: var(--orange); box-shadow: 0 6px 16px -6px rgba(242, 98, 15, .5); }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .btn-primary { background: var(--orange); box-shadow: 0 6px 16px -6px rgba(242, 98, 15, .5); } }
.btn-accent { background: var(--orange); color: #fff; box-shadow: 0 8px 20px -8px rgba(242, 98, 15, .7); }
.btn-accent:hover { background: var(--orange-600); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-ghost-light { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .25); }
.btn-soft { background: var(--s-bg); color: var(--s-ink); }
.btn-danger { background: var(--i-bg); color: var(--i-ink); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.link { display: inline-flex; align-items: center; gap: 2px; color: var(--orange-600); font-weight: 600; font-size: 13.5px; background: none; border: 0; padding: 0; }

/* ---------- form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; text-transform: none; }
.field input, .field textarea, .field select, .filters select, .filters input {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; font-size: 16px;
}
.field textarea { resize: vertical; min-height: 92px; }
.field input:focus, .field textarea:focus, .field select:focus, .filters select:focus, .filters input:focus {
  border-color: var(--orange); box-shadow: 0 0 0 4px rgba(242, 98, 15, .15);
}
.field input.ro { background: var(--sunken); color: var(--muted); }
.field small { color: var(--warn); font-size: 12px; font-weight: 500; }
.field.need textarea { border-color: color-mix(in srgb, var(--warn) 55%, var(--line-2)); }
.form-error { color: var(--i-ink); background: var(--i-bg); padding: 10px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 500; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.login-hero {
  position: relative; overflow: hidden; color: #fff; display: flex; align-items: center; padding: 64px;
  background:
    radial-gradient(900px 500px at 110% -10%, rgba(242, 98, 15, .35), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(47, 111, 219, .35), transparent 60%),
    linear-gradient(160deg, var(--navy-800), var(--navy-950));
}
.login-hero::after {
  content: ""; position: absolute; inset: 0; opacity: .07;
  background-image: repeating-linear-gradient(-45deg, #fff 0 14px, transparent 14px 28px);
  mask-image: linear-gradient(to bottom, transparent 55%, #000);
}
.login-hero-inner { position: relative; z-index: 1; max-width: 460px; }
.login-hero h1, .login-mobile-brand h1 { font-size: 48px; font-weight: 800; letter-spacing: -.03em; margin: 22px 0 10px; }
.login-hero h1 span, .login-mobile-brand h1 span { color: var(--orange); }
.login-hero p { font-size: 18px; color: rgba(255, 255, 255, .78); }
.hero-points { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 14px; }
.hero-points li { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .9); font-weight: 500; }
.hero-points .ic { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .1); color: var(--orange); }
.login-panel { display: grid; place-items: center; padding: 32px 24px calc(32px + var(--safe-b)); }
.login-form { width: 100%; max-width: 380px; display: grid; gap: 18px; }
.login-form h2 { font-size: 26px; }
.login-mobile-brand { display: none; }
.lang-switch { display: flex; justify-content: center; gap: 6px; }
.lang-switch button { border: 0; background: none; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13px; }
.lang-switch button.on { background: var(--sunken); color: var(--ink); }
.demo { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 12px 14px; background: var(--surface-2); }
.demo summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; list-style: none; }
.demo summary::-webkit-details-marker { display: none; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 8px; }
.demo-grid button { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); }
.demo-grid button:hover { border-color: var(--orange); }
.demo-grid button .ic { color: var(--orange); }
.demo-grid b { display: block; font-size: 13.5px; } .demo-grid span { font-size: 11px; color: var(--muted); word-break: break-all; }

@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; background: var(--bg); }
  .login-hero { display: none; }
  .login-panel { align-items: start; padding-top: calc(48px + var(--safe-t)); }
  .login-mobile-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 8px; }
  .login-mobile-brand h1 { font-size: 34px; margin: 12px 0 0; }
  .login-form h2 { font-size: 20px; }
}

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 8px; padding: 20px 14px;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950)); color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 20px; }
.brand b { display: block; font-size: 17px; letter-spacing: -.01em; }
.brand span { font-size: 12px; color: rgba(255, 255, 255, .55); }
.side-nav { display: grid; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: rgba(255, 255, 255, .72); font-weight: 500; transition: background .15s, color .15s; }
.side-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav a.active { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
.side-nav a.side-cta { order: -1; margin-bottom: 10px; background: var(--orange); color: #fff; justify-content: center; font-weight: 700; box-shadow: 0 10px 24px -10px rgba(242, 98, 15, .8); }
.side-nav a.side-cta:hover { background: var(--orange-600); }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); }
.side-user div { flex: 1; min-width: 0; } .side-user b { display: block; font-size: 13.5px; } .side-user span { font-size: 12px; color: rgba(255, 255, 255, .55); }
.side-user .icon-btn { color: rgba(255, 255, 255, .6); } .side-user .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.main-col { min-width: 0; }
.view { max-width: 1240px; margin: 0 auto; padding: 32px 36px 48px; outline: none; }
.view.enter { animation: enter .28s cubic-bezier(.2, .7, .2, 1); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.net-banner { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; font-size: 13px; font-weight: 600; }
.net-banner.off { background: #3A2A06; color: #FFD58A; } .net-banner.sync { background: var(--c-bg); color: var(--c-ink); }
.tabbar { display: none; }
.mobile-only { display: none !important; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .view { padding: calc(20px + var(--safe-t)) 16px calc(var(--tabbar-h) + 28px + var(--safe-b)); }
  .mobile-only { display: inline-grid !important; } .desktop-only { display: none !important; }
  .tabbar {
    display: flex; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + var(--safe-b));
    padding: 0 6px var(--safe-b); background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-top: 1px solid var(--line);
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; }
  .tabbar a.active { color: var(--orange-600); }
  .tabbar a.active:not(.tab-fab) .ic { transform: translateY(-1px); }
  .tab-fab .fab {
    display: grid; place-items: center; width: 56px; height: 56px; margin-top: -26px; border-radius: 18px; color: #fff;
    background: linear-gradient(150deg, #FF8A3D, var(--orange-600)); box-shadow: 0 12px 24px -8px rgba(242, 98, 15, .75), 0 0 0 5px var(--bg);
    transition: transform .15s;
  }
  .tab-fab:active .fab { transform: scale(.94); }
  .net-banner { padding-top: calc(8px + var(--safe-t)); }
}

/* ---------- page parts ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 750; }
.eyebrow { font-size: 12.5px; font-weight: 700; color: var(--orange-600); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.head-actions { display: flex; gap: 10px; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.back-link:hover { color: var(--ink); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.h-sm { font-size: 13px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 8px; display: flex; gap: 6px; align-items: center; }
.prose { white-space: pre-wrap; margin-bottom: 18px; color: var(--ink); }
.prose:last-child { margin-bottom: 0; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.empty.ok { color: var(--s-ink); font-weight: 600; }
.stack-gap { display: grid; gap: 12px; }
.sk { height: 76px; border-radius: var(--r); background: linear-gradient(90deg, var(--sunken), var(--surface-2), var(--sunken)); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.count-chip { min-width: 26px; height: 24px; padding: 0 8px; border-radius: 99px; background: var(--orange-50); color: var(--orange-600); font-weight: 700; font-size: 12.5px; display: inline-grid; place-items: center; }

.avatar {
  display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 12px; font-size: 13px; font-weight: 700;
  color: #fff; background: linear-gradient(140deg, var(--navy-700), var(--navy-900)); letter-spacing: .02em;
}
.avatar.lg { width: 46px; height: 46px; border-radius: 14px; font-size: 15px; }
.avatar.xl { width: 76px; height: 76px; border-radius: 22px; font-size: 26px; background: linear-gradient(140deg, #FF8A3D, var(--orange-600)); }

/* badges & pills */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-submitted { background: var(--s-bg); color: var(--s-ink); }
.badge-open { background: var(--i-bg); color: var(--i-ink); }
.badge-closed { background: var(--c-bg); color: var(--c-ink); }
.pill { min-width: 26px; height: 24px; padding: 0 7px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; }
.pill-s { background: var(--s-bg); color: var(--s-ink); } .pill-i { background: var(--i-bg); color: var(--i-ink); } .pill-c { background: var(--c-bg); color: var(--c-ink); }
.rk { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-size: 13px; font-weight: 800; flex: none; }
.rk-s { background: var(--s); color: #fff; } .rk-i { background: var(--i); color: #fff; } .rk-c { background: var(--c); color: #fff; }

/* card rows */
.list { display: grid; gap: 10px; }
.card-row {
  display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card-row:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.card-row-date { width: 46px; height: 50px; border-radius: 12px; background: var(--sunken); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.card-row-date b { font-size: 18px; } .card-row-date span { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.card-row-main { min-width: 0; }
.card-row-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-row-meta { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; }
.card-row-counts { display: flex; gap: 4px; }
.card-row .chev { color: var(--line-2); }
.list.compact .card-row { grid-template-columns: auto 1fr auto; padding: 10px 12px; }
.list.compact .card-row-counts, .list.compact .badge { display: none; }
.list.compact .chev { display: inline-block; }
@media (max-width: 640px) {
  .card-row { grid-template-columns: auto 1fr auto; gap: 12px; }
  .card-row-counts { display: none; } .card-row .chev { display: none; }
}

/* tabs */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--sunken); border-radius: 12px; margin-bottom: 16px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.tabs.compact { margin: 0; } .tabs.compact button { padding: 6px 12px; }

/* ---------- worker home ---------- */
.today {
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  padding: 24px; border-radius: 24px; color: #fff; margin-bottom: 18px; box-shadow: var(--shadow-lg);
  background: radial-gradient(500px 240px at 100% 0%, rgba(242, 98, 15, .45), transparent 70%), linear-gradient(135deg, var(--navy-800), var(--navy-950));
}
.today.is-done { background: radial-gradient(500px 240px at 100% 0%, rgba(43, 182, 115, .45), transparent 70%), linear-gradient(135deg, #0E4D3A, #082A22); }
.today-ic { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: rgba(255, 255, 255, .12); color: #FFB37F; }
.today.is-done .today-ic { color: #7BE3B0; }
.today h2 { font-size: 20px; } .today p { color: rgba(255, 255, 255, .72); margin-top: 4px; }
@media (max-width: 640px) {
  .today { grid-template-columns: auto 1fr; padding: 20px; }
  .today .btn { grid-column: 1 / -1; width: 100%; }
  .page-head h1 { font-size: 25px; }
}
.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 2px; box-shadow: var(--shadow-sm); }
.stat-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--sunken); color: var(--ink-2); margin-bottom: 8px; }
.stat-ic.ok { background: var(--s-bg); color: var(--s-ink); } .stat-ic.warn { background: var(--i-bg); color: var(--i-ink); }
.stat-streak .stat-ic { background: var(--orange-50); color: var(--orange); }
.stat b { font-size: 26px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
@media (max-width: 760px) { .grid-stats { grid-template-columns: repeat(2, 1fr); } }
#home-body { display: grid; gap: 0; } #home-body .panel { margin-bottom: 18px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.day i { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--sunken); border: 2px dashed var(--line-2); }
.day.done i { background: var(--s); border: 0; color: #fff; }
.day.is-today i { box-shadow: 0 0 0 3px var(--orange-50); border-color: var(--orange); }
.day.done.is-today i { border: 0; }
.day small { font-size: 11px; }

/* ---------- new card form ---------- */
.form-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.form-head .icon-btn { background: var(--surface); border: 1px solid var(--line); }
.form-head-txt { flex: 1; min-width: 0; } .form-head-txt .eyebrow { margin-bottom: 2px; }
.form-head h1 { font-size: 22px; }
.form-count { text-align: center; line-height: 1.1; } .form-count b { font-size: 22px; display: block; } .form-count span { font-size: 11px; color: var(--muted); font-weight: 600; }
.progress { height: 6px; border-radius: 99px; background: var(--sunken); overflow: hidden; margin-bottom: 14px; }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #FF8A3D, var(--orange-600)); transition: width .35s cubic-bezier(.2, .7, .2, 1); }
.steps-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px 4px; scrollbar-width: none; scroll-snap-type: x proximity; }
.steps-chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; scroll-snap-align: center; }
.chip em { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--s-bg); color: var(--s-ink); font-size: 11px; display: grid; place-items: center; }
.chip.on { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.chip.on em { background: rgba(255, 255, 255, .2); color: #fff; }
.draft-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--c-ink); background: var(--c-bg); padding: 8px 12px; border-radius: 12px; margin-bottom: 12px; }
.draft-note .link { margin-left: auto; color: var(--c-ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .rk { width: 20px; height: 20px; font-size: 11px; border-radius: 6px; }
.step-body { min-height: 300px; }
.cat-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cat-tools > div { display: flex; gap: 6px; }
.items { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line); transition: background .25s; }
.item:last-child { border-bottom: 0; }
.item.flash { background: var(--surface-2); }
.item-label { min-width: 0; } .item-label b { display: block; font-weight: 600; } .item-label span { font-size: 12px; color: var(--muted); }
.seg-ctl { display: flex; gap: 6px; flex: none; }
.rate {
  width: 48px; height: 46px; border-radius: 13px; border: 1.5px solid var(--line-2); background: var(--surface); font-weight: 800; font-size: 16px; color: var(--muted);
  transition: background .12s, color .12s, border-color .12s, transform .1s, box-shadow .12s;
}
.rate:active { transform: scale(.93); }
.rate-s:hover { border-color: var(--s); color: var(--s); } .rate-i:hover { border-color: var(--i); color: var(--i); } .rate-c:hover { border-color: var(--c); color: var(--c); }
.rate-s[aria-checked="true"] { background: var(--s); border-color: var(--s); color: #fff; box-shadow: 0 6px 14px -6px var(--s); }
.rate-i[aria-checked="true"] { background: var(--i); border-color: var(--i); color: #fff; box-shadow: 0 6px 14px -6px var(--i); }
.rate-c[aria-checked="true"] { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 6px 14px -6px var(--c); }
@media (max-width: 420px) { .rate { width: 42px; height: 44px; } .item { padding-left: 14px; } }
.form-foot {
  position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; margin-top: 18px;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.form-foot .btn-primary { flex: 1; max-width: 320px; margin-left: auto; }
@media (max-width: 900px) {
  body.is-form .tabbar { display: none; }
  body.is-form .view { padding-bottom: 24px; }
  .form-foot { padding-bottom: calc(14px + var(--safe-b)); }
  .form-head h1 { font-size: 18px; }
}
.summary-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.sum { border-radius: var(--r); padding: 14px; text-align: center; }
.sum b { display: block; font-size: 28px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; } .sum span { font-size: 12px; font-weight: 600; }
.sum-s { background: var(--s-bg); color: var(--s-ink); } .sum-i { background: var(--i-bg); color: var(--i-ink); } .sum-c { background: var(--c-bg); color: var(--c-ink); }
.summary-tiles.small { margin: 0; } .summary-tiles.small .sum { padding: 10px; } .summary-tiles.small b { font-size: 22px; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.details-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .details-grid { grid-template-columns: 1fr; } }
.seg-static { display: inline-flex; padding: 4px; background: var(--sunken); border-radius: 12px; gap: 4px; width: fit-content; }
.seg-static span { padding: 8px 16px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.seg-static span.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.flagged { margin-top: 18px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.flagged h4 { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.flag-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.flag-row small { color: var(--muted); font-size: 12px; }

.success { max-width: 460px; margin: 6vh auto 0; text-align: center; display: grid; gap: 14px; justify-items: center; }
.success-badge { width: 104px; height: 104px; border-radius: 34px; display: grid; place-items: center; color: #fff; background: linear-gradient(150deg, #3BD08B, var(--s)); box-shadow: 0 20px 40px -14px var(--s); animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } }
.success h1 { font-size: 28px; } .success p { color: var(--muted); }
.success .summary-tiles { width: 100%; margin: 8px 0; }
.success-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- card detail ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.detail-main, .detail-side { display: grid; gap: 14px; }
.detail-side { position: sticky; top: 24px; }
@media (max-width: 980px) { .detail-grid { grid-template-columns: 1fr; } .detail-side { position: static; order: -1; } }
.meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.meta span { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.meta b { font-weight: 600; }
@media (max-width: 560px) { .meta { grid-template-columns: 1fr 1fr; } }
.cat-panel .panel-head { margin-bottom: 10px; }
.rated { display: grid; gap: 2px; }
.rated-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.rated-row:last-child { border: 0; }
.review-box { background: var(--c-bg); border-color: transparent; } .review-box .h-sm { color: var(--c-ink); }

/* ---------- supervisor dashboard ---------- */
.grid-kpi { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm); }
a.kpi:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.kpi > span { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi-big { font-size: 32px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-big.warn { color: var(--i); }
.kpi-hero { flex-direction: row; align-items: center; gap: 18px; color: #fff; border: 0; background: radial-gradient(400px 200px at 100% 0, rgba(242, 98, 15, .4), transparent 70%), linear-gradient(135deg, var(--navy-800), var(--navy-950)); }
.kpi-hero span { color: rgba(255, 255, 255, .7); font-size: 13px; font-weight: 600; display: block; }
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--orange) calc(var(--p) * 1%), rgba(255, 255, 255, .14) 0); }
.ring > div { width: 66px; height: 66px; border-radius: 50%; background: var(--navy-900); display: grid; place-items: center; }
.ring b { font-size: 15px; }
@media (max-width: 1100px) { .grid-kpi { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .kpi-big { font-size: 26px; } .kpi { padding: 14px; } }
.dash-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; align-items: start; }
.dash-grid .span-2 { grid-column: span 2; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .dash-grid .span-2 { grid-column: auto; } }
.people { display: grid; gap: 10px; max-height: 300px; overflow: auto; }
.person { display: flex; align-items: center; gap: 12px; }
.person b { display: block; font-size: 14px; } .person span { font-size: 12px; color: var(--muted); }
.leader { display: grid; gap: 12px; }
.leader-row { display: grid; grid-template-columns: auto 160px 1fr 52px; gap: 12px; align-items: center; font-size: 14px; font-weight: 500; }
.leader-row b { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink-2); }
.leader-track { height: 10px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.leader-track div { height: 100%; border-radius: 99px; background: var(--navy-700); }
:root[data-theme="dark"] .leader-track div { background: #4F8BF0; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .leader-track div { background: #4F8BF0; } }
@media (max-width: 560px) { .leader-row { grid-template-columns: auto 1fr 52px; } .leader-track { grid-column: 2 / 4; grid-row: 2; } }

/* charts */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .cg { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .ca { stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .ct { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .cb { fill: var(--navy-700); transition: fill .12s; }
:root[data-theme="dark"] .chart .cb { fill: #4F8BF0; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .chart .cb { fill: #4F8BF0; } }
.chart .bar.is-hot .cb { fill: var(--orange); }
.ctip {
  position: absolute; z-index: 5; transform: translate(-50%, -100%); pointer-events: none; white-space: nowrap;
  background: var(--navy-950); color: #fff; padding: 8px 10px; border-radius: 10px; font-size: 12px; box-shadow: var(--shadow-lg);
}
.ctip b { display: block; font-size: 12.5px; } .ctip div { color: rgba(255, 255, 255, .75); }
.hbars { display: grid; gap: 14px; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 600; margin-bottom: 5px; }
.hbar-top b { font-variant-numeric: tabular-nums; }
.hbar-track { height: 10px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 99px; background: var(--i); }
.hbar-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.stack-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: -6px 0 14px; }
.stack-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-s, .seg-s { background: var(--s); } .sw-i, .seg-i { background: var(--i); } .sw-c, .seg-c { background: var(--c); }
.stacks { display: grid; gap: 14px; }
.stack-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 5px; gap: 10px; }
.stack-label b { color: var(--s-ink); font-variant-numeric: tabular-nums; }
.stack-bar { position: relative; display: flex; gap: 2px; height: 12px; }
.seg { height: 100%; border-radius: 3px; transition: opacity .12s; min-width: 4px; }
.seg:first-of-type { border-radius: 99px 3px 3px 99px; } .seg:nth-last-of-type(2) { border-radius: 3px 99px 99px 3px; }
.seg:only-of-type { border-radius: 99px; }
.stack-bar:hover .seg:not(.is-hot) { opacity: .45; }

/* filters */
.filters { display: grid; grid-template-columns: 1.6fr 1fr auto auto; gap: 10px; margin-bottom: 16px; align-items: end; }
.search { position: relative; display: block; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 42px !important; }
.date-f { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.filters > * { min-width: 0; }
@media (max-width: 900px) { .filters { grid-template-columns: 1fr 1fr; } .search, #fu { grid-column: 1 / -1; } }

/* team */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.member { min-width: 0; grid-template-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 14px; box-shadow: var(--shadow-sm); }
.member.off { opacity: .6; }
.member-top { display: flex; align-items: center; gap: 12px; }
.member-top div { flex: 1; min-width: 0; } .member-top b { display: block; } .member-top span { font-size: 13px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); flex: none; }
.dot.on { background: var(--s); box-shadow: 0 0 0 4px var(--s-bg); }
.member dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 12px; background: var(--surface-2); border-radius: 12px; }
.member dt { font-size: 11.5px; color: var(--muted); font-weight: 600; } .member dd { margin: 0; font-weight: 600; font-size: 14px; }
.member-actions { display: flex; flex-wrap: wrap; gap: 8px; } .member-actions .btn { flex: 1 1 140px; min-width: 0; white-space: normal; }

/* profile */
.profile-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.profile-hero h1 { font-size: 26px; } .profile-hero p { color: var(--muted); margin: 2px 0 10px; }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.settings { display: grid; gap: 14px; max-width: 720px; }
.setting { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.setting > div:nth-child(2) { flex: 1; min-width: 160px; }
.setting-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--orange-50); color: var(--orange); }

/* modal & toast */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(7, 22, 41, .55); backdrop-filter: blur(4px); animation: fade .2s; }
.modal {
  position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow: auto;
  background: var(--surface); border-radius: 22px; padding: 24px; box-shadow: var(--shadow-lg); display: grid; gap: 16px; animation: rise .25s cubic-bezier(.2, .8, .2, 1);
}
.modal h2 { font-size: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, -46%); } }
@media (max-width: 560px) {
  .modal { top: auto; bottom: 0; transform: translateX(-50%); width: 100%; border-radius: 24px 24px 0 0; padding-bottom: calc(24px + var(--safe-b)); animation: sheet .3s cubic-bezier(.2, .8, .2, 1); }
  @keyframes sheet { from { transform: translate(-50%, 100%); } }
  .modal-actions .btn { flex: 1; }
}
.toasts { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); top: calc(16px + var(--safe-t)); display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--navy-950); color: #fff;
  box-shadow: var(--shadow-lg); font-weight: 500; font-size: 14px; animation: tin .3s cubic-bezier(.2, .8, .2, 1); transition: opacity .3s, transform .3s;
}
.toast-ok .ic { color: #5FD69B; } .toast-err .ic { color: #FF8A8A; } .toast-warn .ic { color: #FFD58A; }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes tin { from { opacity: 0; transform: translateY(-12px); } }
