/* AdPulse — Minimal, High-Signal Interface Stylesheet
 *
 * Brand Palette & Semantic Roles:
 *   Ink Black (#080E1A):        Primary typography, observed data, top bar
 *   Space Indigo (#181C3D):     Navigation structure, active tab state, baseline curve
 *   Atomic Tangerine (#FC6D26): Primary action CTA & TV-attributed lift / attention needed
 *   Pale Slate (#C4C5D0):       Borders, dividers, structural framing
 *   Bright Snow (#F8FAFC):      Page canvas & table header background
 *   Pure White (#FFFFFF):       Content panels & data tables
 */

:root {
  --ink-black: #080E1A;
  --space-indigo: #181C3D;
  --atomic-tangerine: #FC6D26;
  --pale-slate: #C4C5D0;
  --bright-snow: #F8FAFC;
  --pure-white: #FFFFFF;

  --tangerine-hover: #E05A14;
  --border-subtle: #E2E4EC;
  --text-main: #080E1A;
  --text-muted: #525870;

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--bright-snow);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  color: var(--ink-black);
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.015em;
}

a {
  color: var(--space-indigo);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Top Navigation Bar (Ink Black — Quiet & Compact)
   ========================================================================== */
.site-header {
  background-color: var(--ink-black);
  color: var(--pure-white);
  border-bottom: 1px solid var(--space-indigo);
}

.site-header-inner {
  max-width: 1380px;
  margin: 0 auto;
  height: 52px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--pure-white);
  text-decoration: none;
  line-height: 1;
}

.brand:hover {
  text-decoration: none;
  color: var(--pure-white);
}

.brand-emblem {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: block;
  flex-shrink: 0;
}

.brand-wordmark {
  height: 18px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  color: var(--pale-slate);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
}

.nav-links a:hover {
  color: var(--pure-white);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--pure-white);
  background: var(--space-indigo);
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--pale-slate);
}

.user-account-link {
  color: var(--pure-white);
  font-weight: 500;
  text-decoration: none;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.user-account-link:hover {
  color: var(--pure-white);
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.user-account-link.active {
  color: var(--pure-white);
  background: var(--space-indigo);
}

/* ==========================================================================
   System Notice Banner (Only shown when Synthetic or Attention Needed)
   ========================================================================== */
.alert-banner {
  padding: 0.45rem 1.5rem;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.synthetic-banner {
  background: var(--space-indigo);
  color: var(--bright-snow);
  border-bottom: 1px solid rgba(196, 197, 208, 0.2);
}

/* ==========================================================================
   Main Workspace Container
   ========================================================================== */
.container {
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--pale-slate);
  flex-wrap: wrap;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.page-header h1 {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

/* ==========================================================================
   Campaign Workflow Tabs & Date Range Selector
   ========================================================================== */
.subnav-bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  border-bottom: 1px solid var(--pale-slate);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.subnav-date-picker {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0.35rem 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.date-picker-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 225px;
  padding: 0.34rem 0.65rem;
  border: 1px solid var(--pale-slate);
  border-radius: 5px;
  background-color: var(--pure-white);
  color: var(--ink-black);
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
}

.date-picker-input-wrap:hover,
.subnav-date-picker.is-open .date-picker-input-wrap {
  border-color: var(--space-indigo);
}

.subnav-date-picker.is-open .date-picker-input-wrap {
  box-shadow: 0 0 0 2px rgba(24, 28, 61, 0.1);
}

.date-picker-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.date-range-input {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0;
  width: 100%;
  min-width: 155px;
  font-size: 0.84rem !important;
  font-weight: 500;
  color: var(--ink-black) !important;
  cursor: pointer;
  outline: none;
  pointer-events: none;
}

.date-picker-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.subnav-date-picker.is-open .date-picker-chevron {
  transform: rotate(180deg);
}

/* Litepicker-style Dual-Month Range Popover */
.litepicker-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 350;
  background: var(--pure-white);
  border: 1px solid var(--pale-slate);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(8, 14, 26, 0.14), 0 2px 6px rgba(8, 14, 26, 0.06);
  width: max-content;
  max-width: calc(100vw - 2rem);
  overflow: hidden;
}

.litepicker-popover[hidden] {
  display: none !important;
}

.lp-body {
  display: flex;
  align-items: stretch;
}

.lp-macros {
  width: 162px;
  background: var(--bright-snow);
  border-right: 1px solid var(--border-subtle);
  padding: 0.75rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-shrink: 0;
}

.lp-macros-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.15rem 0.5rem 0.35rem;
}

.lp-macro-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-black);
  text-align: left;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.44rem 0.6rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.1s ease, color 0.1s ease;
}

