/* ==========================================================================
   Scoraline Design System v2 — Borderless Fintech UI Components
   Zero card borders · Zero box-in-box nesting · Strict >= 15px · 400 body
   ========================================================================== */

/* ── Bold Flat Crimson Icons (Tier 1) & Micro-Icons (Tier 2) ─────────────── */
/* TT Commons optical cap-height sits ~2px above em-box center: lift inline icons by -2px */
.sw-ic {
  position: relative;
  top: -2px;
  display: inline-block;
  flex: none;
  vertical-align: middle;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.card-head .sw-ic,
.dk-icon-tile .sw-ic,
.sw-empty .sw-ic {
  top: 0;
}

.sw-ic--nav { width: 22px; height: 22px; }
.sw-ic--sm  { width: 22px; height: 22px; }
.sw-ic--md  { width: 28px; height: 28px; }
.sw-ic--hd  { width: 28px; height: 28px; }
.sw-ic--kpi { width: 32px; height: 32px; }
.sw-ic--lg  { width: 38px; height: 38px; }

.sw-ic-ui {
  position: relative;
  top: -1.5px;
  display: inline-block;
  width: 17px;
  height: 17px;
  flex: none;
  vertical-align: middle;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Borderless Tactile Buttons (Surface-aware: white on canvas, slate inside white cards) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px 8px;
  border-radius: 12px;
  border: 0;
  background: var(--sw-surface);
  color: var(--sw-ink);
  box-shadow: 0 1px 3px rgba(17, 22, 29, 0.08), 0 4px 12px rgba(17, 22, 29, 0.04);
  font-family: var(--sw-font);
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: 1.25;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.14s ease;
}

.btn:hover {
  background: #F8FAFC;
  color: var(--sw-ink);
  box-shadow: 0 2px 6px rgba(17, 22, 29, 0.11), 0 6px 16px rgba(17, 22, 29, 0.06);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
}

.panel-box .btn:not(.primary):not(.save):not(.dark):not(.red):not(.grn):not(.ghost),
.crm-pane .btn:not(.primary):not(.save):not(.dark):not(.red):not(.grn):not(.ghost),
.modal .btn:not(.primary):not(.save):not(.dark):not(.red):not(.grn):not(.ghost),
.card .btn:not(.primary):not(.save):not(.dark):not(.red):not(.grn):not(.ghost),
.kt-sub-card .btn:not(.primary):not(.save):not(.dark):not(.red):not(.grn):not(.ghost) {
  background: #E4EAF2;
  color: var(--sw-ink);
  box-shadow: 0 1px 2px rgba(17, 22, 29, 0.08);
}

.panel-box .btn:not(.primary):not(.save):not(.dark):not(.red):not(.grn):not(.ghost):hover,
.crm-pane .btn:not(.primary):not(.save):not(.dark):not(.red):not(.grn):not(.ghost):hover,
.modal .btn:not(.primary):not(.save):not(.dark):not(.red):not(.grn):not(.ghost):hover,
.card .btn:not(.primary):not(.save):not(.dark):not(.red):not(.grn):not(.ghost):hover,
.kt-sub-card .btn:not(.primary):not(.save):not(.dark):not(.red):not(.grn):not(.ghost):hover {
  background: #D7E0EC;
  box-shadow: 0 2px 5px rgba(17, 22, 29, 0.11);
}

.btn.sm {
  min-height: 36px;
  padding: 7px 14px 5px;
  font-size: var(--fs-xs);
  border-radius: 10px;
}

.btn.primary,
.btn.save {
  background: var(--sw-brand);
  color: var(--sw-ink-inv);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(192, 30, 30, 0.22);
}

.btn.primary:hover,
.btn.save:hover {
  background: var(--sw-brand-hover);
  color: var(--sw-ink-inv);
  box-shadow: 0 4px 12px rgba(192, 30, 30, 0.28);
}

.btn.dark {
  background: var(--sw-ink);
  color: var(--sw-ink-inv);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(17, 22, 29, 0.18);
}

.btn.dark:hover {
  background: #232C37;
  color: var(--sw-ink-inv);
  box-shadow: 0 4px 12px rgba(17, 22, 29, 0.24);
}

.btn.red {
  color: var(--sw-err);
  background: var(--sw-err-bg);
  box-shadow: none;
}

.btn.red:hover {
  background: #FADADA;
  color: var(--sw-err);
  box-shadow: none;
}

.btn.grn {
  color: var(--sw-ok);
  background: var(--sw-ok-bg);
  box-shadow: none;
}

.btn.grn:hover {
  background: #D6F0DF;
  color: var(--sw-ok);
  box-shadow: none;
}

.btn.ghost {
  background: transparent;
  color: var(--sw-ink-2);
  box-shadow: none;
}

.btn.ghost:hover {
  background: var(--sw-surface-2);
  color: var(--sw-ink);
  box-shadow: none;
  transform: none;
}

.btn:disabled,
.btn:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

button:focus-visible,
summary:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--sw-info);
  outline-offset: 2px;
}

