/* GENERATED — do not edit.
 *
 * Produced by tools/gen-soout.js from the reference dashboard. Change the generator and
 * re-run; an edit made here is lost on the next run and, worse, makes the port disagree
 * with the file it is supposed to be a copy of.
 *
 * The reference's own stylesheet, page frame dropped and every selector scoped to .so-scope.
 * See tools/gen-poout.js for why the token block sits on the scope rather than on :root.
 */
.so-scope {
  --surface-1:      #fcfcfb;
  --page-plane:     #f9f9f7;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --gridline:       #e1e0d9;
  --baseline:       #c3c2b7;
  --border:         rgba(11,11,11,0.10);
  --series-1: #2a78d6; /* blue */
  --series-2: #eb6834; /* orange */
  --series-3: #1baf7a; /* aqua */
  --series-4: #eda100; /* yellow */
  --series-1-wash: rgba(42,120,214,0.10);
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;
  --success-text: #006300;
}

:root[data-theme="dark"] .so-scope,
:root[data-theme="midnight"] .so-scope,
:root[data-theme="ocean"] .so-scope,
:root[data-theme="aurora"] .so-scope {
  --surface-1:      #1a1a19;
  --page-plane:     #0d0d0d;
  --text-primary:   #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted:     #898781;
  --gridline:       #2c2c2a;
  --baseline:       #383835;
  --border:         rgba(255,255,255,0.10);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-1-wash: rgba(57,135,229,0.14);
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;
  --success-text: #0ca30c;
}

.so-scope .tp-inner { display:flex; flex-direction:column; gap:16px; }
.so-scope { color:var(--text-primary); }

.so-scope header.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
.so-scope .card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
  }
.so-scope .card + .card { margin-top: 16px; }
.so-scope .card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
  }
.so-scope .card-title {
    font-size: 14.5px;
    font-weight: 650;
    margin: 0;
  }
.so-scope .card-note {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
  }
.so-scope /* KPI tiles */
  .kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
  }
@media (max-width: 860px) {
  .so-scope .kpi-row { grid-template-columns: repeat(2, 1fr); }
}
.so-scope .kpi-tile {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
  }
.so-scope .kpi-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 8px;
  }
.so-scope .kpi-value {
    font-size: 26px;
    font-weight: 650;
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin: 0;
  }
.so-scope .kpi-sub {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
  }
.so-scope .kpi-delta { font-weight: 600; }
.so-scope .kpi-delta.down { color: var(--success-text); }
.so-scope .kpi-delta.up { color: var(--status-critical); }
.so-scope /* Filter row */
  .filter-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }
.so-scope .filter-btn {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12.5px;
    cursor: pointer;
  }
.so-scope .filter-btn.active {
    background: var(--series-1);
    border-color: var(--series-1);
    color: #fff;
    font-weight: 600;
  }
.so-scope .filter-btn:hover:not(.active) { color: var(--text-primary); }
.so-scope svg text { font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", sans-serif; }
.so-scope .axis-label { fill: var(--text-muted); font-size: 11px; }
.so-scope .grid-line { stroke: var(--gridline); stroke-width: 1; }
.so-scope .baseline-line { stroke: var(--baseline); stroke-width: 1; }
.so-scope .chart-shell { position: relative; width: 100%; }
.so-scope .tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.16);
    opacity: 0;
    transition: opacity 0.08s ease;
    z-index: 5;
    min-width: 150px;
  }
.so-scope .tooltip.show { opacity: 1; }
.so-scope .tooltip .tt-date {
    font-weight: 650;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-size: 12.5px;
  }
.so-scope .tooltip .tt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 3px;
  }
.so-scope .tooltip .tt-key {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
  }
.so-scope .tooltip .tt-swatch {
    width: 10px; height: 2px;
    border-radius: 2px;
    display: inline-block;
  }
.so-scope .tooltip .tt-val {
    font-weight: 650;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
  }
.so-scope .legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-top: 10px;
  }
.so-scope .legend-item { display: flex; align-items: center; gap: 6px; }
.so-scope .legend-swatch-line { width: 14px; height: 2px; border-radius: 2px; }
.so-scope .legend-swatch-box { width: 10px; height: 10px; border-radius: 2px; }
.so-scope .two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
@media (max-width: 860px) {
  .so-scope .two-col { grid-template-columns: 1fr; }
}
.so-scope .hbar-row {
    display: grid;
    grid-template-columns: 92px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
  }
.so-scope .hbar-name {
    font-size: 12.5px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
.so-scope .hbar-track {
    background: var(--gridline);
    border-radius: 4px;
    height: 16px;
    position: relative;
    overflow: hidden;
  }
.so-scope .hbar-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    border-radius: 4px;
    transition: filter 0.1s ease;
  }
