/* ============================================================
   ScanWin — sw-theme.css  (Bootstrap 5.3 brand theme layer)
   ------------------------------------------------------------
   Loaded immediately AFTER the Bootstrap CDN stylesheet.

   Bootstrap components are themed here through their own documented
   CSS custom properties (--bs-btn-*, --bs-badge-*, --bs-card-*,
   --bs-progress-*) instead of selector overrides — see
   https://getbootstrap.com/docs/5.3/customize/css-variables/ .
   NOTE: on the CDN build, overriding --bs-primary at :root does NOT
   recolor compiled components; per-component vars (below) are the
   documented mechanism. Brand color tokens (--sw-*) live in style.css.

   These classes are page-agnostic: reuse them as other pages migrate.
   ============================================================ */

/* ---- Buttons: use as `btn sw-btn-primary`, `btn sw-btn-white`.
   13px/600, 8.25px padding-y reproduces the design's 38px height. */
.sw-btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--sw-violet);
  --bs-btn-border-color: var(--sw-violet);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--sw-violet-600);
  --bs-btn-hover-border-color: var(--sw-violet-600);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--sw-violet-600);
  --bs-btn-active-border-color: var(--sw-violet-600);
  --bs-btn-focus-shadow-rgb: 110, 93, 248;
  --bs-btn-font-size: 13px;
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: 10px;
  --bs-btn-padding-y: 8.25px;
  --bs-btn-padding-x: 16px;
}
.sw-btn-white {
  --bs-btn-color: #0f1020;
  --bs-btn-bg: #fff;
  --bs-btn-border-color: var(--sw-border);
  --bs-btn-hover-color: #0f1020;
  --bs-btn-hover-bg: #f9fafb;
  --bs-btn-hover-border-color: var(--sw-border);
  --bs-btn-active-color: #0f1020;
  --bs-btn-active-bg: #f9fafb;
  --bs-btn-active-border-color: var(--sw-border);
  --bs-btn-focus-shadow-rgb: 110, 93, 248;
  --bs-btn-font-size: 13px;
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: 10px;
  --bs-btn-padding-y: 8.25px;
  --bs-btn-padding-x: 16px;
}
/* Full-width violet CTA base for the mobile flows: pair with a page
   class that sets only size (fs / padding / radius). */
.sw-btn-cta {
  --bs-btn-bg: var(--sw-violet);
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--sw-violet);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--sw-violet);
  --bs-btn-active-color: #fff;
  --bs-btn-border-width: 0;
  --bs-btn-font-weight: 700;
  --bs-btn-border-radius: 12px;
  --bs-btn-line-height: normal;
  --bs-btn-focus-shadow-rgb: 110, 93, 248;
}
.sw-btn-cta:active {
  filter: brightness(0.96);
}

/* 26px-high pill size (e.g. inline "Connect") — smaller than .btn-sm */
.sw-btn-xs {
  --bs-btn-font-size: 11px;
  --bs-btn-padding-y: 4.25px;
  --bs-btn-padding-x: 12px;
}
/* Toggle chip, pair with `btn rounded-pill` + data-bs-toggle="button" */
.sw-btn-pill {
  --bs-btn-color: #1a1232;
  --bs-btn-bg: #f3f4f6;
  --bs-btn-border-width: 0;
  --bs-btn-hover-color: #1a1232;
  --bs-btn-hover-bg: #e9eaee;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--sw-violet);
  --bs-btn-focus-shadow-rgb: 110, 93, 248;
  --bs-btn-font-size: 12px;
  --bs-btn-font-weight: 500;
  --bs-btn-padding-y: 8px;
  --bs-btn-padding-x: 14px;
}
/* design darkens the selected pill on hover; Bootstrap has no
   active-hover variable */
.sw-btn-pill.active:hover {
  background-color: var(--sw-violet-600);
}

/* ---- Badges: use as `badge rounded-pill sw-badge-*`.
   line-height 1.5 restores the design pills' text box (.badge
   hardcodes line-height 1). */
.sw-badge-success {
  --bs-badge-font-size: 10px;
  --bs-badge-font-weight: 600;
  --bs-badge-color: #047857;
  --bs-badge-padding-y: 4px;
  --bs-badge-padding-x: 10px;
  background: #d1fae5;
  line-height: 1.5;
}
.sw-badge-violet-soft {
  --bs-badge-font-size: 12px;
  --bs-badge-font-weight: 600;
  --bs-badge-color: var(--sw-violet);
  --bs-badge-padding-y: 7px;
  --bs-badge-padding-x: 14px;
  background: #f0edff;
  line-height: 1.5;
}
.sw-badge-violet {
  --bs-badge-font-size: 10px;
  --bs-badge-font-weight: 700;
  --bs-badge-padding-y: 3px;
  --bs-badge-padding-x: 9px;
  background: var(--sw-violet);
  line-height: 1.5;
}

/* ---- Cards: use as `card sw-pf-card` (+ .card-body). */
.sw-pf-card {
  --bs-card-spacer-y: 24px;
  --bs-card-spacer-x: 28px;
  --bs-card-border-color: var(--sw-border);
  --bs-card-border-radius: 16px;
  /* border-* utilities inside cards render the brand border */
  --bs-border-color: var(--sw-border);
  /* .card sets word-wrap: break-word; the design's text boxes rely on
     the browser default (overflow, no mid-word breaks) */
  overflow-wrap: normal;
}
@media (max-width: 575.98px) {
  .sw-pf-card {
    --bs-card-spacer-y: 20px;
    --bs-card-spacer-x: 20px;
  }
}

