:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --line-strong: #b8c3d4;
  --blue: #2563eb;
  --teal: #0f9f6e;
  --amber: #d97706;
  --red: #dc2626;
  --violet: #7c3aed;
  --cyan: #0891b2;
  --shadow: 0 18px 40px rgba(23, 32, 51, 0.08);
  --radius: 8px;
  --sidebar-width: 260px;
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 247, 251, 0.95)),
    var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  z-index: 10;
}

.brand {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.brand:hover,
.brand:focus-visible {
  background: var(--surface-2);
  outline: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: #172033;
  color: white;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #374151;
  text-align: left;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item:hover,
.nav-item:focus-visible {
  background: var(--surface-2);
  outline: 0;
}

.nav-item.is-active {
  background: #e8f0ff;
  color: #1244b8;
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.sidebar-footer span,
.sidebar-footer small {
  display: block;
  overflow-wrap: anywhere;
}

.sidebar-footer span {
  margin-bottom: 4px;
  color: var(--ink);
  font-weight: 700;
}

.main {
  min-width: 0;
  padding: 22px 28px 40px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 64px;
}

.title-block {
  min-width: 0;
}

.title-block p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.title-block h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--line-strong);
  box-shadow: 0 6px 16px rgba(23, 32, 51, 0.08);
  outline: 0;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.mobile-only {
  display: none;
}

.sync-pill,
.badge,
.status-pill,
.priority-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #e8e1d8;
  background: #fffdf9;
  color: #72737c;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.badge {
  background: #fbfaf7;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.sync-pill.is-api {
  border-color: rgba(15, 159, 110, 0.32);
  background: #e8f8f1;
  color: #08724e;
}

.sync-pill.is-mock,
.sync-pill.is-partial {
  border-color: rgba(217, 119, 6, 0.32);
  background: #fff7e8;
  color: #9a5a00;
}

.sync-banner {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(217, 119, 6, 0.28);
  border-radius: var(--radius);
  background: #fff9ed;
  color: #7a4a08;
}

.sync-banner[hidden] {
  display: none;
}

.sync-banner svg {
  width: 18px;
  height: 18px;
}

.sync-banner strong {
  display: block;
  margin-bottom: 2px;
  color: #603500;
}

.content {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.section {
  display: grid;
  gap: 14px;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.section-title {
  min-width: 0;
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.control,
.input,
.select,
.textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.select {
  appearance: none;
  padding-right: 38px;
  border-color: #e3ded6;
  background:
    linear-gradient(45deg, transparent 50%, #7f8088 50%) calc(100% - 18px) 50% / 6px 6px no-repeat,
    linear-gradient(135deg, #7f8088 50%, transparent 50%) calc(100% - 14px) 50% / 6px 6px no-repeat,
    #fffdf9;
  color: #282a32;
  font-weight: 750;
  box-shadow: 0 1px 0 rgba(32, 34, 42, 0.03);
}

.select-shell {
  position: relative;
  display: block;
  min-width: 0;
}

.select-shell::before {
  content: "";
  position: absolute;
  inset: 6px auto 6px 6px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff8126, #7963f0);
  opacity: 0;
  transition: opacity 120ms ease;
  pointer-events: none;
}

.select-shell:focus-within::before,
.select-shell:hover::before {
  opacity: 1;
}

.select-shell:focus-within .select,
.select:hover {
  border-color: rgba(255, 129, 38, 0.5);
  background-color: #ffffff;
  box-shadow: 0 10px 22px rgba(32, 34, 42, 0.08);
}

.select-compact {
  min-height: 36px;
  padding-left: 12px;
  padding-right: 30px;
  border-radius: 8px;
  background-position: calc(100% - 15px) 50%, calc(100% - 11px) 50%, 0 0;
  font-weight: 800;
}

.select-shell-status {
  max-width: 118px;
}

.select-shell-field {
  width: 100%;
}

.select-shell-field .select {
  min-height: 42px;
  padding-left: 14px;
  border-color: #ded8cf;
  background-color: #fffdf9;
}

.select-shell-person .select {
  border-color: rgba(255, 129, 38, 0.28);
  background-color: #fff7ef;
}

.input,
.select,
.textarea {
  padding: 0 11px;
}

.textarea {
  min-height: 86px;
  padding: 10px 11px;
  resize: vertical;
}

.control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border-color: #e3ded6;
  background: #fffdf9;
  box-shadow: 0 1px 0 rgba(32, 34, 42, 0.03);
}

.control svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.control .input {
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.control .input:focus,
.input:focus,
.select:focus,
.textarea:focus {
  outline: 2px solid rgba(255, 129, 38, 0.18);
  outline-offset: 1px;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.segmented button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.segmented button.is-active {
  background: var(--ink);
  color: white;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.danger-button {
  border: 1px solid rgba(220, 38, 38, 0.24);
  background: #fff0f0;
  color: var(--red);
}

.ghost-button {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.primary-button svg,
.secondary-button svg,
.danger-button svg,
.ghost-button svg {
  width: 16px;
  height: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
}

.metric {
  width: 100%;
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(23, 32, 51, 0.04);
  text-align: left;
}

button.metric {
  appearance: none;
}

.metric-button:hover,
.metric-button:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
  outline: 0;
}

.metric span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric span svg {
  width: 18px;
  height: 18px;
}

.metric strong {
  display: block;
  margin-top: 16px;
  font-size: 32px;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.mini-stat {
  display: grid;
  gap: 6px;
  min-height: 64px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.mini-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.mini-stat strong {
  font-size: 22px;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.execution-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.execution-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.45fr);
  gap: 14px;
}

.time-scale {
  white-space: nowrap;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(23, 32, 51, 0.04);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header h3 {
  margin: 0;
  font-size: 15px;
}

.panel-body {
  padding: 16px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fafbfc;
  color: var(--muted);
  text-align: center;
}

.list-stack {
  display: grid;
  gap: 10px;
}

.project-row,
.task-row,
.queue-row,
.meeting-row,
.person-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.project-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.row-title {
  min-width: 0;
}

.row-title h3,
.row-title h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.row-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: 10px;
}

.status-pill.status-active,
.status-pill.status-in_progress {
  border-color: rgba(121, 99, 240, 0.28);
  background: #f0edff;
  color: #5b45d8;
}

.status-pill.status-todo,
.status-pill.status-draft,
.status-pill.status-planning,
.status-pill.status-pending {
  border-color: rgba(115, 119, 132, 0.26);
  background: #f7f6f2;
  color: #585b65;
}

.status-pill.status-blocked,
.status-pill.status-needs_info {
  border-color: rgba(255, 129, 38, 0.34);
  background: #fff1e6;
  color: #c3540d;
}

.status-pill.status-done,
.status-pill.status-confirmed,
.status-pill.status-confirmed_reference {
  border-color: rgba(17, 166, 117, 0.3);
  background: #e6f8ef;
  color: #078057;
}

.status-pill.status-rejected,
.status-pill.status-cancelled,
.status-pill.status-cancel {
  border-color: rgba(239, 63, 109, 0.28);
  background: #ffeaf0;
  color: #c82357;
}

.priority-pill.priority-urgent,
.priority-pill.priority-p0 {
  border-color: rgba(239, 63, 109, 0.3);
  background: #ffeaf0;
  color: #c82357;
}

.priority-pill.priority-high,
.priority-pill.priority-p1 {
  border-color: rgba(255, 129, 38, 0.34);
  background: #fff1e6;
  color: #c3540d;
}

.priority-pill.priority-medium,
.priority-pill.priority-p2 {
  border-color: rgba(121, 99, 240, 0.28);
  background: #f0edff;
  color: #5b45d8;
}

.priority-pill.priority-low,
.priority-pill.priority-p3 {
  border-color: rgba(17, 166, 117, 0.3);
  background: #e6f8ef;
  color: #078057;
}

.badge.is-sample {
  border-color: rgba(124, 58, 237, 0.2);
  background: #f4efff;
  color: #6231bd;
}

.progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebf2;
}

.progress span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}

.chart-bars {
  display: grid;
  gap: 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.chart-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebf2;
}

.chart-track span {
  display: block;
  width: var(--bar, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color, var(--blue));
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.task-name {
  max-width: 460px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
}

.muted {
  color: var(--muted);
}

.strong {
  font-weight: 800;
}

.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.kanban-column {
  min-width: 240px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f9fafc;
}

.kanban-column.is-drag-over {
  border-color: var(--blue);
  background: #edf4ff;
}

.kanban-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 900;
}

.kanban-list {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.task-card {
  display: grid;
  gap: 10px;
  min-height: 128px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.task-card[draggable="true"] {
  cursor: grab;
}

.task-card.is-dragging {
  opacity: 0.46;
}

.task-card h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.task-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.focus-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.focus-score {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fff7e8;
  color: #935400;
  font-size: 12px;
  font-weight: 900;
}

.day-bucket {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.day-bucket-head,
.mini-task-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini-task-line {
  min-height: 30px;
  color: var(--muted);
  font-size: 12px;
}

.mini-task-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-task-line strong {
  color: var(--ink);
  white-space: nowrap;
}

.queue-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
}

.queue-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.search-box {
  position: relative;
  min-width: min(360px, 100%);
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.cleanup-stack {
  display: grid;
  gap: 10px;
}

.cleanup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.35fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.cleanup-row-head {
  display: grid;
  gap: 8px;
}

.cleanup-samples {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.cleanup-samples span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.cleanup-controls {
  display: grid;
  gap: 8px;
}

.hint-box,
.candidate-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfc;
}

.hint-box p,
.candidate-panel h4 {
  margin: 0;
}

.hint-box p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.candidate-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.candidate-editor-list {
  display: grid;
  gap: 10px;
}

.candidate-editor-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 132px minmax(110px, 0.8fr) minmax(110px, 0.8fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.candidate-editor-row .input,
.candidate-editor-row .select {
  min-height: 34px;
}

.candidate-editor-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.candidate-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(121, 99, 240, 0.22);
  border-radius: 999px;
  background: #f2efff;
  color: #45358f;
  font-size: 12px;
  font-weight: 850;
}

.candidate-chip small {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 5px;
}

.field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.section-subhead h3 {
  margin: 0;
  font-size: 15px;
}

.project-master-form,
.project-master-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.project-master-stack {
  display: grid;
  gap: 10px;
}

.project-master-row .row-title {
  display: grid;
  gap: 12px;
}

.project-master-row .row-title p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.timeline {
  display: grid;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.timeline-header,
.timeline-row {
  display: grid;
  grid-template-columns: 280px repeat(var(--timeline-columns, 12), minmax(72px, 1fr));
  min-width: 1144px;
}

.timeline-header {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.timeline-header span {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.timeline-name {
  position: sticky;
  left: 0;
  z-index: 1;
  display: grid;
  align-content: center;
  min-height: 54px;
  padding: 10px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 800;
}

.timeline-track {
  position: relative;
  grid-column: 2 / -1;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(var(--timeline-step, 8.333%) - 1px),
      rgba(217, 224, 234, 0.8) calc(var(--timeline-step, 8.333%) - 1px),
      rgba(217, 224, 234, 0.8) var(--timeline-step, 8.333%)
    );
}

.timeline-bar {
  position: absolute;
  top: 16px;
  left: var(--left, 0%);
  width: var(--width, 8%);
  min-width: 36px;
  height: 22px;
  border-radius: 999px;
  background: var(--bar-color, var(--blue));
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  cursor: default;
  z-index: 2;
}

.timeline-bar:hover,
.timeline-bar:focus-visible {
  z-index: 20;
}

.timeline-bar.is-overdue {
  background: var(--red);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.18);
}

.workload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.person-row {
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #e8f0ff;
  color: #1244b8;
  font-size: 13px;
  font-weight: 900;
}

.capacity {
  display: grid;
  gap: 7px;
}

.capacity-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.api-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.75fr);
  gap: 14px;
}

.filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius);
  background: #edf4ff;
  color: #1244b8;
  font-size: 13px;
  font-weight: 800;
}

.filter-banner span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filter-banner svg {
  width: 16px;
  height: 16px;
}

.endpoint-list {
  display: grid;
  gap: 8px;
}

.endpoint-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfc;
}

.method {
  display: inline-flex;
  justify-content: center;
  min-width: 54px;
  padding: 4px 7px;
  border-radius: 6px;
  background: #e8f0ff;
  color: #1244b8;
  font-size: 12px;
  font-weight: 900;
}

.code {
  overflow-wrap: anywhere;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.loading {
  display: grid;
  place-items: center;
  min-height: 360px;
  color: var(--muted);
}

/* Reference-inspired shell: ClickUp/TeamUnity style without changing API data flow. */
:root {
  --bg: #f3f2ef;
  --surface: #ffffff;
  --surface-2: #f8f7f5;
  --ink: #20222a;
  --muted: #81838c;
  --line: #e8e5df;
  --line-strong: #d6d2ca;
  --blue: #7963f0;
  --teal: #11a675;
  --amber: #ff8126;
  --red: #ef3f6d;
  --violet: #7963f0;
  --cyan: #65d6df;
  --shadow: 0 22px 54px rgba(32, 34, 42, 0.12);
  --radius: 8px;
  --sidebar-width: 286px;
}

body {
  padding: 32px;
  background: #303236;
}

.app-shell {
  min-height: calc(100vh - 64px);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background: var(--bg);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.sidebar {
  height: auto;
  min-height: calc(100vh - 64px);
  gap: 20px;
  padding: 30px 22px;
  border-right: 0;
  background: #202126;
  color: #ffffff;
  backdrop-filter: none;
}

.brand {
  grid-template-columns: 48px 1fr;
  color: #ffffff;
}

.brand:hover,
.brand:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.brand-mark {
  width: 48px;
  height: 48px;
  background: #ff8126;
  color: #ffffff;
}

.brand small {
  color: rgba(255, 255, 255, 0.58);
}

.nav-list {
  gap: 8px;
}

.nav-item {
  min-height: 46px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.82);
}

.nav-item:hover,
.nav-item:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-item.is-active {
  background: rgba(255, 129, 38, 0.16);
  color: #ffffff;
}

.nav-item.is-active svg {
  color: #ff8126;
}

.sidebar-footer {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
}

.sidebar-footer span {
  color: #ffffff;
}

.main {
  padding: 34px 36px 42px;
  background: var(--bg);
}

.topbar {
  min-height: 58px;
  margin-bottom: 20px;
}

.title-block p {
  color: #9a9895;
  letter-spacing: 0;
}

.title-block h1 {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 900;
}

.sync-pill,
.badge,
.status-pill,
.priority-pill {
  border-radius: 999px;
}

.icon-button,
.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.segmented,
.input,
.select {
  border-radius: var(--radius);
}

.primary-button {
  border-color: #ff8126;
  background: #ff8126;
}

.secondary-button {
  background: #ffffff;
}

.section {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.execution-hero {
  padding: 0 0 18px;
  border: 0;
  background: transparent;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: 18px;
}

.report-left,
.report-right {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.report-metrics {
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 18px;
}

.metric {
  position: relative;
  min-height: 132px;
  padding: 20px 24px;
  border: 0;
  background: #ffffff;
  box-shadow: none;
}

.metric span {
  color: #20222a;
  font-size: 17px;
  font-weight: 900;
  text-transform: none;
}

.metric span svg {
  width: 22px;
  height: 22px;
  padding: 5px;
  border-radius: 999px;
  background: #fff0e7;
  color: #ff5b16;
  box-sizing: content-box;
}

.metric:nth-child(2) span svg {
  background: #dcfce8;
  color: #059669;
}

.metric:nth-child(3) span svg {
  background: #eee9ff;
  color: #7963f0;
}

.metric:nth-child(4) span svg {
  background: #ffe5ef;
  color: #ef3f6d;
}

.metric strong {
  margin-top: 16px;
  font-size: 38px;
  font-weight: 500;
}

.metric small {
  margin-top: 14px;
  color: #8c8a86;
  font-weight: 700;
}

.metric-button:hover,
.metric-button:focus-visible {
  border-color: transparent;
  box-shadow: 0 18px 36px rgba(255, 129, 38, 0.14);
  transform: translateY(-1px);
}

.panel {
  border: 0;
  background: #ffffff;
  box-shadow: none;
}

.visual-panel {
  overflow: hidden;
}

.panel-header {
  min-height: 60px;
  padding: 18px 24px 10px;
  border-bottom: 0;
}

.panel-header h3 {
  font-size: 20px;
  font-weight: 900;
}

.panel-body {
  padding: 14px 24px 20px;
}

.chart-panel .panel-body {
  min-height: 234px;
}

.vertical-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(38px, 1fr));
  align-items: end;
  gap: 16px;
  min-height: 206px;
}

.vertical-bar {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #3d4150;
}

.vertical-track {
  position: relative;
  width: 14px;
  height: 150px;
  overflow: hidden;
  border-radius: 999px;
  background: #fff2a6;
}

.vertical-track span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--height, 0%);
  border-radius: inherit;
  background: #ff8126;
}

.vertical-bar.is-today .vertical-track {
  background: #d9fbe8;
}

.vertical-bar.is-today .vertical-track span {
  background: #11a675;
}

.vertical-bar strong {
  font-size: 12px;
}

.vertical-bar small {
  font-size: 12px;
}

.category-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 14px;
}

.category-tile {
  display: grid;
  place-items: center;
  gap: 9px;
  min-height: 132px;
  border: 0;
  border-radius: var(--radius);
  background: #ffd7a9;
  color: #20222a;
}

.category-tile span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.category-tile svg {
  width: 23px;
  height: 23px;
  color: #ff5b16;
}

.category-tile strong {
  font-size: 24px;
  line-height: 1;
}

.category-tile small {
  font-size: 15px;
  font-weight: 800;
}

.category-review {
  background: #9fe4f7;
}

.category-review svg {
  color: #0b85a5;
}

.category-risk {
  background: #f4ee9e;
}

.category-risk svg {
  color: #d8a600;
}

.category-done {
  background: #a6efbb;
}

.category-done svg {
  color: #03945f;
}

.execution-grid {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 18px;
}

.board-panel .panel-body {
  padding: 0 0 20px 24px;
}

.kanban {
  grid-auto-columns: 286px;
  gap: 14px;
  align-items: stretch;
  min-height: max(520px, calc(100vh - 360px));
  padding: 0 24px 8px 0;
}

.kanban-column {
  width: 286px;
  min-width: 286px;
  min-height: inherit;
  border: 0;
  background: transparent;
  border-radius: var(--radius);
}

.kanban-column.is-drag-over {
  background: rgba(121, 99, 240, 0.09);
  box-shadow: inset 0 0 0 2px rgba(121, 99, 240, 0.28);
}

.kanban-head {
  padding: 0 0 16px;
  border-bottom: 0;
  color: #2b2d33;
  font-size: 20px;
}

.kanban-list {
  gap: 16px;
  padding: 0;
  min-height: calc(100% - 46px);
  align-content: start;
}

.task-filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(180px, 1fr) repeat(3, minmax(132px, 0.72fr));
  gap: 10px;
  align-items: center;
}

.task-filter-bar .control,
.task-filter-bar .select {
  min-width: 0;
}

.task-card {
  min-height: 232px;
  padding: 18px;
  border: 0;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(32, 34, 42, 0.06);
}

.task-card:hover {
  box-shadow: 0 16px 34px rgba(32, 34, 42, 0.11);
}

.task-card h4 {
  font-size: 17px;
  font-weight: 900;
}

.task-card p {
  min-height: 42px;
  color: #5f6067;
  font-size: 13px;
  line-height: 1.45;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack .avatar + .avatar {
  margin-left: -10px;
}

.avatar-sm {
  width: 30px;
  height: 30px;
  border: 2px solid #ffffff;
  background: #202126;
  color: #ffffff;
  font-size: 10px;
}

.avatar-soft {
  background: #ff8126;
}

.avatar-xs {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: #202126;
  color: #ffffff;
  font-size: 9px;
}

.person-chip {
  display: inline-flex;
  align-items: center;
  max-width: 150px;
  min-height: 32px;
  gap: 7px;
  padding: 3px 10px 3px 4px;
  border: 1px solid rgba(255, 129, 38, 0.24);
  border-radius: 999px;
  background: #fff7ef;
  color: #3b2f28;
  font-size: 12px;
  font-weight: 850;
  vertical-align: middle;
}

.person-chip > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-chip-support {
  border-color: rgba(121, 99, 240, 0.24);
  background: #f2efff;
  color: #45358f;
}

.person-chip-support .avatar-xs {
  background: #7963f0;
}

.card-stats {
  display: flex;
  color: #7d7e86;
  font-size: 12px;
  font-weight: 800;
}

.card-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.card-stats svg {
  width: 14px;
  height: 14px;
}

.card-project-line {
  display: none;
}

.gantt-panel .panel-body,
.compact-timeline {
  overflow: hidden;
}

.timeline {
  gap: 0;
  padding-bottom: 0;
  border-top: 1px solid var(--line);
}

.timeline-header,
.timeline-row {
  grid-template-columns: 230px repeat(var(--timeline-columns, 12), minmax(58px, 1fr));
  min-width: 980px;
}

.timeline-header {
  background: #fbfaf8;
  color: #8b8e99;
}

.timeline-header span {
  padding: 10px;
  border-right: 1px solid var(--line);
}

.timeline-name {
  min-height: 56px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.timeline-track {
  min-height: 56px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(var(--timeline-step, 8.333%) - 1px),
      rgba(232, 229, 223, 0.92) calc(var(--timeline-step, 8.333%) - 1px),
      rgba(232, 229, 223, 0.92) var(--timeline-step, 8.333%)
    );
}

.timeline-bar {
  top: 15px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  min-width: 78px;
  padding: 0 12px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(121, 99, 240, 0.18);
}

.timeline-bar > span:not(.timeline-tooltip) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-tooltip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 40;
  display: grid;
  width: min(320px, 70vw);
  gap: 7px;
  padding: 12px 14px;
  border: 1px solid rgba(32, 34, 42, 0.12);
  border-radius: 12px;
  background: #202126;
  color: #ffffff;
  box-shadow: 0 18px 42px rgba(32, 34, 42, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.timeline-tooltip::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #202126;
  transform: rotate(45deg);
}

.timeline-bar.tooltip-below .timeline-tooltip {
  top: calc(100% + 10px);
  bottom: auto;
}

.timeline-bar.tooltip-below .timeline-tooltip::after {
  top: -6px;
  bottom: auto;
}

.timeline-tooltip strong {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.25;
  white-space: normal;
}

.timeline-tooltip small {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
}

.timeline-tooltip small span {
  color: rgba(255, 255, 255, 0.52);
}

.timeline-bar:hover .timeline-tooltip,
.timeline-bar:focus-visible .timeline-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.chart-bars {
  gap: 14px;
}

.chart-row {
  grid-template-columns: 88px minmax(0, 1fr) 32px;
}

.chart-track {
  height: 12px;
  background: #f0eee9;
}

.grid-2,
.execution-grid,
.queue-grid,
.api-grid {
  align-items: start;
}

.section,
.panel,
.panel-body,
.list-stack {
  align-content: start;
}

.panel-body.list-stack,
.section > .list-stack {
  align-self: start;
}

.grid-2 > .section,
.grid-2 > .panel,
.queue-grid > .section,
.queue-grid > .panel {
  align-self: start;
}

.kanban-column {
  align-self: stretch;
}

@media (max-width: 1180px) {
  .report-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .grid-2,
  .execution-grid,
  .queue-grid,
  .api-grid {
    grid-template-columns: 1fr;
  }

  .workload-grid,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .task-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  body {
    padding: 0;
    background: var(--bg);
  }

  .app-shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(var(--sidebar-width), calc(100vw - 58px));
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 160ms ease;
    box-shadow: var(--shadow);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .main {
    padding: 16px 14px 30px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    width: 100%;
  }

  .mobile-only {
    display: inline-grid;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-metrics,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .report-right {
    grid-template-columns: 1fr;
  }

  .category-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-filter-bar {
    grid-template-columns: 1fr;
  }

  .kanban {
    grid-auto-columns: minmax(274px, calc(100vw - 56px));
  }

  .kanban-column {
    width: min(286px, calc(100vw - 56px));
    min-width: min(286px, calc(100vw - 56px));
  }

  .section-header,
  .execution-hero,
  .project-row,
  .queue-row,
  .cleanup-row,
  .person-row {
    grid-template-columns: 1fr;
  }

  .queue-actions {
    justify-content: start;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .candidate-editor-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .main {
    padding: 18px 14px 28px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 126px;
  }

  .category-tiles {
    grid-template-columns: 1fr;
  }

  .vertical-chart {
    min-width: 540px;
    overflow: visible;
  }

  .chart-panel .panel-body {
    overflow-x: auto;
  }

  .title-block h1 {
    font-size: 24px;
  }

  .toolbar,
  .segmented {
    width: 100%;
  }

  .segmented button,
  .primary-button,
  .secondary-button,
  .danger-button {
    flex: 1;
  }

  .segmented button {
    min-width: 0;
    padding: 0 6px;
    font-size: 12px;
  }
}

/* Dark mode is the default dashboard theme. Keep this block last so it wins over
   legacy light-page literals that still exist in older view sections. */
:root {
  color-scheme: dark;
  --bg: #070b13;
  --surface: #0f1725;
  --surface-2: #151f31;
  --ink: #e7edf7;
  --muted: #9aa7ba;
  --line: #263348;
  --line-strong: #3a4961;
  --blue: #78a7ff;
  --teal: #57d8aa;
  --amber: #f6c96f;
  --red: #fb8b86;
  --violet: #b7a7ff;
  --cyan: #67d9f0;
  --shadow: 0 22px 56px rgba(0, 0, 0, 0.42);
}

body {
  background:
    radial-gradient(circle at top left, rgba(120, 167, 255, 0.14), transparent 34vw),
    #050913;
  color: var(--ink);
}

.app-shell,
.main {
  background: var(--bg);
}

.app-shell {
  border-color: rgba(148, 163, 184, 0.18);
}

.sidebar {
  background: #090f1c;
  color: var(--ink);
}

.brand,
.nav-item,
.title-block h1,
.section-title h2,
.panel-header h3,
.metric span,
.metric strong,
.kanban-head,
.task-card h4,
.timeline-name strong,
.row-title,
.strong {
  color: var(--ink);
}

.brand small,
.title-block p,
.sidebar-footer,
.muted,
.sync-pill,
.section-title p,
.panel-header p,
.metric small,
.task-card p,
.card-stats,
.timeline-header,
.loading,
.empty-state,
.meta-line,
.hint-box,
.cleanup-samples,
.candidate-editor-count {
  color: var(--muted);
}

.brand:hover,
.brand:focus-visible,
.nav-item:hover,
.nav-item:focus-visible {
  background: rgba(148, 163, 184, 0.12);
}

.nav-item {
  color: #c7d2e2;
}

.nav-item.is-active {
  background: rgba(120, 167, 255, 0.16);
  color: var(--ink);
}

.nav-item.is-active svg {
  color: var(--blue);
}

.brand-mark,
.primary-button,
.segmented button.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #07111f;
}

.sidebar-footer,
.section,
.panel,
.metric,
.task-card,
.project-row,
.task-row,
.queue-row,
.meeting-row,
.person-row,
.cleanup-row,
.candidate-panel,
.candidate-editor-row,
.endpoint-row,
.mini-stat,
.focus-row,
.day-bucket,
.sync-banner,
.filter-banner,
.hint-box,
.table-wrap,
.data-table,
.candidate-list,
.endpoint-list {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}

.section,
.panel {
  background: transparent;
}

.panel,
.metric,
.task-card,
.project-row,
.task-row,
.queue-row,
.meeting-row,
.person-row,
.cleanup-row,
.candidate-panel,
.endpoint-row,
.mini-stat,
.focus-row,
.day-bucket,
.table-wrap {
  background: var(--surface);
}

.metric:hover,
.task-card:hover,
.metric-button:hover,
.metric-button:focus-visible {
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

.icon-button,
.secondary-button,
.danger-button,
.ghost-button,
.segmented,
.segmented button,
.input,
.select,
.textarea,
.control,
.search-box,
.select-shell,
.select-shell-field,
.select-shell-person,
.select-shell-status {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.input::placeholder,
.textarea::placeholder,
.search-box input::placeholder {
  color: #7f8da2;
}

.select option,
.input,
select,
textarea {
  background: var(--surface);
  color: var(--ink);
}

.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.segmented button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.danger-button {
  border-color: rgba(251, 139, 134, 0.38);
  background: rgba(239, 68, 68, 0.14);
  color: var(--red);
}

.badge,
.sync-pill,
.status-pill,
.priority-pill,
.candidate-chip,
.person-chip {
  border-color: var(--line);
  background: rgba(148, 163, 184, 0.16);
  color: #c7d2e2;
}

.person-chip-support {
  border-color: rgba(183, 167, 255, 0.32);
  background: rgba(124, 58, 237, 0.18);
  color: #d8d1ff;
}

.avatar-sm,
.avatar-xs {
  border-color: var(--surface);
  background: #1c2940;
  color: var(--ink);
}

.avatar-soft,
.person-chip-support .avatar-xs {
  background: var(--blue);
  color: #07111f;
}

.metric span svg,
.category-tile span {
  background: rgba(120, 167, 255, 0.16);
  color: var(--blue);
}

.metric:nth-child(2) span svg,
.category-done span {
  background: rgba(87, 216, 170, 0.16);
  color: var(--teal);
}

.metric:nth-child(3) span svg,
.category-review span {
  background: rgba(183, 167, 255, 0.18);
  color: var(--violet);
}

.metric:nth-child(4) span svg,
.category-risk span {
  background: rgba(246, 201, 111, 0.18);
  color: var(--amber);
}

.category-tile,
.category-review,
.category-risk,
.category-done {
  background: var(--surface-2);
  color: var(--ink);
}

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

.vertical-track,
.chart-track,
.progress {
  background: #1e293b;
}

.vertical-track span,
.chart-track span,
.progress span {
  background: var(--blue);
}

.vertical-bar.is-today .vertical-track {
  background: rgba(87, 216, 170, 0.16);
}

.vertical-bar.is-today .vertical-track span {
  background: var(--teal);
}

.kanban-column {
  background: transparent;
}

.kanban-column.is-drag-over {
  background: rgba(120, 167, 255, 0.12);
  box-shadow: inset 0 0 0 2px rgba(120, 167, 255, 0.28);
}

.timeline-header,
.timeline-name,
.timeline-track {
  border-color: var(--line);
  background: var(--surface);
}

.timeline-track {
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(var(--timeline-step, 8.333%) - 1px),
      rgba(58, 73, 97, 0.88) calc(var(--timeline-step, 8.333%) - 1px),
      rgba(58, 73, 97, 0.88) var(--timeline-step, 8.333%)
    );
}

.timeline-tooltip,
.timeline-tooltip::after,
.toast {
  background: #08111f;
  color: var(--ink);
  border-color: var(--line-strong);
}

.timeline-tooltip strong {
  color: var(--ink);
}

.timeline-tooltip small {
  color: #c7d2e2;
}

.timeline-tooltip small span {
  color: var(--muted);
}

.data-table th,
.data-table td,
.task-card-footer,
.panel-header,
.timeline,
.cleanup-row,
.candidate-editor-row {
  border-color: var(--line);
}

.code {
  border-color: var(--line);
  background: #08111f;
  color: #dbeafe;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f2ef;
  --surface: #ffffff;
  --surface-2: #f8f7f5;
  --ink: #20222a;
  --muted: #81838c;
  --line: #e8e5df;
  --line-strong: #d6d2ca;
  --blue: #7963f0;
  --teal: #11a675;
  --amber: #ff8126;
  --red: #ef3f6d;
  --violet: #7963f0;
  --cyan: #65d6df;
  --shadow: 0 22px 54px rgba(32, 34, 42, 0.12);
}

:root[data-theme="light"] body {
  background: #f3f2ef;
  color: var(--ink);
}

:root[data-theme="light"] .app-shell,
:root[data-theme="light"] .main {
  background: var(--bg);
}

:root[data-theme="light"] .app-shell {
  border-color: rgba(32, 34, 42, 0.1);
  box-shadow: 0 24px 60px rgba(32, 34, 42, 0.12);
}

:root[data-theme="light"] .sidebar {
  background: #ffffff;
  color: var(--ink);
}

:root[data-theme="light"] .brand,
:root[data-theme="light"] .nav-item,
:root[data-theme="light"] .title-block h1,
:root[data-theme="light"] .section-title h2,
:root[data-theme="light"] .panel-header h3,
:root[data-theme="light"] .metric span,
:root[data-theme="light"] .metric strong,
:root[data-theme="light"] .kanban-head,
:root[data-theme="light"] .task-card h4,
:root[data-theme="light"] .timeline-name strong,
:root[data-theme="light"] .row-title,
:root[data-theme="light"] .strong {
  color: var(--ink);
}

:root[data-theme="light"] .brand small,
:root[data-theme="light"] .title-block p,
:root[data-theme="light"] .sidebar-footer,
:root[data-theme="light"] .muted,
:root[data-theme="light"] .sync-pill,
:root[data-theme="light"] .section-title p,
:root[data-theme="light"] .panel-header p,
:root[data-theme="light"] .metric small,
:root[data-theme="light"] .task-card p,
:root[data-theme="light"] .card-stats,
:root[data-theme="light"] .timeline-header,
:root[data-theme="light"] .loading,
:root[data-theme="light"] .empty-state,
:root[data-theme="light"] .meta-line,
:root[data-theme="light"] .hint-box,
:root[data-theme="light"] .cleanup-samples,
:root[data-theme="light"] .candidate-editor-count {
  color: var(--muted);
}

:root[data-theme="light"] .brand:hover,
:root[data-theme="light"] .brand:focus-visible,
:root[data-theme="light"] .nav-item:hover,
:root[data-theme="light"] .nav-item:focus-visible {
  background: var(--surface-2);
}

:root[data-theme="light"] .nav-item {
  color: #374151;
}

:root[data-theme="light"] .nav-item.is-active {
  background: #e8f0ff;
  color: #1244b8;
}

:root[data-theme="light"] .nav-item.is-active svg {
  color: #1244b8;
}

:root[data-theme="light"] .brand-mark,
:root[data-theme="light"] .primary-button,
:root[data-theme="light"] .segmented button.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

:root[data-theme="light"] .sidebar-footer,
:root[data-theme="light"] .panel,
:root[data-theme="light"] .metric,
:root[data-theme="light"] .task-card,
:root[data-theme="light"] .project-row,
:root[data-theme="light"] .task-row,
:root[data-theme="light"] .queue-row,
:root[data-theme="light"] .meeting-row,
:root[data-theme="light"] .person-row,
:root[data-theme="light"] .cleanup-row,
:root[data-theme="light"] .candidate-panel,
:root[data-theme="light"] .candidate-editor-row,
:root[data-theme="light"] .endpoint-row,
:root[data-theme="light"] .mini-stat,
:root[data-theme="light"] .focus-row,
:root[data-theme="light"] .day-bucket,
:root[data-theme="light"] .sync-banner,
:root[data-theme="light"] .filter-banner,
:root[data-theme="light"] .hint-box,
:root[data-theme="light"] .table-wrap,
:root[data-theme="light"] .data-table,
:root[data-theme="light"] .candidate-list,
:root[data-theme="light"] .endpoint-list {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

:root[data-theme="light"] .section {
  background: transparent;
}

:root[data-theme="light"] .icon-button,
:root[data-theme="light"] .secondary-button,
:root[data-theme="light"] .danger-button,
:root[data-theme="light"] .ghost-button,
:root[data-theme="light"] .segmented,
:root[data-theme="light"] .segmented button,
:root[data-theme="light"] .input,
:root[data-theme="light"] .select,
:root[data-theme="light"] .textarea,
:root[data-theme="light"] .control,
:root[data-theme="light"] .search-box,
:root[data-theme="light"] .select-shell,
:root[data-theme="light"] .select-shell-field,
:root[data-theme="light"] .select-shell-person,
:root[data-theme="light"] .select-shell-status {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

:root[data-theme="light"] .input::placeholder,
:root[data-theme="light"] .textarea::placeholder,
:root[data-theme="light"] .search-box input::placeholder {
  color: #7f8088;
}

:root[data-theme="light"] .secondary-button:hover,
:root[data-theme="light"] .ghost-button:hover,
:root[data-theme="light"] .icon-button:hover,
:root[data-theme="light"] .segmented button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

:root[data-theme="light"] .badge,
:root[data-theme="light"] .sync-pill,
:root[data-theme="light"] .status-pill,
:root[data-theme="light"] .priority-pill,
:root[data-theme="light"] .candidate-chip,
:root[data-theme="light"] .person-chip {
  border-color: var(--line);
  background: #f7f6f2;
  color: #585b65;
}

:root[data-theme="light"] .person-chip-support {
  border-color: rgba(121, 99, 240, 0.24);
  background: #f2efff;
  color: #45358f;
}

:root[data-theme="light"] .avatar-sm,
:root[data-theme="light"] .avatar-xs {
  border-color: #ffffff;
  background: #202126;
  color: #ffffff;
}

:root[data-theme="light"] .avatar-soft,
:root[data-theme="light"] .person-chip-support .avatar-xs {
  background: var(--blue);
  color: #ffffff;
}

:root[data-theme="light"] .metric span svg,
:root[data-theme="light"] .category-tile span {
  background: #fff0e7;
  color: #ff5b16;
}

:root[data-theme="light"] .metric:nth-child(2) span svg,
:root[data-theme="light"] .category-done span {
  background: #dcfce8;
  color: #059669;
}

:root[data-theme="light"] .metric:nth-child(3) span svg,
:root[data-theme="light"] .category-review span {
  background: #eee9ff;
  color: var(--violet);
}

:root[data-theme="light"] .metric:nth-child(4) span svg,
:root[data-theme="light"] .category-risk span {
  background: #fff7e8;
  color: #935400;
}

:root[data-theme="light"] .category-tile {
  background: #ffd7a9;
  color: var(--ink);
}

:root[data-theme="light"] .category-review {
  background: #9fe4f7;
}

:root[data-theme="light"] .category-risk {
  background: #f4ee9e;
}

:root[data-theme="light"] .category-done {
  background: #a6efbb;
}

:root[data-theme="light"] .vertical-bar {
  color: #3d4150;
}

:root[data-theme="light"] .vertical-track {
  background: #fff2a6;
}

:root[data-theme="light"] .chart-track,
:root[data-theme="light"] .progress {
  background: #f0eee9;
}

:root[data-theme="light"] .timeline-header,
:root[data-theme="light"] .timeline-name,
:root[data-theme="light"] .timeline-track {
  border-color: var(--line);
  background: var(--surface);
}

:root[data-theme="light"] .timeline-track {
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(var(--timeline-step, 8.333%) - 1px),
      rgba(232, 229, 223, 0.92) calc(var(--timeline-step, 8.333%) - 1px),
      rgba(232, 229, 223, 0.92) var(--timeline-step, 8.333%)
    );
}

:root[data-theme="light"] .timeline-tooltip,
:root[data-theme="light"] .timeline-tooltip::after,
:root[data-theme="light"] .toast {
  background: #202126;
  color: #ffffff;
  border-color: rgba(32, 34, 42, 0.12);
}

:root[data-theme="light"] .timeline-tooltip strong {
  color: #ffffff;
}

:root[data-theme="light"] .timeline-tooltip small {
  color: rgba(255, 255, 255, 0.86);
}

:root[data-theme="light"] .timeline-tooltip small span {
  color: rgba(255, 255, 255, 0.52);
}

:root[data-theme="light"] .code {
  border-color: var(--line);
  background: #fafbfc;
  color: var(--ink);
}