/* ── Borderless Soft-Fill Inputs, Selects & Textareas ────────────────────── */
input.s,
.sw-input,
.sw-select,
.sw-textarea,
.fg input:not([type="checkbox"]):not([type="radio"]),
.fg select,
.admin-tools input,
.admin-tools select {
  min-height: 44px;
  padding: 10px 15px;
  background-color: #F1F4F9;
  box-shadow: inset 0 1px 2px rgba(17, 22, 29, 0.065);
  border: 0;
  border-radius: 12px;
  color: var(--sw-ink);
  font-family: var(--sw-font);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.35;
  transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

select,
.sw-select,
.fg select,
.admin-tools select {
  cursor: pointer;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3.25 5.25L7 9L10.75 5.25' stroke='%23556070' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
}

select::picker-icon {
  display: none !important;
}

.admin-tools input,
.admin-tools select {
  background-color: var(--sw-surface);
  box-shadow: 0 1px 3px rgba(17, 22, 29, 0.06);
}

.panel-box .admin-tools input,
.panel-box .admin-tools select {
  background-color: #F1F4F9;
  box-shadow: inset 0 1px 2px rgba(17, 22, 29, 0.065);
}

.fg input[type="checkbox"],
.fg input[type="radio"] {
  width: 18px !important;
  height: 18px;
  min-height: 0;
  padding: 0;
  margin: 0;
  flex: none;
  accent-color: var(--sw-brand);
  cursor: pointer;
}

.fg label:has(> input[type="checkbox"]),
.fg label:has(> input[type="radio"]) {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--sw-ink);
  font-size: var(--fs-base);
  font-weight: 400;
}

input.s:focus,
.sw-input:focus,
.sw-select:focus,
.sw-textarea:focus,
.fg input:not([type="checkbox"]):not([type="radio"]):focus,
.fg select:focus,
.admin-tools input:focus,
.admin-tools select:focus {
  outline: none;
  background-color: var(--sw-surface);
  box-shadow: var(--focus-ring);
}

input::placeholder,
textarea::placeholder {
  color: var(--sw-ink-3);
  opacity: 0.78;
}

/* ── Segmented Controls & Pill Chips (White tray + soft-gray active pill on canvas) ── */
.seg,
.bc-modes {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--sw-surface);
  box-shadow: 0 1px 3px rgba(17, 22, 29, 0.07), 0 4px 12px rgba(17, 22, 29, 0.035);
  border: 0;
  flex-wrap: wrap;
}

.seg button,
.bc-modes button {
  border: 0;
  background: transparent;
  color: var(--sw-ink-3);
  padding: 9px 16px 7px;
  min-height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--sw-font);
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: 1.25;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.seg button:hover,
.bc-modes button:hover {
  color: var(--sw-ink);
  background: var(--sw-canvas);
}

