:root {
  --bg: #f3f1ec;
  --bg-2: #e8e4db;
  --surface: #fffcf7;
  --ink: #1c2421;
  --muted: #5d6b64;
  --line: #d5d0c6;
  --brand: #1f6f5b;
  --brand-2: #164f42;
  --accent: #c45c26;
  --danger: #9b2c2c;
  --ok: #1f6f5b;
  --shadow: 0 10px 30px rgba(28, 36, 33, 0.06);
  --radius: 14px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(31,111,91,.12), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(196,92,38,.08), transparent 50%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  min-height: 100vh;
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.app {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #16352e, #1f6f5b 140%);
  color: #f4f7f5;
  padding: 1.4rem 1rem 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0.2rem 0 1.4rem;
  padding: 0 .5rem;
}
.brand small {
  display: block;
  font-size: .72rem;
  opacity: .75;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-top: .25rem;
}
.nav a {
  display: block;
  color: #e7f2ee;
  padding: .55rem .7rem;
  border-radius: 10px;
  margin-bottom: .2rem;
  text-decoration: none;
  font-size: .95rem;
}
.nav a:hover, .nav a.active {
  background: rgba(255,255,255,.12);
  text-decoration: none;
}
.nav .section {
  margin: 1rem .7rem .35rem;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .55;
}

.main { padding: 1.4rem 1.6rem 2.5rem; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.topbar h1 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}
.card h2, .card h3 { margin-top: 0; }

.grid {
  display: grid;
  gap: 1rem;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

.stat {
  padding: 1rem 1.1rem;
}
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.7rem; font-weight: 650; margin-top: .2rem; }

label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: .55rem .7rem;
  font: inherit;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(31,111,91,.25);
  border-color: var(--brand);
}
.field { margin-bottom: .85rem; }
.row-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: .8rem;
}
.row-fields.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.row-fields.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 0;
  border-radius: 999px;
  padding: .55rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: var(--brand);
  color: #fff;
}
.btn:hover { background: var(--brand-2); text-decoration: none; color: #fff; }
.btn.secondary { background: #e7e2d8; color: var(--ink); }
.btn.secondary:hover { background: #ddd6c9; color: var(--ink); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: .35rem .7rem; font-size: .85rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
th, td {
  text-align: left;
  padding: .65rem .55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: rgba(31,111,91,.03); }

.alert {
  padding: .75rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}
.alert.ok { background: #e5f4ef; color: #164f42; border: 1px solid #b7ddd0; }
.alert.error { background: #fde8e8; color: #7f1d1d; border: 1px solid #f0b4b4; }

.badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  background: #e7e2d8;
}
.badge.ok { background: #d8efe6; color: #164f42; }
.badge.warn { background: #f8e4d4; color: #8a3b12; }

.guest-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.guest-card {
  width: min(480px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.6rem;
}
.guest-card.wide { width: min(720px, 100%); }
.muted { color: var(--muted); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.checkbox { display: flex; align-items: center; gap: .45rem; margin: .5rem 0; }
.checkbox input { width: auto; }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a {
  padding: .4rem .8rem;
  border-radius: 999px;
  background: #e7e2d8;
  color: var(--ink);
  text-decoration: none;
  font-size: .9rem;
}
.tabs a:hover, .tabs a.active { background: var(--brand); color: #fff; }

@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .grid-2, .grid-3, .grid-4, .row-fields, .row-fields.cols-3, .row-fields.cols-4 {
    grid-template-columns: 1fr;
  }
}

.wa-grid { display:flex; flex-wrap:wrap; gap:.45rem; }

.week-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .55rem;
}
.week-day {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 220px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.week-day.fest { background: #fff8f0; }
.week-day-head {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .55rem .65rem;
  background: linear-gradient(180deg, #1f6f5b, #164f42);
  color: #fff;
  font-size: .85rem;
}
.week-day-body { padding: .45rem; display: flex; flex-direction: column; gap: .4rem; }
.slot-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: .4rem .45rem;
  background: #fff;
}
.slot-title { font-weight: 600; font-size: .82rem; }
.slot-meta { font-size: .72rem; margin: .15rem 0 .3rem; }
.slot-assign select { font-size: .78rem; padding: .3rem; }

@media (max-width: 1100px) {
  .week-cal { grid-template-columns: 1fr; }
}

.wa-grid { display:flex; flex-wrap:wrap; gap:.45rem; }

@media print {
  .sidebar, .no-print { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
}
