:root {
  color-scheme: dark;
  --bg: #090d12;
  --panel: #111821;
  --panel-strong: #151f2b;
  --ink: #eef4fb;
  --muted: #91a0b4;
  --line: #263342;
  --accent: #47c7a0;
  --accent-strong: #81f0cf;
  --accent-soft: #12392f;
  --gold: #f0bd58;
  --gold-soft: #34270d;
  --warn: #e8a64d;
  --shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(180deg, #0d131a 0%, var(--bg) 42%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

@media (min-width: 1500px) {
  .shell {
    margin-left: max(32px, calc((100vw - 1510px) / 2));
    margin-right: 360px;
  }
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow,
.metric-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 3.4rem;
  line-height: 0.95;
  letter-spacing: 0;
}

.summary {
  min-width: 154px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: right;
}

.topbar-side {
  display: grid;
  grid-template-columns: 154px;
  align-items: start;
  gap: 12px;
}

.summary strong {
  display: block;
  font-size: 1.9rem;
  line-height: 1;
}

.summary span {
  color: var(--muted);
  font-weight: 650;
}

.todo-panel {
  width: min(1180px, calc(100% - 32px));
  max-height: 300px;
  margin: 18px auto 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

@media (min-width: 1500px) {
  .todo-panel {
    position: fixed;
    top: 22px;
    right: 24px;
    z-index: 20;
    width: 318px;
    margin: 0;
  }
}

.todo-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

.todo-panel h2 {
  margin: 0;
  font-size: 0.9rem;
}

#todoCount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.todo-list {
  display: grid;
  max-height: 244px;
  overflow: auto;
}

.todo-item {
  display: grid;
  gap: 4px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(145, 160, 180, 0.14);
}

.todo-item:last-child {
  border-bottom: 0;
}

.todo-name {
  font-size: 0.9rem;
  font-weight: 800;
}

.todo-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.todo-empty {
  padding: 20px 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(140px, 180px) minmax(170px, 220px);
  gap: 12px;
  margin-bottom: 14px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  outline: none;
  padding: 9px 11px;
}

select option {
  background: var(--panel);
  color: var(--ink);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(71, 199, 160, 0.18);
}

.overview {
  display: grid;
  grid-template-columns: minmax(140px, 190px) 1fr;
  align-items: center;
  gap: 18px;
  margin: 16px 0 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-value {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
}

.progress-track {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #1a2430;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.category-stat,
.group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.category-stat {
  padding: 12px;
}

.category-stat header,
.group header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.category-stat h2,
.group h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.category-stat p,
.group-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  white-space: nowrap;
}

.mini-track {
  height: 7px;
  overflow: hidden;
  margin-top: 11px;
  border-radius: 999px;
  background: #1a2430;
}

.mini-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.task-groups {
  display: grid;
  gap: 14px;
}

.group {
  overflow: hidden;
}

.group header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

.task-list {
  display: grid;
}

.task-row {
  display: grid;
  grid-template-columns: 64px minmax(180px, 1fr) minmax(130px, 190px) minmax(120px, 160px) 116px;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(145, 160, 180, 0.14);
}

.task-row.highlighted {
  background: linear-gradient(90deg, rgba(240, 189, 88, 0.16), transparent 72%);
}

.task-row.no-number .task-number {
  visibility: hidden;
}

.task-row:last-child {
  border-bottom: 0;
}

.task-number {
  color: var(--muted);
  font-weight: 750;
}

.task-name {
  font-weight: 750;
}

.reward {
  color: var(--warn);
  font-weight: 700;
}

.progress-pill {
  display: inline-flex;
  justify-content: center;
  width: fit-content;
  min-width: 86px;
  padding: 6px 10px;
  border: 1px solid hsla(var(--progress-hue, 210), 70%, 58%, 0.34);
  border-radius: 999px;
  background: hsla(var(--progress-hue, 210), 52%, 22%, 0.88);
  color: hsl(var(--progress-hue, 210), 86%, 78%);
  font-weight: 800;
}

.task-row.complete .progress-pill {
  border-color: rgba(129, 240, 207, 0.58);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.highlight-button {
  justify-self: end;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #1b2633;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  padding: 7px 10px;
}

.highlight-button:hover,
.highlight-button:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.highlight-button.active {
  border-color: rgba(240, 189, 88, 0.82);
  background: var(--gold-soft);
  color: #ffd88b;
}

.empty {
  padding: 34px 16px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .topbar,
  .overview {
    display: grid;
  }

  .topbar-side {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .todo-panel {
    width: min(100% - 20px, 1180px);
    max-height: 300px;
    margin: 0 auto 18px;
  }

  h1 {
    font-size: 2.25rem;
  }

  .summary {
    width: 100%;
    text-align: left;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .overview {
    grid-template-columns: 1fr;
  }

  .task-row {
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: start;
  }

  .reward,
  .progress-cell,
  .task-action {
    grid-column: 2;
  }

  .highlight-button {
    justify-self: start;
  }
}
