:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-muted: #f1f4f7;
  --line: #d9e0e7;
  --line-strong: #bdc7d0;
  --text: #17202a;
  --muted: #657282;
  --teal: #0a4ea3;
  --teal-soft: #e7f0ff;
  --green: #3f7d45;
  --green-soft: #e7f4e9;
  --amber: #b88a28;
  --amber-soft: #fff3cf;
  --red: #b42318;
  --red-soft: #fde7e5;
  --blue: #2563eb;
  --blue-soft: #e7efff;
  --shadow: 0 18px 45px rgba(23, 32, 42, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100vh;
  padding: 22px 16px;
  background: #061a35;
  color: #f8fafc;
}

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

.brand-logo {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(226, 184, 78, 0.42);
  border-radius: 8px;
  background: #ffffff;
}

.brand-logo img {
  display: block;
  width: 43px;
  height: 43px;
  object-fit: contain;
}

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

.brand span {
  margin-top: 2px;
  color: #e2b84e;
  font-size: 13px;
}

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

.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d4dedb;
  text-align: left;
}

.nav button:hover,
.nav button.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav svg,
.topbar svg,
.primary-button svg,
.icon-button svg,
.small-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

i[data-lucide].icon-text {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #d4dedb;
  font-size: 13px;
}

.sidebar-footer strong {
  color: #ffffff;
  font-size: 13px;
}

.main {
  min-width: 0;
  padding: 22px;
}

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

.eyebrow {
  display: block;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

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

h1 {
  margin-top: 4px;
  font-size: 26px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.icon-button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  white-space: nowrap;
}

.primary-button {
  padding: 10px 14px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 700;
}

.primary-button:hover {
  background: #0b605a;
}

.primary-button.wide {
  width: 100%;
}

.icon-button,
.small-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.icon-button {
  width: 40px;
}

.small-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.small-button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.meeting-panel,
.content-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.meeting-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 18px;
}

.content-panel {
  min-width: 0;
  min-height: calc(100vh - 108px);
}

.content-view {
  padding: 18px;
}

.panel-title,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title span,
.status-pill,
.priority-pill,
.risk-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.panel-title span,
.status-pill.todo {
  background: var(--surface-muted);
  color: var(--muted);
}

.status-pill.doing {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-pill.done {
  background: var(--green-soft);
  color: var(--green);
}

.priority-pill.high,
.risk-pill.high {
  background: var(--red-soft);
  color: var(--red);
}

.priority-pill.medium,
.risk-pill.medium {
  background: var(--amber-soft);
  color: var(--amber);
}

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

.meeting-form {
  display: grid;
  gap: 13px;
}

.meeting-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.meeting-form label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

input,
select {
  min-height: 40px;
  padding: 8px 10px;
}

textarea {
  resize: vertical;
  padding: 10px;
  line-height: 1.45;
}

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

.toggle-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.check-line {
  display: inline-flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px !important;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.check-line input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--teal);
}

.check-line span {
  color: var(--text) !important;
}

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

