/* DOBROVOZIM web portal — shared stylesheet.
   Theme: roads & road trips — asphalt, lane markings, highway-sign green
   and road-trip paper. Vanilla CSS, no external fonts/assets: system font
   stack only. Class names are the JS contract — style only, no structure. */

:root {
  color-scheme: light;
  /* forest-lined asphalt */
  --asphalt: #203c36;
  --asphalt-2: #2e4841;
  --asphalt-3: #556a60;
  /* warm road-atlas paper */
  --paper: #f5f2e9;
  --card: #fffefb;
  --line: #e0e3d8;
  --line-strong: #b9c5b9;
  /* road-marking yellow */
  --lane: #e5ae45;
  --lane-soft: #fbf1d9;
  /* highway sign green (primary) */
  --accent: #17634c;
  --accent-dark: #104a39;
  --accent-soft: #edf4ec;
  --accent-line: #b9d3be;
  /* motorway blue (admin) */
  --sign-blue: #1462a8;
  --sign-blue-dark: #0f4d85;
  --sign-blue-soft: #e4eef8;
  /* ink */
  --ink: #263b34;
  --ink-soft: #52645b;
  --ink-faint: #657368;
  --danger: #c23a2b;
  --danger-soft: #fbe9e5;
  --danger-line: #efc4bb;
  --warn: #7d5f0e;
  --warn-soft: #fdf3d7;
  --warn-line: #e8d391;
  --ok: #0a5f3b;
  --ok-soft: #e3f2e9;
  --ok-line: #b7dcc6;
  --radius: 20px;
  --radius-s: 10px;
  --shadow: 0 2px 4px rgba(32, 60, 54, 0.025), 0 12px 36px rgba(32, 60, 54, 0.055);
  --font-display: "Avenir Next", Avenir, "Segoe UI", -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 40px 24px 64px;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 16px;
  line-height: 1.5;
  /* Quiet atlas grid: texture stays behind, never competes with the data. */
  background:
    radial-gradient(ellipse at 5% 0%, rgba(191, 211, 182, 0.35), transparent 48%),
    radial-gradient(ellipse at 100% 20%, rgba(235, 206, 142, 0.18), transparent 45%),
    repeating-linear-gradient(0deg, transparent 0 47px, rgba(74, 91, 80, 0.035) 47px 48px),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(74, 91, 80, 0.035) 47px 48px),
    var(--paper);
}

::selection { background: rgba(240, 180, 41, 0.45); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: 780px;
  margin: 0 auto;
}

main, .card, .field, .row-2 > *, .row-3 > * { min-width: 0; }
a { color: var(--accent-dark); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
input, select, textarea, button { accent-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--ink-faint); opacity: 1; }

/* Wide variant for data-heavy pages (the directory's 10-column tables). */
.wrap.wide {
  max-width: 1120px;
}

/* ---------- route marker brand + quiet lane-line divider ---------- */
.site-head {
  margin-bottom: 32px;
}

.site-head .brand::before {
  content: "";
  display: inline-block;
  width: 35px;
  height: 39px;
  margin-right: 12px;
  vertical-align: -12px;
  border: 1px solid var(--accent-dark);
  border-radius: 10px 10px 15px 15px;
  background:
    repeating-linear-gradient(0deg, var(--lane) 0 5px, transparent 5px 9px) center / 2px 23px no-repeat,
    linear-gradient(103deg, transparent 38%, #ffffffbb 39% 42%, transparent 43%) center / 26px 23px no-repeat,
    linear-gradient(77deg, transparent 57%, #ffffffbb 58% 61%, transparent 62%) center / 26px 23px no-repeat,
    var(--accent);
  box-shadow: inset 0 0 0 3px var(--paper), 0 3px 8px #203c3610;
}

.site-head .brand {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--asphalt);
  text-decoration: none;
}

.site-head .brand:hover { color: var(--accent-dark); }

.site-head::after {
  content: "";
  display: block;
  height: 5px;
  margin: 24px 0 0;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, var(--lane) 0 16px, transparent 16px 28px) right center / 112px 3px no-repeat,
    linear-gradient(90deg, var(--accent) 0 48px, var(--line) 48px calc(100% - 128px), transparent calc(100% - 128px));
}

