/* P2R design system, deck standard v3, adapted for a phone-first app.
   Navy and white do the work. Yellow marks the one thing that matters.
   Gradient for emphasis only: one hero card per screen. */

:root {
  --navy: #0B1033;
  --yellow: #FFD000;
  --blue: #3B8BE0;
  --grey: #F4F6FB;
  --white: #FFFFFF;
  --line: #E3E7F0;
  --muted: #5B6178;
  --soft: #8A90A6;
  --accident: #F0506E;   /* module colour: Concerns */
  --nearmiss: #F59E0B;   /* module colour: Opportunities */
  --ok: #10B981;         /* module colour: Summary */
  --gradient: linear-gradient(150deg, #2453C9 0%, #16226B 55%, #0B1033 100%);
  --radius: 18px;
  --shadow: 0 1px 2px rgba(11, 16, 51, .04), 0 8px 24px rgba(11, 16, 51, .06);
  --head: 'Arial Black', 'Arial Bold', Gadget, Arial, sans-serif;
  --body: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--grey); color: var(--navy);
  font: 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

/* ---------- top bar */
.topbar { padding: calc(14px + var(--safe-t)) 0 10px; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.brand img { width: 28px; height: 28px; object-fit: contain; }
.brand span { font-size: 13px; letter-spacing: .14em; color: var(--muted); white-space: nowrap; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; background: var(--white); border-radius: 999px;
  padding: 7px 14px 7px 10px; font: 11px/1 var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--navy);
  box-shadow: var(--shadow); white-space: nowrap;
}
.pill img { width: 14px; height: 14px; object-fit: contain; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 700; color: var(--navy); padding: 8px 0; background: none; border: 0; cursor: pointer; }

/* ---------- headlines: one sentence, blue full stop, underline rule */
h1, h2, h3 { font-family: var(--head); font-weight: 900; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 6.4vw, 44px); line-height: 1.08; }
h2 { font-size: 20px; line-height: 1.2; }
h3 { font-size: 16px; }
.dot { color: var(--blue); }
.rule { display: flex; gap: 6px; margin: 14px 0 22px; align-items: center; }
.rule i { height: 3px; border-radius: 2px; background: var(--yellow); width: 56px; }
.rule i:nth-child(2) { background: var(--blue); width: 18px; }
.rule i:nth-child(3) { background: var(--blue); width: 4px; opacity: .5; }
.lede { color: var(--muted); margin: -8px 0 22px; max-width: 56ch; }
.eyebrow { font: 11px/1.2 var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- cards */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.hero {
  background: var(--gradient); color: var(--white); border-radius: var(--radius); padding: 22px; position: relative; overflow: hidden;
  box-shadow: 0 12px 32px rgba(22, 34, 107, .28);
}
.hero::after {
  content: ''; position: absolute; right: -40px; bottom: -50px; width: 260px; height: 260px;
  background: url(../img/phoenix-white.png) center/contain no-repeat; opacity: .07; pointer-events: none;
}
.hero .eyebrow { color: rgba(255, 255, 255, .72); }

/* ---------- home counters */
.counters { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.counter { padding: 4px 4px 2px; position: relative; z-index: 1; display: flex; flex-direction: column; }
.counter .eyebrow { min-height: 2.4em; }
.counter + .counter { border-left: 1px solid rgba(255, 255, 255, .16); padding-left: 20px; }
.counter .num { font: 900 clamp(64px, 19vw, 120px)/1 var(--head); letter-spacing: -.03em; margin: auto 0 6px; padding-top: 14px; font-variant-numeric: tabular-nums; }
.counter .num.hl { color: var(--yellow); }
.counter .sub { font-size: 13px; color: rgba(255, 255, 255, .78); }
.counter .tag { display: flex; align-items: flex-start; gap: 6px; }
.counter .tag img { width: 16px; height: 16px; flex: none; margin-top: -1px; }
.counter .flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { transform: scale(1.15); } 100% { transform: scale(1); } }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.action {
  display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--navy);
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
  border-bottom: 4px solid var(--c); transition: transform .15s ease, box-shadow .15s ease; min-height: 168px;
}
.action:active { transform: scale(.98); }
@media (hover: hover) { .action:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(11, 16, 51, .1); } }
.action .row { display: flex; justify-content: space-between; align-items: flex-start; }
.action img { width: 40px; height: 40px; object-fit: contain; }
.action .num { font: 900 14px var(--head); color: var(--soft); }
.action h2 { font-size: 22px; margin-top: auto; }
.action p { margin: 0; color: var(--muted); font-size: 14px; }
.action .go { font: 900 13px var(--head); color: var(--c); letter-spacing: .02em; }

