:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-alt: #faf9f6;
  --border: #e8e5de;
  --text: #1a1a1a;
  --text-muted: #7a7570;
  --accent: #4f7c52;
  --accent-light: #e8f0e9;
  --accent-dark: #3a5e3d;
  --warn: #b45309;
  --warn-light: #fef3c7;
  --danger: #b91c1c;
  --danger-light: #fee2e2;
  --today-bg: #f0f7f1;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

/* ── Nav ── */
.site-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav .brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-dark);
  text-decoration: none;
  letter-spacing: -.01em;
}

.site-nav nav {
  display: flex;
  gap: .25rem;
  margin-left: auto;
}

.site-nav nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}

.site-nav nav a:hover { color: var(--text); background: var(--bg); }
.site-nav nav a.active { color: var(--accent-dark); background: var(--accent-light); }

/* ── Page shell ── */
.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 1.5rem;
  color: var(--text);
}

/* ── Flash messages ── */
.flash {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  margin-bottom: 1.25rem;
  font-weight: 500;
}
.flash.success { background: var(--accent-light); color: var(--accent-dark); }
.flash.warning { background: var(--warn-light); color: var(--warn); }
.flash.danger  { background: var(--danger-light); color: var(--danger); }

/* ── Today cards ── */
.today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.today-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: var(--shadow);
}

.today-card .person {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .4rem;
}

.today-card .room {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: .75rem;
}

.today-card .task-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.today-card .task-list li {
  font-size: .85rem;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: .4rem;
}

.today-card .task-list li::before {
  content: "·";
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  line-height: 1.6;
}

/* ── Schedule strip ── */
.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
}

.schedule-header h3 {
  font-size: .85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin: 0;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.schedule-table th {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.schedule-table td {
  padding: .55rem 1rem;
  font-size: .88rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

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

.schedule-table tr.is-today td {
  background: var(--today-bg);
}

.schedule-table .date-cell {
  color: var(--text-muted);
  font-size: .82rem;
  white-space: nowrap;
  width: 110px;
}

.schedule-table .date-cell .today-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .1rem .4rem;
  border-radius: 4px;
  margin-left: .35rem;
  vertical-align: middle;
}

.schedule-table .cycle-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--border);
  border-radius: 50%;
  margin-left: .4rem;
  vertical-align: middle;
}

/* ── Section header row ── */
.section-label {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin: 1.75rem 0 .6rem;
}

/* ── Cards (rooms/members) ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1rem;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.card-head .room-name {
  font-weight: 700;
  font-size: 1rem;
}

.card-body {
  padding: 1rem 1.25rem;
}

.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}

.task-row:last-of-type { border-bottom: none; }

.task-row .task-name { color: var(--text); }

.no-tasks {
  color: var(--text-muted);
  font-size: .88rem;
  font-style: italic;
  padding: .5rem 0;
}

.add-task-form {
  display: flex;
  gap: .5rem;
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px dashed var(--border);
}

/* ── Members table ── */
.members-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.members-table th {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.members-table td {
  padding: .7rem 1rem;
  font-size: .9rem;
  border-bottom: 1px solid var(--border);
}

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

.members-table code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1rem .4rem;
  font-size: .82rem;
}

/* ── Forms ── */
.form-row {
  display: flex;
  gap: .5rem;
}

input[type="text"] {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .45rem .75rem;
  font-size: .9rem;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,124,82,.15);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: .45rem .9rem;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, opacity .15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--border);
  font-size: .8rem;
  padding: .3rem .65rem;
}
.btn-danger:hover { background: var(--danger-light); border-color: var(--danger); }

.btn-notify {
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid #c5dbc6;
}
.btn-notify:hover { background: #d6ebd7; }

/* ── Misc ── */
.muted { color: var(--text-muted); font-size: .88rem; }
.hint  { color: var(--text-muted); font-size: .82rem; margin-top: .4rem; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: .95rem;
}

.empty-state a { color: var(--accent-dark); }

/* ── Daily checklist ── */
.today-card .person a {
  color: var(--text-muted);
  text-decoration: none;
}
.today-card .person a:hover { color: var(--accent-dark); }

.checklist {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.check-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .98rem;
  transition: background .12s ease;
}
.check-row:hover { background: var(--bg); }

.check-row input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.check-row.is-done span {
  color: var(--text-muted);
  text-decoration: line-through;
}
