/* TischZeit — shared design system for guest + admin pages.
   Warm fine-dining ambiance. Offline-safe: system + serif fallback stacks only. */

:root {
  /* Palette */
  --cream: #f7f1e6;
  --cream-deep: #efe6d4;
  --charcoal: #2b2522;
  --charcoal-soft: #443c37;
  --terracotta: #8c3b2f;
  --terracotta-dark: #6f2c22;
  --burgundy: #5e1f1f;
  --gold: #c9a24b;
  --gold-soft: #e0c884;
  --ink: #2b2522;
  --muted: #7a6f66;
  --line: #e2d7c4;
  --surface: #fffdf8;
  --surface-2: #fbf6ec;
  --green: #3f7d4f;
  --green-soft: #e3efe4;
  --red: #a23b32;
  --shadow: 0 10px 30px rgba(43, 37, 34, 0.12);
  --shadow-soft: 0 4px 14px rgba(43, 37, 34, 0.08);

  /* Type */
  --serif: Georgia, "Times New Roman", "Iowan Old Style", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Spacing / radius */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --gap: 16px;
  --maxw: 980px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-deep) 100%);
  line-height: 1.55;
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.4em;
  color: var(--charcoal);
}

h1 { font-size: clamp(2rem, 6vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }

a {
  color: var(--terracotta);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px;
}

/* Header */
.header {
  background: var(--charcoal);
  color: var(--cream);
  border-bottom: 3px solid var(--gold);
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--cream);
  letter-spacing: 0.5px;
}
.brand .dot { color: var(--gold); }
.header a { color: var(--gold-soft); }
.header nav { display: flex; gap: 18px; font-size: 0.95rem; }

/* Hero */
.hero {
  text-align: center;
  padding: 56px 0 40px;
  background:
    radial-gradient(1200px 400px at 50% -120px, rgba(201, 162, 75, 0.18), transparent),
    transparent;
}
.hero h1 { color: var(--terracotta-dark); }
.hero .tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  color: var(--charcoal-soft);
  max-width: 640px;
  margin: 0 auto 18px;
}
.hours {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.95rem;
  box-shadow: var(--shadow-soft);
}
.hours::before { content: "\1F557"; }

/* Layout */
main { padding-bottom: 64px; }
.grid {
  display: grid;
  gap: var(--gap);
}
@media (min-width: 720px) {
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: var(--gap); }
.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.card-title .step {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: var(--radius-pill);
  background: var(--terracotta);
  color: #fff;
  font-family: var(--serif);
  font-size: 0.95rem;
  flex: none;
}

/* Fields */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
  color: var(--charcoal-soft);
}
.hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
}
.input, select.input, textarea.input {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  min-height: 48px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { min-height: 92px; resize: vertical; }
.input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.25);
}
.field-row {
  display: grid;
  gap: var(--gap);
}
@media (min-width: 560px) {
  .field-row.two { grid-template-columns: 1fr 1fr; }
}
.error-msg {
  color: var(--red);
  font-size: 0.84rem;
  margin-top: 5px;
  min-height: 1px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--charcoal);
  transition: transform 0.1s, background 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--terracotta) 0%, var(--terracotta-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { background: var(--terracotta-dark); color: #fff; }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: var(--charcoal);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--charcoal-soft);
}
.btn-danger {
  background: transparent;
  border-color: var(--red);
  color: var(--red);
}
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: 0.88rem; }
.btn-block { width: 100%; }

/* Pills (time slots) */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 84px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--charcoal);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.pill .free {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 2px;
}
.pill:hover:not([disabled]):not(.selected) {
  border-color: var(--gold);
}
.pill.selected {
  background: var(--terracotta);
  border-color: var(--terracotta-dark);
  color: #fff;
}
.pill.selected .free { color: var(--gold-soft); }
.pill[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: line-through;
}
.slot-group-label {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--muted);
  margin: 14px 0 6px;
}
.slot-group-label:first-child { margin-top: 0; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--charcoal-soft);
}
.badge-zone { background: var(--cream-deep); }
.badge-confirmed { background: var(--green-soft); color: var(--green); border-color: #cfe3d1; }
.badge-cancelled { background: #f4e2e0; color: var(--red); border-color: #e8cbc7; }

/* Confirmation */
.confirm {
  text-align: center;
  padding: 8px 4px;
}
.confirm .check {
  width: 72px; height: 72px;
  margin: 0 auto 14px;
  border-radius: var(--radius-pill);
  background: var(--green-soft);
  color: var(--green);
  display: grid; place-items: center;
  font-size: 2.2rem;
}
.confirm-details {
  text-align: left;
  margin: 18px auto;
  max-width: 460px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.confirm-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.confirm-row:last-child { border-bottom: none; }
.confirm-row .label { color: var(--muted); }
.confirm-row .value { font-weight: 600; text-align: right; }
.ref-id {
  font-family: var(--serif);
  letter-spacing: 0.5px;
  word-break: break-all;
}

/* Messages / toasts */
.notice {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 0 0 16px;
  font-size: 0.95rem;
  border: 1px solid transparent;
}
.notice-error { background: #f7e6e3; color: var(--red); border-color: #ecc9c4; }
.notice-info { background: var(--cream-deep); color: var(--charcoal-soft); border-color: var(--line); }
.hidden { display: none !important; }

.loading {
  color: var(--muted);
  font-style: italic;
  padding: 18px 4px;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
  font-style: italic;
}

/* Footer */
.footer {
  text-align: center;
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
}

/* Admin: stats */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.stat .num {
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--terracotta);
  line-height: 1.1;
}
.stat .lbl { font-size: 0.82rem; color: var(--muted); }

/* Admin: daily list */
.res-list { display: flex; flex-direction: column; gap: 12px; }
.res-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--surface-2);
}
.res-item.cancelled { opacity: 0.65; }
.res-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.res-time {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--terracotta-dark);
}
.res-meta { color: var(--muted); font-size: 0.9rem; }
.res-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Occupancy matrix */
.matrix-wrap { overflow-x: auto; }
.matrix {
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.78rem;
  width: 100%;
}
.matrix th, .matrix td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
}
.matrix th {
  background: var(--cream-deep);
  font-family: var(--serif);
  font-weight: 600;
  position: sticky;
  left: auto;
}
.matrix th.row-head {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 1;
}
.matrix td.row-head {
  text-align: left;
  background: var(--surface-2);
  font-weight: 600;
  position: sticky;
  left: 0;
}
.matrix td.occupied {
  background: var(--terracotta);
  color: #fff;
  font-weight: 600;
}
.matrix td.free-cell { background: var(--surface); color: var(--line); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(43, 37, 34, 0.55);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow);
}
.modal h2 { margin-top: 0; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: var(--gap);
  flex-wrap: wrap;
  margin-bottom: var(--gap);
}
.toolbar .field { margin-bottom: 0; }
