:root {
  --bg: #eef1e8;
  --surface: #ffffff;
  --surface-2: #e2e7d9;
  --border: #ccd3bf;
  --text: #202b22;
  --text-muted: #5c6b5b;
  --accent: #b9812f;
  --brand: #2f4a3c;
  --brand-text: #f3f5ee;
  --brand-text-muted: #c9d2bd;
  --free: #2f8657;
  --free-bg: #cdeed9;
  --pending: #c17a12;
  --pending-bg: #ffe2a3;
  --occupied: #c23f2e;
  --occupied-bg: #ffcabd;
  --danger: #a4473a;
  --shadow: rgba(28, 36, 28, 0.10);
  --radius: 14px;
  --focus: #8a611f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121a14; --surface: #1b241c; --surface-2: #232f21; --border: #33402f;
    --text: #e7ecdf; --text-muted: #a3b099; --accent: #d7a750; --brand: #1a2a1f;
    --brand-text: #eef1e5; --brand-text-muted: #a9b89e; --free: #7fcda0; --free-bg: #17331f;
    --pending: #f0bd63; --pending-bg: #46330f; --occupied: #f0917d; --occupied-bg: #4a231c;
    --danger: #d68b7c; --shadow: rgba(0, 0, 0, 0.4); --focus: #eec27a;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Work Sans', system-ui, sans-serif;
  padding-inline: 20px;
  padding-block: 32px 56px;
  line-height: 1.5;
}
a { color: inherit; }
.page { max-width: 760px; margin-inline: auto; display: flex; flex-direction: column; gap: 18px; }
.page--narrow { max-width: 520px; }

/* Verejná stránka kalendára (/kalendar/{slug}) — myslená na vloženie (napr.
   iframe) do cudzieho webu: stránka/pozadie za kartami je priehľadné (aby
   splynulo s hostiteľským webom), ale samotný kalendár a legenda si
   ponechávajú vlastné biele pozadie a ohraničenú šírku ako všade inde. */
body.embed-page { background: transparent; padding: 10px; }
.cal-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 2px 8px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cal-main__title { font-family: 'Zilla Slab', Georgia, serif; font-weight: 600; font-size: 1.02rem; }
.cal-main__nav { display: flex; align-items: center; justify-content: space-between; }

.header {
  background: var(--brand);
  color: var(--brand-text);
  border-radius: var(--radius);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 8px 24px var(--shadow);
}
.admin-header { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.header h1 { font-family: 'Zilla Slab', Georgia, serif; font-weight: 600; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); margin: 0; text-wrap: balance; }
.header p { margin: 0; color: var(--brand-text-muted); font-size: 0.9rem; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 2px 8px var(--shadow); }
.panel--form { max-width: 100%; }

.nav-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 8px var(--shadow); }
.nav-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1.05rem; line-height: 1; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.nav-btn:hover { background: var(--surface-2); }
.nav-btn--disabled { opacity: 0.35; cursor: default; }
.month-label { font-family: 'Zilla Slab', Georgia, serif; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 0.9rem; }

.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 0.62rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); padding-bottom: 3px; border-bottom: 1px solid var(--border); margin-bottom: 3px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.day { position: relative; aspect-ratio: 1; border-radius: 6px; display: flex; align-items: flex-start; padding: 4px; font-variant-numeric: tabular-nums; font-size: 0.74rem; background: var(--free-bg); color: var(--text); }
/* Dni susedného mesiaca (výplň mriežky) – vždy jedna neutrálna farba, bez
   ohľadu na skutočnú obsadenosť. */
.day--out { background: var(--surface-2); color: var(--text-muted); opacity: 0.6; }
/* Obsadený/rezervovaný deň susedného mesiaca (rezervácia pokračujúca cez
   hranicu mesiacov) – plná farba ako v "domácom" mesiaci, len číslo dňa je
   o niečo tlmenšie, aby bolo jasné, že ide o iný mesiac. */
.day--adjacent span:first-child { opacity: 0.55; }
.day--pending { background: var(--pending-bg); color: var(--pending); font-weight: 600; }
.day--occupied { background: var(--occupied-bg); color: var(--occupied); font-weight: 600; }
.day--today { box-shadow: inset 0 0 0 2px var(--brand); font-weight: 700; }
.day--half { background-clip: padding-box; font-weight: 600; }
.dotstate { position: absolute; bottom: 4px; right: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--free); opacity: 0.6; }
.day--pending .dotstate { background: var(--pending); opacity: 1; }
.day--occupied .dotstate { background: var(--occupied); opacity: 1; }
.day--half .dotstate { display: none; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 2px 8px var(--shadow); }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-dot--free { background: var(--free); }
.legend-dot--pending { background: var(--pending); }
.legend-dot--occupied { background: var(--occupied); }

.note, .hint { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; margin: 0; }
.notice { padding: 10px 14px; border-radius: 10px; font-size: 0.85rem; }
.notice--warn { background: var(--pending-bg); color: var(--text); border: 1px solid var(--pending); }

.back-link { font-size: 0.85rem; color: var(--text-muted); text-decoration: none; }
.back-link:hover { text-decoration: underline; }

form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
input[type="text"], input[type="password"] {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 0.92rem;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
input.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.8rem; }
input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.static-value { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.85rem; margin: 0; }

.btn { font-family: 'Work Sans', system-ui, sans-serif; font-weight: 600; font-size: 0.85rem; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-text); }
.btn-primary:hover { opacity: 0.92; }
.btn-secondary { background: var(--surface-2); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--occupied-bg); }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,0.35); color: var(--brand-text); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.admin-toolbar { display: flex; justify-content: flex-end; }
.cal-list { display: flex; flex-direction: column; gap: 10px; }
.cal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; box-shadow: 0 2px 8px var(--shadow); }
.cal-card__name { font-family: 'Zilla Slab', Georgia, serif; font-weight: 600; font-size: 1rem; }
.cal-card__url { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.78rem; color: var(--text-muted); text-decoration: none; }
.cal-card__url:hover { text-decoration: underline; }
.cal-card__actions { display: flex; gap: 8px; }
.cal-card__actions form { display: inline; }
.empty-state { color: var(--text-muted); font-size: 0.9rem; padding: 20px; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius); }
code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.85em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
