/* Status board template: header + live clock, four tiles, card grid (Total / Live / NG chart per card).
   Used by every dashboard level: Dashboard > Unit > Machine > Model > Result. */
:root {
  --sb-ink: #12263f; --sb-muted: #5b6b80; --sb-faint: #8a97a8; --sb-line: #e3e8f0; --sb-bg: #fafbfe;
  --sb-ok: #0e7c5a; --sb-ok-bg: #e6f5ef; --sb-ng: #c72a1c; --sb-ng-bg: #fdecea;
  --sb-due: #d98e04; --sb-due-text: #9a5b00; --sb-due-bg: #fff4dd; --sb-none: #64748b; --sb-none-bg: #eef1f6; --sb-blue: #2f6fed;
  --sb-shadow: 0 1px 2px rgba(18, 38, 63, .06), 0 1px 3px rgba(18, 38, 63, .04);
}
* { box-sizing: border-box; }
body.sb { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--sb-bg); color: var(--sb-ink);
  font-family: 'Product Sans', 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: 14.4px; line-height: 1.5; }
:where(.sb a) { color: inherit; }

/* top bar */
.sb-nav { height: 70px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; background: #fff; box-shadow: 0 0 35px rgba(154, 161, 171, .15); }
.sb-nav__brand { font-size: 18px; color: #919ca7; text-decoration: none; letter-spacing: .2px; }
.sb-nav__links a { margin-left: 18px; font-size: 13px; color: var(--sb-muted); text-decoration: none; }
.sb-nav__links a:hover { color: var(--sb-ink); }
.sb-page { width: 100%; max-width: 1360px; margin: 0 auto; padding: 24px 48px 56px; flex: 1; }

/* header */
.sb-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 24px; }
.sb-eyebrow { display: block; margin-bottom: 4.8px; font-size: 11px; font-weight: 600; line-height: 16.5px; letter-spacing: .99px; text-transform: uppercase; color: var(--sb-faint); }
.sb-title { margin: 0; font-size: 26px; font-weight: 600; line-height: 31.2px; letter-spacing: -.26px; }
.sb-title a { text-decoration: none; color: var(--sb-ink); }
.sb-title a:hover { text-decoration: underline; }
.sb-title__sep { margin: 0 8px; font-weight: 400; color: var(--sb-faint); }
.sb-meta { display: flex; align-items: center; gap: 18px; }
.sb-live { display: inline-flex; align-items: center; gap: 7.2px; padding: 4.8px 10.4px; font-size: 12px; font-weight: 600; line-height: 18px; color: var(--sb-muted); background: #fff; border: 1px solid var(--sb-line); border-radius: 999px; }
.sb-live__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sb-ok); box-shadow: 0 0 0 1.66px rgba(14, 124, 90, .365); animation: sb-pulse 2.4s infinite; }
@keyframes sb-pulse { 50% { box-shadow: 0 0 0 4px rgba(14, 124, 90, .12); } }
.sb-clock { display: flex; flex-direction: column; text-align: right; }
.sb-clock__date { font-size: 13px; line-height: 17.55px; color: var(--sb-muted); }
.sb-clock__time { font-size: 20px; font-weight: 600; line-height: 27px; letter-spacing: .2px; white-space: nowrap; }