.seg button.on,
.bc-modes button.on {
  background: #E4EAF2;
  color: var(--sw-ink);
  font-weight: 600;
  box-shadow: none;
}

/* Inverted polarity inside white cards (gray tray + crisp white active pill) */
.panel-box .seg,
.panel-box .bc-modes,
.modal .seg {
  background: var(--sw-surface-2);
  box-shadow: none;
}

.panel-box .seg button.on,
.panel-box .bc-modes button.on,
.modal .seg button.on {
  background: var(--sw-surface);
  color: var(--sw-ink);
  box-shadow: var(--shadow-xs);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 16px 6px;
  border-radius: var(--r-pill);
  border: 0;
  background: var(--sw-surface);
  color: var(--sw-ink-2);
  box-shadow: 0 1px 3px rgba(17, 22, 29, 0.06);
  font-family: var(--sw-font);
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: 1.25;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.14s ease;
}

.panel-box .chip,
.modal .chip,
.crm-pane .chip {
  background: #FFFFFF;
  color: var(--sw-ink);
  box-shadow: 0 1px 3px rgba(17, 22, 29, 0.12), 0 2px 6px rgba(17, 22, 29, 0.04);
}

.chip:hover {
  background: #E4EAF2;
  color: var(--sw-ink);
  transform: translateY(-1px);
}

.panel-box .chip:hover,
.modal .chip:hover,
.crm-pane .chip:hover {
  background: var(--sw-brand-bg);
  color: var(--sw-brand);
  box-shadow: 0 2px 6px rgba(192, 30, 30, 0.12);
}

.chip.on {
  background: var(--sw-brand-bg);
  color: var(--sw-brand);
  font-weight: 600;
  box-shadow: none;
}

.cs-states .chip.on,
.crm-chips .chip.on {
  background: var(--sw-ink);
  color: var(--sw-ink-inv);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(17, 22, 29, 0.18);
}

/* ── Section Headings & Flat Filter Bar (No box wrapper!) ────────────────── */
.admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.admin-heading h2 {
  margin: 0;
  font-size: var(--fs-xl);
  line-height: var(--lh-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--sw-ink);
}

.admin-heading p {
  margin: 4px 0 0;
  color: var(--sw-ink-3);
  font-size: var(--fs-base);
  font-weight: 400;
}

.admin-heading .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  flex: none;
}

.sw-sec-title {
  margin: 24px 0 12px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--sw-ink);
  letter-spacing: -0.01em;
}

.admin-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 0;
  margin: 0 0 16px;
  background: transparent;
  border: 0;
}

.admin-tools input {
  flex: 1 1 240px;
  min-width: 200px;
}

.admin-tools select {
  flex: 0 1 auto;
}

/* ── Flat Borderless White Surfaces on #F3F5F8 Canvas (Zero Nesting!) ────── */
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.cards.cards-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cards.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  position: relative;
  background: var(--sw-surface);
  border: 0;
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.card .k {
  color: var(--sw-ink-3);
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: 1.35;
}

.card .v {
  font-size: var(--fs-kpi);
  font-weight: 600;
  margin-top: 8px;
  letter-spacing: -0.02em;
  line-height: var(--lh-kpi);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--sw-ink);
}

.card .v.ok  { color: var(--sw-ok); font-weight: 600; }
.card .v.hi  { color: var(--sw-err); font-weight: 600; }
.card .v.amb { color: var(--sw-warn); font-weight: 600; }

.card .v.v-md {
  font-size: 22px;
  line-height: 1.25;
}

.card .v small {
  font-size: var(--fs-xs);
  color: var(--sw-ink-3);
  font-weight: 400;
  letter-spacing: 0;
  line-height: var(--lh-xs);
  display: block;
  margin-top: 6px;
}

