:root {
  --bg: #0f1218;
  --surface: #1a1f2a;
  --border: #2a3344;
  --text: #e8ecf4;
  --muted: #8b95a8;
  --accent: #c9a227;
  --accent-dim: #8a7020;
  --free: #3d7a4a;
  --booked: #a84848;
  --font: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1e2635 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

h1.site-title {
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.25;
}

.sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.sub.site-note {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.intro-notes {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.intro-notes p {
  margin: 0 0 0.5rem;
  color: var(--text);
}

.intro-notes p:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input[type="date"],
input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 4rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent-dim);
  outline-offset: 1px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.row > div {
  flex: 1;
  min-width: 10rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--accent-dim);
  background: #222836;
}

.btn-primary {
  background: linear-gradient(180deg, #b8922a 0%, var(--accent-dim) 100%);
  border-color: #a08030;
  color: #0f0f0f;
  font-weight: 600;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-danger {
  border-color: #6b3030;
  color: #f0b0b0;
  background: #2a1818;
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.35rem 0.55rem;
}

.pending-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  white-space: nowrap;
}

.slots {
  display: grid;
  gap: 0.75rem;
}

.slot {
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.slot h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.slot .status {
  font-size: 1.1rem;
  font-weight: 600;
}

.slot.free .status {
  color: #8fcf9a;
}

.slot.booked .status {
  color: #f0a0a0;
}

.slot.closed {
  border-color: #3a3f52;
  background: #12151c;
}

.slot.closed .status {
  color: var(--muted);
}

.slot.pending {
  border-color: #6b5a2a;
  background: #221c14;
}

.slot.pending .status {
  color: #d4a84b;
}

.request-panel {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #141820;
}

.request-panel h3 {
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin-bottom: 0.85rem;
}

.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
}

.check-row input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent-dim);
}

.request-box {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.request-box .btn-primary {
  margin-top: 0.5rem;
  width: 100%;
}

.inline-msg {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  color: var(--muted);
}

.inline-msg.err {
  color: #f0a0a0;
}

.inline-msg.ok {
  color: #8fcf9a;
}

.slot .detail {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.admin-nav {
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  font-size: 1rem;
  margin: 0 0 1rem;
}

.login-box {
  max-width: 20rem;
}

.msg {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.msg.err {
  background: #2a1818;
  border: 1px solid #6b3030;
  color: #f0b0b0;
}

.msg.ok {
  background: #182a1f;
  border: 1px solid #306b40;
  color: #b0f0c0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.empty {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0.5rem 0;
}

footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

/* Month overview */
.cal-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 1rem 1rem 1.1rem;
  margin-bottom: 1.75rem;
}

.cal-wrap h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.cal-nav .cal-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
  text-align: center;
}

.cal-nav .btn {
  min-width: 2.75rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cal-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-dot.booked {
  background: #c45c5c;
}

.cal-dot.pending {
  background: #c9a227;
}

.cal-dot.free {
  background: #4a6b52;
  opacity: 0.65;
}

.cal-dot.closed {
  background: #5a6278;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-cell {
  min-height: 3.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #141820;
  padding: 0.35rem 0.3rem 0.4rem;
  cursor: default;
}

.cal-cell.pad {
  border: none;
  background: transparent;
  min-height: 3.35rem;
}

.cal-cell.day {
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
}

.cal-cell.day:hover:not(.is-selected) {
  border-color: var(--accent-dim);
  background: #1a2230;
}

.cal-cell.day.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.35);
}

.cal-num {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cal-pips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.cal-pip {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0.12rem 0.28rem;
  border-radius: 4px;
  line-height: 1;
  letter-spacing: 0.02em;
}

.cal-pip.a.booked,
.cal-pip.n.booked {
  background: #3d2222;
  color: #f0a0a0;
}

.cal-pip.a.pending,
.cal-pip.n.pending {
  background: #2a2414;
  color: #d4a84b;
}

.cal-pip.a.free,
.cal-pip.n.free {
  background: #182218;
  color: #7aab84;
}

.cal-pip.a.closed,
.cal-pip.n.closed {
  background: #1e222c;
  color: #8b92a8;
}

@media (max-width: 380px) {
  .cal-num {
    font-size: 0.78rem;
  }
  .cal-pip {
    font-size: 0.52rem;
    padding: 0.1rem 0.22rem;
  }
}
