/* Ligtas App styles. Plain CSS so the server needs no build step. */
:root {
  --bg: #EAF0EF; --surface: #FFFFFF; --surface-2: #F3F7F6; --ink: #13282A; --muted: #56696B; --line: #D3DFDD;
  --brand: #0D5B60; --on-brand: #FFFFFF; --brand-soft: #DCEDEC;
  --sun: #E3A00C; --sun-soft: #FBEFCB; --sun-ink: #6B4A00;
  --crit: #BF2A2F; --crit-bg: #FBE3E3; --urg: #C9590C; --urg-bg: #FDE9D9;
  --norm: #2C65A0; --norm-bg: #E1EBF6; --low: #6F8183; --low-bg: #E8EEEE; --ok: #2B7A4B; --ok-bg: #DFF1E5;
  --shadow: 0 18px 50px -24px rgba(13, 60, 64, .45);
  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Figtree', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #0C1718; --surface: #132224; --surface-2: #182B2D; --ink: #E3EEEC; --muted: #9AB0AE; --line: #29403F;
  --brand: #4FB3AE; --on-brand: #06201F; --brand-soft: #173A3A;
  --sun: #F2B93B; --sun-soft: #3A2F12; --sun-ink: #F6D486;
  --crit: #F07276; --crit-bg: #3D1A1C; --urg: #F49A55; --urg-bg: #3B2414; --norm: #7EB0E6; --norm-bg: #172B40;
  --low: #9AAAAB; --low-bg: #223133; --ok: #6CCB91; --ok-bg: #163322; --shadow: 0 18px 50px -24px rgba(0,0,0,.8);
  color-scheme: dark;
}}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font-body); }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; line-height: 1.15; }
p { margin: 0; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.mono { font-family: var(--font-mono); }
.sub { color: var(--muted); font-size: 13.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: grid; gap: 14px; }

/* Buttons and fields */
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 6px; border: 0; background: var(--brand); color: var(--on-brand); font-weight: 700; padding: 11px 16px; border-radius: 12px; font-size: 15px; text-decoration: none; }
.btn.sec { background: var(--surface-2); color: var(--ink); border: 1.5px solid var(--line); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.warn { background: var(--crit); color: #fff; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1; }
.linkbtn { background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.field { display: grid; gap: 5px; }
.field > label, .lbl { font-weight: 600; font-size: 13.5px; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=file], select, textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 11px; font-size: 15px;
}
textarea { min-height: 110px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.err { color: var(--crit); font-size: 13px; font-weight: 600; }
.flash { border-radius: 12px; padding: 10px 14px; font-size: 14px; background: var(--ok-bg); color: var(--ink); }
.flash.warn { background: var(--sun-soft); }
.flash.bad { background: var(--crit-bg); }
.note { font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.note b { color: var(--ink); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: grid; gap: 10px; min-width: 0; }
.panel h2 { font-size: 18px; }
.panel h3 { font-size: 15px; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.p-critical { background: var(--crit-bg); color: var(--crit); }
.p-urgent { background: var(--urg-bg); color: var(--urg); }
.p-normal { background: var(--norm-bg); color: var(--norm); }
.p-low { background: var(--low-bg); color: var(--low); }
.st { font-size: 12px; font-weight: 600; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; white-space: nowrap; background: var(--surface-2); }
.st-submitted { border-color: var(--sun); background: var(--sun-soft); color: var(--sun-ink); }
.st-resolved, .st-closed { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.overdue { font-size: 11px; font-weight: 800; color: #fff; background: var(--crit); border-radius: 5px; padding: 1px 6px; letter-spacing: .03em; text-transform: uppercase; }

/* ---------- Reporter app ---------- */
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--surface); display: flex; flex-direction: column; }
@media (min-width: 600px) { .app { margin-block: 24px; min-height: calc(100vh - 48px); border-radius: 28px; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; } }
.app-bar { display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 12px; background: var(--brand); color: var(--on-brand); }
.app-bar b { font-family: var(--font-display); font-size: 17px; display: block; }
.app-bar small { display: block; font-size: 11.5px; opacity: .85; }
.app-back { background: rgba(255,255,255,.16); color: inherit; width: 34px; height: 34px; border-radius: 10px; font-size: 20px; line-height: 34px; text-align: center; text-decoration: none; flex: none; }
.screen { flex: 1; padding: 18px 16px calc(env(safe-area-inset-bottom, 0px) + 24px); display: flex; flex-direction: column; gap: 14px; }
.eyebrow { font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.hero h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.hero h1 span { display: block; color: var(--brand); }
.hero p { margin-top: 8px; color: var(--muted); }
.big { display: block; width: 100%; text-align: left; border: 1.5px solid var(--line); background: var(--surface-2); border-radius: 16px; padding: 14px 16px; font-weight: 700; font-size: 16.5px; font-family: var(--font-display); color: var(--ink); text-decoration: none; }
.big small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 13px; color: var(--muted); }
.big.primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.big.primary small { color: var(--on-brand); opacity: .85; }
.big.ghost { background: none; border-style: dashed; }
.big.danger { border-color: var(--crit); color: var(--crit); background: var(--crit-bg); }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--brand); }
.q { font-family: var(--font-display); font-size: 21px; font-weight: 700; }
.q + .sub { margin-top: -8px; }
.choice { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
.choice.two { grid-template-columns: 1fr 1fr; }
.opt { position: relative; display: block; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: 14px; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; line-height: 1.35; }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.opt:has(input:focus-visible) { outline: 3px solid var(--sun); outline-offset: 2px; }
.emerg { border: 2px solid var(--crit); background: var(--crit-bg); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.emerg h3 { font-size: 17px; color: var(--crit); }
.emerg p { font-size: 13.5px; }
.hl { display: grid; gap: 8px; }
.hl-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.hl-item b { display: block; font-size: 14px; }
.hl-item span { font-size: 12px; color: var(--muted); }
.hl-item .num { font-family: var(--font-mono); font-weight: 700; font-size: 16px; color: var(--crit); white-space: nowrap; user-select: all; text-decoration: none; }
.hl-item.todo { border-style: dashed; }
.hl-item.todo .num { color: var(--muted); font-size: 12px; font-family: var(--font-body); font-weight: 600; }
.codecard { background: var(--brand); color: var(--on-brand); border-radius: 18px; padding: 18px; display: grid; gap: 10px; text-align: center; }
.codecard .k { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.codecard .v { font-family: var(--font-mono); font-size: 26px; font-weight: 700; letter-spacing: .04em; user-select: all; }
.codecard .pair { display: grid; grid-template-columns: 1.6fr 1fr; gap: 8px; }
.codecard .pair > div { background: rgba(255,255,255,.12); border-radius: 12px; padding: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding-bottom: 12px; position: relative; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 10px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); }
.timeline li.done .dot { background: var(--brand); border-color: var(--brand); }
.timeline li.now .dot { background: var(--sun); border-color: var(--sun); box-shadow: 0 0 0 4px var(--sun-soft); }
.timeline li span { color: var(--muted); font-size: 12px; display: block; }
.thread { display: grid; gap: 8px; }
.msg { max-width: 86%; padding: 8px 11px; border-radius: 14px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; white-space: normal; }
.msg.me { justify-self: end; background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.msg.me small { color: var(--on-brand); opacity: .8; }
.composer { display: flex; gap: 8px; }
.composer > input, .composer > select { flex: 1; min-width: 0; }
.offline-bar { background: var(--sun-soft); color: var(--sun-ink); font-size: 13px; font-weight: 600; padding: 8px 16px; text-align: center; }

/* ---------- Staff area ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top-in { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; padding: 12px 16px; max-width: 1320px; margin: 0 auto; }
.brand { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; min-width: 0; }
.brand b { font-family: var(--font-display); font-size: 19px; font-weight: 800; display: block; line-height: 1.1; }
.brand span { font-size: 12px; color: var(--muted); }
.nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.nav a { color: var(--muted); font-weight: 600; text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); }
.wrap { padding-inline: 16px; padding-block: 20px 48px; max-width: 1320px; margin: 0 auto; display: grid; gap: 16px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.alert { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--crit-bg); border: 1.5px solid var(--crit); border-radius: 14px; padding: 10px 14px; }
.alert b { color: var(--crit); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: end; }
.filters select, .filters input { font-size: 14px; padding: 7px 9px; }
.list { display: grid; gap: 8px; }
.crow { display: grid; grid-template-columns: 5px minmax(0, 1fr) auto; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; color: inherit; text-decoration: none; }
.crow:hover { border-color: var(--brand); }
.crow .stripe { background: var(--low); }
.crow .stripe.critical { background: var(--crit); } .crow .stripe.urgent { background: var(--urg); } .crow .stripe.normal { background: var(--norm); }
.crow .main { padding: 10px 0; min-width: 0; display: grid; gap: 3px; }
.crow .t { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.crow .t .mono { font-weight: 700; font-size: 12.5px; }
.crow .meta { font-size: 12px; color: var(--muted); }
.crow .side { padding: 10px 12px 10px 0; display: grid; gap: 6px; justify-items: end; align-content: start; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: 16px; }
.case { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ctrls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ctrls label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--muted); display: grid; gap: 4px; }
.ctrls select { font-size: 14px; padding: 7px 9px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink); }
.reasons { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.quote { background: var(--surface-2); border-left: 3px solid var(--brand); padding: 10px 12px; border-radius: 0 10px 10px 0; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 12px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.audit { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.audit li { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; }
.audit time { color: var(--muted); font-variant-numeric: tabular-nums; }
.auth { max-width: 420px; margin: 8vh auto; padding-inline: 16px; display: grid; gap: 16px; }
.qr svg { width: 200px; height: 200px; background: #fff; padding: 10px; border-radius: 10px; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; font-family: var(--font-mono); font-size: 14px; background: var(--surface-2); padding: 12px; border-radius: 12px; }

@media (max-width: 900px) {
  .case { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .ctrls, .row2 { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dd { margin-bottom: 8px; }
  .audit li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .brand span { display: none; }
}

/* ---------- Reports, admin, posters ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.kpi .n { font-family: var(--font-display); font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .l { font-size: 12.5px; color: var(--muted); }
.kpi.hot .n { color: var(--crit); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.chart-wrap { overflow-x: auto; }
svg.chart { width: 100%; min-width: 520px; height: auto; display: block; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .ax { fill: var(--muted); font: 11px var(--font-body); }
svg.chart .val { fill: var(--ink); font: 700 11px var(--font-body); }
.b-critical { fill: var(--crit); background: var(--crit); } .b-urgent { fill: var(--urg); background: var(--urg); }
.b-normal { fill: var(--norm); background: var(--norm); } .b-low { fill: var(--low); background: var(--low); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.hbars { display: grid; gap: 7px; }
.hbar { display: grid; grid-template-columns: 170px minmax(0, 1fr) 36px; gap: 10px; align-items: center; font-size: 13px; }
.hbar .track { background: var(--surface-2); border-radius: 5px; height: 14px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--brand); border-radius: 5px; }
.hbar .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.tbl .c { text-align: center; }
.tbl.num td, .tbl.num th { text-align: right; font-variant-numeric: tabular-nums; }
.tbl.num td:first-child, .tbl.num th:first-child { text-align: left; }
.tbl select { width: auto; font-size: 13px; padding: 5px 7px; }
.tbl input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--brand); }
.tbl .acts { white-space: nowrap; text-align: right; }
.tbl .acts form { display: inline; }
.muted-row td { opacity: .55; }
.yes { color: var(--ok); font-weight: 800; }
.no { color: var(--muted); }
.chipok, .chipwarn { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; }
.chipok { background: var(--ok-bg); color: var(--ok); }
.chipwarn { background: var(--urg-bg); color: var(--urg); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 700; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.privacy-wall { display: flex; gap: 12px; align-items: flex-start; background: var(--sun-soft); border-radius: 14px; padding: 12px 16px; font-size: 14px; }
.privacy-wall svg { flex: none; color: var(--sun-ink); margin-top: 1px; }
.status { display: grid; gap: 9px; }
.srow { display: grid; grid-template-columns: 10px 120px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 14px; }
.srow span { color: var(--muted); overflow-wrap: anywhere; }
.sdot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.sdot.crit { background: var(--crit); } .sdot.warn { background: var(--urg); } .sdot.off { background: var(--low); }
.issue { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; }
.hlrow { padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
/* The poster is printed on paper, so it keeps the same light colours in both themes. */
.poster { background: #FFFFFF; color: #0D2B2D; border-radius: 14px; padding: 24px 22px; display: grid; gap: 10px; justify-items: center; text-align: center; border: 1px solid var(--line); max-width: 380px; width: 100%; justify-self: center; }
.poster .pk { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: #4C6466; }
.poster h3 { font-size: 26px; font-weight: 800; color: #0D5B60; }
.poster .lede { font-size: 14px; }
.poster .qrbox { width: 200px; height: 200px; padding: 6px; outline: 3px solid #E3A00C; border-radius: 6px; background: #FFFFFF; }
.poster .qrbox svg { width: 100%; height: 100%; display: block; }
.poster .url { font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.poster .foot { font-size: 12px; border-top: 1px dashed #A9BDBE; padding-top: 8px; width: 100%; color: #2D4446; }
.poster .foot span { color: #7A8E90; font-size: 11px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .srow { grid-template-columns: 10px minmax(0, 1fr); }
  .srow span { grid-column: 2; }
  .hbar { grid-template-columns: 110px minmax(0, 1fr) 30px; }
}

/* AI summary */
.ai { background: linear-gradient(135deg, var(--brand-soft), var(--surface-2)); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: grid; gap: 8px; }
.ai .tag { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--brand); }