.card .v small.sw-sub-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.panel-box,
main .box {
  background: var(--sw-surface);
  border: 0;
  border-radius: var(--r-lg);
  padding: 22px 26px;
  margin-bottom: 20px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.panel-box h3,
main .box h3 {
  margin: 0 0 16px;
  font-size: var(--fs-md);
  line-height: var(--lh-md);
  color: var(--sw-ink);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ── Unified Borderless Tables (Subtle row hairlines only) ───────────────── */
.admin-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.45;
  color: var(--sw-ink);
}

th,
td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--sw-divider);
  white-space: nowrap;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

th {
  color: var(--sw-ink-3);
  font-weight: 400;
  font-size: var(--fs-xs);
  line-height: 1.35;
  background: transparent;
  border-bottom: 1px solid var(--sw-divider-strong);
}

th.num,
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
}

td.wrap,
th.wrap {
  white-space: normal;
}

tbody tr {
  transition: background-color 0.12s ease;
}

tbody tr:hover {
  background: var(--sw-surface-hover);
}

.admin-table th,
.admin-table td {
  text-align: left;
  white-space: normal;
  vertical-align: top;
  padding: 14px 14px;
}

.admin-table th {
  font-size: var(--fs-xs);
  color: var(--sw-ink-3);
}

.admin-table .money {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums lining-nums;
}

.admin-table .email {
  overflow-wrap: break-word;
  min-width: 265px;
}

.admin-table .btn {
  white-space: nowrap;
  min-height: 36px;
  padding: 6px 14px;
}

.admin-table .id {
  color: var(--sw-ink-3);
  font-variant-numeric: tabular-nums lining-nums;
}

.admin-table .record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 112px;
}

/* ── Borderless Soft Badges & Pills (Strictly 15px, zero borders) ────────── */
.pill,
.state,
.kt-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 2px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  line-height: 1.3;
  font-weight: 400;
  white-space: nowrap;
  background: var(--sw-surface-2);
  color: var(--sw-ink-2);
  border: 0;
}

.pill.list,
.pill.grant,
.state.grant {
  background: var(--sw-info-bg);
  color: var(--sw-info);
}

.pill.detail,
.state.pending,
.kt-badge.amb {
  background: var(--sw-warn-bg);
  color: var(--sw-warn);
}

.pill.on,
.state.paid,
.kt-badge.ok {
  background: var(--sw-ok-bg);
  color: var(--sw-ok);
}

.pill.off,
.state.error,
.kt-badge.hi {
  background: var(--sw-err-bg);
  color: var(--sw-err);
}

.pill.al {
  background: var(--sw-brand);
  color: var(--sw-ink-inv);
  font-weight: 600;
  min-width: 24px;
  height: 24px;
  padding: 2px 7px 0;
  line-height: 1;
  justify-content: center;
}

.state.warn-note {
  white-space: normal;
  border-radius: 12px;
  padding: 6px 12px;
  line-height: 1.35;
  margin-top: 6px;
}

.pill.ai {
  background: var(--sw-ai-bg);
  color: var(--sw-ai);
}

.pill.mut,
.kt-badge.mut {
  background: var(--sw-surface-2);
  color: var(--sw-ink-3);
}

