/*
 * Shared look for the worker app and the admin app, in DC Wäst's graphic
 * profile: Calibri (Carlito, which has the same metrics, where Calibri is not
 * installed, as on phones), and only the profile's colours – DC Brown #724314,
 * black, Grey #4A4A4A, Line beige #D9CFC3 and Light surface #F7F3EE – on
 * white. The profile's Dark brown is left out of the app at DC Wäst's request
 * (2026-11-04); the printed sheets keep it for their subtitles.
 *
 * Two deliberate exceptions. Status is text, not coloured badges, as the
 * profile asks; but the worker's ticks stay green (--ok), because at a gate in
 * daylight green reads as "done" faster than brown. And the profile is written
 * for documents, so there is no dark mode: the app is always light.
 */
@import url('https://fonts.googleapis.com/css2?family=Carlito:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --ground: #F7F3EE; --surface: #FFFFFF; --surface-2: #F7F3EE; --sunk: #F7F3EE;
  --ink: #000000; --ink-2: #4A4A4A; --muted: #4A4A4A;
  --line: #D9CFC3; --line-strong: #4A4A4A;
  --accent: #724314; --accent-ink: #724314; --accent-soft: #F7F3EE;
  --ok: #0F6544; --ok-soft: #DFF0E8;
  --warn: #724314; --warn-soft: #F7F3EE;
  --crit: #724314; --crit-soft: #F7F3EE;
  --shadow: 0 1px 2px rgba(62,34,1,.08), 0 10px 28px -16px rgba(62,34,1,.28);
  --r: 6px;
  --display: Calibri, Carlito, "Segoe UI", sans-serif;
  --body: Calibri, Carlito, "Segoe UI", sans-serif;
  --mono: Calibri, Carlito, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
/* Room for the scrollbar is kept on every page, so the layout does not jump between short and long tabs. */
html { scrollbar-gutter: stable; }
body { background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; text-wrap: balance; }
h1, h2 { color: var(--accent); }
h1 { font-size: 1.75rem; line-height: 1.15; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Shell */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--accent);
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
/* The profile's vector logo, at its proportions (14.3 x 16.0). */
.brand-logo { width: 27px; height: 30px; flex: none; display: block; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 15px; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
.spacer { flex: 1; }
main { width: 100%; max-width: 1060px; margin: 0 auto; padding-inline: 16px; padding-block: 24px 56px; }
main.narrow { max-width: 460px; }

/* Text */
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.lede { color: var(--ink-2); max-width: 60ch; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.error-text { color: var(--crit); font-weight: 700; font-size: 14px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 8px; border: 1.5px solid transparent;
  padding: 10px 16px; font-weight: 700; font-size: 16px; cursor: pointer; background: var(--accent); color: var(--surface); line-height: 1.2; text-decoration: none; }
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.accent { background: var(--accent); color: #fff; }
.btn.ghost { background: var(--surface); color: var(--accent); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.ok { background: var(--accent); color: #fff; }
.btn.danger { background: transparent; color: var(--crit); border-color: var(--crit); }
.btn.sm { padding: 6px 11px; font-size: 14px; border-radius: 6px; }
.btn.wide { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-ink); font-weight: 700; font-size: 14px; cursor: pointer; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Forms */
.fields { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .fields.two { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.field input, .field select, .field textarea { padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); width: 100%; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.code-input { font-family: var(--mono); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.check { display: flex; gap: 9px; align-items: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 14.5px; font-weight: 400; cursor: pointer; }
.check input { width: 19px; height: 19px; accent-color: var(--accent); flex: none; cursor: pointer; }

/* Surfaces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.panel.raised { box-shadow: var(--shadow); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.empty { text-align: center; padding: 36px 20px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r); font-size: 14px; }

/* Status. The profile replaces coloured badges with text: waiting in bold DC Brown, approved as plain text, rejected and closed in bold black. */
.chip { display: inline-flex; align-items: center; font-size: 14px; white-space: nowrap; }
.chip.pending { color: var(--accent); font-weight: 700; }
.chip.approved { color: var(--ink); }
.chip.rejected, .chip.neutral { color: var(--ink); font-weight: 700; }
.chip.declared { color: var(--muted); font-size: 13px; }
.code-pill { font-family: var(--mono); font-weight: 700; font-size: 18px; letter-spacing: .16em; background: var(--accent); color: var(--surface); padding: 5px 12px; border-radius: 4px; display: inline-block; align-self: flex-start; }

/* Lists */
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.list-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; width: 100%; text-align: left; cursor: pointer; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Cards */
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .grid { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; text-align: left; cursor: pointer; width: 100%; }
.card:hover { box-shadow: var(--shadow); }
.card h3 { font-size: 1.1rem; }
.card.closed { border-top-color: var(--line); }
.card.closed h3 { color: var(--muted); }
.card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.stats { display: flex; gap: 14px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.stats b { font-family: var(--mono); color: var(--ink); font-size: 15px; font-weight: 700; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1.5px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; padding: 9px 13px; font-weight: 700; font-size: 15px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Definition list */
.dl { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); margin: 0; }
.dl div { display: flex; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.dl div:last-child { border-bottom: 0; }
.dl dt { flex: 0 0 40%; color: var(--muted); font-size: 13.5px; padding-top: 2px; }
.dl dd { margin: 0; flex: 1; min-width: 120px; font-weight: 400; overflow-wrap: anywhere; }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; background: rgba(62,34,1,.35); }
.drawer-in { background: var(--ground); width: min(580px, 100%); height: 100%; overflow-y: auto; border-left: 1px solid var(--line); padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
.drawer-head { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 18px; display: flex; gap: 12px; align-items: center; z-index: 2; }
.drawer-body { padding: 18px; display: flex; flex-direction: column; gap: 18px; }
.icon-btn { background: var(--surface); color: var(--accent); border: 1px solid var(--line); border-radius: 7px; width: 34px; height: 34px; flex: none; cursor: pointer; font-size: 16px; line-height: 1; display: grid; place-items: center; }

/* Photos */
.photos { display: flex; gap: 10px; flex-wrap: wrap; }
.photo { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.photo img { width: 150px; height: 100px; object-fit: cover; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; cursor: zoom-in; display: block; }
.photo figcaption { font-size: 13px; color: var(--muted); }
.signature img { width: 100%; max-width: 320px; height: auto; object-fit: contain; cursor: default; }

/* Overlays */
.backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(62,34,1,.8); display: grid; place-items: center; padding: 16px; }
.dialog { background: var(--surface); border-radius: var(--r); padding: 20px; width: 100%; max-width: 480px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.lightbox img { max-width: min(900px, 100%); max-height: 85vh; border-radius: 8px; background: #fff; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 90;
  background: var(--accent); color: var(--surface); padding: 11px 18px; border-radius: 6px; font-size: 15px; font-weight: 400; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
/* Errors in bold, with a beige edge: the profile has no red. */
.toast.bad { font-weight: 700; border-left: 4px solid var(--line); }
/* The profile's fact box: Light surface with a DC Brown edge. */
.notice { border: 0; border-left: 2px solid var(--accent); background: var(--surface-2); border-radius: 0; padding: 12px 14px; font-size: 14.5px; color: var(--ink); }

/* Printing is on white: the beige page ground and tinted surfaces are for the screen only. */
@media print {
  :root { --ground: #FFFFFF; --surface-2: #FFFFFF; --sunk: #FFFFFF; }
  html, body { background: #FFFFFF !important; }
}
