:root {
  color-scheme: light;
  --page: #f2f4f3;
  --surface: #ffffff;
  --surface-soft: #f7f8f7;
  --ink: #17201e;
  --muted: #66706d;
  --line: #dce2df;
  --line-strong: #c8d0cc;
  --green: #176b5b;
  --green-dark: #105447;
  --green-soft: #e4f0ec;
  --coral: #bb4f3b;
  --coral-soft: #f8e9e5;
  --amber: #9a6919;
  --amber-soft: #f8f0dc;
  --shadow: 0 12px 30px rgba(22, 35, 31, 0.06);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 1040px;
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(23, 107, 91, 0.2);
  outline-offset: 2px;
}

.topbar {
  height: 66px;
  padding: 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand-letter {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--ink);
  border-radius: 6px;
  font-family: Georgia, serif;
  font-size: 17px;
}

.service-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #2c9b72;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #e4f2ec;
}

.page-shell {
  width: min(1380px, calc(100% - 84px));
  margin: 0 auto;
  padding: 38px 0 56px;
}

.page-heading {
  margin-bottom: 28px;
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.eyebrow,
.panel-kicker {
  margin: 0;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-heading h1 {
  margin: 5px 0 6px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 35px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0;
}

.heading-note,
.workspace-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.button {
  min-height: 40px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 700;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  color: #ffffff;
  background: var(--green);
}

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

.button-secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
}

.button-secondary:hover {
  background: var(--surface-soft);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 286px minmax(600px, 1fr);
  gap: 22px;
  align-items: start;
}

.sidebar {
  display: grid;
  gap: 14px;
}

.panel,
.task-workspace {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.panel h2,
.workspace-heading h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

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

.progress-track {
  height: 7px;
  margin: 18px 0 10px;
  overflow: hidden;
  background: #e7ece9;
  border-radius: 3px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
  transition: width 350ms ease;
}

.metrics-list {
  margin: 0;
}

.metrics-list > div {
  padding: 12px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.metrics-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.metrics-list dt {
  color: var(--muted);
}

.metrics-list dd {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.advice-panel {
  border-top: 3px solid var(--green);
}

.advice-panel h2 {
  margin-top: 9px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 20px;
  line-height: 1.4;
}

.advice-detail {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.focus-block {
  margin-top: 16px;
  padding: 13px 14px;
  display: grid;
  gap: 4px;
  background: var(--green-soft);
  border-left: 3px solid var(--green);
  border-radius: 4px;
}

.focus-block span,
.focus-block small {
  color: var(--muted);
  font-size: 11px;
}

.focus-block strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-list {
  margin-top: 15px;
  display: grid;
  gap: 11px;
}

.category-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.category-row span:last-child {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

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

.task-workspace {
  min-height: 630px;
  padding: 24px;
}

.workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.workspace-heading h2 {
  margin-bottom: 5px;
  font-size: 19px;
}

.search-field {
  width: 260px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.search-field span {
  padding-left: 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.search-field input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.toolbar {
  margin-top: 23px;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tabs {
  display: flex;
  gap: 4px;
}

.tab {
  height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-weight: 700;
}

.tab:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.tab.is-active {
  color: var(--green-dark);
  background: var(--green-soft);
}

.tab span {
  margin-left: 4px;
  font-size: 11px;
  font-weight: 800;
}

.category-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.category-filter select {
  height: 34px;
  padding: 0 28px 0 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

.task-list {
  display: grid;
}

.task-item {
  min-height: 82px;
  padding: 15px 4px;
  display: grid;
  grid-template-columns: 32px minmax(220px, 1fr) 82px 72px 98px 34px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

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

.task-item.is-completed .task-title {
  color: #8a9390;
  text-decoration: line-through;
}

.task-item.is-completed .task-meta {
  opacity: 0.7;
}

.check-button {
  width: 24px;
  height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  color: transparent;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}

.check-button:hover {
  border-color: var(--green);
}

.is-completed .check-button {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.task-copy {
  min-width: 0;
}

.task-title {
  margin: 0 0 7px;
  overflow: hidden;
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.priority,
.category-tag,
.due-label {
  justify-self: start;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.priority {
  padding: 4px 8px;
  border-radius: 4px;
}

.priority-high {
  color: var(--coral);
  background: var(--coral-soft);
}

.priority-medium {
  color: var(--amber);
  background: var(--amber-soft);
}

.priority-low {
  color: var(--green);
  background: var(--green-soft);
}

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

.due-label {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.due-label.is-overdue {
  color: var(--coral);
}

.delete-button,
.close-button {
  width: 32px;
  height: 32px;
  padding: 0;
  color: #929b98;
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 20px;
  line-height: 1;
}

.delete-button:hover,
.close-button:hover {
  color: var(--coral);
  background: var(--coral-soft);
}

.loading-state,
.empty-state {
  padding: 80px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 15px;
}

.empty-state p {
  margin: 8px 0 0;
}

.task-dialog {
  width: 540px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(17, 32, 27, 0.22);
}

.task-dialog::backdrop {
  background: rgba(17, 27, 24, 0.45);
}

.task-dialog form {
  padding: 26px;
}

.dialog-heading {
  margin-bottom: 24px;
  display: flex;
  align-items: start;
  justify-content: space-between;
}

.dialog-heading h2 {
  margin: 5px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 26px;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-field-wide {
  margin-bottom: 16px;
}

.form-field input,
.form-field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--green);
}

.form-error {
  margin: 16px 0 0;
  padding: 10px 12px;
  color: #963e2e;
  background: var(--coral-soft);
  border-radius: 5px;
  font-size: 12px;
}

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

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 20;
  min-width: 220px;
  padding: 13px 16px;
  color: #ffffff;
  background: var(--ink);
  border-radius: 6px;
  box-shadow: 0 14px 40px rgba(17, 32, 27, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: #963e2e;
}
