:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef3f7;
  --text: #17202a;
  --muted: #667085;
  --line: #d9e0e7;
  --primary: #0f766e;
  --primary-hover: #115e59;
  --focus: #2563eb;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --done: #667085;
  --shadow: 0 18px 45px rgba(20, 32, 46, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 34%, #e9eef3 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.workspace {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.auth-layout {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(440px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #ffffff;
  background: #263238;
  border-radius: 8px;
  font-weight: 760;
  letter-spacing: 0;
}

h1,
p {
  margin: 0;
}

.brand-block h1,
.topbar h1 {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.brand-block p,
.eyebrow,
.current-user,
.metric small {
  color: var(--muted);
}

.auth-tabs,
.filters {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft);
  border-radius: 8px;
}

.auth-tab,
.filter-button {
  min-height: 36px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.auth-tab.is-active,
.filter-button.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.field {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 14px;
  font-weight: 640;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  outline: none;
}

input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 680;
}

.primary-button {
  padding: 0 18px;
  color: #ffffff;
  background: var(--primary);
}

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

.primary-button:disabled,
.ghost-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.ghost-button {
  padding: 0 14px;
  color: var(--text);
  background: #ffffff;
  border-color: var(--line);
}

.ghost-button:hover {
  background: #f8fafc;
}

.form-error {
  padding: 10px 12px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #fecdca;
  border-radius: 8px;
  font-size: 14px;
}

.task-layout {
  display: grid;
  gap: 18px;
}

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

.eyebrow {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 740;
  text-transform: uppercase;
  letter-spacing: 0;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.current-user {
  max-width: 220px;
  overflow: hidden;
  font-weight: 640;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-input-band,
.summary-band,
.tasks-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.task-input-band {
  padding: 18px;
}

.task-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr)) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
}

.metric {
  display: grid;
  gap: 2px;
}

.metric span {
  font-size: 24px;
  line-height: 1.1;
  font-weight: 760;
}

.metric small {
  font-size: 13px;
}

.tasks-section {
  min-height: 320px;
  overflow: hidden;
}

.task-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.task-item:first-child {
  border-top: 0;
}

.task-check {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #ffffff;
  background: #ffffff;
  border: 1px solid #b8c4d0;
  border-radius: 8px;
}

.task-check.is-completed {
  background: var(--primary);
  border-color: var(--primary);
}

.task-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 640;
}

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

.task-edit-input {
  min-height: 40px;
}

.task-actions {
  display: flex;
  gap: 6px;
}

.icon-button {
  width: 40px;
  padding: 0;
  color: var(--muted);
  background: #ffffff;
  border-color: var(--line);
}

.icon-button:hover {
  color: var(--text);
  background: #f8fafc;
}

.icon-button.danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #fecdca;
}

.state-block {
  display: grid;
  min-height: 318px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  font-weight: 640;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .workspace {
    width: min(100% - 20px, 1120px);
    padding: 16px 0;
  }

  .auth-layout {
    min-height: calc(100vh - 32px);
  }

  .auth-panel {
    padding: 20px;
  }

  .topbar,
  .user-menu,
  .task-form {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: grid;
  }

  .user-menu {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .summary-band {
    grid-template-columns: repeat(3, 1fr);
  }

  .filters {
    grid-column: 1 / -1;
    overflow-x: auto;
  }

  .filter-button {
    flex: 1;
    min-width: max-content;
  }

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

  .task-item {
    grid-template-columns: 34px 1fr;
  }

  .task-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}
