:root {
  --ink: #1d2929;
  --muted: #667573;
  --line: #d6dedd;
  --page: #f4f7f5;
  --surface: #ffffff;
  --nav: #203536;
  --teal: #087c77;
  --teal-soft: #e3f2ef;
  --amber: #94600a;
  --amber-soft: #fff1d8;
  --red: #a83c33;
  --red-soft: #fde7e3;
  --steel: #edf1f1;
  --shadow: 0 1px 2px rgba(20, 36, 36, 0.06);
  font-family: "Segoe UI", "Noto Sans TC", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
}

.topbar {
  align-items: center;
  background: var(--nav);
  color: #f7fbfa;
  display: flex;
  height: 64px;
  justify-content: space-between;
  padding: 0 28px;
}

.brand, .toolbar {
  align-items: center;
  display: flex;
  gap: 14px;
}

.brand-mark {
  align-items: center;
  background: #edf6f3;
  border-radius: 6px;
  color: var(--nav);
  display: inline-flex;
  font-size: 15px;
  font-weight: 700;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.brand-name { font-size: 15px; font-weight: 600; margin: 0; }
.brand-module { color: #b9ccca; font-size: 12px; margin: 2px 0 0; }

.field {
  align-items: center;
  color: #d9e4e2;
  display: flex;
  font-size: 12px;
  gap: 8px;
}

select {
  appearance: none;
  background: #30494a;
  border: 1px solid #526a6a;
  border-radius: 5px;
  color: white;
  font: inherit;
  min-height: 36px;
  padding: 0 30px 0 10px;
}

.badge {
  border-radius: 4px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 10px;
}

.badge-sample { background: #d4ece7; color: #07524f; }

.dashboard { margin: 0 auto; max-width: 1400px; padding: 26px 28px 36px; }

.page-head {
  align-items: start;
  display: flex;
  gap: 32px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1 { font-size: 27px; font-weight: 650; line-height: 1.22; margin: 0 0 8px; }
h2 { font-size: 16px; font-weight: 650; line-height: 1.3; margin: 0; }
.subtitle { color: var(--muted); font-size: 14px; margin: 0; max-width: 650px; }

.run-meta {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(125px, 1fr));
  margin: 0;
  min-width: 480px;
}

.run-meta div { border-left: 1px solid var(--line); padding: 12px 14px; }
.run-meta div:first-child { border-left: 0; }
.run-meta dt { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.run-meta dd { font-size: 13px; font-weight: 600; margin: 0; }

.safety-banner {
  align-items: center;
  background: var(--teal-soft);
  border-left: 4px solid var(--teal);
  border-radius: 4px;
  color: #164b49;
  display: flex;
  font-size: 13px;
  gap: 12px;
  margin-bottom: 22px;
  padding: 12px 15px;
}

.section-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}
.caption { color: var(--muted); font-size: 12px; }
.metrics-section { margin-bottom: 22px; }

.metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(8, minmax(100px, 1fr));
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  min-height: 102px;
  padding: 14px 13px;
}

.metric.warning { border-top: 3px solid #e5a935; }
.metric.critical { border-top: 3px solid #cd574a; }
.metric.standard { border-top: 3px solid var(--teal); }
.metric-label { color: var(--muted); font-size: 12px; line-height: 1.35; }
.metric-value { display: block; font-size: 30px; font-weight: 650; margin-top: 11px; }

.work-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(520px, 1.2fr) minmax(360px, 0.95fr);
  margin-bottom: 14px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 17px 18px;
}

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; font-size: 13px; width: 100%; }
th { color: var(--muted); font-size: 11px; font-weight: 600; padding: 0 10px 10px 0; text-align: left; }
td { border-top: 1px solid var(--line); height: 48px; padding: 9px 10px 9px 0; }
.score { font-weight: 650; }

.status-pill {
  border-radius: 4px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 7px;
}
.status-pill.normal { background: var(--teal-soft); color: var(--teal); }
.status-pill.review { background: var(--amber-soft); color: var(--amber); }

.alerts-heading { align-items: start; }
.segments { background: var(--steel); border-radius: 5px; display: flex; padding: 3px; }
.segment {
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  min-height: 30px;
  padding: 0 10px;
}
.segment.active { background: var(--surface); color: var(--ink); font-weight: 600; }
.warnings { list-style: none; margin: 0; padding: 0; }
.warning-row {
  align-items: flex-start;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 9px;
  grid-template-columns: 9px 1fr auto;
  padding: 11px 0;
}
.warning-row:first-child { border-top: 0; }
.warning-dot { border-radius: 50%; height: 8px; margin-top: 5px; width: 8px; }
.warning-dot.critical { background: var(--red); }
.warning-dot.attention { background: #d69724; }
.warning-title { font-size: 13px; font-weight: 600; margin: 0 0 3px; }
.warning-source { color: var(--muted); font-size: 11px; margin: 0; }
.priority { color: var(--muted); font-size: 11px; font-weight: 600; }

.status-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(250px, 0.76fr) minmax(250px, 0.76fr) minmax(340px, 1.15fr);
}
.status-list { display: grid; gap: 0; }
.status-item {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 48px;
}
.status-item:first-child { border-top: 0; }
.status-label { color: var(--muted); font-size: 13px; }
.status-count { font-size: 20px; font-weight: 650; }
.status-count.critical { color: var(--red); }
.status-count.warning { color: var(--amber); }
.briefing { border-top: 3px solid var(--teal); }
.briefing-text { font-size: 14px; line-height: 1.55; margin: 4px 0 13px; }
.briefing-footnote { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 0; }

@media (max-width: 1100px) {
  .page-head { display: block; }
  .run-meta { margin-top: 18px; min-width: 0; }
  .metrics { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .work-grid, .status-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; height: auto; padding: 14px 16px; }
  .toolbar { justify-content: space-between; width: 100%; }
  .dashboard { padding: 20px 14px 26px; }
  h1 { font-size: 23px; }
  .run-meta { display: block; }
  .run-meta div { border-left: 0; border-top: 1px solid var(--line); }
  .run-meta div:first-child { border-top: 0; }
  .safety-banner { align-items: flex-start; flex-direction: column; gap: 5px; }
  .metrics { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .alerts-heading { align-items: flex-start; flex-direction: column; }
  .panel { padding: 15px 13px; }
}