.lp-macro-btn:hover {
  background: rgba(24, 28, 61, 0.06);
}

.lp-macro-btn.is-active {
  background: var(--space-indigo);
  color: var(--pure-white);
  font-weight: 600;
}

.lp-main {
  display: flex;
  flex-direction: column;
}

.lp-months {
  display: flex;
  gap: 1.15rem;
  padding: 0.85rem 1rem 0.65rem;
}

.lp-month-col {
  width: 238px;
}

.lp-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
  min-height: 28px;
}

.lp-month-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-black);
  text-align: center;
  flex: 1;
}

.lp-nav-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  background: var(--pure-white);
  color: var(--ink-black);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.lp-nav-btn:hover {
  background: var(--bright-snow);
  border-color: var(--space-indigo);
}

.lp-nav-spacer {
  width: 28px;
  height: 28px;
  display: inline-block;
}

.lp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.lp-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 3px;
}

.lp-day-empty {
  height: 32px;
}

.lp-day {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-black);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  height: 32px;
  width: 100%;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  position: relative;
  font-variant-numeric: tabular-nums;
}

.lp-day:hover {
  background: rgba(252, 109, 38, 0.16);
  color: var(--ink-black);
}

.lp-day.is-in-range {
  background: rgba(252, 109, 38, 0.14);
  color: var(--ink-black);
  border-radius: 0;
}

.lp-day.is-start-date,
.lp-day.is-end-date {
  background: var(--atomic-tangerine);
  color: var(--pure-white);
  font-weight: 600;
}

.lp-day.is-start-date:not(.is-end-date) {
  border-radius: 5px 0 0 5px;
}

.lp-day.is-end-date:not(.is-start-date) {
  border-radius: 0 5px 5px 0;
}

.lp-day.is-start-date.is-end-date {
  border-radius: 5px;
}

.lp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bright-snow);
}

.lp-selection-preview {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.lp-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

@media (max-width: 720px) {
  .lp-body {
    flex-direction: column;
  }
  .lp-macros {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .lp-months {
    flex-direction: column;
  }
}

.subnav-divider {
  width: 1px;
  height: 22px;
  background-color: var(--pale-slate);
  flex-shrink: 0;
}

.subnav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  border-bottom: none;
  margin-bottom: -1px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  flex: 1;
}

.subnav::-webkit-scrollbar {
  display: none;
}

.subnav a {
  padding: 0.6rem 0.1rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  margin-bottom: 0;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.subnav a:hover {
  color: var(--ink-black);
  text-decoration: none;
}

.subnav a.active {
  color: var(--ink-black);
  font-weight: 600;
  border-bottom-color: var(--atomic-tangerine);
}

/* ==========================================================================
   Summary KPI Strip (Compact, Scannable, No Decorative Borders)
   ========================================================================== */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  background: var(--pure-white);
  border: 1px solid var(--pale-slate);
  border-radius: 6px;
  margin-bottom: 1.25rem;
}

.stat-cell {
  padding: 0.85rem 1.1rem;
  border-right: 1px solid var(--border-subtle);
}

.stat-cell:last-child {
  border-right: none;
}

.stat-label {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink-black);
  font-variant-numeric: tabular-nums;
  margin: 0.15rem 0 0.1rem;
}

