:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #d9dee7;
  --text: #1f2937;
  --muted: #667085;
  --green: #147d64;
  --amber: #b26a00;
  --red: #b42318;
  --blue: #2f5f9f;
  --ink: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

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

button {
  height: 36px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: #ffffff;
  padding: 0 14px;
  cursor: pointer;
}

button.secondary {
  background: #ffffff;
  color: var(--ink);
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

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

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 18px 24px 32px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  min-height: 80px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 0.7fr);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

.side-stack {
  display: grid;
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.panel-head {
  min-height: 48px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.panel h2 {
  margin: 0;
  font-size: 15px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  background: #fbfcfe;
}

td:first-child,
th:first-child {
  width: 28%;
}

td:nth-child(4),
th:nth-child(4) {
  width: 130px;
}

.task-title {
  color: var(--ink);
  font-weight: 700;
}

.task-standard {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.4;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  background: #edf0f5;
  color: var(--text);
  white-space: nowrap;
}

.pill.green {
  background: #dff4ed;
  color: var(--green);
}

.pill.amber {
  background: #fff0d0;
  color: var(--amber);
}

.pill.red {
  background: #ffe1de;
  color: var(--red);
}

.pill.blue {
  background: #e2ecff;
  color: var(--blue);
}

.progress {
  width: 100%;
  height: 8px;
  border-radius: 99px;
  background: #edf0f5;
  overflow: hidden;
  margin-top: 5px;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.compact-list {
  padding: 8px 12px 12px;
}

.compact-item {
  padding: 10px 4px;
  border-bottom: 1px solid #edf0f5;
}

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

.compact-item strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.compact-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.timeline {
  padding: 12px 16px 14px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #edf0f5;
}

.timeline-row:last-child {
  border-bottom: 0;
}

.timeline-date {
  color: var(--muted);
  font-size: 12px;
}

.task-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.task-form label {
  display: grid;
  gap: 6px;
}

.task-form label.full {
  grid-column: 1 / -1;
}

.task-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-form input,
.task-form textarea,
.task-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 9px 10px;
  min-height: 38px;
}

.task-form input[type="datetime-local"] {
  appearance: auto;
}

.task-form textarea {
  min-height: 74px;
  resize: vertical;
}

.task-form button,
.task-form .muted {
  align-self: end;
}

.empty {
  color: var(--muted);
  padding: 12px 4px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .focus-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .shell {
    padding: 14px 12px 24px;
  }

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

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

  th,
  td {
    padding: 10px;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  .table-wrap {
    overflow: visible;
  }

  tbody tr {
    padding: 12px 14px;
    border-bottom: 1px solid #edf0f5;
  }

  tbody tr:last-child {
    border-bottom: 0;
  }

  td,
  td:first-child,
  td:nth-child(4) {
    width: 100%;
  }

  td {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    border-bottom: 0;
    padding: 6px 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  td:first-child {
    display: block;
    padding-bottom: 8px;
  }

  td:first-child::before {
    display: none;
  }
}
