:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-soft: #f9fbfd;
  --ink: #1f2933;
  --muted: #657184;
  --quiet: #8994a5;
  --line: #d9e0e8;
  --line-strong: #b9c3cf;
  --teal: #0f766e;
  --teal-strong: #115e59;
  --teal-soft: #e4f3f1;
  --blue: #2864ad;
  --blue-soft: #e8f1fb;
  --amber: #b7791f;
  --amber-soft: #fff4dc;
  --red: #b42318;
  --red-soft: #fff0ed;
  --green: #177245;
  --green-soft: #e8f6ef;
  --violet: #6246a8;
  --violet-soft: #f0ecfb;
  --shadow: 0 16px 36px rgba(31, 41, 51, 0.09);
  --radius: 8px;
  --sidebar: 262px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

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

button {
  color: inherit;
}

a {
  color: var(--blue);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #18232f;
  color: #f9fbfd;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: #0f766e;
  font-weight: 850;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: #aeb9c6;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #c7d1de;
  cursor: pointer;
  text-align: left;
}

.nav-item svg,
.button svg,
.icon-button svg,
.search-box svg,
.inline-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.active {
  box-shadow: inset 3px 0 0 #2dd4bf;
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.secondary-link {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: #c7d1de;
  text-decoration: none;
}

.secondary-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 82px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 250, 0.92);
  backdrop-filter: blur(12px);
}

.topbar-main,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-main {
  flex: 1 1 auto;
}

.topbar-actions {
  flex: 0 1 auto;
  justify-content: flex-end;
}

