:root {
  font:
    15px/1.6 system-ui,
    -apple-system,
    "Microsoft YaHei",
    sans-serif;
  color: #302a24;
  background: #f8f7f4;
  --accent: #dc620c;
  --line: #e9e3db;
}
.metrics { display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:20px;margin:20px 0 }
.metric small { display:block }
.metric strong { display:block;font-size:25px;color:#3b3027;font-weight:650 }
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  height: 76px;
  padding: 0 max(24px, calc((100vw - 1280px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
a {
  color: var(--accent);
  text-decoration: none;
}
.brand {
  font-size: 20px;
  font-weight: 700;
  color: #302a24;
  display: flex;
  gap: 10px;
  align-items: center;
}
.brand span {
  background: #fff0de;
  color: var(--accent);
  padding: 3px 12px;
  border-radius: 12px;
}
main {
  max-width: 1280px;
  margin: 36px auto;
  padding: 0 24px;
  min-height: 75vh;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}
.login {
  max-width: 450px;
  margin: 9vh auto;
}
.eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 2px;
}
h1 {
  font-size: 29px;
  letter-spacing: -0.6px;
  margin: 12px 0;
}
h2 {
  font-size: 23px;
  margin: 0 0 18px;
}
h3 {
  font-size: 17px;
}
p {
  margin: 10px 0;
}
.muted,
small {
  color: #81786e;
}
label {
  display: block;
  margin: 14px 0 8px;
  font-size: 14px;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  border: 1px solid #d7d0c7;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  padding: 10px 12px;
  font: inherit;
  accent-color: var(--accent);
}
textarea {
  min-height: 110px;
  resize: vertical;
}
input[type="checkbox"] {
  display: inline;
  width: auto;
}
button,
.button {
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  font: inherit;
  background: var(--accent);
  color: #fff;
  display: inline-block;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.secondary {
  background: #f2ede7;
  color: #51483d;
}
button.danger {
  background: #fff0ed;
  color: #b52e20;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #ffb97b;
  outline-offset: 2px;
}
.login button {
  width: 100%;
  margin-top: 20px;
}
nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
nav button {
  background: transparent;
  color: #75695c;
}
nav button.active {
  background: #fff0de;
  color: #b84900;
  font-weight: 700;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 20px;
}
.toolbar input {
  max-width: 280px;
}
.toolbar select {
  max-width: 150px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.split {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}
.list {
  max-height: 75vh;
  overflow: auto;
}
.list button {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  color: inherit;
  margin-bottom: 8px;
  border: 1px solid var(--line);
}
.list button.selected {
  border-color: var(--accent);
  background: #fff8ef;
}
.badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  background: #eee9e2;
  color: #62584c;
}
.badge.healthy,
.badge.issued {
  background: #e4f4e9;
  color: #1d7042;
}
.badge.down,
.badge.refund_review {
  background: #ffebe7;
  color: #ac3020;
}
.messages {
  max-height: 50vh;
  min-height: 220px;
  overflow: auto;
  background: #faf8f5;
  padding: 16px;
  border-radius: 10px;
}
.message {
  margin: 12px 0;
  max-width: 90%;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message.user {
  background: #fff0df;
  margin-left: auto;
}
.message.private {
  border-style: dashed;
  color: #79693b;
  background: #fffbe8;
}
.message small {
  display: block;
}
.message a {
  display: block;
}
.money {
  font-size: 30px;
  font-weight: 700;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 12px;
  vertical-align: top;
}
th {
  color: #877969;
  font-weight: 500;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f8f6f2;
  padding: 14px;
  border-radius: 8px;
  font-size: 13px;
  max-height: 450px;
  overflow: auto;
}
.settings-editor {
  min-height: 400px;
  font:
    13px/1.6 ui-monospace,
    Consolas,
    monospace;
}
#notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 440px;
  background: #302a24;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  z-index: 20;
}
#notice:empty {
  display: none;
}
footer {
  text-align: center;
  padding: 24px;
  color: #968879;
  font-size: 12px;
}
[hidden] {
  display: none !important;
}
/* Read-only business workspace; existing operational forms retain their styles. */
header { padding:0 32px; height:72px; }
.brand small { font:600 11px/1 ui-monospace,monospace;letter-spacing:2px;margin-top:4px; }
main { max-width:1580px;padding:0 32px;margin:30px auto; }
#workspace { display:grid;grid-template-columns:190px minmax(0,1fr);gap:36px; }
.workspace-sidebar { padding-top:10px; }
.sidebar-caption { color:#9b8e81;font-size:11px;letter-spacing:2px;margin:0 12px 18px; }
#tabs { display:flex;flex-direction:column;gap:5px; }
#tabs button { text-align:left;padding:11px 14px;border-radius:10px;font-size:14px; }
#tabs button.active { background:#fff0dd;color:#ad4c08;box-shadow:inset 3px 0 #df6d21; }
.sidebar-note { border-top:1px solid var(--line);padding:24px 12px;font-size:11px;color:#968a7f;line-height:1.9; }
.sidebar-note strong { color:#74685d;font-weight:500; }
#content { min-width:0; }
.data-heading { display:flex;align-items:center;justify-content:space-between;gap:24px;margin:0 0 26px; }
.data-heading .eyebrow { font:600 10px/1.5 ui-monospace,monospace;letter-spacing:2px;color:#a76b40; }
.data-heading h1 { font-size:32px;margin:7px 0 9px;letter-spacing:-1px; }
.data-heading p.muted { font-size:13px; }
.snapshot-time { color:#93877c;font-size:11px;text-align:right;line-height:1.9;white-space:nowrap; }
.analytics-toolbar { display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap;padding:16px 20px;background:#fff;border:1px solid var(--line);border-radius:12px;margin-bottom:24px; }
.analytics-toolbar label { margin:0 0 5px;font-size:10px;color:#948679;letter-spacing:1px; }
.analytics-toolbar select { min-width:135px;font-size:13px;padding:8px 12px;background:#fcfbf9;border-color:#e7e1d9; }
.analytics-toolbar button { padding:9px 16px;font-size:12px; }
.analytics-toolbar > span { margin:auto 0 auto auto;color:#a19488;font-size:11px; }
.product-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:22px; }
.product-grid.one-product { grid-template-columns:minmax(0,1fr); }
.data-stack { display:grid;gap:22px;min-width:0; }
.data-card { padding:24px;overflow:hidden;box-shadow:0 3px 14px #302a2403; }
.card-title { display:flex;justify-content:space-between;align-items:flex-start;gap:15px;padding-bottom:18px;border-bottom:1px solid #f0ece6; }
.card-title h3 { margin:0;font-size:17px;font-weight:650;letter-spacing:-.3px; }
.card-title p { margin:5px 0 0;font-size:11px;color:#9a8c7e; }
.source-state { font-size:10px;padding:4px 8px;border-radius:5px;white-space:nowrap;font-weight:500; }
.source-state.ok { background:#edf5ee;color:#4d7755; }
.source-state.stale { background:#fff1d9;color:#9c721d; }
.source-state.failed { background:#fcebe7;color:#ad5543; }
.data-metrics { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 18px;padding:26px 0 22px; }
.data-metric { min-width:0; }
.data-metric > span { display:block;color:#918071;font-size:11px;margin-bottom:9px; }
.data-metric strong { display:block;color:#312b25;font-size:27px;letter-spacing:-.7px;line-height:1.4;font-weight:600;font-variant-numeric:tabular-nums;overflow-wrap:anywhere; }
.data-metric small { display:block;color:#aa9c8e;font-size:10px;margin-top:5px; }
.currency-amount { display:block;font-size:.8em; }
.amount-empty { font-size:13px;font-weight:400;color:#9a8c7e;letter-spacing:0; }
.data-card h4 { margin:25px 0 10px;font-size:12px;font-weight:600;color:#756558; }
.chart-heading { display:flex;justify-content:space-between;align-items:center;border-top:1px solid #f0ece6;padding-top:18px;margin-top:5px; }
.chart-heading h4 { margin:0;font-size:11px; }
.chart-heading > span { font-size:10px;color:#a39487; }
.data-chart { display:block;width:100%;height:auto;margin:8px 0 10px;overflow:visible; }
.chart-grid { fill:none;stroke:#ede8e1;stroke-width:1;stroke-dasharray:4 5; }
.chart-line { fill:none;stroke:#df8b4b;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round; }
.data-chart text { fill:#a99b8e;font:10px system-ui,sans-serif; }
.chart-records { font-size:11px;color:#9b8878;margin:6px 0 18px; }
summary { cursor:pointer; }
.source-details { border-top:1px solid #f0ece6;padding-top:15px;font-size:10px;color:#9c8c7e;line-height:1.8; }
.source-details p { margin:5px 0;overflow-wrap:anywhere; }
.source-empty,.data-empty { padding:34px 16px;text-align:center;color:#a08f81;background:#fcfaf7;border-radius:8px;margin:20px 0;font-size:12px; }
.source-empty strong,.data-empty strong { color:#847161;font-size:13px;font-weight:500; }
.data-note { color:#aa998a;font-size:10px;line-height:1.9;margin:16px 0; }
.data-warning { color:#987123;background:#fff8e9;border-radius:7px;padding:10px 12px;font-size:11px; }
.data-card .table-wrap { margin:12px 0;max-height:540px; }
.data-card table { font-size:11px; }
.data-card th,.data-card td { padding:12px 8px; }
.data-card td { overflow-wrap:anywhere;max-width:230px; }
.data-card th { background:#fcfaf7;white-space:nowrap;color:#a08e7d; }
.operations-strip { margin-top:24px;display:grid;grid-template-columns:1fr 1.6fr;gap:0 28px;align-items:center; }
.operations-strip h3 { margin:8px 0;font-size:15px; }
.operations-strip .eyebrow { font-size:10px; }
.operations-strip .muted { font-size:11px; }
.operations-strip .data-metrics { grid-template-columns:repeat(3,minmax(0,1fr));padding:10px 0; }
.health-summary { grid-column:1/-1;display:flex;align-items:center;gap:14px;flex-wrap:wrap;border-top:1px solid #f0ece6;padding-top:17px;margin-top:18px;font-size:10px;color:#a29182; }
.health-target { display:flex;align-items:center;gap:5px; }
.health-dot { width:5px;height:5px;border-radius:50%;background:#b8aca0; }
.health-dot.healthy { background:#75a181; }
.health-dot.unknown { background:#d6a16b; }
.data-footnote { color:#a39588;font-size:10px;line-height:1.9;margin:24px 0 0;padding:0 2px; }
.data-footnote strong { color:#897a6c;font-size:11px;font-weight:500; }
.original-links { display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-top:12px; }
.original-links a { color:#a76b40; }
@media (min-width:1800px) { .data-metric strong {font-size:32px;} }
@media (max-width:1150px) {
  #workspace {grid-template-columns:160px minmax(0,1fr);gap:20px;}
  .data-card {padding:19px;}
  .snapshot-time {display:none;}
  .data-metric strong {font-size:23px;}
  .operations-strip {grid-template-columns:1fr;}
}
@media (max-width:950px) {
  .product-grid {grid-template-columns:minmax(0,1fr);}
  .data-heading h1 {font-size:28px;}
}
@media (max-width: 760px) {
  #workspace {display:block;}
  .workspace-sidebar {padding:0;}
  .sidebar-caption,.sidebar-note {display:none;}
  #tabs {flex-direction:row;flex-wrap:nowrap;overflow-x:auto;padding:0 0 10px;margin-bottom:20px;}
  #tabs button {flex:0 0 auto;font-size:12px;padding:9px 12px;}
  .data-heading {margin-bottom:18px;}
  .analytics-toolbar {padding:12px;gap:10px;}
  .analytics-toolbar > span {display:none;}
  .analytics-toolbar select {min-width:115px;}
  .operations-strip .data-metrics {gap:10px;}
  .operations-strip .data-metric strong {font-size:25px;}
  header {
    padding: 0 18px;
    height: 64px;
  }
  .brand {
    font-size: 17px;
  }
  main {
    margin: 22px auto;
    padding: 0 14px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .list {
    max-height: 230px;
  }
  .card {
    padding: 18px;
  }
  .messages {
    max-height: 50vh;
  }
  h1 {
    font-size: 24px;
  }
  #notice {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
}