/* Only use Atomic Tangerine when signifying TV-Attributed Lift */
.stat-value.tv-signal {
  color: var(--atomic-tangerine);
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Panels & Cards
   ========================================================================== */
.card {
  background: var(--pure-white);
  border: 1px solid var(--pale-slate);
  border-radius: 6px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.card h2 {
  font-size: 1.02rem;
  font-weight: 600;
}

.card-lead {
  margin: 0.15rem 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.25rem;
}

/* ==========================================================================
   Progressive Disclosure (<details class="disclosure">)
   ========================================================================== */
details.disclosure {
  background: var(--pure-white);
  border: 1px solid var(--pale-slate);
  border-radius: 6px;
  margin-bottom: 1.25rem;
}

details.disclosure > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.75rem 1.15rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--space-indigo);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

details.disclosure > summary::-webkit-details-marker {
  display: none;
}

details.disclosure > summary::after {
  content: "Show +";
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

details.disclosure[open] > summary {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bright-snow);
}

details.disclosure[open] > summary::after {
  content: "Hide −";
}

.disclosure-body {
  padding: 1.1rem 1.25rem;
}

/* ==========================================================================
   Semantic Status Badges (Color = Meaning)
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

/* Neutral informational metadata */
.badge-neutral {
  background: var(--bright-snow);
  color: var(--space-indigo);
  border: 1px solid var(--pale-slate);
}

/* Verified / Complete / Ready */
.badge-finalized,
.badge-success {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

/* Provisional / Needs Attention / Synthetic Notice -> Uses Atomic Tangerine */
.badge-provisional,
.badge-warning,
.badge-synthetic {
  background: rgba(252, 109, 38, 0.1);
  color: #C2410C;
  border: 1px solid rgba(252, 109, 38, 0.35);
}

/* Blocked / Disputed / Stale */
.badge-danger {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-search-input {
  max-width: 260px;
  padding: 0.38rem 0.65rem;
  border: 1px solid var(--pale-slate);
  border-radius: 4px;
  font-size: 0.83rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
}

.table-wrap.table-scroll-10 {
  max-height: 416px;
  overflow-y: auto;
}

.table-wrap.table-scroll-10 thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bright-snow);
  box-shadow: inset 0 -1px 0 var(--border-subtle);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--bright-snow);
  color: var(--space-indigo);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

thead th.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}

thead th.sortable-th:hover {
  background-color: #EDF1F7;
  color: var(--ink-black);
}

thead th.sortable-th:focus-visible {
  outline: 2px solid var(--atomic-tangerine);
  outline-offset: -2px;
}

thead th.sortable-th.is-sorted {
  color: var(--ink-black);
}

.sort-indicator {
  display: inline-block;
  margin-left: 0.28rem;
  font-size: 0.65rem;
  line-height: 1;
  color: var(--atomic-tangerine);
  vertical-align: middle;
}

tbody tr:hover {
  background: var(--bright-snow);
}

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

td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.table-single-line th,
.table-single-line td {
  white-space: nowrap;
}

tbody tr.selectable-row {
  cursor: pointer;
  transition: background-color 0.12s ease;
}

tbody tr.selectable-row:hover {
  background-color: #F1F5F9;
}

tbody tr.selectable-row.is-selected,
tbody tr.selectable-row.is-selected:hover {
  background-color: rgba(252, 109, 38, 0.09);
}

tbody tr.selectable-row.is-selected td:first-child {
  box-shadow: inset 3px 0 0 var(--atomic-tangerine);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.81rem;
}

/* ==========================================================================
   Forms & Buttons
   ========================================================================== */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.form-group {
  margin-bottom: 0.75rem;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--ink-black);
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="file"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--pale-slate);
  border-radius: 4px;
  font-size: 0.86rem;
  font-family: var(--font-sans);
  background: var(--pure-white);
  color: var(--ink-black);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--space-indigo);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

/* Primary CTA — Atomic Tangerine */
.btn-primary {
  background: var(--atomic-tangerine);
  color: var(--pure-white);
}

.btn-primary:hover {
  background: var(--tangerine-hover);
  color: var(--pure-white);
}

/* Secondary Structural Action */
.btn-secondary {
  background: var(--pure-white);
  color: var(--ink-black);
  border-color: var(--pale-slate);
}

.btn-secondary:hover {
  background: var(--bright-snow);
  border-color: var(--space-indigo);
}

/* Muted Slate-Blue Action (when model is already up-to-date) */
.btn-muted-slate {
  background: #526077;
  color: var(--pure-white);
  border-color: #465368;
}

.btn-muted-slate:hover {
  background: #3E4A5E;
  color: var(--pure-white);
  border-color: #333E50;
}

.btn:disabled {
  opacity: 0.72;
  cursor: default;
}

.btn-sm {
  padding: 0.28rem 0.6rem;
  font-size: 0.78rem;
}

/* ==========================================================================
   Charts
   ========================================================================== */
.chart-container {
  width: 100%;
  background: var(--pure-white);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.5rem;
}

