:root {
  color-scheme: light;
  --ink: #18201d;
  --muted: #63716c;
  --line: #dfe8e2;
  --paper: #f8faf7;
  --panel: #ffffff;
  --green: #19745b;
  --teal: #0891a1;
  --gold: #c88719;
  --red: #c84f45;
  --shadow: 0 18px 48px rgba(24, 32, 29, 0.09);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

.topbar {
  min-height: 220px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 42px clamp(18px, 4vw, 56px) 30px;
  background:
    linear-gradient(90deg, rgba(17, 71, 57, 0.92), rgba(32, 91, 95, 0.74)),
    url("./assets/restaurant-hero.png") center/cover;
  color: #fff;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.78;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 54px);
  letter-spacing: 0;
}

.source-meta {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.82);
}

.upload-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.16);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.upload-button input { display: none; }

main {
  width: min(1500px, calc(100% - 36px));
  margin: 24px auto 50px;
}

.control-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.control-group > span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.segmented button,
select {
  min-height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  cursor: pointer;
}

.segmented button.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.cockpit {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(0, 2.05fr);
  gap: 16px;
  align-items: stretch;
  margin: 18px 0;
}

.cockpit-score,
.cockpit-board {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.cockpit-score {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 430px;
  padding: 20px 22px;
}

.cockpit-score span,
.cockpit-score em,
.cockpit-head p,
.cockpit-lights em,
.cockpit-progress span,
.cockpit-actions span {
  color: var(--muted);
}

.cockpit-score strong {
  margin: 8px 0 6px;
  font-size: clamp(54px, 5.8vw, 82px);
  line-height: 0.95;
}

.cockpit-score em {
  font-style: normal;
  font-weight: 700;
}

.score-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-top: 16px;
}

.score-breakdown article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: #f7faf8;
}

.score-breakdown b,
.score-breakdown span,
.score-breakdown strong {
  display: block;
}

.score-breakdown b {
  font-size: 12px;
  line-height: 1.15;
}

.score-breakdown span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.score-breakdown strong {
  min-width: 32px;
  text-align: right;
  font-size: 18px;
  font-weight: 900;
}

.score-breakdown article.plus strong {
  color: var(--green);
}

.score-breakdown article.minus {
  background: #fff5f3;
  border-color: rgba(200,79,69,0.2);
}

.score-breakdown article.minus strong {
  color: var(--red);
}

.cockpit-board {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 430px;
  padding: 22px;
}

.cockpit-head,
.cockpit-progress > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.cockpit-head h2 {
  margin: 0;
  font-size: 22px;
}

.cockpit-head p {
  margin: 6px 0 0;
  font-size: 13px;
}

.cockpit-head strong {
  font-size: clamp(24px, 3vw, 38px);
}

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

.cockpit-lights article {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 86px;
  padding: 13px 12px;
  background: #f7faf8;
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.cockpit-lights article.warn {
  border-color: rgba(200, 135, 25, 0.42);
  background: #fff8eb;
}

.cockpit-lights article.danger {
  border-color: rgba(200, 79, 69, 0.48);
  background: #fff1ef;
  box-shadow: 0 10px 28px rgba(200, 79, 69, 0.14);
}

.cockpit-lights b,
.cockpit-lights em,
.cockpit-lights strong,
.cockpit-lights small {
  display: block;
}

.cockpit-lights b {
  font-size: 13px;
}

.cockpit-lights em {
  margin-top: 5px;
  font-style: normal;
}

.cockpit-lights strong {
  color: var(--ink);
  font-size: clamp(18px, 1.8vw, 25px);
  line-height: 1.05;
  font-weight: 900;
}

.cockpit-lights small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.cockpit-lights article.warn strong {
  color: #9b620d;
}

.cockpit-lights article.danger strong {
  color: var(--red);
}

.light {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(25,116,91,0.12);
}

.light.warn {
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(200,135,25,0.14);
}

.light.danger {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(200,79,69,0.14), 0 0 18px rgba(200,79,69,0.5);
  animation: dangerPulse 1.35s ease-in-out infinite;
}

@keyframes dangerPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(200,79,69,0.18), 0 0 12px rgba(200,79,69,0.36);
  }
  55% {
    transform: scale(1.22);
    box-shadow: 0 0 0 9px rgba(200,79,69,0.08), 0 0 22px rgba(200,79,69,0.55);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(200,79,69,0.18), 0 0 12px rgba(200,79,69,0.36);
  }
}

.progress-track {
  height: 12px;
  margin-top: 8px;
  overflow: hidden;
  background: #edf3ef;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), var(--teal));
}

.cockpit-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.cockpit-actions article {
  min-height: 74px;
  padding: 12px 14px;
  border-left: 3px solid var(--green);
  background: #f7faf8;
}

.cockpit-actions b,
.cockpit-actions span {
  display: block;
}

.cockpit-actions b {
  margin-bottom: 4px;
}

.cockpit-actions span {
  font-size: 12px;
}

.standards {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.standard-head h2 {
  margin: 0;
  font-size: 20px;
}

.standard-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.standard-grid article {
  min-height: 96px;
  padding: 12px;
  background: #f7faf8;
  border: 1px solid var(--line);
}

.standard-grid span,
.standard-grid em {
  display: block;
  color: var(--muted);
}

.standard-grid strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 22px;
}

.standard-grid em {
  font-style: normal;
  font-size: 12px;
}

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