/* ---- Progress: use as `progress sw-progress` > `progress-bar`. */
.sw-progress {
  --bs-progress-height: 8px;
  --bs-progress-bg: #fff;
  --bs-progress-border-radius: 999px;
  --bs-progress-bar-bg: var(--sw-violet);
}
/* design rounds the bar's leading edge at partial fill */
.sw-progress .progress-bar {
  border-radius: 999px;
}

/* ---- Form controls: brand skins for .form-control
   (docs/5.3/forms/form-control — custom background/height/focus
   colors require custom CSS on the CDN build). */
/* grey 44px app field */
.sw-input {
  background-color: #f3f4f6;
  border-color: var(--sw-border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #0f1020;
  height: 44px;
  padding: 0 14px;
}
.sw-input:focus {
  background-color: #fff;
  border-color: #b9aef5;
  box-shadow: none;
  color: #0f1020;
}
.sw-input::placeholder {
  color: #9ca3af;
}
textarea.sw-input {
  height: auto;
  min-height: 64px;
  resize: vertical;
}
/* white modal/dialog field with violet focus ring */
.sw-input-modal {
  border-color: #e5e8ed;
  border-radius: 10px;
  font-size: 14px;
  color: #0f1020;
  padding: 11px 14px;
}
.sw-input-modal:focus {
  border-color: var(--sw-violet);
  box-shadow: 0 0 0 3px rgba(109, 94, 247, 0.15);
  color: #0f1020;
}
textarea.sw-input-modal {
  resize: vertical;
  min-height: 84px;
}

/* ---- Filter chips (campaign filters, receipt tabs) — use as
   `btn rounded-pill sw-chip-filter`; `.is-active` is toggled by page
   JS; optional count span gets `sw-chip-filter__count`. ---- */
.sw-chip-filter {
  --bs-btn-bg: #fff;
  --bs-btn-color: #6b7280;
  --bs-btn-border-color: #e5e8ed;
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-color: #6b7280;
  --bs-btn-hover-border-color: #e5e8ed;
  --bs-btn-font-size: 13px;
  --bs-btn-font-weight: 600;
  --bs-btn-padding-y: 9px;
  --bs-btn-padding-x: 16px;
  --bs-btn-line-height: normal;
  --bs-btn-focus-shadow-rgb: 110, 93, 248;
}
.sw-chip-filter__count,
.sw-chip-filter span {
  color: #9ca3af;
}
.sw-chip-filter.is-active {
  background: #1a1b2e;
  border-color: #1a1b2e;
  color: #fff;
}
.sw-chip-filter.is-active .sw-chip-filter__count,
.sw-chip-filter.is-active span {
  color: #c7bdfc;
}

/* ---- Stat tiles (dashboard-style KPI cards) — use as
   `row row-cols-2 row-cols-lg-4 sw-stat-grid` > `.col` >
   `card card-body sw-stat-card d-flex flex-column h-100`. ---- */
.sw-stat-grid {
  --bs-gutter-x: 24px;
  --bs-gutter-y: 24px;
}
@media (max-width: 991.98px) {
  .sw-stat-grid {
    --bs-gutter-x: 12px;
    --bs-gutter-y: 12px;
  }
}
.sw-stat-card {
  gap: 12px; /* off the spacer scale */
  --bs-card-border-color: #edf0f2;
  --bs-card-border-radius: 16px;
  --bs-card-spacer-y: 18px;
  --bs-card-spacer-x: 20px;
}
.sw-stat-card__head {
  gap: 10px; /* 8px flips label wraps on mobile */
}
.sw-stat-card__ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}
.sw-stat-card__ico svg {
  width: 20px;
  height: 20px;
}
.sw-stat-card__ico--violet {
  background: #f3f1fe;
  color: #6e5df8;
}
.sw-stat-card__ico--green {
  background: #dbf7e5;
  color: #057352;
}
.sw-stat-card__ico--amber {
  background: #fef3d9;
  color: #d98a00;
}
.sw-stat-card__ico--blue {
  background: #e5f0ff;
  color: #2f74e0;
}
.sw-stat-card__label {
  font-size: 13px;
  color: #6b7280;
}
.sw-stat-card__val {
  font-size: 26px;
  color: #0f0f21;
}
.sw-stat-card__sub {
  font-size: 12px;
  color: #9ca3af;
}

/* ---- Text helpers Bootstrap's scale can't express ---- */
/* brand ink — darkest heading color; no Bootstrap text utility matches */
.sw-ink {
  color: #0f1020;
}
/* flex min-width guard (no Bootstrap min-width utility exists) */
.sw-minw-0 {
  min-width: 0;
}

/* fixed side-rail column (Figma 360px / 320px) for two-column layouts —
   %-based grid columns can't pin a px width. Pair with a d-lg-flex or
   d-xl-flex wrapper + a .col main column. */
@media (min-width: 1200px) {
  .sw-pf-rail {
    flex: 0 0 360px;
  }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
  .sw-pf-rail {
    flex: 0 0 320px;
  }
}