.kpi {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

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

.kpi strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: 24px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.stack {
  display: grid;
  gap: 16px;
}

.module {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

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

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

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.task-list,
.timeline-list,
.risk-list,
.resource-list,
.doc-list,
.message-list {
  display: grid;
  gap: 10px;
}

.task-card,
.timeline-item,
.risk-item,
.resource-item,
.doc-item,
.message-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.task-card {
  display: grid;
  gap: 10px;
}

.task-top,
.task-meta,
.resource-top,
.risk-top,
.timeline-top,
.doc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-top h3,
.resource-top h3,
.risk-top h3,
.doc-top h3 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-meta {
  align-items: flex-end;
  color: var(--muted);
  font-size: 13px;
}

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

.kanban-column {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.kanban-column h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kanban-count {
  color: var(--muted);
  font-size: 13px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
}

.timeline-time {
  color: var(--teal);
  font-weight: 800;
}

.timeline-body {
  display: grid;
  gap: 6px;
}

.timeline-body p,
.risk-item p,
.resource-item p,
.message-item p {
  color: var(--muted);
  line-height: 1.5;
}

.resource-item {
  display: grid;
  gap: 8px;
}

.budget-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 90px;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  color: var(--muted);
  font-size: 13px;
}

.budget-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.budget-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.procurement-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.procurement-grid,
.tool-grid {
  display: grid;
  gap: 14px;
}

.procurement-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.procurement-icon,
.tool-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(226, 184, 78, 0.45);
  border-radius: 8px;
  background: #fff8df;
  color: var(--teal);
}

.procurement-icon svg,
.tool-icon svg,
.procurement-chip svg,
.tool-mini svg {
  width: 19px;
  height: 19px;
}

.procurement-body {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.procurement-body p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.procurement-spec {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.procurement-spec div,
.ops-card,
.tool-flow div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.procurement-spec dt,
.tool-flow span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.procurement-spec dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.check-grid {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.check-grid span {
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.procurement-strip,
.tool-mini-list {
  display: grid;
  gap: 8px;
}

.procurement-chip,
.tool-mini {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.procurement-chip span,
.tool-mini span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.procurement-chip strong,
.tool-mini strong {
  color: var(--teal);
  font-size: 13px;
}

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

.automation-card {
  display: grid;
  gap: 11px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.automation-card p,
.ops-card p,
.tool-card p,
.tool-hero p {
  color: var(--muted);
  line-height: 1.5;
}

.automation-card textarea {
  min-height: 96px;
  background: #fbfcfd;
}

.ops-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ops-card {
  display: grid;
  gap: 8px;
  background: #ffffff;
}

.ops-card span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.tool-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #eef5ff 100%);
}

.tool-hero h2 {
  margin-top: 5px;
  margin-bottom: 7px;
  font-size: 22px;
}

.tool-hero > strong {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border: 1px solid rgba(10, 78, 163, 0.18);
  border-radius: 50%;
  background: #ffffff;
  color: var(--teal);
  font-size: 25px;
}

.tool-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.tool-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

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

.tool-top > strong {
  color: var(--teal);
}

.tool-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tool-flow p {
  margin-top: 5px;
}

.venue-map {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.9fr;
  grid-template-rows: 90px 90px 90px;
  gap: 10px;
  min-height: 290px;
}

.map-zone {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 800;
  text-align: center;
}

.map-zone.stage {
  grid-column: 1 / 3;
  background: var(--teal-soft);
  color: var(--teal);
}

.map-zone.screen {
  background: var(--blue-soft);
  color: var(--blue);
}

.map-zone.seating {
  grid-row: 2 / 4;
  background: #eef5ed;
  color: var(--green);
}

.map-zone.signin {
  background: var(--amber-soft);
  color: var(--amber);
}

.map-zone.vip {
  background: var(--red-soft);
  color: var(--red);
}

.map-zone.break {
  grid-column: 2 / 4;
}

.agent-console {
  display: grid;
  gap: 12px;
}

.message-list {
  max-height: 310px;
  overflow: auto;
}

.message-item {
  border-color: var(--line);
}

.message-item.user {
  background: var(--teal-soft);
}

.message-item.agent {
  background: #ffffff;
}

.message-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.agent-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.doc-item {
  display: grid;
  gap: 10px;
}

.doc-item textarea {
  min-height: 140px;
  background: #fbfcfd;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 420px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 18px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--text);
  color: #ffffff;
  box-shadow: var(--shadow);
}

@media (max-width: 1180px) {
  .workspace-layout,
  .dashboard-grid,
  .two-column,
  .kanban,
  .procurement-kpis,
  .procurement-spec {
    grid-template-columns: 1fr;
  }

  .meeting-panel {
    position: static;
    max-height: none;
  }
}

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

  .sidebar {
    min-height: auto;
    padding: 14px;
  }

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

  .nav button {
    justify-content: center;
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    padding: 14px;
  }

  .topbar,
  .panel-title,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .ops-board,
  .tool-flow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .field-row,
  .kpi-grid,
  .agent-input,
  .budget-row,
  .timeline-item,
  .procurement-card,
  .tool-hero,
  .tool-top {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .primary-button {
    flex: 1;
  }

  .venue-map {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .procurement-icon,
  .tool-icon {
    width: 40px;
    height: 40px;
  }

  .tool-hero > strong {
    width: auto;
    height: auto;
    min-height: 52px;
    border-radius: 8px;
  }

  .map-zone,
  .map-zone.stage,
  .map-zone.screen,
  .map-zone.seating,
  .map-zone.signin,
  .map-zone.vip,
  .map-zone.break {
    grid-column: auto;
    grid-row: auto;
    min-height: 72px;
  }
}