canvas.chart-canvas {
  width: 100%;
  height: 300px;
  display: block;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.legend-line {
  display: inline-block;
  width: 20px;
  height: 0;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.donut-summary-box {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 0.5rem 0.25rem 1.1rem;
  flex-wrap: wrap;
}

.donut-canvas-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas.donut-canvas {
  width: 180px;
  height: 180px;
  display: block;
}

.donut-legend {
  flex: 1;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.83rem;
}

.donut-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
  vertical-align: middle;
}

.donut-legend-label {
  flex: 1;
  font-weight: 500;
  color: var(--ink-black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-legend-pct {
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   Utilities & Login Card
   ========================================================================== */
.run-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.9rem;
  background: var(--pure-white);
  border: 1px solid var(--pale-slate);
  border-radius: 6px;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.status-box {
  margin-top: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
  font-size: 0.82rem;
  background: var(--bright-snow);
  border: 1px solid var(--pale-slate);
}

.status-box.success {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #065F46;
}

.status-box.error {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #991B1B;
}

.fit-controls-dock {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  height: 72px;
  flex-shrink: 0;
}

.fit-launcher-form {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 72px;
  margin: 0;
  flex-shrink: 0;
}

.fit-launcher-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.fit-launcher-row select {
  width: auto;
  height: 33px;
  padding: 0 0.55rem;
  font-size: 0.81rem;
  line-height: 31px;
}

.fit-launcher-btn {
  width: 100%;
  height: 33px;
  padding: 0 0.9rem;
  font-size: 0.83rem;
}

.fit-progress-drawer {
  width: 0;
  height: 72px;
  margin-left: 0;
  opacity: 0;
  overflow: hidden;
  flex-shrink: 0;
  pointer-events: none;
  transition:
    width 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    margin-left 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.24s ease;
}

.fit-progress-drawer.is-active {
  width: 360px;
  margin-left: 0.65rem;
  opacity: 1;
  pointer-events: auto;
}

.fit-progress-card {
  width: 360px;
  height: 72px;
  margin: 0;
  padding: 0.5rem 0.8rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--pure-white);
  border: 1px solid var(--pale-slate);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(8, 14, 26, 0.05);
  transform: translateX(22px);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.fit-progress-drawer.is-active .fit-progress-card {
  transform: translateX(0);
}

.fit-progress-card.success {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #065F46;
}

.fit-progress-card.error {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #991B1B;
}

.fit-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0;
}

.fit-progress-stage {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-black);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fit-progress-pct {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--atomic-tangerine);
  flex-shrink: 0;
}

.fit-progress-track {
  width: 100%;
  height: 7px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.fit-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #F05D1B 0%,
    #FC6D26 26%,
    #FFBD4A 50%,
    #FC6D26 74%,
    #F05D1B 100%
  );
  background-size: 200% 100%;
  animation: fit-bar-shimmer 1.75s linear infinite;
  transition: width 0.35s ease;
}

@keyframes fit-bar-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.fit-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.connector-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 0.65rem;
}

.connector-tile-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  padding: 0.7rem 0.85rem;
  background: var(--pure-white);
  border: 1px solid var(--pale-slate);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
  font-family: var(--font-sans);
}

.connector-tile-btn:hover {
  border-color: var(--space-indigo);
  background: var(--bright-snow);
}

.connector-tile-btn.active {
  border-color: var(--atomic-tangerine);
  background: rgba(252, 109, 38, 0.05);
  box-shadow: inset 0 0 0 1px var(--atomic-tangerine);
}

.connector-tile-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-black);
}

.connector-tile-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.12rem;
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}

.text-muted {
  color: var(--text-muted);
}

.unavailable {
  color: var(--text-muted);
  font-style: italic;
}

.login-card {
  max-width: 400px;
  margin: 4.5rem auto 3.5rem;
  background: var(--pure-white);
  border: 1px solid var(--pale-slate);
  border-radius: 6px;
  padding: 2rem;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  line-height: 1;
}

.login-brand .brand-emblem {
  width: 24px;
  height: 24px;
  border-radius: 5px;
}

.login-brand .brand-wordmark {
  height: 24px;
  width: auto;
}

.form-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.form-label-row label {
  margin-bottom: 0;
  line-height: 1.25;
}

