:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --panel: #ffffff;
  --ink: #1c2520;
  --muted: #65716b;
  --line: #dce4dd;
  --accent: #2f7d62;
  --accent-strong: #21634c;
  --accent-soft: #dff1e9;
  --warn: #b75e21;
  --danger: #a23c3c;
  --shadow: 0 22px 60px rgba(31, 48, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(47, 125, 98, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(183, 94, 33, 0.08), transparent 32%),
    var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app {
  min-height: 100vh;
  padding: 28px;
}

.workspace {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: calc(100vh - 56px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(220, 228, 221, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  background: #eef4ef;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
}

.brand h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.05;
}

.brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.filters {
  display: grid;
  gap: 8px;
}

.filter-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.filter-button strong {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(101, 113, 107, 0.12);
  color: var(--ink);
  font-size: 13px;
}

.filter-button.active,
.filter-button:hover {
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.progress-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.progress-copy strong {
  color: var(--ink);
}

.progress-track {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: #e8eee9;
}

#progressBar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #d08a3c);
  transition: width 180ms ease;
}

.legal-links {
  display: grid;
  gap: 10px;
  font-size: 13px;
}

.legal-links a,
.legal-links button {
  width: fit-content;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  text-decoration: none;
}

.legal-links a:hover,
.legal-links button:hover {
  color: var(--accent);
}

.content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

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

.notice {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #f1d6a6;
  border-radius: 8px;
  background: #fff8ea;
  color: #76511f;
  font-size: 14px;
}

.task-form input,
.task-form select {
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: white;
  color: var(--ink);
}

.task-form input:focus,
.task-form select:focus,
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 125, 98, 0.14);
}

.primary-button,
.ghost-button,
.icon-button,
.status-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.primary-button {
  height: 46px;
  padding: 0 16px;
  background: var(--accent);
  color: white;
}

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

.ghost-button {
  height: 46px;
  padding: 0 14px;
  border-color: var(--line);
  background: white;
  color: var(--muted);
}

.ghost-button:hover {
  color: var(--danger);
}

.board {
  display: grid;
  gap: 10px;
}

.task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.task.is-done {
  background: #fbfcfb;
}

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

.status-button {
  width: 38px;
  height: 38px;
  color: var(--accent);
  border-color: var(--line);
  background: var(--accent-soft);
}

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

.task-title {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 700;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f0f4f1;
}

.pill.high {
  background: #fdebe3;
  color: var(--warn);
}

.pill.medium {
  background: #e7f0ff;
  color: #315f9d;
}

.pill.low {
  background: #eef3e1;
  color: #5f7030;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-actions select {
  width: 126px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.icon-button {
  width: 38px;
  height: 38px;
  border-color: var(--line);
  background: white;
  color: var(--muted);
}

.icon-button:hover {
  color: var(--danger);
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 280px;
  margin-top: 16px;
  border: 1px dashed #c7d3ca;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  color: var(--accent);
}

.empty-state h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

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

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

  .workspace {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 28px);
  }

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

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .primary-button {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .content,
  .sidebar {
    padding: 18px;
  }

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

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

  .primary-button {
    grid-column: auto;
  }

  .task {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .task-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .task-actions select {
    flex: 1;
  }
}

.policy-page {
  min-height: 100vh;
  padding: 28px;
}

.policy-content {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.policy-content h1 {
  margin: 16px 0 18px;
  font-size: 30px;
}

.policy-content h2 {
  margin: 24px 0 8px;
  font-size: 18px;
}

.policy-content p {
  color: var(--muted);
  line-height: 1.6;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
}
