:root {
  color-scheme: dark;
  --bg: oklch(16% 0.018 255);
  --panel: oklch(21% 0.018 255);
  --panel-2: oklch(25% 0.018 250);
  --line: oklch(34% 0.018 250);
  --ink: oklch(96% 0.01 250);
  --muted: oklch(76% 0.025 250);
  --accent: oklch(74% 0.12 182);
  --accent-ink: oklch(15% 0.035 182);
  --warn: oklch(76% 0.14 75);
  --danger: oklch(68% 0.18 25);
  --success: oklch(72% 0.14 145);
  --radius: 8px;
  --shadow: 0 18px 48px oklch(0% 0 0 / 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, oklch(30% 0.07 182 / 0.28), transparent 34rem),
    var(--bg);
}

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

button {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.06);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: oklch(14% 0.018 255);
  color: var(--ink);
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

label,
legend {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

fieldset {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel h1,
.sidebar h1,
.topbar h2,
.section-heading h3 {
  margin: 0;
  text-wrap: balance;
}

.login-copy,
.section-heading p {
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: oklch(13% 0.016 255 / 0.96);
}

.kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-list a {
  min-height: 38px;
  display: flex;
  align-items: center;
  border-radius: var(--radius);
  padding: 0 10px;
  color: var(--muted);
  text-decoration: none;
}

.nav-list a:hover {
  background: var(--panel-2);
  color: var(--ink);
}

.secondary-button,
.ghost-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.danger-button {
  background: var(--danger);
  color: white;
}

.content {
  display: grid;
  gap: 28px;
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

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

.section-heading {
  max-width: 760px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel);
}

.stat strong {
  display: block;
  font-size: 28px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.work-form {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel);
}

.compact-form {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.form-grid,
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--ink);
  background: oklch(18% 0.018 255);
}

.check-pill input {
  width: auto;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

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

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.status.pending {
  background: oklch(76% 0.14 75 / 0.18);
  color: var(--warn);
}

.status.done {
  background: oklch(72% 0.14 145 / 0.18);
  color: var(--success);
}

.row-actions,
.assignment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assignment-actions button,
.row-actions button {
  min-height: 32px;
  padding: 0 10px;
}

.group-list,
.recurring-list {
  display: grid;
  gap: 12px;
}

.group-item,
.recurring-item {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel);
}

.group-item-header,
.recurring-item-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.notice,
.error-text {
  border-radius: var(--radius);
  padding: 12px;
  background: oklch(76% 0.14 75 / 0.14);
  color: var(--warn);
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

