
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #111827;
  --muted: #667085;
  --border: #dfe3e8;
  --accent: #0f172a;
  --danger: #b42318;
  --warning: #b54708;
  --success: #027a48;
  --radius: 18px;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button, input, select, textarea { font: inherit; }

.topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 14px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); margin-bottom: 6px; }
h2 { font-size: clamp(1.25rem, 3vw, 1.8rem); margin-bottom: 8px; }
h3 { font-size: 1.05rem; margin-bottom: 6px; }

.eyebrow {
  margin-bottom: 7px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .11em;
  color: var(--muted);
}

.muted { color: var(--muted); }

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

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

.hero {
  padding: 22px;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.button, .small-button, .icon-button, .tab {
  border: 0;
  cursor: pointer;
}

.button {
  border-radius: 12px;
  padding: 11px 15px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.button.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.tabs {
  margin: 18px 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab {
  flex: 0 0 auto;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  font-weight: 700;
}

.tab.active {
  background: var(--accent);
  color: white;
}

.view {
  display: grid;
  gap: 18px;
}

.section {
  display: grid;
  gap: 10px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.section-count {
  color: var(--muted);
  font-size: .9rem;
}

.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 16px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.item-meta {
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.item-main { min-width: 0; }
.item-title { overflow-wrap: anywhere; }
.item-next, .item-notes { margin-bottom: 6px; }
.item-notes { white-space: pre-wrap; }

.item-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 88px;
}

.small-button {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
}

.complete-btn { color: var(--success); }

.empty {
  padding: 30px 18px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 15px;
  color: var(--muted);
}

.status {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.status.error {
  border-color: #fecdca;
  background: #fffbfa;
  color: var(--danger);
}

.hidden { display: none; }

dialog {
  width: min(680px, calc(100vw - 24px));
  border: 0;
  padding: 0;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .25);
}

dialog::backdrop { background: rgba(15, 23, 42, .48); }

.dialog-card {
  display: grid;
  gap: 15px;
  padding: 22px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 1.4rem;
}

label {
  display: grid;
  gap: 7px;
  font-size: .9rem;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: white;
  border-radius: 11px;
  padding: 10px 12px;
  color: var(--text);
}

textarea { resize: vertical; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

@media (max-width: 700px) {
  .topbar { padding-top: 18px; }
  .topbar > .button { display: none; }
  .hero {
    align-items: stretch;
    flex-direction: column;
  }
  .hero .button { width: 100%; }
  .grid-2 { grid-template-columns: 1fr; }
  .item-card { flex-direction: column; }
  .item-actions {
    width: 100%;
    flex-direction: row;
  }
  .small-button { flex: 1; }
}