.emergency {
  display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 14px 18px;
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 14px; color: var(--muted);
}
.emergency b { color: var(--navy); }
.emergency .ico { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #FDE8EC; color: var(--accident); display: grid; place-items: center; font: 900 14px var(--head); }

.foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 26px 0 calc(26px + var(--safe-b)); color: var(--soft); font-size: 12px; }
.foot a { color: var(--soft); text-decoration: none; font-weight: 700; }
.foot a:hover { color: var(--navy); }

/* ---------- forms */
.form-head { display: flex; gap: 14px; align-items: center; margin-top: 4px; }
.form-head img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.section { margin-bottom: 14px; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.section-title .n { font: 900 14px var(--head); color: var(--c, var(--blue)); }
.section-note { color: var(--muted); font-size: 14px; margin: -8px 0 14px; }
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > .label { display: block; font-weight: 700; margin-bottom: 7px; }
.field .req { color: var(--accident); margin-left: 2px; }
.field .hint { color: var(--muted); font-size: 13px; margin: -3px 0 8px; }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line); background: var(--white); border-radius: 12px; padding: 13px 14px;
  font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
select.input { background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230B1033' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") right 14px center no-repeat; padding-right: 38px; }
textarea.input { min-height: 104px; resize: vertical; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(59, 139, 224, .15); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two .field { margin-bottom: 18px; }

.choices { display: grid; gap: 8px; }
.choices.grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  min-height: 48px; font-size: 15px; transition: border-color .15s, background .15s; cursor: pointer;
}
.choice span::before {
  content: ''; flex: none; width: 18px; height: 18px; border: 2px solid #C5CAD8; border-radius: 50%; background: var(--white);
  transition: all .15s;
}
.choice input[type=checkbox] + span::before { border-radius: 5px; }
.choice input:checked + span { border-color: var(--navy); background: #F7F8FC; font-weight: 700; }
.choice input:checked + span::before { border-color: var(--navy); background: var(--navy); box-shadow: inset 0 0 0 3px var(--white); }
.choice input[type=checkbox]:checked + span::before { box-shadow: none; background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1.5' stroke='white' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center no-repeat; }
.choice input:focus-visible + span { box-shadow: 0 0 0 4px rgba(59, 139, 224, .2); }
.yesno { grid-template-columns: 1fr 1fr; }

.field.invalid .input, .field.invalid .choice span { border-color: var(--accident); }
.field .err { color: #C42848; font-size: 13px; font-weight: 700; margin-top: 6px; }

/* evidence */
.drop {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.drop label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  border: 1.5px dashed #C5CAD8; border-radius: 14px; padding: 18px 10px; cursor: pointer; font-weight: 700; font-size: 14px;
  transition: border-color .15s, background .15s; min-height: 92px;
}
.drop label:hover { border-color: var(--blue); background: #F7FAFE; }
.drop label small { font-weight: 400; color: var(--muted); font-size: 12px; }
.drop svg { width: 26px; height: 26px; color: var(--blue); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-top: 12px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--grey); border: 1px solid var(--line); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .file { display: grid; place-items: center; height: 100%; padding: 8px; text-align: center; font-size: 11px; color: var(--muted); word-break: break-all; }
.thumb button {
  position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(11, 16, 51, .78); color: var(--white); font-size: 16px; line-height: 1; display: grid; place-items: center;
}

.submitbar {
  position: sticky; bottom: 0; z-index: 5; padding: 14px 0 calc(14px + var(--safe-b));
  background: linear-gradient(to top, var(--grey) 70%, rgba(244, 246, 251, 0));
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none;
  border-radius: 14px; padding: 15px 22px; font: 900 16px var(--head); letter-spacing: .01em; transition: transform .1s, opacity .15s, background .15s;
  background: var(--navy); color: var(--white); min-height: 52px;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--white); color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { background: #FDE8EC; color: #C42848; }
.btn.small { min-height: 40px; padding: 9px 14px; font-size: 13px; border-radius: 11px; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; background: var(--blue); width: 0; transition: width .2s; }
.form-error { background: #FDE8EC; color: #9E1F3A; border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 700; margin-bottom: 10px; }

/* done */
.done { text-align: center; padding: 34px 22px; }
.done .tick { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center; background: rgba(255, 255, 255, .12); }
.done .ref { display: inline-block; margin: 14px 0 6px; background: var(--yellow); color: var(--navy); font: 900 18px var(--head); padding: 8px 16px; border-radius: 999px; letter-spacing: .04em; }
.done p { color: rgba(255, 255, 255, .8); max-width: 44ch; margin: 10px auto 0; }

/* ---------- admin */
.login { max-width: 420px; margin: 8vh auto 0; }
.demo-note { background: #FFF8D6; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px; }
.kpis { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.kpi { display: flex; flex-direction: column; min-height: 150px; }
.kpi .big { font: 900 44px/1 var(--head); margin-top: auto; padding-top: 18px; font-variant-numeric: tabular-nums; }
.kpi .cmp { font-size: 13px; color: var(--muted); margin-top: 8px; }
.hero.kpi .big { color: var(--yellow); }
.hero.kpi .cmp { color: rgba(255, 255, 255, .78); }

.tabs { display: flex; gap: 6px; background: var(--white); border-radius: 14px; padding: 5px; box-shadow: var(--shadow); width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 9px 16px; border-radius: 10px; font-weight: 700; cursor: pointer; white-space: nowrap; color: var(--muted); }
.tabs button.on { background: var(--navy); color: var(--white); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; align-items: center; }
.filters .input { width: auto; padding: 10px 12px; min-width: 0; }
.filters .search { flex: 1 1 220px; }
.filters select.input { flex: 0 1 180px; }

.list { display: grid; gap: 10px; }
.item {
  display: grid; grid-template-columns: 6px 1fr auto; gap: 14px; align-items: center; background: var(--white); border-radius: 14px;
  box-shadow: var(--shadow); padding: 14px 16px 14px 0; text-decoration: none; color: var(--navy); overflow: hidden;
}
.item .bar { align-self: stretch; background: var(--c); border-radius: 0 4px 4px 0; }
.item .t { font-weight: 700; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.item .m { font-size: 13px; color: var(--muted); margin-top: 3px; }
.item .r { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.badge { display: inline-block; font: 900 11px/1 var(--head); letter-spacing: .06em; text-transform: uppercase; padding: 6px 9px; border-radius: 999px; white-space: nowrap; background: var(--grey); color: var(--navy); }
.badge.New { background: var(--yellow); }
.badge.Investigating { background: #E4EFFC; color: #1D5FAE; }
.badge.Action { background: #FDE8EC; color: #B4233F; }
.badge.Closed { background: #E3F7EF; color: #0B7A55; }
.badge.type { background: none; padding: 0; color: var(--c); }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

.detail { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.dl { display: grid; grid-template-columns: 200px 1fr; gap: 10px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 14px; }
.dl dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gallery a { display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--grey); border: 1px solid var(--line); }
.gallery img, .gallery video { width: 100%; height: 100%; object-fit: cover; }
.gallery .file { display: grid; place-items: center; height: 100%; padding: 10px; text-align: center; font-size: 12px; color: var(--navy); word-break: break-all; text-decoration: none; }
.notes { display: grid; gap: 10px; margin-bottom: 12px; }
.note { background: var(--grey); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.note small { display: block; color: var(--muted); margin-bottom: 3px; font-size: 12px; }
.sticky { position: sticky; top: 16px; }
.stack { display: grid; gap: 14px; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: var(--navy); color: var(--white);
  padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; z-index: 50; box-shadow: 0 12px 32px rgba(11, 16, 51, .3);
  animation: up .25s ease-out;
}
@keyframes up { from { transform: translate(-50%, 12px); opacity: 0; } }
.offline { background: var(--yellow); color: var(--navy); text-align: center; font-weight: 700; font-size: 13px; padding: 8px 16px; }

.lightbox { position: fixed; inset: 0; background: rgba(11, 16, 51, .92); z-index: 60; display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-height: 90dvh; border-radius: 10px; }

@media (max-width: 860px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .detail { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 560px) {
  .actions { grid-template-columns: 1fr; }
  .action { min-height: 0; flex-direction: row; align-items: center; gap: 14px; padding: 18px; }
  .action .row { flex-direction: column; gap: 8px; align-items: center; }
  .action .num { display: none; }
  .action h2 { margin: 0 0 4px; font-size: 19px; }
  .action .go { display: none; }
  .counter + .counter { padding-left: 16px; }
  .two { grid-template-columns: 1fr; gap: 0; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 10px; }
  .kpi { min-height: 120px; }
  .kpi .big { font-size: 36px; }
  .brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* =====================================================================
   Warehouse Shift additions
   ===================================================================== */
:root { --amber: #F59E0B; --red: #F0506E; --green: #10B981; --nav-h: 64px; }
body.app { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 8px); }
main.wrap { padding-bottom: 24px; }

/* bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.tabbar nav { display: flex; max-width: 720px; margin: 0 auto; }
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; min-height: var(--nav-h);
  text-decoration: none; color: var(--soft); font: 700 11px var(--body); position: relative;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--navy); }
.tabbar a.on::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--yellow); }
.tabbar .dotn { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: #fff; font: 900 10px/17px var(--head); text-align: center; padding: 0 4px; }

.topbar .who { font-size: 12px; color: var(--muted); text-align: right; line-height: 1.25; }
.topbar .who b { display: block; color: var(--navy); font-size: 13px; }
.topbar .who a { color: var(--muted); }

/* shift hero */
.shift-hero h1 { font-size: clamp(30px, 8vw, 44px); }
.shift-hero .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: rgba(255, 255, 255, .8); font-size: 14px; margin-top: 6px; position: relative; z-index: 1; }
.ring { --p: 0; width: 86px; height: 86px; border-radius: 50%; flex: none; position: relative; z-index: 1;
  background: conic-gradient(var(--yellow) calc(var(--p) * 1%), rgba(255, 255, 255, .16) 0); display: grid; place-items: center; }
.ring::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: #16226B; }
.ring b { position: relative; font: 900 22px var(--head); }
.ring small { position: absolute; bottom: -20px; font-size: 11px; color: rgba(255, 255, 255, .7); white-space: nowrap; }
.hero-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; position: relative; z-index: 1; }

/* routine list */
.routines { display: grid; gap: 10px; margin-top: 14px; }
.routine { text-align: left;
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; background: var(--white); border-radius: 16px;
  padding: 14px 14px 14px 12px; box-shadow: var(--shadow); text-decoration: none; color: var(--navy); min-height: 68px;
}
.routine:active { transform: scale(.985); }
.routine .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--grey); color: var(--navy); }
.routine .ic svg { width: 22px; height: 22px; }
.routine.done .ic { background: #E3F7EF; color: #0B7A55; }
.routine.part .ic { background: #FFF4DB; color: #B26B00; }
.routine.due .ic { background: #FDE8EC; color: #B4233F; }
.routine .t { font-weight: 700; }
.routine .m { font-size: 13px; color: var(--muted); margin-top: 2px; }
.routine .st { font: 900 11px var(--head); letter-spacing: .06em; text-transform: uppercase; color: var(--soft); text-align: right; }
.routine.done .st { color: #0B7A55; }
.routine.part .st { color: #B26B00; }
.routine.due .st { color: #B4233F; }

.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-top: 10px; background: #FFF8D6; text-decoration: none; color: var(--navy); }
.alert.red { background: #FDE8EC; }
.alert.blue { background: #E4EFFC; }
.alert b { display: block; }

.section-h { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 0 10px; }
.section-h h2 { font-size: 18px; }
.section-h a, .section-h button { font-weight: 700; font-size: 14px; color: var(--blue); background: none; border: 0; text-decoration: none; cursor: pointer; padding: 0; }

/* compact rows */
.rows { background: var(--white); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.rowi { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-top: 1px solid var(--line); text-decoration: none; color: var(--navy); min-height: 56px; }
.rowi:first-child { border-top: 0; }
.rowi .grow { flex: 1; min-width: 0; }
.rowi .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowi .m { font-size: 13px; color: var(--muted); }
.rowi .chev { color: var(--soft); flex: none; }
.rowi select.input, .rowi .input { padding: 9px 30px 9px 10px; font-size: 14px; width: auto; max-width: 46%; }

/* segmented status control */
.seg { display: inline-flex; background: var(--grey); border-radius: 10px; padding: 3px; gap: 2px; flex: none; }
.seg button { border: 0; background: none; border-radius: 8px; padding: 8px 10px; font: 700 13px var(--body); color: var(--muted); cursor: pointer; min-width: 40px; min-height: 36px; }
.seg button.on { background: var(--white); color: var(--navy); box-shadow: 0 1px 3px rgba(11, 16, 51, .12); }
.seg button.on.pass, .seg button.on.present { background: var(--green); color: #fff; }
.seg button.on.fail, .seg button.on.absent { background: var(--red); color: #fff; }
.seg button.on.late, .seg button.on.na { background: var(--amber); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 700; background: var(--grey); color: var(--navy); border: 0; }
.chip.ok { background: #E3F7EF; color: #0B7A55; }
.chip.warn { background: #FFF4DB; color: #8A5300; }
.chip.bad { background: #FDE8EC; color: #B4233F; }
.chip.blue { background: #E4EFFC; color: #1D5FAE; }
button.chip { cursor: pointer; }
button.chip.on { background: var(--navy); color: #fff; }

.badge.open, .badge.pending, .badge.signed { background: var(--yellow); }
.badge.in_progress { background: #E4EFFC; color: #1D5FAE; }
.badge.closed, .badge.accepted, .badge.done { background: #E3F7EF; color: #0B7A55; }
.badge.high, .badge.critical { background: #FDE8EC; color: #B4233F; }
.badge.draft { background: var(--grey); color: var(--muted); }

/* grid stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--white); border-radius: 16px; box-shadow: var(--shadow); padding: 14px; min-height: 96px; display: flex; flex-direction: column; }
.stat .eyebrow { font-size: 10px; }
.stat .v { font: 900 30px/1 var(--head); margin-top: auto; padding-top: 10px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat.ok .v { color: #0B7A55; } .stat.warn .v { color: #B26B00; } .stat.bad .v { color: #C42848; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }

/* charts */
.chart { width: 100%; height: 170px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart text { font: 700 10px var(--body); fill: var(--muted); }
.bars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 36px; gap: 8px; align-items: center; font-size: 13px; }
.hbar .track { height: 10px; border-radius: 5px; background: var(--grey); overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--blue); border-radius: 5px; }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }
.hbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* signature pad */
.sig { position: relative; border: 1.5px dashed #C5CAD8; border-radius: 14px; background: #FBFCFE; touch-action: none; overflow: hidden; }
.sig canvas { display: block; width: 100%; height: 190px; touch-action: none; cursor: crosshair; }
.sig .line { position: absolute; left: 18px; right: 18px; bottom: 44px; border-bottom: 1.5px solid var(--line); pointer-events: none; }
.sig .x { position: absolute; left: 18px; bottom: 48px; font: 900 18px var(--head); color: var(--soft); pointer-events: none; }
.sig .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--soft); font-size: 14px; pointer-events: none; }
.sig .clear { position: absolute; top: 8px; right: 8px; }
.sig-done { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; }
.sig-done img { max-height: 110px; margin: 0 auto; }
.sig-done .by { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; margin-top: 6px; }
.sig-done .by b { color: var(--navy); }
.sealed { display: inline-flex; align-items: center; gap: 6px; background: #E3F7EF; color: #0B7A55; font: 900 11px var(--head); letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; }

/* stars */
.stars { display: flex; gap: 6px; }
.stars button { border: 0; background: none; padding: 2px; cursor: pointer; color: #D5D9E5; }
.stars button.on { color: var(--yellow); }
.stars svg { width: 38px; height: 38px; }
.stars.sm svg { width: 18px; height: 18px; }
.stars.sm { gap: 1px; }
.stars.sm span { color: #D5D9E5; } .stars.sm span.on { color: #E8B400; }

/* bottom sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(11, 16, 51, .45); z-index: 40; animation: fade .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--grey); border-radius: 22px 22px 0 0;
  max-height: 92dvh; overflow: auto; padding: 8px 16px calc(20px + var(--safe-b)); animation: sheetup .25s ease-out; max-width: 720px; margin: 0 auto;
}
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: #C5CAD8; margin: 4px auto 12px; }
@keyframes sheetup { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* huddle presenter */
.presenter { position: fixed; inset: 0; z-index: 70; background: var(--gradient); color: #fff; display: flex; flex-direction: column; padding: calc(18px + var(--safe-t)) 22px calc(18px + var(--safe-b)); }
.presenter .slide { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; overflow: auto; }
.presenter h2 { font-size: clamp(26px, 7vw, 54px); }
.presenter .body { font-size: clamp(18px, 4.6vw, 30px); line-height: 1.35; white-space: pre-wrap; }
.presenter .big { font: 900 clamp(56px, 18vw, 140px)/1 var(--head); color: var(--yellow); }
.presenter .nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.presenter .nav .btn { background: rgba(255, 255, 255, .14); }
.presenter .count { font: 900 13px var(--head); letter-spacing: .1em; color: rgba(255, 255, 255, .7); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 900 10px var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 14px; } .mt2 { margin-top: 24px; }
.center { text-align: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.photo-row { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-row img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; }
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.tl:first-child { border-top: 0; }
.tl time { font: 900 12px var(--head); color: var(--muted); padding-top: 2px; }
.login-hero { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 16px calc(24px + var(--safe-b)); max-width: 460px; margin: 0 auto; }
.login-hero .hero { padding: 28px 22px; }
.login-hero h1 { font-size: 40px; }
.fd-btn { background: var(--yellow); color: var(--navy); }
textarea.input.short { min-height: 70px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 700; }
@media (max-width: 400px) { .seg button { padding: 8px 7px; min-width: 34px; font-size: 12px; } }

/* board pack + print */
.boardpack h3 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
@media print {
  @page { size: A4; margin: 12mm; }
  body, body.app { background: #fff; padding: 0; }
  .topbar, .tabbar, .no-print, .back, .submitbar, .toast { display: none !important; }
  .card, .stat, .hero { box-shadow: none !important; border: 1px solid #E3E7F0; break-inside: avoid; }
  .stats { grid-template-columns: repeat(4, 1fr) !important; }
  .stat { min-height: 0; padding: 10px; } .stat .v { font-size: 22px; }
  main.wrap { max-width: none; padding: 0; }
}
