:root {
  --black: #121212;
  --mint: #36e0c3;
  --purple: #6d60ba;
  --paper: #f4f5f2;
  --card: #ffffff;
  --line: #e4e4e0;
  --muted: #5c5c5c;
  --good: #0f8f7a;
  --wait: #3d4fbf;
  --bad: #b42318;
  color: var(--black);
  background: var(--paper);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body { margin: 0; }

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

.app { min-height: 100vh; }

.header {
  background: var(--black);
  color: #fff;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1120px;
  min-height: 72px;
  margin: 0 auto;
  padding: 14px 28px;
}

.brand img { display: block; height: 28px; width: auto; }

.product { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.product strong {
  font-family: Montserrat, Inter, sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.eyebrow {
  color: var(--mint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.who { text-align: right; }
.who strong { display: block; font-weight: 600; }
.who span { color: #c8c8c8; font-size: 13px; }

button.help { background: transparent; cursor: pointer; }
.help {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #fff;
  padding: 8px 14px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.help:hover { border-color: var(--mint); color: var(--mint); }

.sheet {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 28px 64px;
}

.banner {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.month-bar, .actions, .week-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.month-bar { margin-bottom: 18px; }
.month-bar h2 {
  margin: 0 6px;
  min-width: 220px;
  text-align: center;
  font-family: Montserrat, Inter, sans-serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.icon-btn, .btn {
  border: 0;
  border-radius: 12px;
  background: var(--mint);
  color: var(--black);
  min-height: 42px;
  padding: 8px 16px;
  font-weight: 600;
}

.icon-btn {
  min-width: 42px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 22px;
  line-height: 1;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--black);
}
.btn.quiet {
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}
.btn.dirty {
  background: var(--black);
  color: var(--mint);
}
.btn:hover, .icon-btn:hover { filter: brightness(0.97); }
.btn:disabled, .icon-btn:disabled {
  background: #ececea;
  color: #9a9a9a;
  border-color: transparent;
  cursor: default;
  filter: none;
}

.weeks {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 22px;
}

.week {
  flex: 0 0 auto;
  width: 168px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(18, 18, 18, 0.04);
  padding: 14px 14px 12px;
}

.week-name { display: block; font-weight: 600; letter-spacing: -0.02em; }
.week.selected {
  border-color: var(--black);
  box-shadow: inset 0 3px 0 var(--mint);
}
.week small { display: block; margin-top: 6px; color: var(--muted); }
.week .state.good { color: var(--good); font-weight: 600; }
.week .state.wait { color: var(--wait); font-weight: 600; }
.week .state.bad { color: var(--bad); font-weight: 600; }
.week .partial { color: #8a6116; }

.summary {
  margin: 4px 0 18px;
}
.summary h3, .week-head {
  margin: 0 0 6px;
  font-family: Montserrat, Inter, sans-serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.summary .total, .total {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 6px;
}
.status { margin: 0; color: var(--muted); }
.status.good { color: var(--good); }
.status.wait { color: var(--wait); }
.status.bad { color: var(--bad); }

.actions { margin-bottom: 14px; }

.zero {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff8d6;
}

.toast {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
}
.toast.success { border-color: var(--good); }
.toast.warning, .toast.info { border-color: #e2b93b; }
.toast.error { border-color: var(--bad); }

.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.grid th, .grid td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.grid tr:last-child td { border-bottom: 0; }
.grid th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #fafaf8;
}
.grid.review { max-width: 760px; }
.team-wrap { overflow-x: auto; margin-top: 8px; }
.grid.team { width: max-content; min-width: 100%; }
.grid.team th, .grid.team td { padding: 8px 10px; white-space: nowrap; }
.grid.team tbody tr { cursor: pointer; }
.grid.team tr.picked td { background: #f3fbf8; }
.grid.team td.draft { font-style: italic; }
.grid.team td.open { background: #fff4d6; }
.grid.team tr.picked td.open { background: #fff4d6; }
.grid.team tfoot td { font-weight: 700; background: #fafaf8; }
.team-status.good { color: var(--good); font-weight: 600; }
.team-status.wait { color: var(--wait); font-weight: 600; }
.team-status.bad { color: var(--bad); font-weight: 600; }
.team-filter { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.team-filter select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  color: var(--black);
}
.team-detail {
  margin-top: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  white-space: pre-wrap;
}
.team-detail h3 { margin: 0 0 8px; }
.team-detail p { margin: 0 0 8px; }
.consultant-add { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.consultant-add input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}
.grid.review th.num, .grid.review td.num { text-align: right; }
.num, .grid td.num, .grid th.num { text-align: center; }
.draft { color: var(--muted); }

.hours, .notes, .dialog select, .dialog input, .dialog textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
}
.hours { width: 96px; text-align: center; }
.hours:focus, .notes:focus, .dialog select:focus, .dialog input:focus, .dialog textarea:focus {
  outline: 2px solid var(--mint);
  border-color: transparent;
}
.hours:disabled, .notes:disabled { background: transparent; color: #8d8d8d; border-color: transparent; }
.notes { min-width: 160px; }

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  background: #f1f1ee;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.pill.good { background: #e7f8f4; color: var(--good); }
.pill.wait { background: #eef0ff; color: var(--wait); }
.pill.bad { background: #fdecec; color: var(--bad); }

.trash {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-width: 32px;
  min-height: 32px;
  border-radius: 8px;
}
.trash:hover { background: #f1f1ee; color: var(--black); }

.empty {
  padding: 28px 18px;
  border-radius: 18px;
  background: var(--card);
  color: var(--muted);
}

#open-weeks { color: var(--muted); }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 18, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.dialog {
  width: min(480px, 100%);
  background: var(--card);
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(18, 18, 18, 0.24);
}

.dialog h3 {
  margin: 0 0 8px;
  font-family: Montserrat, Inter, sans-serif;
  letter-spacing: -0.02em;
}
.dialog p { margin: 0 0 16px; }
.dialog label { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 600; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

@media (max-width: 720px) {
  .header-inner, .sheet { padding-left: 16px; padding-right: 16px; }
  .who, .eyebrow { display: none; }
  .product strong { font-size: 16px; }
  .month-bar h2 { min-width: 0; font-size: 22px; }
  .grid:not(.review) th:nth-child(2), .grid:not(.review) td:nth-child(2) { display: none; }
  .notes { min-width: 0; }
}
