/* Stillpoint Safety — core look: tokens, top navigation, page header, cards,
   chips, buttons, lists and tables. Modelled on Mellett V2's premium style
   (warm whites, graphite ink, hairlines, one accent) with a safety-green accent. */
:root {
  --brand: #12694A; --brand-deep: #0B4F37; --brand-soft: #E8F3EC; --brand-tint: #F2F8F4;
  --ink: #111418; --ink-2: #3A4149; --muted: #626B74; --faint: #8A929A;
  --line: #E6E5E0; --line-2: #EFEEEA; --bg: #F5F4F0; --card: #FFFFFF; --well: #F8F7F4;
  --red: #B42318; --red-soft: #FCEEEC; --amber: #8B6109; --amber-soft: #FBF3DF; --amber-line: #F0DDA8;
  --blue: #2456C4; --blue-soft: #EDF2FC; --green: #177A4C; --green-soft: #EAF6EF;
  --r: 20px; --r-sm: 14px;
  --shadow: 0 1px 2px rgba(17, 20, 24, .04), 0 10px 30px rgba(17, 20, 24, .05);
  --shadow-lift: 0 2px 4px rgba(17, 20, 24, .05), 0 18px 40px rgba(17, 20, 24, .10);
  --ease: cubic-bezier(.22, .8, .28, 1);
  --font: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
.shell { max-width: 1340px; margin: 0 auto; padding: 18px 28px 64px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: .01em; }
.muted { color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── Top navigation: floating translucent bar ─────────────────────────── */
.topbar { position: sticky; top: 12px; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 10px 12px 10px 18px; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-name { font-weight: 700; letter-spacing: .16em; font-size: 15px; }
.brand-tag { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--brand); background: var(--brand-soft); padding: 4px 8px; border-radius: 7px; }
.nav { display: flex; gap: 2px; padding: 4px; background: #F1F0EC; border-radius: 14px; margin: 0 auto; }
.nav button { display: flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 11px; color: var(--ink-2); font-size: 15px; font-weight: 500; transition: background .2s var(--ease), color .2s; white-space: nowrap; }
.nav button:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }
.nav button .svg { display: none; }
.nav button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .04); }
.nav .count { font-size: 11px; font-weight: 700; color: var(--amber); background: var(--amber-soft); border-radius: 6px; padding: 1px 6px; }
.top-right { display: flex; align-items: center; gap: 10px; flex: none; }
.role { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; font-weight: 600; font-size: 14px; }
.role .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.role select { appearance: none; border: 0; background: transparent; font-weight: 600; padding-right: 4px; cursor: pointer; max-width: 190px; }
.icon-btn { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--ink-2); }
.icon-btn:hover { background: var(--well); }
.icon-btn .badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.avatar-me { width: 42px; height: 42px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 15px; border: 1px solid var(--line); background: #fff; color: var(--ink); transition: transform .15s var(--ease), box-shadow .2s, background .2s; white-space: nowrap; }
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(18, 105, 74, .28); }
.btn-primary:hover { background: var(--brand-deep); box-shadow: 0 8px 22px rgba(18, 105, 74, .34); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #262B31; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--well); box-shadow: none; }
.btn-sm { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 14px; }
.btn-block { width: 100%; }
.link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.link:hover { color: var(--brand); }
.link .svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.link:hover .svg { transform: translateX(2px); }

/* ── Page header (hero) ───────────────────────────────────────────────── */
.hero { margin-top: 26px; padding: 30px 36px; border-radius: 24px; border: 1px solid var(--line-2); background: radial-gradient(120% 140% at 100% 0%, #E3F1E8 0%, rgba(227, 241, 232, 0) 55%), linear-gradient(100deg, #FFFFFF 0%, #FBFBF8 60%, #F3F8F4 100%); box-shadow: 0 1px 2px rgba(17, 20, 24, .03); display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; }
.hero h1 { margin: 8px 0 8px; font-size: 36px; line-height: 1.1; letter-spacing: -.02em; font-weight: 700; }
.hero .sub { color: var(--muted); font-size: 17px; }
.hero .sub b { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* ── Attention banner ─────────────────────────────────────────────────── */
.banner { margin-top: 18px; display: flex; align-items: center; gap: 14px; padding: 16px 22px; border-radius: 16px; background: var(--amber-soft); border: 1px solid var(--amber-line); color: #5E4106; }
.banner b { color: #3F2B03; }
.banner .link { margin-left: auto; color: #5E4106; }
.banner.info { background: var(--brand-tint); border-color: #CFE5D7; color: #1E4A37; }
.banner.info .link { color: var(--brand-deep); }

/* ── Cards and layout ─────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 24px 28px; }
.card-head { display: flex; align-items: baseline; gap: 12px; padding: 22px 28px 6px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.card-head .hint { color: var(--muted); font-size: 14px; }
.card-head .end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.grid { display: grid; gap: 20px; margin-top: 20px; }
.g-main { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.stack { display: grid; gap: 20px; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 34px 4px 4px; }
.section-title h2 { margin: 0; font-size: 21px; letter-spacing: -.01em; }

/* ── KPI strip: one card, hairline dividers ───────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 20px; }
.kpis.three { grid-template-columns: repeat(3, 1fr); }
.kpis.six { grid-template-columns: repeat(6, 1fr); }
.kpis.six .kpi { padding: 20px 22px; }
.kpis.six .v { font-size: 30px; }
.kpi { padding: 24px 28px; border-left: 1px solid var(--line); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi .v { font-size: 38px; font-weight: 600; letter-spacing: -.02em; margin: 8px 0 4px; line-height: 1.05; }
.kpi .v small { font-size: 16px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.kpi .d { color: var(--muted); font-size: 14px; }
.kpi .link { margin-top: 12px; font-size: 14px; }

/* ── Status chips and avatars ─────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 8px; font-size: 13px; font-weight: 600; background: #F1F0EC; color: var(--ink-2); white-space: nowrap; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip.plain::before { display: none; }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.ink { background: var(--ink); color: #fff; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 8px; font-size: 13px; font-weight: 600; background: #F1F0EC; color: var(--ink-2); white-space: nowrap; }
.tag .svg { width: 14px; height: 14px; }
.av { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: none; letter-spacing: .02em; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who .n { font-weight: 600; }
.who .s { color: var(--muted); font-size: 13px; }

/* ── Attention list ("Needs you") ─────────────────────────────────────── */
.group-label { display: flex; gap: 8px; align-items: baseline; padding: 14px 28px 8px; color: var(--ink-2); font-weight: 600; font-size: 15px; }
.group-label span { color: var(--faint); font-weight: 500; }
.items { display: grid; gap: 10px; padding: 0 16px 16px; }
.item { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 16px; background: var(--well); border: 1px solid transparent; text-align: left; width: 100%; transition: background .2s, border-color .2s, transform .2s var(--ease); }
.item:hover { background: #F2F1EC; border-color: var(--line); }
.item.urgent { background: #FDF3F1; }
.item.urgent:hover { background: #FBEAE7; border-color: #F3D2CC; }
.item-ic { position: relative; width: 44px; height: 44px; border-radius: 12px; background: #fff; display: grid; place-items: center; color: var(--ink-2); flex: none; border: 1px solid var(--line-2); }
.item.urgent .item-ic { color: var(--red); }
.item-ic .pip { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.item-body { min-width: 0; flex: 1; }
.item-title { font-weight: 600; font-size: 16px; }
.item-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.item-end { display: flex; align-items: center; gap: 16px; flex: none; }
.count-badge { margin-left: auto; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 14px; background: var(--red); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }

/* ── Dark summary card ────────────────────────────────────────────────── */
.dark { position: relative; overflow: hidden; border-radius: var(--r); padding: 26px 28px; color: #fff; background: radial-gradient(90% 120% at 100% 100%, rgba(18, 105, 74, .55) 0%, rgba(18, 105, 74, 0) 60%), linear-gradient(160deg, #1F242A 0%, #15191D 100%); box-shadow: var(--shadow-lift); }
.dark .eyebrow { color: rgba(255, 255, 255, .62); }
.dark .row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .10); font-size: 15px; }
.dark .row:last-of-type { border-bottom: 0; }
.dark .row span:first-child { color: rgba(255, 255, 255, .66); }
.dark .row b { font-weight: 600; text-align: right; }
.dark .big { font-size: 46px; font-weight: 600; letter-spacing: -.02em; margin: 10px 0 2px; }
.dark .btn { margin-top: 16px; width: 100%; background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .18); }
.dark .btn:hover { background: rgba(255, 255, 255, .12); }

/* ── Quick actions ────────────────────────────────────────────────────── */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 8px 18px 20px; }
.quick button { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 14px; background: var(--well); font-weight: 600; text-align: left; transition: background .2s; }
.quick button:hover { background: #EFEEE9; }
.quick .svg { color: var(--ink-2); }

/* ── Sub-tabs and segmented filters ───────────────────────────────────── */
.tabs { display: flex; gap: 30px; margin: 30px 4px 0; border-bottom: 1px solid #DEDDD7; overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; padding: 10px 2px 14px; color: var(--muted); font-size: 16px; font-weight: 500; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); font-weight: 600; }
.tabs button.on::after { content: ''; position: absolute; left: -2px; right: -2px; bottom: -1px; height: 3px; border-radius: 3px; background: var(--brand); }
.seg { display: inline-flex; gap: 2px; padding: 4px; background: #F1F0EC; border-radius: 13px; flex-wrap: wrap; }
.seg button { padding: 7px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 500; font-size: 14px; white-space: nowrap; }
.seg button span { color: var(--faint); margin-left: 6px; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.toolbar { display: flex; align-items: center; gap: 12px; padding: 20px 24px 6px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-left: auto; color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; width: 200px; color: var(--ink); }

/* ── Tables ───────────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; padding: 0 8px 8px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 16px 16px 10px; white-space: nowrap; }
.tbl td { padding: 16px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr.click { cursor: pointer; transition: background .15s; }
.tbl tr.click:hover td { background: var(--well); }
.tbl .r { text-align: right; }
.tbl .t1 { font-weight: 600; }
.tbl .t2 { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tbl .chev { color: var(--faint); width: 28px; }
.tbl tfoot td { font-weight: 700; border-top: 1px solid var(--line); }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .ic { width: 56px; height: 56px; border-radius: 16px; background: var(--well); display: grid; place-items: center; margin: 0 auto 12px; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