.kpi {
  position: relative;
  min-width: 0;
  min-height: 126px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.kpi.good {
  border-color: rgba(25,116,91,0.45);
  background: linear-gradient(180deg, #ffffff 0%, #f3fbf7 100%);
}

.kpi.warn {
  border-color: rgba(200,135,25,0.48);
  background: linear-gradient(180deg, #ffffff 0%, #fff9ed 100%);
}

.kpi.bad {
  border-color: rgba(200,79,69,0.55);
  background: linear-gradient(180deg, #ffffff 0%, #fff4f2 100%);
}

.kpi span,
.panel-head p,
.kpi em {
  color: var(--muted);
}

.kpi span {
  display: block;
  font-size: 13px;
}

.kpi strong {
  display: block;
  margin: 12px 0 8px;
  font-size: clamp(20px, 1.8vw, 29px);
  letter-spacing: 0;
  line-height: 1.1;
}

.kpi em {
  display: block;
  font-style: normal;
  font-size: 12px;
}

.benchmark-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 10px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eef5f1;
  color: var(--muted);
}

.kpi.good .benchmark-badge {
  background: rgba(25,116,91,0.12);
  color: var(--green);
}

.kpi.warn .benchmark-badge {
  background: rgba(200,135,25,0.14);
  color: var(--gold);
}

.kpi.bad .benchmark-badge {
  background: rgba(200,79,69,0.14);
  color: var(--red);
}

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

.panel {
  min-width: 0;
  min-height: 380px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel.wide {
  grid-column: span 2;
}

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

.panel h2 {
  margin: 0;
  font-size: 18px;
}

.panel p {
  margin: 0;
  font-size: 12px;
}

.chart {
  min-width: 0;
  width: 100%;
  height: 310px;
}

.chart-tall {
  height: 380px;
}

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

.alert {
  padding: 12px;
  border-left: 4px solid var(--teal);
  background: #f4fbfa;
}

.alert.warning {
  border-color: var(--gold);
  background: #fff8eb;
}

.alert.danger {
  border-color: var(--red);
  background: #fff2f0;
}

.alert strong {
  display: block;
  margin-bottom: 4px;
}

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

.table-wrap {
  overflow: auto;
  max-height: 430px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 700;
  background: #f5f8f6;
  position: sticky;
  top: 0;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.page-size,
.page-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-controls button {
  min-height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  cursor: pointer;
}

.page-controls button:disabled {
  color: #a6b2ad;
  background: #f4f7f5;
  cursor: not-allowed;
}

.score-guide {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.score-guide-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.score-guide h2 {
  margin: 0;
  font-size: 20px;
}

.score-guide p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.score-guide-head strong {
  font-size: clamp(24px, 3vw, 36px);
  white-space: nowrap;
}

.score-guide-grid,
.score-formula {
  display: grid;
  gap: 10px;
}

.score-guide-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.score-guide-grid article,
.score-formula article {
  padding: 12px;
  border: 1px solid var(--line);
  background: #f7faf8;
}

.score-guide-grid article.good {
  border-color: rgba(25, 116, 91, 0.28);
  background: #f2faf6;
}

.score-guide-grid article.warn {
  border-color: rgba(200, 135, 25, 0.34);
  background: #fff8eb;
}

.score-guide-grid article.bad {
  border-color: rgba(200, 79, 69, 0.34);
  background: #fff1ef;
}

.score-guide b,
.score-guide span,
.score-guide strong,
.score-guide em {
  display: block;
}

.score-guide-grid b {
  margin-bottom: 5px;
  font-size: 16px;
}

.score-guide-grid span,
.score-formula em {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.score-formula span {
  color: var(--muted);
  font-size: 12px;
}

.score-formula strong {
  margin: 6px 0;
  font-size: 17px;
  line-height: 1.25;
}

.score-formula em {
  font-style: normal;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 16px;
  background: #16231f;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

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

@media (max-width: 1180px) {
  main { width: calc(100% - 32px); }
  .cockpit {
    grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.25fr);
  }
  .cockpit-score,
  .cockpit-board {
    min-height: 0;
  }
  .cockpit-board {
    justify-content: flex-start;
  }
  .cockpit-lights { grid-template-columns: 1fr 1fr; }
  .cockpit-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel.wide { grid-column: span 2; }
  .standard-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .score-guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .score-formula { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  main { width: calc(100% - 28px); }
  .topbar {
    min-height: 210px;
  }
  .cockpit { grid-template-columns: 1fr; }
  .cockpit-score {
    min-height: 0;
  }
  .cockpit-board {
    min-height: 0;
  }
  .cockpit-actions { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .standard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel.wide { grid-column: auto; }
  .score-guide-grid,
  .score-formula { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 260px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-end;
  }
  .control-strip,
  .control-group {
    align-items: stretch;
    flex-direction: column;
  }
  .control-strip {
    gap: 14px;
  }
  .segmented button,
  select {
    min-height: 38px;
  }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .cockpit-head,
  .cockpit-progress > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }
  .cockpit-lights { grid-template-columns: 1fr; }
  .standard-head,
  .score-guide-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .pagination {
    align-items: stretch;
    flex-direction: column;
  }
  .page-controls {
    justify-content: space-between;
  }
}

@media (max-width: 520px) {
  main { width: calc(100% - 20px); margin-top: 16px; }
  .topbar {
    min-height: 240px;
    padding: 30px 18px 24px;
  }
  h1 { font-size: clamp(28px, 10vw, 40px); }
  .source-meta { font-size: 13px; line-height: 1.45; }
  .upload-button { width: 100%; }
  .control-strip { padding: 12px; }
  .segmented { gap: 5px; }
  .segmented button { flex: 1 1 calc(33.333% - 5px); padding: 0 8px; }
  .cockpit { gap: 12px; }
  .cockpit-score,
  .cockpit-board {
    padding: 16px;
  }
  .cockpit-score strong { font-size: 62px; }
  .score-breakdown {
    gap: 6px;
  }
  .score-breakdown article {
    min-height: 58px;
    padding: 8px;
  }
  .score-breakdown strong {
    min-width: 28px;
    font-size: 17px;
  }
  .cockpit-head strong { font-size: 30px; }
  .cockpit-lights {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .cockpit-lights article {
    min-height: 92px;
    align-items: flex-start;
    padding: 11px 10px;
  }
  .cockpit-lights b { font-size: 12px; }
  .cockpit-lights strong { font-size: 20px; }
  .cockpit-lights small { font-size: 10px; }
  .cockpit-actions {
    gap: 8px;
    margin-top: 12px;
  }
  .cockpit-actions article {
    min-height: 0;
    padding: 10px 12px;
  }
  .cockpit-actions span {
    font-size: 11px;
  }
  .kpi-grid { grid-template-columns: 1fr; }
  .standard-grid { grid-template-columns: 1fr; }
  .score-guide-grid,
  .score-formula { grid-template-columns: 1fr; }
  .panel {
    min-height: 0;
    padding: 14px;
  }
  .chart { height: 260px; }
  .chart-tall { height: 340px; }
  .table-wrap { max-height: 360px; }
  table { font-size: 12px; }
  th, td { padding: 9px 7px; }
}

@media (max-width: 360px) {
  .cockpit-lights { grid-template-columns: 1fr; }
  .score-breakdown { grid-template-columns: 1fr; }
}

/* Futuristic cockpit theme */
:root {
  color-scheme: dark;
  --ink: #e8fbff;
  --muted: #7faebe;
  --line: rgba(38, 226, 255, 0.22);
  --paper: #030b16;
  --panel: rgba(4, 18, 33, 0.78);
  --green: #22f4ff;
  --teal: #21d8ff;
  --gold: #ffd166;
  --red: #ff5570;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34), inset 0 0 28px rgba(30, 222, 255, 0.045);
}

body {
  background:
    radial-gradient(circle at 50% -10%, rgba(38, 226, 255, 0.18), transparent 32%),
    radial-gradient(circle at 82% 12%, rgba(47, 124, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #020812 0%, #04111f 42%, #020712 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    linear-gradient(rgba(38, 226, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 226, 255, 0.028) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.82), rgba(0,0,0,0.16));
}

.topbar {
  min-height: 142px;
  align-items: center;
  border-bottom: 1px solid rgba(38, 226, 255, 0.28);
  background:
    linear-gradient(90deg, rgba(2, 14, 28, 0.94), rgba(5, 35, 53, 0.75)),
    url("./assets/restaurant-hero.png") center/cover;
  box-shadow: inset 0 -1px 0 rgba(38, 226, 255, 0.38), 0 18px 48px rgba(0, 0, 0, 0.35);
}

h1,
.command-title h2 {
  text-shadow: 0 0 18px rgba(38, 226, 255, 0.45);
}

.upload-button,
.segmented button,
select,
.page-controls button {
  border-color: rgba(38, 226, 255, 0.28);
  background: rgba(4, 22, 40, 0.78);
  color: var(--ink);
}

.segmented button.active {
  border-color: rgba(34, 244, 255, 0.86);
  background: linear-gradient(180deg, rgba(31, 221, 255, 0.28), rgba(0, 126, 154, 0.42));
  box-shadow: 0 0 16px rgba(34, 244, 255, 0.22);
}

.control-strip,
.standards,
.kpi,
.panel,
.score-guide,
.cockpit-score,
.cockpit-board,
.command-cockpit,
.command-metrics article,
.cockpit-core {
  border-color: var(--line);
  background:
    linear-gradient(180deg, rgba(7, 31, 52, 0.86), rgba(3, 13, 27, 0.9));
  box-shadow: var(--shadow);
}

.command-cockpit {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(360px, 1.22fr) minmax(300px, 0.95fr);
  grid-template-areas:
    "title title title"
    "metrics metrics metrics"
    "score core board";
  gap: 14px;
  margin: 18px 0;
  padding: 16px;
  overflow: hidden;
}

.command-cockpit::before,
.command-cockpit::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.command-cockpit::before {
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 2%, rgba(34,244,255,0.18) 2.1%, transparent 2.4% 97.6%, rgba(34,244,255,0.18) 97.9%, transparent 98.2%),
    linear-gradient(180deg, rgba(34,244,255,0.18), transparent 8%, transparent 92%, rgba(34,244,255,0.16));
}

.command-cockpit::after {
  left: 18%;
  right: 18%;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(34,244,255,0.9), transparent);
  box-shadow: 0 0 22px rgba(34,244,255,0.7);
}

.command-title {
  grid-area: title;
  text-align: center;
  padding: 4px 12px 2px;
}

.command-title span,
.eyebrow {
  color: #8ff8ff;
}

.command-title h2 {
  margin: 0;
  color: #f2fdff;
  font-size: clamp(22px, 2.4vw, 36px);
  letter-spacing: 0.04em;
}

.command-title p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.command-metrics article {
  min-height: 216px;
  padding: 14px 16px;
  text-align: center;
  border: 1px solid var(--line);
}

.command-metrics span {
  display: block;
  color: #6fefff;
  font-size: 13px;
  font-weight: 700;
}

.command-metrics strong {
  display: block;
  margin-top: 8px;
  color: #f3fdff;
  font-size: clamp(20px, 2.3vw, 32px);
  line-height: 1;
  text-shadow: 0 0 14px rgba(34,244,255,0.4);
}

.command-metrics small {
  display: block;
  margin-top: 8px;
  color: #f4e7c5;
  font-size: 12px;
  font-weight: 700;
}

.gauge-card {
  position: relative;
  overflow: hidden;
}

.gauge-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 999px 999px 0 0;
  background: radial-gradient(circle at 50% 74%, rgba(255, 247, 221, 0.18), transparent 32%);
  opacity: 0.7;
  pointer-events: none;
}

.gauge-meter {
  --needle: 90;
  position: relative;
  width: min(100%, 228px);
  height: 126px;
  margin: 6px auto 0;
  overflow: hidden;
}

.gauge-meter::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -92px;
  width: 210px;
  height: 210px;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255,247,221,0.08) 0 34%, transparent 35%),
    conic-gradient(from 270deg, #ff6b55 0deg 54deg, #ffb020 54deg 122deg, #2fd36f 122deg 180deg, rgba(244,231,197,0.22) 180deg 360deg);
  box-shadow: inset 0 0 0 8px rgba(244,231,197,0.18), 0 0 22px rgba(255,176,32,0.22);
}

.gauge-meter::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -58px;
  width: 142px;
  height: 142px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(13,33,22,0.96), rgba(7,18,12,0.98));
  box-shadow: inset 0 0 26px rgba(255,176,32,0.14);
}

.gauge-meter i {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 2;
  width: 88px;
  height: 4px;
  transform: rotate(calc((var(--needle) - 90) * 1deg));
  transform-origin: left center;
  border-radius: 999px;
  background: linear-gradient(90deg, #fff7dd, #2fd36f);
  box-shadow: 0 0 14px rgba(47,211,111,0.72);
}

.gauge-meter b {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 3;
  width: 20px;
  height: 20px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, #fff7dd, #ffb020);
  box-shadow: 0 0 18px rgba(255,176,32,0.72);
}

.gauge-meter em {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 0;
  z-index: 4;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff6b55, #ffb020, #2fd36f);
  box-shadow: 0 0 10px rgba(255,176,32,0.34);
}

.gauge-meter.compact {
  width: min(100%, 188px);
}

.gauge-meter.compact::before {
  width: 176px;
  height: 176px;
  bottom: -78px;
}

.gauge-meter.compact::after {
  width: 116px;
  height: 116px;
  bottom: -47px;
}

.gauge-meter.compact i {
  width: 72px;
}

.cockpit-score {
  grid-area: score;
}

.cockpit-board {
  grid-area: board;
}

.cockpit-core {
  grid-area: core;
  position: relative;
  display: flex;
  min-height: 430px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  overflow: hidden;
}

.cockpit-core::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(34,244,255,0.13);
  background:
    radial-gradient(circle at center, rgba(34,244,255,0.18), transparent 38%),
    repeating-linear-gradient(0deg, rgba(34,244,255,0.03) 0 1px, transparent 1px 10px);
}

.holo-orbit {
  position: relative;
  min-height: 330px;
  flex: 1;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.holo-orbit::before,
.holo-orbit::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(34,244,255,0.28);
  box-shadow: 0 0 28px rgba(34,244,255,0.2);
}

.holo-orbit::before {
  width: min(72%, 330px);
  aspect-ratio: 1;
  animation: cockpitSpin 18s linear infinite;
}

.holo-orbit::after {
  width: min(50%, 230px);
  aspect-ratio: 1;
  border-style: dashed;
  animation: cockpitSpin 13s linear infinite reverse;
}

.holo-tree {
  position: relative;
  width: 150px;
  height: 220px;
  filter: drop-shadow(0 0 22px rgba(34,244,255,0.8));
  z-index: 1;
}

.holo-tree::before {
  content: "";
  position: absolute;
  left: 67px;
  bottom: 18px;
  width: 18px;
  height: 132px;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(180deg, #62fbff, #0697c7 58%, #053b74);
  box-shadow: 0 0 26px rgba(34,244,255,0.85);
}

.holo-tree::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(34,244,255,0.74), rgba(34,244,255,0.08) 58%, transparent 70%);
}

.holo-tree i {
  position: absolute;
  left: 74px;
  bottom: 112px;
  width: 74px;
  height: 42px;
  border-top: 5px solid #20e9ff;
  border-radius: 70% 50% 0 0;
  transform-origin: left bottom;
}

.holo-tree i:nth-child(2) { transform: rotate(-38deg); width: 84px; }
.holo-tree i:nth-child(3) { transform: rotate(28deg); width: 78px; bottom: 130px; }
.holo-tree i:nth-child(4) { transform: rotate(-72deg); width: 70px; bottom: 134px; }
.holo-tree i:nth-child(5) { transform: rotate(62deg); width: 68px; bottom: 150px; }
.holo-tree i:nth-child(6) { transform: rotate(-12deg); width: 96px; bottom: 156px; }

.core-node {
  position: absolute;
  z-index: 2;
  min-width: 54px;
  padding: 8px 10px;
  border: 1px solid rgba(34,244,255,0.45);
  border-radius: 999px;
  background: rgba(2, 18, 34, 0.86);
  color: #eaffff;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 0 20px rgba(34,244,255,0.22);
}

.core-node.revenue { left: 10%; top: 24%; }
.core-node.cost { right: 12%; top: 29%; }
.core-node.cash { left: 18%; bottom: 24%; }
.core-node.profit { right: 16%; bottom: 18%; }

@keyframes cockpitSpin {
  to { transform: rotate(360deg); }
}

.cockpit-score,
.cockpit-board {
  min-height: 430px;
}

.cockpit-score > span,
.standard-grid span,
.kpi span,
.panel-head p,
.score-guide p,
.score-guide-grid span,
.score-formula span,
.score-formula em,
.alert span,
th,
.pagination {
  color: var(--muted);
}

.cockpit-score > strong {
  color: #f5ffff;
  text-shadow: 0 0 24px rgba(34,244,255,0.65);
}

.cockpit-score em,
.panel h2,
.standard-head h2,
.score-guide h2,
.cockpit-actions b,
.alert strong,
td,
.kpi strong,
.standard-grid strong,
.score-formula strong {
  color: var(--ink);
}

.score-breakdown article,
.standard-grid article,
.score-guide-grid article,
.score-formula article,
.cockpit-actions article,
.alert,
.kpi.good,
.kpi.warn,
.kpi.bad {
  background: rgba(7, 28, 47, 0.76);
  border-color: rgba(38, 226, 255, 0.16);
}

.score-breakdown article.minus,
.alert.danger,
.kpi.bad {
  background: rgba(73, 18, 31, 0.52);
  border-color: rgba(255,85,112,0.34);
}

.cockpit-lights {
  grid-template-columns: 1fr;
}

.command-cockpit .cockpit-lights {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.command-cockpit .cockpit-lights article {
  min-height: 104px;
  align-items: flex-start;
}

.command-cockpit .cockpit-actions {
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.command-cockpit .cockpit-actions article {
  min-height: 58px;
  padding: 10px 12px;
}

.command-cockpit .cockpit-actions span {
  font-size: 11px;
}

.cockpit-lights article {
  background: rgba(7, 28, 47, 0.76);
  border-color: rgba(38, 226, 255, 0.2);
}

.cockpit-lights article.warn {
  background: rgba(84, 55, 8, 0.46);
}

.cockpit-lights article.danger {
  background: rgba(73, 18, 31, 0.58);
}

.cockpit-lights strong {
  color: #ecfeff;
}

.progress-track {
  background: rgba(73, 111, 126, 0.22);
}

.progress-track span {
  background: linear-gradient(90deg, #22f4ff, #31a8ff);
  box-shadow: 0 0 18px rgba(34,244,255,0.55);
}

.benchmark-badge {
  background: rgba(38,226,255,0.09);
  color: #baf8ff;
}

th {
  background: rgba(8, 33, 54, 0.95);
}

.toast {
  background: rgba(1, 10, 20, 0.94);
  border: 1px solid rgba(38, 226, 255, 0.28);
}

@media (max-width: 1180px) {
  .command-cockpit {
    grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.25fr);
    grid-template-areas:
      "title title"
      "metrics metrics"
      "score core"
      "board board";
  }
  .cockpit-lights,
  .command-cockpit .cockpit-lights { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .command-cockpit .cockpit-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .command-cockpit {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "metrics"
      "score"
      "core"
      "board";
  }
  .command-metrics { grid-template-columns: 1fr 1fr; }
  .cockpit-core { min-height: 360px; }
  .holo-orbit { min-height: 260px; }
  .cockpit-lights { grid-template-columns: 1fr 1fr; }
  .command-cockpit .cockpit-lights { grid-template-columns: 1fr 1fr; }
  .command-cockpit .cockpit-actions { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .topbar { min-height: 250px; }
  .command-cockpit { padding: 10px; gap: 10px; }
  .command-title h2 { font-size: 24px; }
  .command-title { padding-bottom: 0; }
  .command-metrics { gap: 8px; }
  .command-metrics article {
    min-height: 56px;
    padding: 8px;
  }
  .command-metrics span { font-size: 11px; }
  .command-metrics strong { font-size: 16px; }
  .cockpit-score,
  .cockpit-board,
  .cockpit-core {
    min-height: 0;
  }
  .cockpit-score {
    padding: 14px;
  }
  .cockpit-score > strong {
    font-size: 54px;
  }
  .cockpit-score em {
    font-size: 13px;
  }
  .score-breakdown {
    margin-top: 12px;
    gap: 6px;
  }
  .score-breakdown article {
    min-height: 48px;
    padding: 6px 7px;
  }
  .score-breakdown b { font-size: 11px; }
  .score-breakdown span { font-size: 9px; }
  .score-breakdown strong {
    min-width: 24px;
    font-size: 16px;
  }
  .cockpit-core { padding: 12px; }
  .holo-orbit { min-height: 180px; }
  .holo-tree { transform: scale(0.68); }
  .core-node { font-size: 11px; padding: 6px 8px; }
  .cockpit-lights { grid-template-columns: 1fr 1fr; }
  .command-cockpit .cockpit-lights article {
    min-height: 78px;
    padding: 9px 8px;
  }
  .command-cockpit .cockpit-actions article {
    min-height: 48px;
    padding: 9px 10px;
  }
  .command-cockpit .cockpit-actions span { font-size: 10px; }
}

/* Food-service command palette and readability pass */
:root {
  --ink: #fff7dd;
  --muted: #d9c89d;
  --line: rgba(255, 190, 89, 0.24);
  --paper: #07120c;
  --panel: rgba(16, 38, 25, 0.84);
  --green: #2fd36f;
  --teal: #35c7a1;
  --gold: #ffb020;
  --red: #ff6b55;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38), inset 0 0 30px rgba(255, 176, 32, 0.045);
}

body {
  background:
    radial-gradient(circle at 50% -12%, rgba(255, 176, 32, 0.18), transparent 28%),
    radial-gradient(circle at 84% 10%, rgba(47, 211, 111, 0.13), transparent 27%),
    linear-gradient(180deg, #07120c 0%, #0c1f15 46%, #06100b 100%);
  color: var(--ink);
}

body::before {
  background:
    linear-gradient(rgba(255, 190, 89, 0.038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 211, 111, 0.026) 1px, transparent 1px);
}

.topbar {
  border-bottom-color: rgba(255, 190, 89, 0.32);
  background:
    linear-gradient(90deg, rgba(8, 26, 15, 0.95), rgba(48, 63, 23, 0.72)),
    url("./assets/restaurant-hero.png") center/cover;
  box-shadow: inset 0 -1px 0 rgba(255, 190, 89, 0.44), 0 18px 48px rgba(0, 0, 0, 0.36);
}

h1,
.command-title h2 {
  color: #fff8df;
  text-shadow: 0 0 14px rgba(255, 176, 32, 0.46), 0 0 28px rgba(47, 211, 111, 0.18);
}

.source-meta,
.command-title p,
.panel p,
.standard-head p,
.score-guide p,
.cockpit-score > span,
.cockpit-score em,
.cockpit-progress span,
.cockpit-actions span,
.score-breakdown span,
.standard-grid span,
.standard-grid em,
.kpi span,
.kpi em,
.alert span,
.pagination,
th {
  color: #e7d7ae;
}

.command-title span,
.eyebrow,
.command-metrics span,
.control-group > span {
  color: #9ee493;
}

.upload-button,
.segmented button,
select,
.page-controls button {
  border-color: rgba(255, 190, 89, 0.34);
  background: rgba(19, 44, 27, 0.86);
  color: #fff7dd;
}

.segmented button.active {
  border-color: rgba(255, 190, 89, 0.86);
  background: linear-gradient(180deg, rgba(255, 176, 32, 0.32), rgba(47, 128, 57, 0.48));
  box-shadow: 0 0 18px rgba(255, 176, 32, 0.28);
}

.control-strip,
.standards,
.kpi,
.panel,
.score-guide,
.cockpit-score,
.cockpit-board,
.command-cockpit,
.command-metrics article,
.cockpit-core {
  border-color: var(--line);
  background:
    linear-gradient(180deg, rgba(22, 54, 33, 0.9), rgba(10, 30, 18, 0.92));
  box-shadow: var(--shadow);
}

.command-cockpit::before {
  background:
    linear-gradient(90deg, transparent 0 2%, rgba(255,190,89,0.2) 2.1%, transparent 2.4% 97.6%, rgba(255,190,89,0.2) 97.9%, transparent 98.2%),
    linear-gradient(180deg, rgba(255,190,89,0.18), transparent 8%, transparent 92%, rgba(47,211,111,0.18));
}

.command-cockpit::after {
  background: linear-gradient(90deg, transparent, rgba(255,190,89,0.92), rgba(47,211,111,0.72), transparent);
  box-shadow: 0 0 24px rgba(255,176,32,0.7);
}

.command-metrics strong,
.cockpit-score > strong {
  color: #fffbe8;
  text-shadow: 0 0 18px rgba(255,176,32,0.52), 0 0 30px rgba(47,211,111,0.22);
}

.cockpit-core::before {
  border-color: rgba(255, 190, 89, 0.18);
  background:
    radial-gradient(circle at center, rgba(47,211,111,0.16), transparent 35%),
    repeating-linear-gradient(0deg, rgba(255,190,89,0.035) 0 1px, transparent 1px 10px);
}

.holo-orbit::before {
  border-color: rgba(255, 176, 32, 0.36);
  background: conic-gradient(from 20deg, transparent, rgba(255,176,32,0.18), transparent, rgba(47,211,111,0.16), transparent);
  box-shadow: 0 0 34px rgba(255,176,32,0.28), inset 0 0 50px rgba(47,211,111,0.08);
}

.holo-orbit::after {
  border-color: rgba(47, 211, 111, 0.36);
  box-shadow: 0 0 32px rgba(47,211,111,0.24);
}

.holo-tree {
  width: 210px;
  height: 220px;
  filter: drop-shadow(0 0 26px rgba(255, 176, 32, 0.58)) drop-shadow(0 0 24px rgba(47,211,111,0.38));
}

.holo-tree::before {
  left: 40px;
  bottom: 38px;
  width: 130px;
  height: 62px;
  border-radius: 8px 8px 70px 70px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,247,221,0.95), rgba(255,176,32,0.72) 42%, rgba(47,125,57,0.68) 78%),
    linear-gradient(180deg, #fff0b8, #ffb020);
  box-shadow: 0 0 34px rgba(255,176,32,0.72), inset 0 -12px 26px rgba(8,38,20,0.45);
}

.holo-tree::after {
  left: 20px;
  right: 20px;
  bottom: 18px;
  height: 28px;
  background: radial-gradient(ellipse at center, rgba(47,211,111,0.7), rgba(255,176,32,0.18) 55%, transparent 72%);
}

.holo-tree i {
  left: 102px;
  bottom: 112px;
  width: 58px;
  height: 88px;
  border-top: 0;
  border-left: 5px solid #fff7dd;
  border-radius: 70% 0 0 20%;
  opacity: 0.9;
  animation: steamFloat 3.2s ease-in-out infinite;
}

.holo-tree i:nth-child(1) { transform: rotate(10deg); }
.holo-tree i:nth-child(2) { transform: rotate(-18deg); width: 62px; bottom: 118px; border-color: #9ee493; animation-delay: -0.4s; }
.holo-tree i:nth-child(3) { transform: rotate(26deg); width: 54px; bottom: 126px; border-color: #ffcf74; animation-delay: -0.8s; }
.holo-tree i:nth-child(4) { transform: rotate(-34deg); width: 48px; bottom: 138px; border-color: #35c7a1; animation-delay: -1.2s; }
.holo-tree i:nth-child(5) { transform: rotate(42deg); width: 46px; bottom: 142px; border-color: #fff7dd; animation-delay: -1.6s; }
.holo-tree i:nth-child(6) { transform: rotate(-4deg); width: 72px; bottom: 154px; border-color: #ffb020; animation-delay: -2s; }

@keyframes steamFloat {
  0%, 100% { opacity: 0.58; translate: 0 4px; }
  50% { opacity: 1; translate: 0 -8px; }
}

.core-node {
  border-color: rgba(255, 190, 89, 0.58);
  background: rgba(22, 54, 33, 0.92);
  color: #fff7dd;
  box-shadow: 0 0 22px rgba(255,176,32,0.24), inset 0 0 16px rgba(47,211,111,0.09);
}

.progress-track {
  background: rgba(244, 231, 197, 0.16);
}

.progress-track span {
  background: linear-gradient(90deg, #2fd36f, #ffb020);
  box-shadow: 0 0 18px rgba(255,176,32,0.5);
}

.light {
  background: #2fd36f;
  box-shadow: 0 0 0 5px rgba(47,211,111,0.12), 0 0 18px rgba(47,211,111,0.32);
}

.light.warn {
  background: #ffb020;
  box-shadow: 0 0 0 5px rgba(255,176,32,0.14), 0 0 18px rgba(255,176,32,0.36);
}

.light.danger {
  background: #ff6b55;
  box-shadow: 0 0 0 5px rgba(255,107,85,0.14), 0 0 18px rgba(255,107,85,0.52);
}

.cockpit-lights article.warn,
.score-guide-grid article.warn,
.kpi.warn {
  background: rgba(75, 50, 13, 0.6);
  border-color: rgba(255,176,32,0.4);
}

.cockpit-lights article.danger,
.score-breakdown article.minus,
.alert.danger,
.alert.warning,
.score-guide-grid article.bad,
.kpi.bad {
  background: rgba(72, 25, 20, 0.62);
  border-color: rgba(255,107,85,0.4);
}

.score-guide-grid article.good,
.alert {
  background: rgba(15, 45, 28, 0.78);
  border-color: rgba(47,211,111,0.34);
}

.score-guide-grid article.warn,
.alert.warning {
  background: rgba(75, 50, 13, 0.72);
  border-color: rgba(255,176,32,0.48);
}

.score-guide-grid article.bad,
.alert.danger {
  background: rgba(72, 25, 20, 0.74);
  border-color: rgba(255,107,85,0.5);
}

.score-guide-grid b,
.score-guide-grid span,
.score-formula span,
.score-formula strong,
.score-formula em,
.alert strong,
.alert span {
  color: #fff7dd;
}

@media (max-width: 900px) {
  .command-metrics article.gauge-card {
    min-height: 196px;
  }
}

/* Fresh food-service light theme */
:root {
  color-scheme: light;
  --ink: #24352c;
  --muted: #6e8176;
  --line: #d9eadf;
  --paper: #f6fbf3;
  --panel: rgba(255, 255, 250, 0.92);
  --green: #57c785;
  --teal: #5fcab0;
  --gold: #ffb84d;
  --red: #f06d5f;
  --shadow: 0 14px 36px rgba(60, 92, 70, 0.11);
}

body {
  background:
    radial-gradient(circle at 12% 8%, rgba(158, 228, 147, 0.32), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(255, 207, 116, 0.24), transparent 26%),
    linear-gradient(180deg, #fbfff6 0%, #eef8ee 52%, #f8fbf2 100%);
  color: var(--ink);
}

body::before {
  background:
    linear-gradient(rgba(87,199,133,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,184,77,0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.44), rgba(0,0,0,0.08));
}

.topbar {
  min-height: 168px;
  border-bottom-color: rgba(87,199,133,0.28);
  background:
    linear-gradient(90deg, rgba(48, 113, 73, 0.88), rgba(121, 156, 70, 0.62)),
    url("./assets/restaurant-hero.png") center/cover;
  box-shadow: 0 12px 34px rgba(75, 110, 77, 0.16);
}

h1,
.command-title h2 {
  color: #fffdf1;
  text-shadow: 0 2px 14px rgba(34, 69, 42, 0.34);
}

.control-strip,
.standards,
.kpi,
.panel,
.score-guide,
.cockpit-score,
.cockpit-board,
.command-cockpit,
.command-metrics article,
.cockpit-core,
.standard-grid article,
.score-guide-grid article,
.score-formula article,
.score-breakdown article,
.cockpit-actions article,
.alert {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.command-cockpit {
  background:
    linear-gradient(180deg, rgba(255,255,250,0.94), rgba(245,253,242,0.9));
}

.command-cockpit::before {
  background:
    linear-gradient(90deg, transparent 0 2%, rgba(87,199,133,0.18) 2.1%, transparent 2.4% 97.6%, rgba(255,184,77,0.18) 97.9%, transparent 98.2%),
    linear-gradient(180deg, rgba(87,199,133,0.16), transparent 10%, transparent 90%, rgba(255,184,77,0.16));
}

.command-cockpit::after {
  background: linear-gradient(90deg, transparent, rgba(87,199,133,0.7), rgba(255,184,77,0.62), transparent);
  box-shadow: 0 0 18px rgba(87,199,133,0.25);
}

.command-title span,
.eyebrow,
.command-metrics span,
.control-group > span {
  color: #4d9c6d;
}

.command-title h2 {
  color: #2c5f43;
  text-shadow: none;
}

.command-title p,
.source-meta,
.panel p,
.standard-head p,
.score-guide p,
.cockpit-score > span,
.cockpit-score em,
.cockpit-progress span,
.cockpit-actions span,
.score-breakdown span,
.standard-grid span,
.standard-grid em,
.kpi span,
.kpi em,
.alert span,
.pagination,
th {
  color: var(--muted);
}

.upload-button,
.segmented button,
select,
.page-controls button {
  border-color: #cfe5d6;
  background: rgba(255, 255, 250, 0.88);
  color: var(--ink);
}

.segmented button.active {
  border-color: #57c785;
  background: linear-gradient(180deg, #72d998, #57c785);
  color: #fff;
  box-shadow: 0 8px 22px rgba(87,199,133,0.2);
}

.command-metrics article {
  min-height: 96px;
  padding: 16px 18px;
}

.command-metrics strong {
  color: #24352c;
  font-size: clamp(22px, 2.4vw, 34px);
  text-shadow: none;
}

.command-metrics article:nth-child(1) { background: linear-gradient(180deg, #fffdf5, #f2fbf0); }
.command-metrics article:nth-child(2) { background: linear-gradient(180deg, #ffffff, #f0fbf5); }
.command-metrics article:nth-child(3) { background: linear-gradient(180deg, #fffaf0, #fff4df); }
.command-metrics article:nth-child(4) { background: linear-gradient(180deg, #ffffff, #f2fbf0); }

.cockpit-score {
  align-items: stretch;
}

.cockpit-score > strong {
  margin-top: -4px;
  color: #294236;
  text-shadow: none;
}

.cockpit-score > strong.good {
  color: #26a95d;
  text-shadow: 0 0 16px rgba(87,199,133,0.24);
}

.cockpit-score > strong.warn {
  color: #c98217;
  text-shadow: 0 0 16px rgba(255,184,77,0.24);
}

.cockpit-score > strong.danger {
  color: #e85f53;
  text-shadow: 0 0 16px rgba(240,109,95,0.22);
}

.score-gauge {
  --needle: 50;
  --score-pct: 50%;
  position: relative;
  width: min(100%, 250px);
  height: 160px;
  margin: 8px 0 4px;
  overflow: hidden;
}

.score-gauge::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -110px;
  width: 238px;
  height: 238px;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255,255,250,0.72) 0 35%, transparent 36%),
    conic-gradient(from 270deg, #f06d5f 0deg 99deg, #ffb84d 99deg 135deg, #57c785 135deg 180deg, #d7e7dc 180deg 360deg);
  box-shadow: inset 0 0 0 8px rgba(255,255,250,0.72), 0 10px 28px rgba(87,199,133,0.16);
}

.score-gauge::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -70px;
  width: 154px;
  height: 154px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(180deg, #fbfff6, #eef8ee);
}

.score-gauge i {
  position: absolute;
  left: 50%;
  bottom: 31px;
  z-index: 2;
  width: 92px;
  height: 4px;
  transform: rotate(calc((var(--needle) + 180) * 1deg));
  transform-origin: left center;
  border-radius: 999px;
  background: linear-gradient(90deg, #fffaf0, var(--score-color, #57c785));
  box-shadow: 0 0 12px var(--score-glow, rgba(87,199,133,0.4));
}

.score-gauge b {
  position: absolute;
  left: 50%;
  bottom: 21px;
  z-index: 3;
  width: 22px;
  height: 22px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, #fffdf5, var(--score-color, #57c785));
  box-shadow: 0 0 14px var(--score-glow, rgba(87,199,133,0.35));
}

.score-gauge em {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  z-index: 4;
  height: 7px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--score-color, #57c785) 0 var(--score-pct), transparent var(--score-pct) 100%),
    #d7e7dc;
}

.score-gauge em::before,
.score-gauge em::after,
.score-threshold::after {
  position: absolute;
  top: 14px;
  min-width: 34px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255,255,250,0.92);
  border: 1px solid rgba(76,98,84,0.12);
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
  font-style: normal;
  letter-spacing: 0;
  text-align: center;
  box-shadow: 0 4px 12px rgba(31,67,48,0.08);
}

.score-gauge em::before {
  content: "0";
  left: -13px;
  color: #e85f53;
  text-shadow: 0 1px 0 rgba(255,255,255,0.85);
}

.score-gauge em::after {
  content: "100";
  right: -28px;
  color: #26a95d;
  text-shadow: 0 1px 0 rgba(255,255,255,0.85);
}

.score-threshold {
  position: absolute;
  left: 50%;
  bottom: 31px;
  z-index: 5;
  width: 92px;
  height: 2px;
  transform: rotate(302.4deg);
  transform-origin: left center;
  pointer-events: none;
}

.score-threshold::before,
.score-threshold::after {
  content: none;
}

.score-gauge.good {
  --score-color: #57c785;
  --score-glow: rgba(87,199,133,0.42);
}

.score-gauge.warn {
  --score-color: #ffb84d;
  --score-glow: rgba(255,184,77,0.42);
}

.score-gauge.danger {
  --score-color: #f06d5f;
  --score-glow: rgba(240,109,95,0.42);
}

.cockpit-core {
  background: linear-gradient(180deg, rgba(255,255,250,0.92), rgba(241,250,235,0.88));
}

.cockpit-core::before {
  border-color: rgba(87,199,133,0.18);
  background:
    radial-gradient(circle at center, rgba(87,199,133,0.12), transparent 36%),
    repeating-linear-gradient(0deg, rgba(87,199,133,0.035) 0 1px, transparent 1px 10px);
}

.holo-orbit::before {
  border-color: rgba(87,199,133,0.28);
  background: conic-gradient(from 20deg, transparent, rgba(87,199,133,0.18), transparent, rgba(255,184,77,0.14), transparent);
  box-shadow: inset 0 0 50px rgba(87,199,133,0.08);
}

.holo-orbit::after {
  border-color: rgba(255,184,77,0.32);
}

.holo-tree {
  filter: drop-shadow(0 0 20px rgba(87,199,133,0.32));
}

.core-node {
  border-color: rgba(87,199,133,0.42);
  background: rgba(255,255,250,0.88);
  color: #315f45;
  box-shadow: 0 8px 18px rgba(87,199,133,0.12);
}

.progress-track {
  background: #dfece2;
}

.progress-track span {
  background: linear-gradient(90deg, #57c785, #ffb84d);
  box-shadow: none;
}

.cockpit-lights article,
.score-breakdown article,
.cockpit-actions article,
.alert {
  background: rgba(255,255,250,0.9);
}

.cockpit-lights article.warn,
.score-guide-grid article.warn,
.kpi.warn,
.alert.warning {
  background: #fff7e8;
  border-color: rgba(255,184,77,0.4);
}

.cockpit-lights article.danger,
.score-breakdown article.minus,
.score-guide-grid article.bad,
.alert.danger,
.kpi.bad {
  background: #fff0ed;
  border-color: rgba(240,109,95,0.35);
}

.score-guide-grid article.good,
.kpi.good {
  background: #eefaf1;
  border-color: rgba(87,199,133,0.35);
}

.cockpit-lights strong,
.kpi strong,
.panel h2,
.standard-head h2,
.score-guide h2,
.cockpit-actions b,
.alert strong,
td,
.standard-grid strong,
.score-formula strong,
.score-guide-grid b,
.score-guide-grid span,
.score-formula span,
.score-formula em,
.score-breakdown b {
  color: #24352c;
}

.score-breakdown article.plus strong {
  color: #2d9f5c;
}

.score-breakdown article.minus strong,
.kpi.bad .benchmark-badge,
.cockpit-lights article.danger strong {
  color: #d65a4e;
}

.benchmark-badge {
  background: rgba(87,199,133,0.12);
  color: #397d55;
}

th {
  background: #eef7ef;
}

.cockpit-actions b,
.cockpit-actions span,
.cockpit-lights b,
.cockpit-lights small,
.cockpit-lights em,
.cockpit-lights article strong {
  color: #24352c;
}

.cockpit-lights article.danger strong,
.score-breakdown article.minus strong {
  color: #d65a4e;
}

.cockpit-lights article.warn strong {
  color: #b87412;
}

/* Final high-contrast pass for light panels, tables and chart captions */
.panel h2,
.standard-head h2,
.score-guide h2,
.alert strong,
td,
.standard-grid strong,
.score-guide-grid strong,
.score-formula strong,
.kpi strong,
.table-title,
.metric-title {
  color: #24352c !important;
  text-shadow: none !important;
}

.panel p,
.standard-head p,
.score-guide p,
.alert span,
.pagination,
th,
td,
.table-wrap,
.page-controls,
.source-meta,
.chart-note,
.kpi span,
.kpi em,
.standard-grid span,
.standard-grid em,
.score-guide-grid span,
.score-guide-grid em {
  color: #52665b !important;
  text-shadow: none !important;
}

thead th {
  color: #f7fff9 !important;
  background: #173f2a !important;
  font-weight: 850;
}

tbody td {
  color: #40544a !important;
  font-weight: 650;
}

.panel h2,
.score-guide h2,
.standard-head h2 {
  font-weight: 850;
}

.alert.danger strong,
.alert.danger span {
  color: #3c241f !important;
}

.alert.warning strong,
.alert.warning span {
  color: #533b13 !important;
}

.table-wrap {
  background: rgba(255,255,250,0.94);
}

.finance-embed-panel {
  margin-top: 18px;
  padding: 18px;
}

.finance-embed-frame {
  width: 100%;
  min-height: 1320px;
  border: 1px solid #d9eadf;
  border-radius: 10px;
  background: #fbfcf8;
}

@media (max-width: 980px) {
  .finance-embed-frame {
    min-height: 1480px;
  }
}

.cockpit-actions article {
  border-left-color: #57c785;
}

@media (max-width: 520px) {
  .score-gauge {
    width: 220px;
    height: 144px;
  }
  .score-gauge::before {
    width: 210px;
    height: 210px;
    bottom: -98px;
  }
  .score-gauge::after {
    width: 132px;
    height: 132px;
    bottom: -60px;
  }
  .score-gauge i {
    width: 78px;
    bottom: 28px;
  }
  .score-threshold {
    bottom: 28px;
    width: 80px;
  }
  .score-threshold::before {
    height: 36px;
    top: -31px;
  }
  .score-threshold::after {
    top: 58px;
  }
  .score-gauge em::before,
  .score-gauge em::after,
  .score-threshold::after {
    min-width: 30px;
    padding: 3px 5px;
    font-size: 18px;
  }
  .score-gauge em::before {
    left: -12px;
  }
  .score-gauge em::after {
    right: -24px;
  }
  .score-threshold::after {
    right: -17px;
  }
}

@media (max-width: 520px) {
  .command-metrics article.gauge-card {
    min-height: 170px;
    padding: 10px 8px;
  }
  .gauge-meter {
    width: 158px;
    height: 92px;
  }
  .gauge-meter::before {
    width: 148px;
    height: 148px;
    bottom: -65px;
  }
  .gauge-meter::after {
    width: 94px;
    height: 94px;
    bottom: -38px;
  }
  .gauge-meter i {
    bottom: 22px;
    width: 60px;
  }
  .gauge-meter b {
    bottom: 13px;
    width: 16px;
    height: 16px;
  }
  .gauge-meter em {
    left: 18px;
    right: 18px;
  }
  .command-metrics small {
    font-size: 10px;
  }
}

/* Compact gauge sizing */
.command-metrics article.gauge-card {
  min-height: 184px;
  padding: 12px 14px;
}

.gauge-meter {
  width: min(100%, 188px);
  height: 104px;
}

.gauge-meter::before {
  width: 176px;
  height: 176px;
  bottom: -78px;
}

.gauge-meter::after {
  width: 116px;
  height: 116px;
  bottom: -47px;
}

.gauge-meter i {
  bottom: 24px;
  width: 72px;
}

.gauge-meter b {
  bottom: 15px;
  width: 18px;
  height: 18px;
}

.gauge-meter.compact {
  width: min(100%, 168px);
}

@media (max-width: 520px) {
  .command-metrics article.gauge-card {
    min-height: 158px;
  }
  .gauge-meter {
    width: 146px;
    height: 84px;
  }
  .gauge-meter::before {
    width: 136px;
    height: 136px;
    bottom: -60px;
  }
  .gauge-meter::after {
    width: 86px;
    height: 86px;
    bottom: -35px;
  }
  .gauge-meter i {
    bottom: 20px;
    width: 55px;
  }
  .gauge-meter b {
    bottom: 12px;
    width: 15px;
    height: 15px;
  }
}

.cockpit-lights strong,
.kpi strong,
.panel h2,
.standard-head h2,
.score-guide h2,
.cockpit-actions b,
.alert strong,
td,
.standard-grid strong,
.score-formula strong {
  color: #fff7dd;
}

.score-breakdown article.plus strong,
.kpi.good .benchmark-badge {
  color: #9ee493;
}

.score-breakdown article.minus strong,
.kpi.bad .benchmark-badge,
.cockpit-lights article.danger strong {
  color: #ff9b8c;
}

.benchmark-badge {
  background: rgba(255,190,89,0.13);
  color: #fff1c4;
}

th {
  background: rgba(20, 48, 30, 0.96);
}

/* Final fresh-theme text contrast fixes */
.cockpit-actions b,
.cockpit-actions span,
.cockpit-lights b,
.cockpit-lights small,
.cockpit-lights em,
.cockpit-lights article strong,
.alert strong,
.alert span {
  color: #24352c;
}

.cockpit-lights article.danger strong,
.score-breakdown article.minus strong {
  color: #d65a4e;
}

.cockpit-lights article.warn strong {
  color: #b87412;
}
