:root {
  --pool: #0b5d71;
  --pool-strong: #073e4c;
  --pool-bright: #1789a6;
  --lane: #dc9c1f;
  --ink: #10262b;
  --ink-soft: #4d6b71;
  --paper: #f6fbfb;
  --surface: #ffffff;
  --line: #d7e6e8;
  --ok: #1f7a4d;
  --ok-bg: #e3f3ea;
  --warn: #a8650f;
  --warn-bg: #fbedd8;
  --full: #b23a2e;
  --full-bg: #f6e4e1;
  --focus: #1789a6;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pool: #4fb3cf;
    --pool-strong: #bfe8f4;
    --pool-bright: #6fcae4;
    --lane: #e3a95c;
    --ink: #eaf3f4;
    --ink-soft: #a9c2c6;
    --paper: #0d2226;
    --surface: #122e33;
    --line: #234249;
    --ok: #6fce9a;
    --ok-bg: #143327;
    --warn: #e3a95c;
    --warn-bg: #3a2a12;
    --full: #e2867a;
    --full-bg: #3a1e1a;
    --focus: #6fcae4;
  }
}
:root[data-theme="dark"] {
  --pool: #4fb3cf;
  --pool-strong: #bfe8f4;
  --pool-bright: #6fcae4;
  --lane: #e3a95c;
  --ink: #eaf3f4;
  --ink-soft: #a9c2c6;
  --paper: #0d2226;
  --surface: #122e33;
  --line: #234249;
  --ok: #6fce9a;
  --ok-bg: #143327;
  --warn: #e3a95c;
  --warn-bg: #3a2a12;
  --full: #e2867a;
  --full-bg: #3a1e1a;
  --focus: #6fcae4;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", sans-serif;
  line-height: 1.45;
}
#app { max-width: 980px; margin: 0 auto; padding: 28px 20px 60px; }
h1, h2, h3 { font-family: "Oswald", sans-serif; text-wrap: balance; }
a { color: var(--pool-bright); }

.eyebrow {
  font-family: "Oswald", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--pool-bright);
  font-weight: 600;
}
.title { font-size: 26px; font-weight: 700; color: var(--pool-strong); margin: 4px 0 6px; }
.subtitle { color: var(--ink-soft); font-size: 14px; margin: 0 0 20px; }

button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
.btn {
  background: var(--pool);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
}
.btn:hover { background: var(--pool-strong); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.ghost {
  background: transparent;
  color: var(--pool-strong);
  border: 1.5px solid var(--line);
}
.btn.ghost:hover { border-color: var(--pool-bright); }
.btn.danger { color: var(--full); border-color: var(--full); }
.btn.danger:hover { background: var(--full-bg); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

input[type="text"], input[type="password"], input[type="date"], input[type="number"], input[type="time"], textarea {
  font: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
textarea { resize: vertical; }

input[type="color"] {
  width: 44px;
  height: 38px;
  padding: 2px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }

.banner {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  margin: 10px 0;
  display: none;
}
.banner.show { display: block; }
.banner.err { background: var(--full-bg); color: var(--full); border: 1px solid var(--full); }
.banner.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); }
.banner.info { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); }

.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.full { background: var(--full-bg); color: var(--full); }

.stufe-group { margin-bottom: 22px; }
.stufe-title {
  font-size: 15px; font-weight: 700; color: var(--pool-strong);
  display: flex; justify-content: space-between; margin-bottom: 8px;
}
.stufe-desc {
  font-size: 13px; color: var(--ink-soft); margin: -4px 0 10px;
}
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.slot-chip {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface);
  text-align: left;
}
.slot-chip:hover:not(.full) { border-color: var(--pool-bright); cursor: pointer; }
.slot-chip.full { opacity: 0.55; cursor: not-allowed; }
.slot-chip.selected { background: var(--pool); border-color: var(--pool); color: #fff; }
.slot-chip .time { font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: 13px; display: block; }

.table-scroll { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.list th, table.list td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
table.list th { color: var(--ink-soft); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }

.admin-slot-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
}
.admin-slot-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.admin-slot-time { font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: 13.5px; }
.admin-child-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 6px 0; border-top: 1px dashed var(--line);
}
.admin-child-row:first-child { border-top: none; padding-top: 0; }
.admin-child-row.empty { color: var(--ink-soft); font-style: italic; font-size: 13px; border-top: none; }
.child-name { font-size: 13.5px; font-weight: 600; min-width: 90px; }
.email-badge { color: var(--pool-bright); cursor: help; font-weight: 400; }
.admin-child-row input[type="text"] { flex: 1; min-width: 100px; font-size: 12.5px; padding: 5px 7px; }
.icon-btn {
  background: transparent; border: 1.5px solid var(--line); color: var(--full);
  border-radius: 7px; width: 26px; height: 26px; line-height: 1; font-size: 13px; flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--full); background: var(--full-bg); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.top-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.top-nav .brand { font-family: "Oswald", sans-serif; font-weight: 700; color: var(--pool-strong); text-decoration: none; }

.project-list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line); gap: 12px; flex-wrap: wrap;
}
.project-list-item:last-child { border-bottom: none; }
.project-list-item .meta { color: var(--ink-soft); font-size: 13px; }

.confirm-inline { display: inline-flex; gap: 6px; align-items: center; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 25, 29, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: modal-fade-in 0.15s ease-out;
}
.modal {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 24px 22px;
  width: 100%;
  max-width: 400px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(9, 25, 29, 0.3);
  animation: modal-slide-in 0.18s ease-out;
}
.modal-eyebrow {
  font-family: "Oswald", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--pool-bright);
}
.modal h3 { margin: 2px 0 16px; color: var(--pool-strong); }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1;
  border-radius: 8px;
}
.modal-close:hover { background: var(--paper); color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modal-slide-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