/* ── Key Copy Pill ───────────────────────────────────────────────────────── */
.keycell {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.keycell code {
  font-family: var(--sw-font);
  font-size: var(--fs-sm);
  color: var(--sw-ink-2);
  background: transparent;
  padding: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.keycopy {
  border: 0;
  background: var(--sw-surface-2);
  border-radius: 8px;
  padding: 4px 11px;
  font-size: var(--fs-xs);
  font-weight: 400;
  cursor: pointer;
  color: var(--sw-ink-2);
  font-family: var(--sw-font);
  transition: color 0.14s ease, background-color 0.14s ease;
}

.keycopy:hover {
  color: var(--sw-brand);
  background: var(--sw-brand-bg);
}

/* ── Modals & Wizard (Clean borderless surfaces) ─────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 22, 29, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 18px;
  z-index: 60;
  overflow: auto;
  backdrop-filter: blur(5px);
}

.modal .box {
  background: var(--sw-surface);
  border: 0;
  border-radius: var(--r-xl);
  padding: 30px;
  width: 600px;
  max-width: 100%;
  box-shadow: var(--shadow-lg);
}

.modal .panel-box {
  background: var(--sw-canvas);
  box-shadow: none;
  padding: 18px 20px;
}

.modal h2 {
  margin: 0 0 6px;
  font-size: var(--fs-lg);
  line-height: var(--lh-lg);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--sw-ink);
}

.modal h3 {
  margin: 0 0 10px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--sw-ink);
}

.modal .sub {
  color: var(--sw-ink-3);
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: var(--lh-sm);
  margin-bottom: 18px;
}

.fg {
  margin-bottom: 16px;
}

.fg label {
  display: block;
  color: var(--sw-ink-3);
  font-size: var(--fs-sm);
  font-weight: 400;
  margin-bottom: 6px;
}

.fg select,
.fg input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
}

.modal .actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
  align-items: center;
}

.modal .actions .btn {
  padding: 10px 20px;
  font-size: var(--fs-base);
}

.modal .save {
  background: var(--sw-brand);
  color: var(--sw-ink-inv);
  font-weight: 600;
}

.modal .save:hover {
  background: var(--sw-brand-hover);
}

/* Wizard */
.wbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 20px;
}

.wstep {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--sw-ink-3);
  padding: 5px 13px;
  border-radius: var(--r-pill);
  border: 0;
  background: var(--sw-surface-2);
  white-space: nowrap;
}

.wstep.on {
  color: var(--sw-brand);
  background: var(--sw-brand-bg);
  font-weight: 600;
}

.wstep.done {
  color: var(--sw-ok);
  background: var(--sw-ok-bg);
}

.wcards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wcard {
  border: 0;
  border-radius: var(--r-md);
  padding: 14px 18px;
  cursor: pointer;
  background: var(--sw-canvas);
  transition: background-color 0.15s ease;
}

.wcard:hover {
  background: var(--sw-surface-2);
}

.wcard.on {
  background: var(--sw-brand-bg);
}

.wc-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
  font-size: var(--fs-base);
}

.wc-mods {
  font-size: var(--fs-xs);
  color: var(--sw-ink-3);
  line-height: 1.45;
}

.wtag {
  font-size: var(--fs-xs);
  color: var(--sw-ink-3);
  margin-left: 6px;
}

.wsum {
  border: 0;
  border-radius: var(--r-md);
  padding: 14px 18px;
  background: var(--sw-canvas);
}

.wsum-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--sw-divider);
}

.wsum-row:last-child {
  border-bottom: 0;
}

/* ── Charts SVG Typography (Strictly >= 15px, weight 400) ────────────────── */
svg text {
  fill: var(--sw-ink-3);
  font-family: var(--sw-font);
  font-size: var(--fs-xs);
  font-weight: 400;
}

/* ── Empty / Error States ────────────────────────────────────────────────── */
div.err {
  padding: 48px 24px;
  text-align: center;
  color: var(--sw-ink-3);
  font-size: var(--fs-base);
}

.sw-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
  color: var(--sw-ink-3);
  font-size: var(--fs-base);
}

/* ── Progress Bars ───────────────────────────────────────────────────────── */
.sw-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

.sw-bar-track {
  width: 140px;
  height: 10px;
  background: var(--sw-surface-2);
  border-radius: var(--r-pill);
  overflow: hidden;
  border: 0;
}

.sw-bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  transition: width 0.25s ease;
}

