:root {
  --ink: #172238;
  --blue: #1d3557;
  --paper: #fff8f0;
  --mint: #2a9d8f;
  --coral: #e76f51;
  --line: rgba(29, 53, 87, 0.15);
  --muted: #657089;
  --surface: #ffffff;
  --shadow: 0 16px 40px rgba(29, 53, 87, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(29, 53, 87, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(29, 53, 87, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100svh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100svh;
  padding: 22px 18px;
  color: var(--paper);
  background: var(--blue);
}

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

.brand img {
  flex: 0 0 auto;
}

.brand strong,
.brand span,
.side-note b,
.side-note span {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.1;
}

.brand span {
  margin-top: 3px;
  color: rgba(255, 248, 240, 0.68);
  font-size: 13px;
}

.nav-tabs {
  display: grid;
  gap: 6px;
}

.nav-tab,
.segment,
.icon-action,
.ghost-action {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.nav-tab {
  padding: 10px 12px;
  color: rgba(255, 248, 240, 0.76);
  background: transparent;
  text-align: left;
}

.nav-tab:hover,
.nav-tab.active {
  color: var(--paper);
  background: rgba(255, 248, 240, 0.12);
}

.side-note {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 248, 240, 0.18);
}

.side-note b {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.45;
}

.mono,
.eyebrow,
.metric span,
.lane-head,
.task-time,
.status,
.chip,
.timeline-row time,
.timeline-row em {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0;
}

.workspace {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: var(--blue);
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1;
}

.operator-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  white-space: nowrap;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(42, 157, 143, 0.55);
  animation: pulse 1.8s infinite;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.metric {
  padding: 16px;
  background: rgba(255, 255, 255, 0.83);
}

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

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

.metric.accent strong {
  color: var(--coral);
}

.screen {
  display: none;
  animation: rise 220ms ease both;
}

.screen.active {
  display: block;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.searchbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  max-width: 420px;
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.searchbox span {
  color: var(--mint);
  font-size: 20px;
}

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

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.segment {
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
}

.segment.active {
  color: var(--paper);
  background: var(--blue);
}

.calendar-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 12px;
  align-items: start;
}

.lane {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
}

.lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.lane-head b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(42, 157, 143, 0.14);
  color: var(--mint);
}

.lane-list {
  display: grid;
  gap: 10px;
  min-height: 340px;
  padding: 10px;
}

.task {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(29, 53, 87, 0.12);
  border-left: 4px solid var(--mint);
  border-radius: 8px;
  background: var(--surface);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.task:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(29, 53, 87, 0.13);
}

.task.has-conflict {
  border-left-color: var(--coral);
}

.priority-critical {
  background: linear-gradient(90deg, rgba(231, 111, 81, 0.08), #fff 34%);
}

.priority-high {
  background: linear-gradient(90deg, rgba(42, 157, 143, 0.08), #fff 34%);
}

.task-time {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.task-time span,
.task-time b {
  display: block;
  overflow-wrap: anywhere;
}

.task-time b {
  margin-top: 8px;
  color: var(--blue);
  font-size: 12px;
}

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

.task-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.task h3 {
  min-width: 0;
  color: var(--blue);
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.task p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.status {
  flex: 0 0 auto;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(29, 53, 87, 0.08);
  color: var(--blue);
  font-size: 11px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 248, 240, 0.72);
  font-size: 11px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.chip.client {
  color: var(--blue);
  background: rgba(29, 53, 87, 0.06);
}

.chip.resource {
  color: var(--mint);
  border-color: rgba(42, 157, 143, 0.28);
}

.lane-chip {
  color: var(--coral);
  border-color: rgba(231, 111, 81, 0.22);
}

.conflict {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(231, 111, 81, 0.1);
  color: var(--coral);
}

.conflict b {
  font-size: 12px;
  text-transform: uppercase;
}

.conflict span {
  color: #9a3f2d;
  font-size: 13px;
  line-height: 1.35;
}

.task-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.icon-action,
.ghost-action {
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.icon-action {
  color: var(--paper);
  background: var(--mint);
}

.ghost-action {
  border: 1px solid rgba(231, 111, 81, 0.28);
  color: var(--coral);
  background: transparent;
}

.done-mark {
  align-self: center;
  color: var(--mint);
  font-size: 13px;
  font-weight: 700;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.section-title h2 {
  color: var(--blue);
  font-size: 24px;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.timeline,
.settings-grid,
.team-grid {
  display: grid;
  gap: 8px;
}

.timeline-row,
.setting-row,
.team-row {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
}

.timeline-row {
  grid-template-columns: 134px minmax(0, 1fr) 120px;
}

.timeline-row time,
.timeline-row em,
.setting-row small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.timeline-row b,
.setting-row b,
.team-row b {
  display: block;
  color: var(--blue);
}

.timeline-row span,
.team-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.timeline-row p {
  margin-top: 6px;
  color: var(--ink);
  font-size: 13px;
}

.setting-row {
  grid-template-columns: 190px minmax(0, 1fr) 130px;
}

.setting-row .mono {
  color: var(--coral);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.team-row {
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 260px) 88px;
}

.loadbar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(29, 53, 87, 0.11);
}

.loadbar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--coral));
}

.empty {
  display: grid;
  place-items: center;
  min-height: 96px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--paper);
  background: var(--blue);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.is-busy .workspace {
  cursor: progress;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 9px rgba(42, 157, 143, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(42, 157, 143, 0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .sidebar {
    position: static;
    min-height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .nav-tabs {
    grid-template-columns: repeat(4, minmax(90px, 1fr));
    flex: 1;
  }

  .side-note {
    display: none;
  }

  .calendar-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 16px;
  }

  .topbar,
  .toolbar,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .operator-chip,
  .searchbox {
    width: 100%;
    min-width: 0;
  }

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

  .segmented {
    overflow-x: auto;
  }

  .segment {
    flex: 0 0 auto;
  }

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

  .task-actions {
    justify-content: flex-start;
  }

  .timeline-row,
  .setting-row,
  .team-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .sidebar {
    padding: 16px;
  }

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

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