.form-label-row a {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.25;
}

/* Breakdown Chart Subnavigation & Bubble Tooltip */
.chart-subnav {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  background: var(--bright-snow);
  border: 1px solid var(--pale-slate);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.chart-subnav-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.3rem 0.68rem;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.chart-subnav-btn:hover {
  color: var(--ink-black);
  background: rgba(24, 28, 61, 0.05);
  text-decoration: none;
}

.chart-subnav-btn.active,
.chart-subnav-btn.active:hover {
  background: var(--atomic-tangerine);
  color: var(--pure-white);
  text-decoration: none;
}

.chart-bubble-tooltip {
  position: absolute;
  z-index: 40;
  pointer-events: none;
  background: var(--ink-black);
  color: var(--pure-white);
  border: 1px solid var(--space-indigo);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  box-shadow: 0 6px 18px rgba(8, 14, 26, 0.24);
  font-size: 0.76rem;
  line-height: 1.35;
  max-width: 260px;
}

.chart-bubble-tooltip[hidden] {
  display: none !important;
}

.cb-tt-title {
  font-weight: 600;
  color: var(--pure-white);
  margin-bottom: 0.15rem;
}

.cb-tt-sub {
  color: var(--pale-slate);
  font-size: 0.72rem;
  margin-bottom: 0.3rem;
}

.cb-tt-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  font-variant-numeric: tabular-nums;
}

/* Sales & Orders Commerce Scorecard */
.commerce-scorecard {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin-bottom: 1.35rem;
}

.commerce-two-col-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
  align-items: stretch;
}

@media (max-width: 960px) {
  .commerce-two-col-grid {
    grid-template-columns: 1fr;
  }
}

.commerce-panel {
  background: var(--pure-white);
  border: 1px solid var(--pale-slate);
  border-radius: 8px;
}

.commerce-summary-wide-card {
  padding: 0;
  overflow: hidden;
}

.commerce-quad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.commerce-quad .commerce-metric {
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
}

.commerce-quad .commerce-metric + .commerce-metric {
  border-left: 1px solid var(--bright-snow);
}

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

  .commerce-quad .commerce-metric:nth-child(3) {
    border-left: none;
  }

  .commerce-quad .commerce-metric:nth-child(n+3) {
    border-top: 1px solid var(--bright-snow);
  }
}

.commerce-channel-table-card {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.commerce-card-row {
  display: flex;
  align-items: stretch;
  flex: 1 1 50%;
}

.commerce-card-row-bottom {
  border-top: 1px solid var(--pale-slate);
}

.commerce-row-label-cell {
  flex: 0 0 88px;
  border-right: 1px solid var(--pale-slate);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0.85rem 0.5rem;
}

.commerce-row-label-cell.is-top {
  padding-bottom: 1.25rem;
}

.commerce-row-label-cell.is-bottom {
  padding-top: 1.25rem;
}

.commerce-row-label-text {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-align: center;
}

.commerce-emblem-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--pure-white);
  padding: 3px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.commerce-emblem {
  width: 22px;
  height: 25px;
  display: block;
}

.commerce-emblem-amazon .amazon-emblem-letter {
  fill: var(--ink-black);
}

.commerce-trio {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.commerce-trio .commerce-metric {
  padding: 1.25rem 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
}

.commerce-trio .commerce-metric + .commerce-metric {
  border-left: 1px solid var(--bright-snow);
}

@media (max-width: 640px) {
  .commerce-card-row {
    flex-direction: column;
  }

  .commerce-row-label-cell {
    flex: 0 0 auto;
    border-right: none;
    border-bottom: 1px solid var(--bright-snow);
    padding: 0.65rem 0.9rem !important;
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .commerce-emblem-badge {
    position: static;
    transform: none;
    padding: 0;
  }

  .commerce-trio,
  .commerce-quad {
    grid-template-columns: 1fr;
  }

  .commerce-trio .commerce-metric + .commerce-metric,
  .commerce-quad .commerce-metric + .commerce-metric {
    border-left: none;
    border-top: 1px solid var(--bright-snow);
  }
}

.commerce-metric-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.commerce-metric-value {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ink-black);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.site-footer {
  border-top: 1px solid var(--pale-slate);
  background: var(--pure-white);
  padding: 0.85rem 1.5rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: auto;
}

.site-footer-inner {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
