/* Matches the public site (saligkauban-site/src/styles.css): same palette, fonts and chunky buttons. Fonts are self-hosted so the admin loads nothing third-party. */
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 400; font-display: swap; src: url('/fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 700; font-display: swap; src: url('/fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 200 800; font-display: swap; src: url('/fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2'); }

:root {
  --bg: #fff8e8;
  --surface: #fffdf6;
  --ink: #0f2a2d;
  --muted: #46605f;
  --line: #e2d5b1;
  --edge: #0f2a2d;
  --shadow: #0f2a2d;
  --accent: #0a6b6f;
  --accent-soft: #d3ebe9;
  --panel: #0a6b6f;
  --mango: #f0a81c;
  --mango-soft: #fdf0cf;
  --bad: #a8281d;
  --bad-soft: #fbe1dc;
  --ok-soft: #d8f0dc;
  --focus: #0f2a2d;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1a1d;
    --surface: #182c32;
    --ink: #e8f1ee;
    --muted: #9db3b8;
    --line: #2f464d;
    --edge: #4c8588;
    --shadow: #050d0e;
    --accent: #5fc9c4;
    --accent-soft: #1b3d42;
    --panel: #083e41;
    --mango-soft: #3a2f14;
    --bad: #ff8a7d;
    --bad-soft: #40211d;
    --ok-soft: #1c3a24;
    --focus: #f3b948;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: 'Bricolage Grotesque', 'Atkinson Hyperlegible', system-ui, sans-serif; line-height: 1.1; letter-spacing: -0.01em; }
h1 { font-size: 2rem; font-weight: 800; margin: 0 0 18px; }
h2 { font-size: 1.3rem; font-weight: 700; margin: 36px 0 12px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.top :focus-visible { outline-color: #fff8e8; }

/* header: teal bar with the white logo, like the site */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  background: var(--panel);
  color: #fff;
  border-bottom: 4px solid var(--mango);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand img { display: block; height: 36px; width: auto; }
.chip { padding: 2px 10px; border: 2px dashed var(--mango); border-radius: 8px; font-size: 0.8rem; font-weight: 700; color: #fff; }
.top nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; margin-left: auto; font-weight: 700; }
.top nav a { color: #fff; text-decoration: none; }
.top nav a:hover, .top nav a[aria-current='page'] { text-decoration: underline; text-decoration-color: var(--mango); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.top button.link { color: #fff; font-weight: 700; }
.top .who { font-size: 0.85rem; opacity: 0.85; font-weight: 400; }

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px max(16px, env(safe-area-inset-right, 0px)) 64px max(16px, env(safe-area-inset-left, 0px));
}

.narrow { max-width: 480px; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.row h1 { margin: 0; }

form { display: grid; gap: 14px; margin: 16px 0; }
form.inline { display: inline-flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0; }
label { display: grid; gap: 4px; font-weight: 700; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
label small, .hint { font-weight: 400; color: var(--muted); font-size: 0.85rem; }

input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border: 2px solid var(--edge);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}
input[type='checkbox'] { width: 20px; min-height: 20px; accent-color: var(--accent); }
textarea { resize: vertical; }

/* mango pill with the hard offset shadow from the site */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 2px solid var(--edge);
  border-radius: 999px;
  background: var(--mango);
  color: #0f2a2d;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--shadow);
  transition: translate 0.15s, box-shadow 0.15s;
}
button:hover, .btn:hover { translate: 0 -2px; box-shadow: 3px 5px 0 var(--shadow); }
button:active, .btn:active { translate: 2px 2px; box-shadow: 1px 1px 0 var(--shadow); }
button.ghost, .btn.ghost { background: var(--surface); color: var(--ink); }
button.link { min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; color: var(--accent); font-weight: 400; text-decoration: underline; translate: none; }
button.danger { background: var(--bad-soft); color: var(--bad); }
form > button { justify-self: start; }

/* tables sit on a card */
.scroll { overflow-x: auto; border: 2px solid var(--edge); border-radius: 14px; background: var(--surface); box-shadow: 4px 4px 0 var(--shadow); }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--mango-soft); }
.num { text-align: right; white-space: nowrap; }
.strong td { font-weight: 700; }
table.sum { max-width: 560px; margin-top: 16px; border: 2px solid var(--edge); border-radius: 14px; border-collapse: separate; border-spacing: 0; overflow: hidden; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); font-size: 0.8rem; font-weight: 700; }
.badge.done { background: var(--ok-soft); }
.badge.cancelled { background: var(--bad-soft); color: var(--bad); }
.badge.admin, .badge.manager { background: var(--mango-soft); }
.error { padding: 10px 14px; border: 2px solid var(--bad); border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-weight: 700; }
.ok { padding: 10px 14px; border: 2px solid var(--accent); border-radius: 10px; background: var(--ok-soft); font-weight: 700; }
.muted { color: var(--muted); font-size: 0.9rem; }

.card, section.narrow, .facts { background: var(--surface); border: 2px solid var(--edge); border-radius: 14px; box-shadow: 4px 4px 0 var(--shadow); }
section.narrow { padding: 24px; }
section.narrow h1 { font-size: 1.7rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 20px; padding: 18px 20px; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.photos figure { margin: 0; }
.photos img { width: 100%; height: 160px; object-fit: cover; border: 2px solid var(--edge); border-radius: 10px; }
.photos figcaption { font-size: 0.85rem; color: var(--muted); }

.doc { max-width: 760px; background: var(--surface); padding: 32px; border: 2px solid var(--edge); border-radius: 14px; }

main a:not(.btn) { color: var(--accent); font-weight: 700; }
.pre { white-space: pre-wrap; }

/* confidentiality guard (guard.js) and watermark */
.secret { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.secret.hide { filter: blur(16px); }
.secret img { pointer-events: none; -webkit-user-drag: none; }
.mark { position: fixed; inset: 0; z-index: 5; display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around; gap: 48px 24px; overflow: hidden; pointer-events: none; opacity: 0.08; transform: rotate(-18deg) scale(1.4); font-size: 0.85rem; font-weight: 700; user-select: none; }

@media (max-width: 640px) {
  .top nav { margin-left: 0; width: 100%; }
  h1 { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  button, .btn { transition: none; }
}

@media print {
  .top, .noprint, .secret, .mark { display: none; }
  body, .doc { background: #fff; color: #000; border: 0; box-shadow: none; }
  main { padding: 0; max-width: none; }
}