.workspace-kicker {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

h1 {
  font-size: 24px;
  line-height: 1.1;
}

h2 {
  font-size: 20px;
  line-height: 1.15;
}

h3 {
  font-size: 15px;
  line-height: 1.2;
}

h4 {
  font-size: 13px;
  line-height: 1.2;
}

.menu-button {
  display: none;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.icon-lines,
.icon-lines::before,
.icon-lines::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.icon-lines::before,
.icon-lines::after {
  content: "";
  position: relative;
}

.icon-lines::before {
  top: -6px;
}

.icon-lines::after {
  top: 4px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  border-color: var(--line-strong);
}

.button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

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

.button.danger {
  border-color: var(--red-soft);
  background: var(--red-soft);
  color: var(--red);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(340px, 28vw);
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
}

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

.select-wrap {
  display: grid;
  gap: 2px;
  min-width: 238px;
  padding: 4px 10px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.select-wrap span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.select-wrap select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 720;
}

main {
  display: grid;
  gap: 18px;
  padding: 22px 24px 36px;
}

.view {
  display: grid;
  gap: 18px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(31, 41, 51, 0.04);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.panel-title p {
  color: var(--muted);
}

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

.panel-body {
  padding: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  display: grid;
  gap: 10px;
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-value {
  font-size: 30px;
  font-weight: 840;
  line-height: 1;
}

.metric-label {
  color: var(--muted);
  font-weight: 720;
}

.metric-note {
  color: var(--quiet);
  font-size: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.7fr);
  gap: 18px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.status-pill,
.priority-pill,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.status-pill.green,
.priority-pill.low,
.tag.green {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.blue,
.priority-pill.medium,
.tag.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-pill.amber,
.priority-pill.high,
.tag.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill.red,
.priority-pill.critical,
.tag.red {
  background: var(--red-soft);
  color: var(--red);
}

.status-pill.violet,
.tag.violet {
  background: var(--violet-soft);
  color: var(--violet);
}

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

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  color: var(--ink);
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #fbfcfe;
}

td .subtext,
.subtext {
  color: var(--muted);
  font-size: 12px;
}

.name-cell {
  display: grid;
  gap: 3px;
}

.avatar-group {
  display: flex;
  align-items: center;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-size: 11px;
  font-weight: 820;
}

.avatar + .avatar {
  margin-left: -8px;
}

.progress {
  display: grid;
  gap: 5px;
}

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

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.progress-fill.amber {
  background: var(--amber);
}

.progress-fill.red {
  background: var(--red);
}

.progress-fill.blue {
  background: var(--blue);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

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

.timeline-copy {
  display: grid;
  gap: 4px;
}

.timeline-copy p {
  color: var(--muted);
}

.risk-list,
.document-list,
.message-list,
.task-list,
.shipment-stack {
  display: grid;
  gap: 10px;
}

.risk-card,
.document-card,
.message-card,
.task-card,
.shipment-card,
.booth-card,
.ai-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.risk-card {
  display: grid;
  gap: 10px;
  border-left: 4px solid var(--amber);
}

.risk-card.critical {
  border-left-color: var(--red);
}

.risk-card.low {
  border-left-color: var(--blue);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.card-title p {
  color: var(--muted);
}

.metadata-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metadata {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  color: var(--muted);
  font-size: 12px;
}

.phase-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.phase-column {
  min-height: 420px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.phase-column header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.phase-column h3 {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
}

.task-card {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.04);
}

.task-card .task-title {
  font-weight: 780;
}

.dependency-note {
  padding: 9px 10px;
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: #805112;
  font-size: 12px;
}

.gantt {
  min-width: 960px;
  display: grid;
  gap: 10px;
}

.gantt-header,
.gantt-row {
  display: grid;
  grid-template-columns: 220px repeat(10, minmax(70px, 1fr));
  gap: 5px;
  align-items: center;
}

.gantt-header {
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.gantt-label {
  font-weight: 760;
}

.gantt-cell {
  height: 28px;
  border-radius: 5px;
  background: #edf2f7;
}

.gantt-bar {
  height: 28px;
  border-radius: 5px;
  background: var(--teal);
}

.gantt-bar.blue {
  background: var(--blue);
}

.gantt-bar.amber {
  background: var(--amber);
}

.gantt-bar.red {
  background: var(--red);
}

.gantt-bar.violet {
  background: var(--violet);
}

.split-screen {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
}

.assistant-shell {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
  min-height: 620px;
}

.assistant-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.chat-thread {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  overflow: auto;
}

.chat-message {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.chat-message.user {
  justify-self: end;
  background: var(--teal);
  color: #fff;
}

.chat-message.assistant {
  border: 1px solid var(--line);
  background: #fff;
}

.citation {
  display: inline-flex;
  margin-top: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 760;
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.chat-input input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
}

.mobile-frame {
  width: 100%;
  max-width: 310px;
  margin: 0 auto;
  overflow: hidden;
  border: 8px solid #222a35;
  border-radius: 30px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mobile-header {
  padding: 18px;
  background: #18232f;
  color: #fff;
}

.mobile-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.check-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
}

.check-row.done .check-dot {
  border-color: var(--green);
  background: radial-gradient(circle at center, var(--green) 0 45%, transparent 48%);
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.drawer.open {
  display: block;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(24, 35, 47, 0.36);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(620px, 100%);
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--panel);
  box-shadow: -18px 0 45px rgba(31, 41, 51, 0.18);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-body {
  overflow: auto;
  display: grid;
  gap: 16px;
  padding: 20px;
}

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

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

  .sidebar {
    position: fixed;
    z-index: 30;
    left: 0;
    top: 0;
    width: var(--sidebar);
    transform: translateX(-100%);
    transition: transform 160ms ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .menu-button {
    display: inline-grid;
  }

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

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .search-box {
    min-width: min(100%, 420px);
    flex: 1 1 280px;
  }

  .select-wrap {
    flex: 1 1 240px;
  }

  .content-grid,
  .split-screen,
  .summary-grid,
  .three-col,
  .two-col,
  .metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 12px 14px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .search-box,
  .select-wrap {
    width: 100%;
    min-width: 0;
  }

  main {
    padding: 14px;
  }

  .panel-header {
    flex-direction: column;
  }

  .summary-grid {
    gap: 10px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .topbar-actions .button {
    width: 100%;
  }

  .drawer-panel {
    width: 100%;
  }

  .mobile-frame {
    max-width: 300px;
  }

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

  .check-row .subtext {
    grid-column: 2;
    text-align: left;
  }
}
