:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef4f1;
  color: #202428;
  --bg: #eef4f1;
  --panel: #ffffff;
  --panel-soft: #f8faf9;
  --line: #d6dedb;
  --line-strong: #b8c6c1;
  --text: #202428;
  --muted: #5c6763;
  --accent: #176b5d;
  --accent-strong: #104d43;
  --blue: #245f9f;
  --danger: #a83b31;
  --shadow: 0 18px 50px rgb(26 39 35 / 10%);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f7faf9 0, var(--bg) 320px), var(--bg);
}
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
a { color: var(--blue); }
h1, h2, h3, h4, p { margin-block-start: 0; }
h1 { margin-block-end: 0; font-size: clamp(1.8rem, 5vw, 3.2rem); line-height: 1; letter-spacing: 0; }
h2 { margin-block-end: 0; font-size: clamp(1.45rem, 3vw, 2.15rem); letter-spacing: 0; }
h3 { margin: 0; font-size: 1.05rem; letter-spacing: 0; }
h4 { margin: 0 0 12px; font-size: 0.95rem; }
label { display: grid; gap: 7px; color: #34403b; font-size: 0.9rem; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 9px 11px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgb(36 95 159 / 28%);
  outline-offset: 2px;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 20;
  transform: translateY(-140%);
  border-radius: 7px;
  background: var(--accent-strong);
  color: #fff;
  padding: 10px 12px;
}
.skip-link:focus { transform: translateY(0); }
.app-shell { width: min(1480px, 100%); margin: 0 auto; padding: 24px; }
.topbar, .section-heading, .panel__header, .button-row, .inline-form, .upload-drop, .mode-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar { justify-content: space-between; margin-bottom: 18px; }
.topbar__status, .pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #34403b;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}
.topbar__status.is-ok, .pill.is-ok { border-color: #a4cbc0; background: #e9f7f3; color: #0d5f51; }
.topbar__status.is-error, .pill.is-error { border-color: #e2b3ad; background: #fff0ee; color: #8f2f27; }
.eyebrow { margin: 0 0 6px; color: #60706a; font-size: 0.75rem; font-weight: 850; letter-spacing: 0; text-transform: uppercase; }
.mode-tabs { margin: 10px 0 22px; border-bottom: 1px solid var(--line); }
.tab {
  appearance: none;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 12px 4px 10px;
  font-weight: 850;
}
.tab.is-active { border-color: var(--accent); color: var(--accent-strong); }
.view { display: none; }
.view.is-active { display: block; }
.section-heading { justify-content: space-between; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid--admin { grid-template-columns: minmax(280px, 0.8fr) minmax(340px, 1.2fr); }
.grid--guest { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
.panel, .subpanel { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); }
.panel { padding: 18px; }
.subpanel { padding: 16px; box-shadow: none; }
.panel--wide { grid-column: 1 / -1; }
.panel__header { justify-content: space-between; margin-bottom: 14px; }
.stack { display: grid; gap: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.button-row { flex-wrap: wrap; }
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  padding: 9px 13px;
  font-weight: 850;
  text-decoration: none;
}
.button:hover { background: var(--accent-strong); }
.button:disabled { cursor: not-allowed; opacity: 0.55; }
.button--ghost { border-color: var(--line-strong); background: #fff; color: #2d3b36; }
.button--ghost:hover { background: #f0f5f3; }
.button--danger { border-color: var(--danger); background: var(--danger); }
.button--danger:hover { background: #832d26; }
.muted { color: var(--muted); line-height: 1.45; }
.list { display: grid; gap: 10px; }
.list--compact { margin-top: 12px; gap: 8px; }
.item { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); padding: 12px; }
.item__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.item__title { overflow-wrap: anywhere; font-weight: 850; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 0.86rem; }
.detail-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.empty-state { border: 1px dashed var(--line-strong); border-radius: 8px; background: #fbfdfc; color: var(--muted); padding: 18px; }
.facts { display: grid; grid-template-columns: minmax(100px, 0.45fr) minmax(0, 1fr); gap: 8px 12px; margin: 0; }
.facts dt { color: var(--muted); font-weight: 800; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.inline-form { align-items: end; margin-top: 12px; }
.inline-form label { flex: 1 1 220px; }
.check {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  align-self: end;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 9px 11px;
}
.check input { width: auto; min-height: auto; }
.upload-drop { align-items: end; flex-wrap: wrap; }
.upload-drop input { flex: 1 1 260px; }
.progress { overflow: hidden; height: 9px; border-radius: 999px; background: #dde7e4; }
.progress span { display: block; width: var(--value, 0%); height: 100%; border-radius: inherit; background: var(--blue); }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 15; width: min(420px, calc(100vw - 36px)); }
.toast { border: 1px solid var(--line-strong); border-radius: 8px; background: #17201d; color: #fff; box-shadow: var(--shadow); padding: 12px 14px; }
.is-hidden { display: none !important; }

@media (max-width: 920px) {
  .app-shell { padding: 18px; }
  .topbar, .section-heading { align-items: flex-start; flex-direction: column; }
  .grid--admin, .grid--guest, .detail-layout { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .app-shell { padding: 14px; }
  .panel, .subpanel { padding: 14px; }
  .inline-form, .button-row { align-items: stretch; flex-direction: column; }
  .button, .inline-form label { width: 100%; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
}

.native-file-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.file-picker {
  flex: 0 0 auto;
}
.native-file-input:focus-visible + .file-picker,
.file-picker:focus-visible {
  outline: 3px solid rgb(36 95 159 / 28%);
  outline-offset: 2px;
}
