:root {
  --orange: #E8921A;
  --black: #0c0c0c;
  --panel: #141414;
  --panel2: #1a1a1a;
  --border: #222;
  --border2: #333;
  --text: #ffffff;
  --muted: #888;
  --muted2: #999;
  --green: #3fb950;
  --red: #f85149;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font-family: 'Barlow', system-ui, -apple-system, sans-serif;
  line-height: 1.4;
}

.wrap { max-width: 1024px; margin: 0 auto; padding: 24px 16px 48px; }

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 24px;
  border-bottom: 2px solid var(--orange);
}
.brand { text-decoration: none; display: block; }
.brand-mark {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900; text-transform: uppercase; letter-spacing: .01em;
  font-size: 32px; line-height: 1; color: var(--text);
}
.brand-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.accent { color: var(--orange); }
nav { display: flex; gap: 8px; }
.navlink {
  font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--text); padding: 8px 12px; border-radius: 6px; background: var(--panel2);
}
.navlink:hover { background: var(--border2); }

/* ---- Flash ---- */
.flashes { margin-bottom: 16px; }
.flash {
  background: #2a2410; border: 1px solid var(--orange); color: #f0d9a8;
  padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 8px;
}

/* ---- Cards ---- */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 16px;
}
.card-fit { align-self: start; }
.card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800; text-transform: uppercase; font-size: 20px;
  color: var(--orange); margin: 0 0 12px;
}
.unit-note { color: var(--muted); font-weight: 600; font-size: 14px; }

/* ---- Buttons ---- */
.btn {
  display: inline-block; border: none; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: 6px; text-decoration: none; text-align: center;
}
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-primary { background: var(--orange); color: var(--black); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--panel2); color: var(--text); border: 1px solid var(--border2); }
.btn-ghost:hover { background: var(--border2); }

/* ---- Upload page ---- */
.uploadcard {
  background: var(--panel); border: 2px dashed var(--border2);
  border-radius: 14px; padding: 48px 24px; text-align: center;
}
.upload-icon { font-size: 36px; color: var(--orange); margin-bottom: 8px; }
.upload-title {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 22px;
  margin: 0 0 4px; color: var(--text);
}
.upload-hint { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.upload-form { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-label { cursor: pointer; }
.sample-form { margin-top: 12px; }

/* ---- Mapping row ---- */
.maprow-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.file-name { font-size: 14px; font-weight: 600; }
.map-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.map-field { display: flex; flex-direction: column; gap: 4px; }
.map-label { font-size: 12px; color: var(--muted); }
.map-actions { margin-top: 12px; display: flex; align-items: center; gap: 12px; }
.warn { color: var(--red); font-size: 13px; }
select, input[type="number"] {
  background: var(--black); color: var(--text); border: 1px solid var(--border2);
  border-radius: 6px; padding: 7px 8px; font-family: inherit; font-size: 14px;
}
select { width: 100%; }

/* ---- Date inputs ---- */
input[type="date"] {
  position: relative;
  background-color: var(--black); color: var(--text); border: 1px solid var(--border2);
  border-radius: 8px; padding: 10px 40px 10px 12px; font-family: inherit; font-size: 15px;
  color-scheme: dark; transition: border-color .15s, box-shadow .15s; cursor: pointer;
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23E8921A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}
input[type="date"]:hover { border-color: var(--orange); }
input[type="date"]:focus {
  outline: none; border-color: var(--orange);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 22%, transparent);
}
/* Stretch the native picker button invisibly across the whole field so a click
   anywhere opens the calendar; the visible orange icon is the background above. */
input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute; inset: 0; width: auto; height: auto; margin: 0; padding: 0;
  cursor: pointer; opacity: 0; background: transparent; color: transparent;
}

