:root {
  color-scheme: dark;
  --bg: #101214;
  --panel: #171b1f;
  --panel-strong: #1f252b;
  --line: #303841;
  --line-soft: #252b31;
  --text: #e7edf2;
  --muted: #98a4ae;
  --accent: #5dd39e;
  --accent-strong: #3abf86;
  --warning: #ffd166;
  --danger: #ff6b6b;
  --shadow: 0 18px 50px rgb(0 0 0 / 28%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 22px;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.workspace {
  display: grid;
  gap: 20px;
}

.topbar,
.task-composer,
.stats-strip,
.timer-panel,
.task-list-shell {
  border: 1px solid var(--line-soft);
  background: var(--panel);
}

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

.task-composer {
  padding: 18px;
  border-radius: 8px;
}

.task-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  gap: 12px;
  align-items: end;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.task-measures span,
.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 42px;
  color: var(--text);
  background: #0d0f11;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  padding: 10px 12px;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(93 211 158 / 14%);
}

.primary-button,
.ghost-button,
.timer-button,
.delete-button {
  min-height: 42px;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 750;
}

.primary-button {
  color: #07100c;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.ghost-button,
.timer-button {
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.ghost-button:hover,
.timer-button:hover {
  border-color: var(--accent);
}

.delete-button {
  color: #fff;
  background: rgb(255 107 107 / 14%);
  border: 1px solid rgb(255 107 107 / 38%);
}

.delete-button:hover {
  background: rgb(255 107 107 / 22%);
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
}

.operation-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: var(--text);
  background: #111519;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.operation-status.is-pending {
  border-left-color: var(--warning);
}

.operation-status.is-error {
  border-left-color: var(--danger);
  color: #ffdede;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border-radius: 8px;
}

.stats-strip > div {
  display: grid;
  gap: 4px;
  padding: 16px;
  background: #14181c;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
}

.timer-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 20px;
  padding: 18px;
  border-color: rgb(93 211 158 / 45%);
  border-radius: 8px;
}

.timer-readout {
  min-width: 112px;
  font-variant-numeric: tabular-nums;
  font-size: 34px;
  font-weight: 850;
  text-align: right;
}

.timer-actions {
  display: flex;
  gap: 10px;
}

.task-list-shell {
  overflow: hidden;
  border-radius: 8px;
}

.list-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.list-header select {
  max-width: 160px;
}

.empty-state {
  padding: 42px 18px;
  color: var(--muted);
  text-align: center;
}

.task-list {
  display: grid;
}

.task-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

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

.task-item.is-done {
  background: rgb(255 255 255 / 2%);
}

.task-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.status-toggle {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #0d0f11;
}

.status-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
}

.status-toggle[aria-pressed="true"]::after {
  content: "";
  display: block;
  width: 7px;
  height: 12px;
  margin: 4px auto 0;
  border: solid #07100c;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.task-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.task-summary {
  min-height: 34px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  font-weight: 760;
}

.is-done .task-summary {
  color: var(--muted);
  text-decoration: line-through;
}

.task-meta {
  color: var(--muted);
  font-size: 13px;
}

.task-measures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.task-measures input {
  min-height: 36px;
  padding: 8px;
}

.task-actions {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px;
}

@media (max-width: 820px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .timer-panel {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
  }

  .task-form,
  .task-item {
    grid-template-columns: 1fr;
  }

  .timer-readout {
    text-align: left;
  }

  .task-actions {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 24px;
  }

  .login-panel {
    padding: 22px;
  }

  .stats-strip,
  .task-measures {
    grid-template-columns: 1fr;
  }

  .list-header {
    align-items: stretch;
    flex-direction: column;
  }

  .list-header select {
    max-width: none;
  }
}