.sw-bar-fill.ok   { background: linear-gradient(90deg, #22C55E, #167936); }
.sw-bar-fill.warn { background: linear-gradient(90deg, #F59E0B, #D97706); }
.sw-bar-fill.err  { background: linear-gradient(90deg, #EF4444, #B51A1A); }
.sw-bar-fill.info { background: linear-gradient(90deg, #3B82F6, #0A60C2); }

.sw-bar-val {
  width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Utility Helpers ─────────────────────────────────────────────────────── */
.sw-row       { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sw-between   { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sw-stack     { display: flex; flex-direction: column; gap: 8px; }
.sw-mt-6      { margin-top: 6px; }
.sw-mt-8      { margin-top: 8px; }
.sw-mt-12     { margin-top: 12px; }
.sw-mt-16     { margin-top: 16px; }
.sw-mb-0      { margin-bottom: 0 !important; }
.sw-mb-10     { margin-bottom: 10px; }
.sw-mb-12     { margin-bottom: 12px; }
.sw-mb-14     { margin-bottom: 14px; }
.sw-w-full    { width: 100%; }
.sw-warn-txt  { color: var(--sw-warn); font-weight: 400; }
.sw-err-txt   { color: var(--sw-err); font-size: var(--fs-sm); min-height: 22px; }
.sw-cell-note { max-width: 280px; font-size: var(--fs-xs); color: var(--sw-ink-3); }
.sw-code-box  { font-family: var(--sw-font); font-size: 18px; font-weight: 600; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; background: var(--sw-surface-2); border: 0; border-radius: 14px; padding: 14px 16px; margin: 12px 0; word-break: break-all; color: var(--sw-ink); }
.sw-codes-grid{ font-family: var(--sw-font); font-size: 16px; font-variant-numeric: tabular-nums; line-height: 1.9; background: var(--sw-surface-2); border: 0; border-radius: 14px; padding: 16px; columns: 2; color: var(--sw-ink); }

/* ── Structured Metadata Strips (Zero AI middots, color-coded values) ────── */
.sw-meta-strip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--sw-ink-3);
}

.sw-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.sw-meta-item .m-lbl {
  color: var(--sw-ink-3);
  font-weight: 400;
}

.sw-meta-item .m-val {
  color: var(--sw-ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sw-meta-item .m-val.ok   { color: var(--sw-ok); }
.sw-meta-item .m-val.amb  { color: var(--sw-warn); }
.sw-meta-item .m-val.hi   { color: var(--sw-err); }
.sw-meta-item .m-val.info { color: var(--sw-info); }

.sw-sub-row {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
}

/* ── Shimmer Loading Skeletons (Instant feedback on tab switch / slow fetch) ── */
@keyframes sw-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.sw-skel {
  display: block;
  border-radius: 10px;
  background: linear-gradient(90deg, #E8EDF4 25%, #F4F7FA 50%, #E8EDF4 75%);
  background-size: 200% 100%;
  animation: sw-shimmer 1.35s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .sw-skel { animation: none; background: #EAEFF6; }
}

.sw-skel-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr 0.8fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--sw-divider);
}

.sw-skel-row:last-child { border-bottom: 0; }
.sw-skel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.sw-skel-pill { width: 132px; height: 38px; border-radius: 12px; }
.sw-skel-h    { height: 22px; width: 220px; border-radius: 8px; }
.sw-skel-lbl  { height: 15px; width: 48%; border-radius: 6px; }
.sw-skel-val  { height: 28px; width: 62%; margin-top: 12px; border-radius: 8px; }
.sw-skel-sub  { height: 14px; width: 78%; margin-top: 12px; border-radius: 6px; }
.sw-skel-ic   { width: 32px; height: 32px; border-radius: 10px; flex: none; }
.sw-skel-line { height: 16px; width: 100%; border-radius: 6px; }
.sw-skel-line.w-70 { width: 70%; }
.sw-skel-line.w-50 { width: 50%; }
.sw-skel-line.w-35 { width: 35%; }
.sw-skel-box  { height: 96px; width: 100%; border-radius: 14px; margin-bottom: 12px; }

@media (max-width: 1220px) {
  .cards.cards-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .cards,
  .cards.cards-5,
  .cards.cards-3,
  .cards.cards-2 {
    grid-template-columns: 1fr;
  }
}