/* tiles */
.sb-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.sb-kpi { display: flex; align-items: center; gap: 16px; min-width: 0; padding: 18px 20px; background: #fff; border: 1px solid var(--sb-line); border-radius: 10px; box-shadow: var(--sb-shadow); }
.sb-kpi__label { display: block; margin-bottom: 3.2px; font-size: 12px; font-weight: 600; line-height: 18px; letter-spacing: .6px; text-transform: uppercase; color: var(--sb-muted); }
.sb-kpi__value { display: block; font-size: 32px; font-weight: 600; line-height: 35.2px; letter-spacing: -.64px; }
.sb-kpi__hint { display: block; margin-top: 2.4px; font-size: 12px; line-height: 18px; color: var(--sb-faint); }
.sb-kpi--ok .sb-kpi__value { color: var(--sb-ok); }
.sb-kpi--muted .sb-kpi__value { color: var(--sb-none); }
.sb-kpi--ng .sb-kpi__value { color: var(--sb-ng); }
.sb-kpi--due .sb-kpi__value { color: var(--sb-due-text); }
.sb-kpi__ring { flex: none; width: 64px; height: 64px; transform: rotate(-90deg); }
.sb-kpi__ring-track { fill: none; stroke: #e8edf4; stroke-width: 6; }
.sb-kpi__ring-value { fill: none; stroke: var(--sb-ok); stroke-width: 6; stroke-linecap: round; }
.sb-kpi__ring-text { transform: rotate(90deg); transform-origin: 32px 32px; font-size: 13px; font-weight: 600; text-anchor: middle; dominant-baseline: central; fill: var(--sb-ink); }
.sb-kpi__ring--ng .sb-kpi__ring-value { stroke: var(--sb-ng); } .sb-kpi__ring--due .sb-kpi__ring-value { stroke: var(--sb-due); }

/* section + cards */
.sb-section-title { margin: 0 0 12px; font-size: 12px; font-weight: 600; line-height: 13.2px; letter-spacing: .96px; text-transform: uppercase; color: var(--sb-faint); }
.sb-section-gap { margin-top: 28px; }
.sb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sb-card { --accent: var(--sb-ok); position: relative; display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--sb-line); border-radius: 10px; box-shadow: var(--sb-shadow); transition: box-shadow .15s, transform .15s; }
.sb-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); }
.sb-card--ng { --accent: var(--sb-ng); } .sb-card--due { --accent: var(--sb-due); } .sb-card--none { --accent: #cbd5e1; }
.sb-card:hover { box-shadow: 0 4px 14px rgba(18, 38, 63, .10); transform: translateY(-1px); }
.sb-card__body { display: block; flex: 1; padding: 20px 20px 18px; color: var(--sb-ink); text-decoration: none; }
.sb-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.sb-card__name { display: block; font-size: 17px; font-weight: 600; line-height: 22.1px; letter-spacing: -.085px; }
.sb-card__sub { display: block; font-size: 12px; line-height: 16px; color: var(--sb-faint); }
.sb-pill { display: inline-flex; align-items: center; gap: 5.6px; flex: none; padding: 3.2px 8.8px; font-size: 11px; font-weight: 600; line-height: 16.5px; white-space: nowrap; color: var(--sb-ok); background: var(--sb-ok-bg); border-radius: 999px; }
.sb-pill__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sb-pill--ng { color: var(--sb-ng); background: var(--sb-ng-bg); }
.sb-pill--due { color: var(--sb-due-text); background: var(--sb-due-bg); }
.sb-pill--none { color: var(--sb-none); background: var(--sb-none-bg); }
.sb-card__headline { display: flex; align-items: baseline; gap: 6.4px; margin-bottom: 9.6px; }
.sb-card__pct { font-size: 36px; font-weight: 600; line-height: 36px; letter-spacing: -1.08px; }
.sb-card__pct-sign { margin-left: .9px; font-size: 18px; color: var(--sb-muted); }
.sb-card__pct-label { font-size: 13px; line-height: 19.5px; color: var(--sb-muted); }
.sb-chart { min-height: 150px; margin: 4px -8px 8px; }
.sb-metrics { display: grid; grid-template-columns: repeat(3, 1fr); padding-top: 14px; border-top: 1px solid var(--sb-line); text-align: center; }
.sb-metric { padding: 0 4px; }
.sb-metric + .sb-metric { border-left: 1px solid var(--sb-line); }
.sb-metric__value { display: block; font-size: 18px; font-weight: 600; line-height: 21.6px; }
.sb-metric__value--ok { color: var(--sb-ok); } .sb-metric__value--ng { color: var(--sb-ng); } .sb-metric__value--zero { color: var(--sb-faint); }
.sb-metric__label { display: block; margin-top: 2.4px; font-size: 11px; font-weight: 500; line-height: 16.5px; letter-spacing: .44px; text-transform: uppercase; color: var(--sb-faint); }
.sb-empty { padding: 4px 0 12px; font-size: 13px; color: var(--sb-faint); }

/* panels (details levels) */
.sb-panel { margin-bottom: 16px; overflow: hidden; background: #fff; border: 1px solid var(--sb-line); border-radius: 10px; box-shadow: var(--sb-shadow); }
.sb-panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--sb-line); }
.sb-panel__title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.085px; }
.sb-panel__sub { font-size: 12px; color: var(--sb-faint); }
.sb-verdict { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--sb-line); background: #fcfdff; }
.sb-verdict__mark { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 600; }
.sb-verdict__mark i { font-size: 30px; } .sb-verdict--ok .sb-verdict__mark { color: var(--sb-ok); } .sb-verdict--ng .sb-verdict__mark { color: var(--sb-ng); }
.sb-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 24px; margin: 0; flex: 1; }
.sb-facts dt { font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--sb-faint); }
.sb-facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.sb-facts .sb-muted { display: block; font-weight: 400; font-size: 12px; }
.sb-muted { color: var(--sb-faint); }
.sb-text-ng { color: var(--sb-ng); font-weight: 600; }
.sb-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px; font-size: 12.5px; color: var(--sb-faint); }
.sb-switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--sb-muted); }
.sb-table-wrap { overflow-x: auto; }
.sb-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.sb-table th { padding: 10px 14px; font-size: 11px; font-weight: 600; letter-spacing: .6px; text-align: left; text-transform: uppercase; color: var(--sb-faint); border-bottom: 1px solid var(--sb-line); }
.sb-table td { padding: 11px 14px; border-bottom: 1px solid #f0f3f8; color: #3b4d66; }
.sb-table tbody tr:last-child td { border-bottom: 0; }
.sb-table .is-num { text-align: right; }
.sb-table tr.is-ng td { background: #fff6f5; }
.sb-table a { color: var(--sb-blue); text-decoration: none; font-weight: 600; }
.sb-section-note { margin: 0 0 12px; font-size: 12.5px; color: var(--sb-faint); }
.sb-note-empty { padding: 18px 20px; color: var(--sb-faint); }

/* footer */
.sb-footer { padding: 19px 24px 20px; font-size: 14.4px; color: #98a6ad; }
.sb-footer a { text-decoration: none; color: #98a6ad; } .sb-footer a:hover { color: var(--sb-ink); }
.sb-footer__sep { margin: 0 8px; }

[hidden] { display: none !important; }
@media (max-width: 900px) { .sb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sb-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .sb-grid { grid-template-columns: 1fr; } .sb-header { flex-direction: column; align-items: flex-start; } .sb-page { padding: 16px 14px 40px; } }
@media (prefers-reduced-motion: reduce) { .sb-card, .sb-live__dot { transition: none; animation: none; } }