.site-head .tagline {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.crumbs {
  margin: 14px 0 4px;
  font-size: 13.5px;
  color: var(--ink-faint);
}
.crumbs a { color: var(--accent-dark); text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }

/* condensed highway-sign headings */
h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 750;
  letter-spacing: -0.035em;
  margin: 6px 0 12px;
  line-height: 1.2;
  color: var(--asphalt);
}

h2 {
  font-family: var(--font-display);
  font-size: 18.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--asphalt);
}

.page-sub {
  margin: 0 0 28px;
  max-width: 74ch;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
}

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
}

.card > h2:first-child { margin-top: 0; }

/* hub cards */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

.hub-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, border-top-color 0.15s ease,
    transform 0.15s ease, box-shadow 0.15s ease;
}

.hub-card:hover,
.hub-card:focus-visible {
  border-color: var(--accent-line);
  border-top-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(35, 38, 44, 0.10), 0 10px 22px rgba(35, 38, 44, 0.10);
}

.hub-card:hover .hc-title,
.hub-card:focus-visible .hc-title { color: var(--accent-dark); }

.hub-card .hc-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16.5px;
  letter-spacing: 0.03em;
  color: var(--asphalt);
  margin-bottom: 4px;
}

.hub-card .hc-desc {
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: 10px;
}

/* audience chips as miniature road signs */
.audience {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 5px;
  color: #fff;
  background: var(--asphalt-2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.audience.public { background: var(--accent); }
.audience.admin { background: var(--sign-blue); }
.audience.superuser { background: var(--asphalt); }

/* ---------- forms ---------- */
.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.field .hint {
  display: block;
  font-weight: 400;
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 3px;
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fcfcf8;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 122, 77, 0.16);
}

input.invalid,
select.invalid { border-color: var(--danger); }

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 18px 20px 4px;
  margin: 0 0 22px;
  min-width: 0;
  background: linear-gradient(135deg, #f5f7ef80, transparent);
}

legend {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0 6px;
}

/* ---------- buttons: highway-sign primary ---------- */
.btn {
  display: inline-block;
  min-height: 44px;
  padding: 10px 18px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 9px;
  border: 1px solid var(--accent-dark);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 2px 3px #203c3610, inset 0 1px 0 #ffffff20;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover { background: var(--accent-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn.secondary {
  background: #fffef9;
  color: var(--accent-dark);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1.5px rgba(14, 122, 77, 0.18);
}
.btn.secondary:hover { background: var(--accent-soft); }

.btn.danger {
  background: #fffef9;
  color: var(--danger);
  border-color: var(--danger);
  box-shadow: inset 0 0 0 1.5px rgba(194, 58, 43, 0.18);
}
.btn.danger:hover { background: var(--danger-soft); }

.btn.small {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
  box-shadow: none;
  color: var(--ink-soft);
}
.btn.ghost:hover { background: rgba(35, 38, 44, 0.05); color: var(--ink); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ---------- notices / status chips ---------- */
.notice {
  padding: 10px 13px;
  border-radius: var(--radius-s);
  font-size: 14px;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-left-width: 4px;
  background: var(--card);
}

.notice.error { background: var(--danger-soft); border-color: var(--danger-line); border-left-color: var(--danger); color: #8e2019; }
.notice.warn { background: var(--warn-soft); border-color: var(--warn-line); border-left-color: var(--lane); color: var(--warn); }
.notice.ok { background: var(--ok-soft); border-color: var(--ok-line); border-left-color: var(--accent); color: var(--ok); }

.chip {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.chip.pending { background: var(--lane); color: #4a3a05; }
.chip.approved { background: var(--accent); color: #fff; }
.chip.denied { background: var(--danger); color: #fff; }
.chip.revoked { background: #657368; color: #fff; }

/* key / id highlight boxes: road-work note */
.keybox {
  background: var(--warn-soft);
  border: 2px dashed var(--lane);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  margin: 10px 0;
  font-family: var(--font-mono);
  font-size: 14px;
  word-break: break-all;
  user-select: all;
  color: #55430c;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.95em;
  word-break: break-all;
}

/* the big reference id as a license plate */
.big-id {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  color: var(--asphalt);
  background: #fffef8;
  border: 2px solid var(--asphalt);
  border-left-width: 14px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9), 0 2px 6px rgba(35, 38, 44, 0.14);
  padding: 10px 14px;
  word-break: break-all;
  user-select: all;
  margin: 8px 0;
  display: inline-block;
  letter-spacing: 0.04em;
}

/* ---------- tables ---------- */
.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-s);
  scrollbar-color: var(--line-strong) transparent;
}

/* directory: section tabs + read-only badge */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 14px;
}
.tabs .tab.active {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45);
}
.tabs .tab.active:hover { background: var(--accent-dark); }

#ro-badge {
  margin-bottom: 12px;
}
#ro-badge .ro-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--asphalt-3);
  border-radius: var(--radius-s);
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  color: var(--ink-soft);
}
#ro-badge .ro-line.on {
  border-color: var(--danger-line);
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: #8e2019;
  font-weight: 600;
}