.so-scope .hbar-fill:hover { filter: brightness(1.08); }
.so-scope .hbar-val {
    font-size: 12.5px;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    white-space: nowrap;
  }
.so-scope .status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 0;
  }
.so-scope .status-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.so-scope table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
  }
.so-scope table.data-table th {
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0 10px 8px;
    border-bottom: 1px solid var(--gridline);
    white-space: nowrap;
  }
.so-scope table.data-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--gridline);
    color: var(--text-secondary);
    white-space: nowrap;
  }
.so-scope table.data-table td.strong { color: var(--text-primary); font-weight: 600; }
.so-scope table.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.so-scope table.data-table tr:last-child td { border-bottom: none; }
.so-scope table.data-table tbody tr:hover td { background: var(--gridline); }
.so-scope .table-scroll { overflow-x: auto; }
.so-scope .daily-table-scroll { max-height: 460px; overflow-y: auto; border-radius: 8px; }
.so-scope table.data-table th[data-key] {
    cursor: pointer;
    user-select: none;
    position: sticky;
    top: 0;
    background: var(--surface-1);
    white-space: nowrap;
  }
.so-scope table.data-table th[data-key]:hover { color: var(--text-secondary); }
.so-scope table.data-table th[data-key] .sort-arrow {
    display: inline-block;
    margin-left: 3px;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.5;
  }
.so-scope table.data-table th[data-key].sorted .sort-arrow { color: var(--series-1); opacity: 1; }
.so-scope table.data-table td.num.positive { color: var(--success-text); }
.so-scope table.data-table td.num.negative { color: var(--status-critical); }
.so-scope .material-search {
    border: 1px solid var(--border);
    background: var(--surface-1);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 12.5px;
    min-width: 220px;
    outline: none;
  }
.so-scope .material-search:focus { border-color: var(--series-1); }
.so-scope .material-search::placeholder { color: var(--text-muted); }
.so-scope table.material-table tbody tr.mat-row { cursor: pointer; }
.so-scope table.material-table tbody tr.mat-row:hover td { background: var(--gridline); }
.so-scope table.material-table td.mat-code-cell { display: flex; flex-direction: column; gap: 2px; }
.so-scope table.material-table .mat-code { color: var(--text-primary); font-weight: 650; }
.so-scope table.material-table .mat-name { color: var(--text-muted); font-size: 11.5px; }
.so-scope .mat-chevron {
    display: inline-block;
    color: var(--text-muted);
    font-size: 10px;
    transition: transform 0.12s ease;
    transform-origin: 50% 50%;
  }
.so-scope .mat-chevron.open { transform: rotate(90deg); color: var(--series-1); }
.so-scope tr.mat-detail-row td {
    padding: 0;
    background: var(--page-plane);
  }
.so-scope .mat-ledger-wrap { padding: 4px 10px 12px 40px; overflow-x: auto; }
.so-scope table.mat-ledger {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    font-size: 12px;
  }
.so-scope table.mat-ledger th {
    text-align: right;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--gridline);
    white-space: nowrap;
  }
.so-scope table.mat-ledger th:first-child,
.so-scope table.mat-ledger th:nth-child(2),
.so-scope table.mat-ledger th:nth-child(3) { text-align: left; }
.so-scope table.mat-ledger td {
    padding: 5px 8px;
    text-align: right;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    border-bottom: 1px solid var(--gridline);
    white-space: nowrap;
  }
.so-scope table.mat-ledger td:first-child { text-align: left; color: var(--text-primary); font-weight: 600; }
.so-scope table.mat-ledger td.num.strong { color: var(--text-primary); font-weight: 650; }
.so-scope table.mat-ledger tr:last-child td { border-bottom: none; }
.so-scope .mat-empty-note { padding: 10px 8px; color: var(--text-muted); font-size: 12px; }
.so-scope .mat-type-chip {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 650;
    padding: 2px 8px;
    border-radius: 999px;
  }
.so-scope .mat-type-so { background: rgba(12,163,12,0.14); color: var(--success-text); }
.so-scope .mat-type-do { background: rgba(208,59,59,0.14); color: var(--status-critical); }
.so-scope .mat-doc-no { color: var(--text-primary); font-weight: 550; text-align: left; }
.so-scope .foot-note {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-top: 6px;
  }
.so-scope .foot-note b { color: var(--text-secondary); }
@media (max-width: 600px) {
  .so-scope .kpi-value { font-size: 21px; }
  .so-scope .hbar-row { grid-template-columns: 74px 1fr auto; }
}

@media (max-width: 991.98px) {
  .so-scope .chart-shell { overflow-x:auto; }
  .so-scope .chart-shell > svg { min-width: 560px; }
  .so-scope .kpi-row { grid-template-columns: repeat(2, 1fr); }
}