/* ---- Verdict ---- */
.verdict-head { margin-bottom: 16px; }
.verdict-label { font-family: 'Barlow Condensed', sans-serif; font-weight: 900; text-transform: uppercase; font-size: 26px; }
.verdict-sub { font-size: 14px; color: var(--muted2); }
.bar { height: 12px; border-radius: 999px; overflow: hidden; background: var(--black); margin-bottom: 16px; }
.bar-fill { height: 100%; transition: width .3s; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 4px; background: var(--panel2); border-radius: 8px; padding: 12px 16px; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat-value { font-size: 24px; font-weight: 700; }
.stat-sub { font-size: 12px; color: var(--muted2); }

/* ---- Station breakdown table ---- */
.stationtable { width: 100%; border-collapse: collapse; font-size: 14px; color: #ddd; }
.stationtable thead tr { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.stationtable th, .stationtable td { padding: 9px 10px; }
.stationtable th.l, .stationtable td.l { text-align: left; }
.stationtable th.r, .stationtable td.r { text-align: right; }
.stationtable tbody tr { border-top: 1px solid var(--border); }
.stationtable tbody tr.is-bottleneck { background: #1c1712; }
.bn-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; background: var(--orange); color: var(--black); padding: 1px 6px; border-radius: 4px; margin-left: 6px; font-weight: 700; }
/* ---- Recommendation card ---- */
.rec-card { border-left: 4px solid var(--orange); }
.rec-ok { border-left-color: var(--green); }
.rec-over { border-left-color: var(--red); }
.rec-headline { font-size: 15px; color: #eee; margin: 0 0 12px; }
.rec-moves { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.rec-move { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #ccc; }
.rec-move-ppl { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 24px; padding: 0 6px; border-radius: 6px; background: var(--orange); color: var(--black); font-weight: 800; font-size: 13px; }
.rec-move strong { color: #fff; }
.rec-line { font-size: 13px; color: var(--muted2); margin: 8px 0 0; line-height: 2; }
.rec-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 5px; margin-right: 8px; vertical-align: middle; }
.rec-tag-cut { background: #14321c; color: #6ee7a0; }
.rec-tag-add { background: #2a1414; color: #f8a; }
.rec-chip { display: inline-block; border-radius: 5px; padding: 2px 8px; margin: 0 4px; font-weight: 600; font-size: 12px; }
.rec-chip-cut { background: #14251a; color: #7fdca0; border: 1px solid #23472f; }
.rec-chip-add { background: #2a1414; color: #f8a; border: 1px solid #5a2a2a; }
.pricetable { width: 100%; border-collapse: collapse; font-size: 13px; color: #ddd; margin-top: 10px; }
.pricetable th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; }
.pricetable td { padding: 6px 8px; border-top: 1px solid var(--border); }
.pricetable th.l, .pricetable td.l { text-align: left; }
.pricetable th.r, .pricetable td.r { text-align: right; }

.rightsize span { font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 5px; }
.rs-cut { background: #14251a; color: #7fdca0; border: 1px solid #23472f; }
.rs-add { background: #2a1414; color: #f8a; border: 1px solid #5a2a2a; }
.rs-ok { color: var(--muted); }

.station-row { cursor: pointer; }
.station-row:hover { background: #1a1a1a; }
.station-row .caret { color: var(--muted); width: 18px; transition: transform .15s; }
.station-row.open .caret { transform: rotate(90deg); display: inline-block; }
.metric-wrap { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 16px 14px; }
.metric-chip { display: flex; flex-direction: column; gap: 2px; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; min-width: 120px; }
.metric-val { font-size: 22px; font-weight: 800; color: #fff; font-family: 'Barlow Condensed', sans-serif; }
.metric-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.head-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.load-col { width: 38%; }
.loadbar { display: inline-block; width: calc(100% - 52px); height: 10px; border-radius: 999px; overflow: hidden; background: var(--black); vertical-align: middle; }
.loadbar-fill { height: 100%; transition: width .3s; }
.loadpct { display: inline-block; width: 46px; text-align: right; font-size: 12px; font-weight: 600; vertical-align: middle; }

/* ---- Order table ---- */
.tablecard { padding: 0; overflow: hidden; }
.ordertable { width: 100%; border-collapse: collapse; font-size: 14px; color: #ddd; }
.ordertable thead tr { background: var(--panel2); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.ordertable th, .ordertable td { padding: 10px 12px; }
.ordertable th.l, .ordertable td { text-align: left; }
.ordertable th.r, .ordertable td.r { text-align: right; }
.ordertable tbody tr { border-top: 1px solid var(--border); }
.muted { color: var(--muted2); }
.total { font-weight: 700; color: var(--text); }
/* ---- Expandable order rows ---- */
.order-row { cursor: pointer; }
.order-row:hover { background: #1a1a1a; }
.order-row .caret { color: var(--muted); width: 20px; transition: transform .15s; display: inline-block; }
.order-row.open .caret { transform: rotate(90deg); }
.detail-row { display: none; }
.detail-row.open { display: table-row; }
.detail-row > td { background: #101010; padding: 0; border-top: 1px solid var(--border); }
.detail-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; padding: 14px 16px; }
.detail-station-head { display: flex; justify-content: space-between; font-weight: 700; color: var(--orange); font-size: 13px; padding-bottom: 4px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.detail-station-hrs { color: #fff; }
.detail-item { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; font-size: 12px; padding: 2px 0; color: #bbb; }
.detail-item-label { color: #ddd; }
.detail-item-detail { grid-column: 1; color: #777; font-size: 11px; }
.detail-item-min { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; color: #aaa; white-space: nowrap; }
.detail-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; padding: 14px 16px 4px; }
.detail-group-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--orange); margin-bottom: 8px; }
.order-row.unprofitable td { border-left: 0; }
.order-row.unprofitable { background: #1f1414; }
.order-row.unprofitable:hover { background: #2a1a1a; }
.detail-total { padding: 10px 16px 14px; font-size: 13px; color: #bbb; border-top: 1px solid var(--border); }
.detail-total strong { color: #fff; }
.station-total td { border-top: 2px solid var(--border2); font-weight: 700; color: #fff; padding: 10px; font-size: 13px; }

.tag { font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.tag-dtf { background: #23364d; color: #6cb6ff; }
.tag-sp { background: #3d2a16; color: var(--orange); }
.tag-mixed { background: #2c2340; color: #b99cff; }
.tag-emb { background: #123a2e; color: #6ee7b7; }
.tag-outsourced { background: #2a2440; color: #a99cff; }
.tag-goods { background: #3a2a12; color: #e8b878; }
.tag-fee { background: #23333a; color: #7fc7dc; }
.tag-blank { background: #2a2a2a; color: #bbb; }

/* DecoNetwork production-status badges (per job), colors matched to Deco's board */
.pstate { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; margin: 1px 3px 1px 0; }
.dstat-stock { background: #2a2440; color: #b9a3ff; }        /* Awaiting Stock — purple */
.dstat-processing { background: #10314a; color: #6cb6ff; }   /* Awaiting Processing — blue */
.dstat-po { background: #33244a; color: #cfa4ee; }           /* Awaiting Purchase Order — lavender */
.dstat-artwork { background: #103a3a; color: #6fd4d4; }      /* Awaiting Artwork — cyan */
.dstat-hold { background: #4a3a12; color: #f2cf5b; }         /* On Hold: Amount Due — yellow */
.dstat-shipped { background: #1c2a1c; color: #7fdca0; }      /* Shipped — green */
.dstat-toship { background: #123a2e; color: #6ee7b7; }       /* Ready to Ship — teal */
.dstat-production { background: #3a2a12; color: #f0a35b; }   /* In Production — orange */
.dstat-cancelled { background: #3a1c1c; color: #f08a8a; }    /* Cancelled — red */
.dstat-quote { background: #2a2440; color: #a99cff; }        /* Quote */
.dstat-other { background: #2a2a2a; color: #bbb; }           /* unknown code */
.legend-lbl { color: var(--muted); font-weight: 600; margin-right: 4px; }
.produced-note { margin: 0 0 12px; font-size: 13px; color: #6cb6ff; }

/* ---- Fetch page ---- */
.or-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 16px; color: #555; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.creds-ok { color: var(--green); font-size: 14px; margin: 0 0 16px; }
.creds-bad { color: var(--orange); font-size: 14px; margin: 0 0 8px; }
.fetch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.fetch-grid input { width: 100%; }
.fetch-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.checkrow { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #ccc; }
.hist-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hist-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.hist-row { display: flex; flex-direction: column; gap: 1px; padding: 9px 10px; border-radius: 8px; text-decoration: none; border-top: 1px solid var(--border); }
.hist-row:first-of-type { border-top: none; }
.hist-row:hover { background: var(--panel2); }
.hist-main { color: var(--text); font-size: 14px; font-weight: 600; }
.hist-sub { color: var(--muted); font-size: 12px; }
.art-form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.art-field { display: flex; flex-direction: column; gap: 4px; }
.art-lbl { font-size: 12px; color: var(--muted); }
.art-input { display: inline-flex; align-items: center; gap: 6px; }
.art-input input { width: 90px; background: var(--black); color: var(--text); border: 1px solid var(--border2); border-radius: 6px; padding: 8px 10px; font-family: inherit; font-size: 14px; }
.art-input .suffix { color: var(--muted); font-size: 13px; }
.art-summary { margin-top: 12px; font-size: 13px; color: var(--muted2); line-height: 1.5; }
.art-summary strong { color: var(--text); }
.art-flag { display: block; margin-top: 4px; color: #f8a; }
.art-flag strong { color: #f8a; }
.art-hint { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.lookup-form { display: flex; gap: 10px; }
.lookup-input { flex: 1; background: var(--black); color: var(--text); border: 1px solid var(--border2); border-radius: 6px; padding: 10px 12px; font-family: inherit; font-size: 16px; }
.fetching { margin-top: 14px; font-size: 14px; color: var(--orange); display: flex; align-items: center; gap: 10px; }
.fetching[hidden] { display: none; }
.spinner { width: 16px; height: 16px; border: 2px solid #4a3a1a; border-top-color: var(--orange); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Settings ---- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #666; margin: 16px 0 6px; }
.group-label:first-of-type { margin-top: 4px; }
.textrow { display: flex; flex-direction: column; gap: 5px; padding: 6px 0; }
.textrow input { width: 100%; background: var(--black); color: var(--text); border: 1px solid var(--border2); border-radius: 6px; padding: 9px 11px; font-family: inherit; font-size: 14px; }
.numrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.numrow-label { font-size: 14px; color: #ccc; }
.numrow-input { display: flex; align-items: center; gap: 8px; }
.numrow-input input { width: 90px; text-align: right; }
.suffix { font-size: 12px; color: #777; width: 72px; }
.settings-actions { display: flex; gap: 12px; margin-top: 4px; }
.config-note { font-size: 13px; color: var(--muted); margin-top: 16px; }
.field-hint { font-size: 11px; color: #777; margin: 2px 0 6px; line-height: 1.5; }
code { background: var(--panel2); padding: 2px 6px; border-radius: 4px; color: var(--orange); }

.legend { font-size: 12px; color: #888; margin: 12px 2px 0; line-height: 1.6; }
.legend code { background: var(--panel2); color: var(--orange); padding: 1px 5px; border-radius: 4px; font-size: 11px; }
.legend strong { color: #bbb; }

/* ---- Footer ---- */
.foot { font-size: 12px; color: #666; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .map-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .brand-mark { font-size: 26px; }
  .tablecard { overflow-x: auto; }
}

/* ===== Team TV dashboard (Sales + Production boards) ===== */
body.tv { background: var(--black); }
.tv-wrap { max-width: 1600px; margin: 0 auto; padding: 20px 28px 40px; }
.tv-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 8px 0 20px; border-bottom: 2px solid var(--orange); margin-bottom: 24px; }
.tv-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; text-transform: uppercase; font-size: clamp(28px, 3.2vw, 46px); line-height: 1; letter-spacing: .5px; }
.tv-tabs { display: flex; gap: 8px; }
.tv-tab { padding: 8px 18px; border-radius: 999px; background: var(--panel2); color: var(--muted2); font-weight: 700; font-size: clamp(14px, 1.3vw, 18px); border: 1px solid var(--border2); }
.tv-tab.active { background: var(--orange); color: #1a1200; border-color: var(--orange); }
.tv-meta { margin-left: auto; color: var(--muted); font-size: clamp(12px, 1.1vw, 15px); text-align: right; }
.tv-meta a { color: var(--orange); font-size: 1.2em; text-decoration: none; }
@keyframes tv-spin { to { transform: rotate(360deg); } }
.tv-meta a.spinning { display: inline-block; animation: tv-spin 0.9s linear infinite; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 22px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.tile.hero { grid-column: span 2; }
.tile.good { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.tile.bad { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.tile-label { font-size: clamp(12px, 1.2vw, 15px); text-transform: uppercase; letter-spacing: .5px; color: var(--muted2); font-weight: 700; }
.tile-value { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: clamp(40px, 5.5vw, 76px); line-height: .95; }
.tile-value.g { color: var(--green); } .tile-value.r { color: var(--red); } .tile-value.o { color: var(--orange); }
.tile-sub { font-size: clamp(13px, 1.2vw, 16px); color: var(--muted2); }
.goalbar { height: 10px; border-radius: 999px; background: var(--black); overflow: hidden; margin-top: 6px; }
.goalbar-fill { height: 100%; border-radius: 999px; transition: width .4s; }

.tv-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .tv-cols { grid-template-columns: 1fr; } .tile.hero { grid-column: span 1; } }
.tv-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px 22px; }
.tv-card h3 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; text-transform: uppercase; font-size: clamp(18px, 1.8vw, 24px); margin-bottom: 12px; color: var(--text); }
.lb-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.lb-row:first-of-type { border-top: none; }
.lb-rank { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: clamp(20px, 2vw, 28px); color: var(--orange); }
.lb-name { font-weight: 700; font-size: clamp(16px, 1.5vw, 21px); }
.lb-sub { color: var(--muted); font-size: clamp(12px, 1.1vw, 14px); }
.lb-val { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: clamp(20px, 2.2vw, 30px); text-align: right; }
.big-order { font-size: clamp(26px, 3.2vw, 44px); font-family: 'Barlow Condensed', sans-serif; font-weight: 700; color: var(--orange); line-height: 1; }
.q-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.q-row:first-of-type { border-top: none; }
.q-left { display: flex; align-items: center; gap: 10px; font-size: clamp(15px, 1.5vw, 20px); font-weight: 600; }
.q-count { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: clamp(22px, 2.4vw, 34px); min-width: 46px; text-align: right; }
.q-val { color: var(--muted2); font-size: clamp(14px, 1.4vw, 19px); font-weight: 700; }
.tv-empty { text-align: center; padding: 80px 20px; color: var(--muted2); font-size: 20px; }

/* dashboard chart + design column */
.tv-chart { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 18px; margin-bottom: 8px; font-size: clamp(12px, 1.2vw, 15px); color: var(--muted2); }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.lg::before { content: ""; width: 22px; height: 4px; border-radius: 2px; }
.lg-ty::before { background: var(--orange); }
.lg-ly::before { background: #666; }
.chart-x { display: flex; justify-content: space-between; margin-top: 4px; color: var(--muted); font-size: clamp(11px, 1.1vw, 14px); font-weight: 600; }
.tv-col-stack { display: flex; flex-direction: column; gap: 16px; }

/* production burn-up bar */
.burn { position: relative; height: 42px; border-radius: 10px; background: var(--black); border: 1px solid var(--border2); overflow: hidden; margin: 4px 0 12px; }
.burn-fill { height: 100%; transition: width .5s ease; }
.burn-pace { position: absolute; top: 0; bottom: 0; width: 3px; background: rgba(255,255,255,.85); box-shadow: 0 0 4px rgba(0,0,0,.6); }
.burn-legend { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; font-size: clamp(14px, 1.4vw, 19px); color: var(--muted2); }
.burn-num { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 1.35em; color: var(--text); }
.burn-num.g { color: var(--green); }
.burn-legend .g { color: var(--green); font-weight: 700; }
.burn-legend .r { color: var(--red); font-weight: 700; }
.burn-dim { color: var(--muted); margin-left: auto; }

/* app links in the TV header (cohesive nav back to the tool pages) */
.tv-nav-sep { width: 1px; align-self: stretch; background: var(--border2); margin: 0 4px; }
.tv-link { padding: 8px 14px; border-radius: 999px; color: var(--muted2); font-weight: 600; font-size: clamp(13px, 1.1vw, 16px); text-decoration: none; }
.tv-link:hover { color: var(--text); background: var(--panel2); }

/* chart hover tooltip */
.chart-hit { cursor: pointer; }
.chart-tip { position: absolute; transform: translate(-50%, -128%); pointer-events: none; z-index: 10;
  background: #0c0c0c; border: 1px solid var(--border2); border-radius: 10px; padding: 8px 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.55); white-space: nowrap; }
.chart-tip[hidden] { display: none; }
.tip-day { color: var(--muted2); font-size: 13px; font-weight: 600; }
.tip-val { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 26px; line-height: 1.05; }
.tip-sub { color: var(--muted); font-size: 12px; }

.range-chart { width: 100%; height: auto; display: block; }

/* ---- Schedule tuner ---- */
.tuner .legend em { color: #f0c987; font-style: normal; }
.tuner-readout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 14px 0 6px; }
.tuner-metric { background: var(--panel2); border: 1px solid var(--border2); border-radius: 10px; padding: 12px 14px; }
.tuner-metric .stat-label { display: block; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.tuner-metric .stat-value { display: block; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 34px; line-height: 1.1; margin: 2px 0; }
.tuner-metric .stat-sub { color: var(--muted); font-size: 12.5px; }
.tuner-global { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 14px 0 10px; padding: 10px 12px; background: var(--panel2); border-radius: 8px; }
.tuner-glabel { font-weight: 600; }
.tuner-gnote { color: var(--muted); font-size: 13px; }
.tuner-stepper { display: inline-flex; align-items: center; gap: 0; }
.tuner-stepper button { width: 30px; height: 32px; border: 1px solid var(--border2); background: #232323; color: var(--orange); font-size: 18px; font-weight: 700; cursor: pointer; line-height: 1; }
.tuner-stepper button:first-child { border-radius: 7px 0 0 7px; }
.tuner-stepper button:last-child { border-radius: 0 7px 7px 0; }
.tuner-stepper button:hover { background: #2e2e2e; }
.tuner-stepper input { width: 58px; height: 32px; text-align: center; border: 1px solid var(--border2); border-left: 0; border-right: 0; background: #0e0e0e; color: #fff; font-size: 15px; font-weight: 700; }
.tuner-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.tuner-table th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--border2); }
.tuner-table th.r { text-align: right; } .tuner-table th.c { text-align: center; }
.tuner-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tuner-table td.r { text-align: right; } .tuner-table td.c { text-align: center; }
.tuner-table td.l { font-weight: 600; }
.tbar { display: inline-block; width: 120px; height: 8px; background: #222; border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.tbar-fill { display: block; height: 100%; border-radius: 4px; }
.tpct { font-weight: 700; font-size: 14px; }
.tuner-actions { display: flex; gap: 12px; margin-top: 16px; }
@media (max-width: 640px) { .tuner-readout { grid-template-columns: 1fr; } .tbar { width: 70px; } }