table.list {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.list th,
table.list td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.list th {
  font-family: var(--font-display);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--accent-line);
  background: var(--accent-soft);
}

table.list tbody tr:hover td { background: rgba(240, 180, 41, 0.08); }

table.list tr:last-child td { border-bottom: none; }

/* Compact modifier (directory + admin approvals): smaller type so wide
   tables fit on screen. */
table.list.compact { font-size: 11.5px; table-layout: auto; }
table.list.compact th,
table.list.compact td { padding: 4px 6px; }
table.list.compact th { font-size: 10px; letter-spacing: 0.3px; border-bottom-width: 2px; }
table.list.compact td a { word-break: break-all; }
table.list.compact .muted { font-size: 11px; }
/* approvals actions cell: stack the control rows tightly */
table.list.compact td[data-th="Actions"] .btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}
table.list.compact td[data-th="Actions"] .btn-row:last-child { margin-bottom: 0; }
table.list.compact .inline-input {
  max-width: 150px;
  padding: 4px 7px;
  font-size: 12.5px;
}
.btn.small.danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-line);
  box-shadow: none;
}
.btn.small.danger-ghost:hover { background: var(--danger-soft); }

/* admin rows as cards on narrow screens */
@media (max-width: 640px) {
  body { padding: 24px 16px 40px; }
  .site-head { margin-bottom: 26px; }
  .site-head .brand { font-size: 18px; letter-spacing: 0.09em; }
  .card { padding: 20px; border-radius: 16px; }
  fieldset { padding: 14px 12px 0; }
  .page-sub { font-size: 14px; }
  .btn.small { min-height: 40px; }
  .btn-row > * { max-width: 100%; }
  .cards { grid-template-columns: 1fr; }
  .row-2, .row-3 { grid-template-columns: 1fr; }

  table.list thead { display: none; }
  table.list tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    margin-bottom: 10px;
    padding: 6px 4px;
    background: var(--card);
  }
  table.list td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px dashed var(--line);
    padding: 6px 8px;
  }
  table.list td:last-child { border-bottom: none; }
  table.list td::before {
    content: attr(data-th);
    font-weight: 700;
    font-size: 12px;
    color: var(--ink-faint);
    text-transform: uppercase;
    flex: 0 0 28%;
    overflow-wrap: anywhere;
  }
  table.list td > * { min-width: 0; max-width: 100%; }
  table.list td { overflow-wrap: anywhere; }
}

/* registration entry card on admin list */
.reg-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--asphalt-3);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--card);
}

.reg-card .reg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.reg-card .reg-title { font-weight: 700; }

.reg-meta {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 2px 0;
}

.reg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--lane);
}

.inline-input {
  width: auto;
  max-width: 260px;
  padding: 6px 9px;
  font-size: 13.5px;
}

/* ---------- footer: end-of-route milestone ---------- */
.footnote {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 2px dashed rgba(240, 180, 41, 0.55);
  font-size: 13px;
  color: var(--ink-faint);
}

.footnote a { color: var(--accent-dark); }

.muted { color: var(--ink-faint); font-size: 13px; }

.hidden { display: none !important; }

.spin {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Respect quiet journeys, and keep keyboard navigation unambiguous. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .btn, .chip, .audience, .card, .hub-card { border: 1px solid ButtonText; }
}

@media print {
  body { background: #fff; padding: 0; }
  .card, .hub-card { box-shadow: none; break-inside: avoid; }
  .site-head::after { background: none; border-bottom: 1px solid; }
}