:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #16181d;
  --muted: #6a7280;
  --line: #dfe3ea;
  --accent: #0d766e;
  --accent-strong: #064e48;
  --danger: #b42318;
  --warn: #b54708;
  --shadow: 0 18px 45px rgba(23, 30, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

.sidebar {
  background: #101418;
  color: white;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e9fbf8;
  color: #0d766e;
  font-weight: 800;
}

.brand p, .brand span {
  margin: 0;
}

.brand p {
  font-weight: 750;
}

.brand span {
  color: #a7b0bc;
  font-size: 13px;
}

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

.nav-item {
  border: 0;
  background: transparent;
  color: #c8d0da;
  text-align: left;
  padding: 11px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.nav-item.active, .nav-item:hover {
  background: #1e252d;
  color: white;
}

.api-hint {
  margin-top: auto;
  padding: 14px;
  border: 1px solid #2e3945;
  border-radius: 8px;
  color: #c8d0da;
}

.api-hint span {
  display: block;
  color: #8d98a6;
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.api-hint code {
  color: white;
  font-size: 13px;
}

main {
  padding: 34px;
  max-width: 1320px;
  width: 100%;
}

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

h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}

.topbar p {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 680px;
  font-size: 17px;
  line-height: 1.5;
}

.icon-button, .composer button {
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.stat span {
  font-size: 30px;
  font-weight: 800;
}

.stat p {
  margin: 4px 0 0;
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 220px 220px;
  gap: 12px;
  margin-bottom: 22px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 118, 110, 0.12);
}

.content-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 22px;
  align-items: start;
}

.composer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 13px;
  position: sticky;
  top: 18px;
}

.composer h2 {
  margin: 0;
  font-size: 20px;
}

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

.task-list {
  display: grid;
  gap: 12px;
}

.task-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 18px;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.task-meta span {
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef1f5;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.task-meta .status.active { background: #e6f7f3; color: var(--accent-strong); }
.task-meta .status.blocked { background: #fff3e6; color: var(--warn); }
.task-meta .status.done { background: #ecfdf3; color: #067647; }
.task-meta .priority.urgent { background: #fee4e2; color: var(--danger); }
.task-meta .priority.high { background: #fff1d6; color: #93370d; }

.task-row h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.details {
  margin: 8px 0 10px;
  color: var(--muted);
  line-height: 1.45;
  white-space: pre-wrap;
}

.task-row small {
  color: #8a93a0;
}

.empty-state {
  background: white;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

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

  .sidebar {
    position: static;
  }

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

  .nav-item {
    text-align: center;
    padding: 10px 8px;
  }

  main {
    padding: 22px;
  }

  .stats, .toolbar, .content-grid {
    grid-template-columns: 1fr;
  }

  .composer {
    position: static;
  }
}

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

  .nav {
    grid-template-columns: 1fr 1fr;
  }

  .topbar {
    display: grid;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

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