:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef3f2;
  --ink: #172026;
  --muted: #6b7780;
  --line: #d9e0e4;
  --teal: #137b73;
  --green: #1f8a58;
  --blue: #2d6cdf;
  --amber: #b7791f;
  --red: #c2413b;
  --violet: #6c5ce7;
  --shadow: 0 12px 30px rgba(25, 35, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button,
select {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: #142326;
  color: #f6faf9;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #f2b84b;
  color: #152326;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #a7b9b8;
}

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

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 11px 12px;
  text-align: left;
  color: #d7e2e0;
  background: transparent;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: #254145;
  color: #ffffff;
}

.privacy-note {
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 8px;
}

.privacy-note strong {
  font-size: 13px;
}

.privacy-note span {
  font-size: 12px;
  line-height: 1.6;
  color: #bfd0ce;
}

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

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

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

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

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
}

h3 {
  font-size: 15px;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 34px 0 12px;
  background: var(--surface);
  color: var(--ink);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.decision-strip {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 14px;
  margin-bottom: 14px;
}

.decision-strip article {
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
}

.decision-strip span,
.metric-card span,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.decision-strip strong {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.5;
}

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

.metric-grid.compact {
  margin-bottom: 18px;
}

.metric-card {
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  align-content: space-between;
  border-top: 4px solid var(--teal);
}

.metric-card strong {
  font-size: 30px;
  line-height: 1;
  margin-top: 12px;
}

.metric-card small {
  color: var(--muted);
  line-height: 1.5;
}

.accent-green {
  border-top-color: var(--green);
}

.accent-blue {
  border-top-color: var(--blue);
}

.accent-amber {
  border-top-color: var(--amber);
}

.accent-red {
  border-top-color: var(--red);
}

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

.dashboard-grid.lower {
  margin-top: 14px;
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-7 {
  grid-column: span 7;
}

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

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

.ghost-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  color: var(--ink);
  min-height: 34px;
  padding: 0 12px;
  cursor: pointer;
}

.priority-list,
.dept-list,
.insight-stack,
.table-list {
  display: grid;
  gap: 10px;
}

.priority-item,
.dept-item,
.table-row,
.insight-stack article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

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

.priority-item p,
.insight-stack p,
.detail-panel p,
.workflow-box li,
.source-box span {
  color: var(--muted);
  line-height: 1.65;
  font-size: 13px;
}

.badge {
  display: inline-flex;
  width: max-content;
  align-items: center;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--teal);
}

.badge.danger {
  color: var(--red);
  background: #fbeceb;
}

.badge.warning {
  color: var(--amber);
  background: #fff4dc;
}

.badge.success {
  color: var(--green);
  background: #e8f6ef;
}

.trend-chart {
  height: 260px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 10px;
  padding: 16px 8px 6px;
  border-bottom: 1px solid var(--line);
}

.trend-chart div {
  min-height: 36px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #22a699, #2d6cdf);
  position: relative;
}

.trend-chart span {
  position: absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 12px;
}

.legend-row {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.teal {
  background: var(--teal);
}

.orange {
  background: var(--amber);
}

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

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

.dept-top,
.row-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: #e5eaed;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--teal);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.85fr);
  gap: 14px;
}

.table-row {
  display: grid;
  gap: 8px;
  cursor: pointer;
}

.table-row.active,
.table-row:hover {
  border-color: rgba(19, 123, 115, 0.45);
  background: #f2faf8;
}

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

.row-meta span {
  font-size: 12px;
  color: var(--muted);
  background: #eef3f6;
  border-radius: 6px;
  padding: 4px 7px;
}

.detail-panel {
  position: sticky;
  top: 20px;
  align-self: start;
  display: grid;
  gap: 14px;
}

.action-box {
  border-radius: 8px;
  background: #f7f4eb;
  border: 1px solid #eadfbe;
  padding: 12px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafb;
}

.segmented button {
  border: 0;
  background: transparent;
  min-height: 32px;
  padding: 0 10px;
  cursor: pointer;
  color: var(--muted);
}

.segmented .active {
  background: var(--teal);
  color: #fff;
}

.workflow-box {
  display: grid;
  gap: 12px;
}

.workflow-box ol {
  margin: 0;
  padding-left: 20px;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.people-grid article {
  border-radius: 8px;
  background: #f7f9fa;
  border: 1px solid var(--line);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.people-grid b {
  font-size: 28px;
}

.people-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.assistant-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 14px;
}

.prompt-panel {
  display: grid;
  align-content: start;
  gap: 10px;
}

.prompt-panel button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  text-align: left;
  padding: 12px;
  cursor: pointer;
}

.chat-panel {
  min-height: 520px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.chat-message {
  max-width: 760px;
  border-radius: 8px;
  padding: 14px;
  line-height: 1.65;
}

.chat-message.user {
  margin-left: auto;
  background: #eaf1ff;
}

.chat-message.bot {
  background: #f3f7f6;
}

.source-box {
  margin-top: 8px;
  border: 1px dashed #b8c7cb;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

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

.timeline span {
  border-left: 3px solid var(--red);
  padding-left: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

  .sidebar {
    position: relative;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(4, 1fr);
  }

  .metric-grid,
  .decision-strip,
  .split-layout,
  .assistant-layout {
    grid-template-columns: 1fr;
  }

  .span-5,
  .span-6,
  .span-7 {
    grid-column: 1 / -1;
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .main {
    padding: 16px;
  }

  .topbar,
  .panel-head,
  .priority-item,
  .dept-top,
  .row-top {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-list {
    grid-template-columns: 1fr 1fr;
  }

  .metric-grid,
  .people-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 23px;
  }
}
