/* ============================================================
   STRATOS DESIGN SYSTEM

   Token-based design system that merges the geometric brand
   identity (punch, cut-corners, gradient CTAs) with the
   engineering-grade consistency of the panel/metric system.

   Usage: Import once globally. Reference tokens via var(--ds-*).
   Use .ds-* utility classes for common patterns.
   Keep Tailwind for LAYOUT ONLY (flex, grid, gap, padding).
   ============================================================ */

/* ----------------------------------------------------------
   1. DESIGN TOKENS (CSS Custom Properties)
   ---------------------------------------------------------- */
html {
  scrollbar-gutter: stable;
}

html, body, #content {
  height: 100%;
  margin: 0;
}

.view {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

:root {
  /* ============================================================
     OpenAds light system — "Madison Avenue on a space station".
     Cool station-white room (~60%), walnut gravity (~25%),
     warm amber/gold light as the accent (~15%). Token NAMES are
     unchanged from the legacy dark system so every existing
     reference keeps working; only the VALUES flipped to light.
     Warmth comes from LIGHT (glows, gold), never from tinting
     the canvas — the background stays cool. See the OpenAds layer
     at the bottom of this file for the new component vocabulary.
     ============================================================ */

  /* ---- Surfaces (the room — cool) ---- */
  --ds-bg-base:        #EDF0F3;    /* Page background — cool station white. Never beige. */
  --ds-bg-surface:     #FCFAF5;    /* Lit panel surface — faintly warm white, pops on the cool ground */
  --ds-bg-raised:      #F4F0E8;    /* Raised/hover element within a panel (warm) */
  --ds-bg-overlay:     #FFFFFF;    /* Dropdowns / popovers — crisp white */
  --ds-bg-input:       #FFFFFF;    /* Form input backgrounds */

  /* ---- Borders (structural seams — cool & quiet) ---- */
  --ds-border-subtle:  #DCE1E6;    /* hair — default panel borders, dividers */
  --ds-border-muted:   #CBD3DA;    /* slightly heavier hair — input borders */
  --ds-border-focus:   #F0603A;    /* amber focus ring */

  /* ---- Brand: amber-as-light (the one focal glow) ---- */
  --ds-punch:          #D24E35;    /* amber-deep — contrast-safe accent text + primary brand */
  --ds-punch-hover:    #BC4026;    /* primary hover */
  --ds-punch-glow:     rgba(240, 96, 58, 0.40);
  --ds-punch-light:    #F0603A;    /* focal amber — CTA fills, glows, gradients */
  --ds-punch-warm:     #F6A878;    /* warmest amber variant */
  --ds-punch-tint:     rgba(240, 96, 58, 0.05);   /* selected card wash */
  --ds-punch-tint-md:  rgba(240, 96, 58, 0.10);   /* soft amber — icon tiles */
  --ds-punch-tint-strong: rgba(240, 96, 58, 0.16); /* active icon / focus glow */

  /* ---- Semantic ---- */
  --ds-blue:           #4E84B0;    /* sky — "the view". Calm orbit-blue for info/links, not a loud accent */
  --ds-blue-deep:      #2F5A7E;    /* deep sky — primary button bg */
  --ds-blue-bright:    #4E84B0;    /* sky — primary button border */
  --ds-green:          #3E8E54;    /* success — calmer green that reads on light */
  --ds-success:        #3E8E54;    /* Alias for --ds-green */
  --ds-green-bg:       #E4F0E5;    /* success background (light tint) */
  --ds-red:            #C8412C;    /* error / danger — deeper red for light surfaces */
  --ds-red-bg:         #F8E6E2;    /* error background (light tint) */
  --ds-yellow:         #B8841F;    /* warning — gold/amber, readable on light */
  --ds-yellow-bg:      #FAEFD7;    /* warning background (light tint) */
  --ds-purple:         #7A5A91;    /* tags / special */
  --ds-cyan:           #4E84B0;    /* fold into sky */
  --ds-pink:           #C25B86;    /* highlights */

  /* ---- Text (warm espresso ink on cool ground) ---- */
  --ds-text-primary:   #26231F;    /* ink — warm espresso, primary body text */
  --ds-text-secondary: #6E6557;    /* taupe — warm grey, secondary text */
  --ds-text-muted:     #9A9082;    /* light taupe — placeholders, captions */
  --ds-text-bright:    #1A1714;    /* near-black ink — headings, emphasis */

  /* ---- Legacy aliases (used by hand-maintained dist/css/style.css) ---- */
  --verydark:          #EDF0F3;    /* was #0f1117 — flips the legacy body background to light */
  --blue:              #4E84B0;    /* was #4793eb — calm sky */

  /* ---- Typography ---- */
  --ds-font-mono:      'JetBrains Mono', 'SF Mono', monospace;  /* technical readouts (mostly admin) */
  --ds-font-sans:      'Hanken Grotesk', 'Outfit', sans-serif;  /* warm humanist body — the default */
  --ds-font-display:   'Jost', 'Outfit', sans-serif;            /* geometric display — headings, labels, CTAs */
  --ds-font-serif:     'Cormorant Garamond', Georgia, serif;    /* high-contrast italic accent — one word at a time */
  --ds-text-xs:        10px;
  --ds-text-sm:        11px;
  --ds-text-base:      12px;
  --ds-text-md:        13px;
  --ds-text-lg:        14px;
  --ds-text-xl:        16px;
  --ds-text-2xl:       20px;
  --ds-text-3xl:       24px;

  /* ---- Spacing ---- */
  --ds-space-1:        4px;
  --ds-space-2:        8px;
  --ds-space-3:        12px;
  --ds-space-4:        16px;
  --ds-space-5:        20px;
  --ds-space-6:        24px;
  --ds-space-8:        32px;
  --ds-space-10:       40px;

  /* ---- Radius (softer / more molded; cut-corners still override where used) ---- */
  --ds-radius-sm:      7px;
  --ds-radius-md:      11px;
  --ds-radius-lg:      16px;
  --ds-radius-xl:      22px;

  /* ---- Shadows: warmth-from-light. Panels are cool-white surfaces
         rimmed with warm light — a warm gold rim + amber bloom +
         a cool grounding shadow, not a flat dark drop. ---- */
  --ds-shadow-sm:      0 0 0 1px rgba(216, 160, 84, .16),
                       0 1px 3px rgba(40, 40, 46, .05),
                       0 8px 22px -10px rgba(236, 164, 76, .18);
  --ds-shadow-md:      0 0 0 1px rgba(216, 160, 84, .20),
                       0 1px 2px rgba(60, 42, 26, .04),
                       0 8px 26px -10px rgba(236, 164, 76, .22),
                       0 24px 52px -26px rgba(40, 40, 46, .18);
  --ds-shadow-lg:      0 0 0 1px rgba(216, 160, 84, .22),
                       0 2px 6px rgba(60, 42, 26, .05),
                       0 18px 44px -12px rgba(240, 168, 76, .34),
                       0 36px 70px -30px rgba(40, 40, 46, .22);
  --ds-shadow-glow:    0 0 0 1px rgba(240, 96, 58, .22),
                       0 12px 38px -6px rgba(240, 96, 58, .45);

  /* ---- Transitions ---- */
  --ds-transition:     all 0.15s ease;
  --ds-transition-slow: all 0.3s ease;

  /* ---- Layout ---- */
  --ds-sidebar-width:  220px;
  --ds-header-height:  52px;

  /* ---- Cut-corner sizes ---- */
  --ds-cut-xs: 4px;
  --ds-cut-sm: 6px;
  --ds-cut-md: 10px;
  --ds-cut-lg: 14px;
}


/* ----------------------------------------------------------
   2. BASE RESETS
   ---------------------------------------------------------- */
.ds-root {
  font-family: var(--ds-font-sans);
  background: var(--ds-bg-base);
  color: var(--ds-text-primary);
  font-size: var(--ds-text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.ds-root * {
  box-sizing: border-box;
}


/* ----------------------------------------------------------
   3. PANELS & SURFACES
   ---------------------------------------------------------- */
.ds-panel {
  background: var(--ds-bg-surface);
  border: none;
  border-radius: var(--ds-radius-md);
  padding: var(--ds-space-3);
  box-shadow: var(--ds-shadow-md);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

.ds-panel + .ds-panel {
  margin-top: var(--ds-space-3);
}

.ds-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--ds-space-2);
}

.ds-panel-title {
  font-size: var(--ds-text-sm);
  color: var(--ds-text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  margin: 0;
}

/* Raised card (within panels or standalone) */
.ds-card {
  background: var(--ds-bg-raised);
  border-radius: var(--ds-radius-sm);
  padding: var(--ds-space-2) var(--ds-space-3);
}


/* ----------------------------------------------------------
   4. METRIC ROWS
   ---------------------------------------------------------- */
.ds-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  border-bottom: 1px solid var(--ds-bg-raised);
}

.ds-metric-row:last-child {
  border-bottom: none;
}

.ds-metric-label {
  color: var(--ds-text-secondary);
  font-size: var(--ds-text-sm);
}

.ds-metric-value {
  color: var(--ds-blue);
  font-size: var(--ds-text-sm);
  font-weight: 700;
}

.ds-metric-value.punch { color: var(--ds-punch); }
.ds-metric-value.green { color: var(--ds-green); }
.ds-metric-value.yellow { color: var(--ds-yellow); }
.ds-metric-value.red { color: var(--ds-red); }
.ds-metric-value.muted { color: var(--ds-text-muted); }


/* ----------------------------------------------------------
   5. METRIC CARDS (large stat displays)
   ---------------------------------------------------------- */
.ds-metric-card {
  background: var(--ds-bg-surface);
  border: none;
  border-radius: var(--ds-radius-md);
  padding: var(--ds-space-4);
  text-align: center;
  box-shadow: var(--ds-shadow-md);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.ds-metric-card-value {
  font-size: var(--ds-text-3xl);
  font-weight: 700;
  color: var(--ds-text-bright);
  line-height: 1.2;
}

.ds-metric-card-label {
  font-size: var(--ds-text-sm);
  color: var(--ds-text-secondary);
  margin-top: var(--ds-space-1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ds-metric-card-detail {
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
  margin-top: var(--ds-space-1);
}

.ds-metric-card.accent {
  background: linear-gradient(135deg, var(--ds-bg-surface) 0%, rgba(210, 78, 53, 0.04) 100%);
}

.ds-metric-card.accent .ds-metric-card-value {
  color: var(--ds-punch);
}


/* ----------------------------------------------------------
   6. STATUS INDICATORS
   ---------------------------------------------------------- */
.ds-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.ds-dot.green  { background: var(--ds-green);  box-shadow: 0 0 4px var(--ds-green); }
.ds-dot.red    { background: var(--ds-red);    box-shadow: 0 0 4px var(--ds-red); }
.ds-dot.yellow { background: var(--ds-yellow); box-shadow: 0 0 4px var(--ds-yellow); }
.ds-dot.gray   { background: var(--ds-text-muted); }
.ds-dot.blue   { background: var(--ds-blue);   box-shadow: 0 0 4px var(--ds-blue); }
.ds-dot.punch  { background: var(--ds-punch);  box-shadow: 0 0 4px var(--ds-punch); }

.ds-status-row {
  display: flex;
  align-items: center;
  gap: var(--ds-space-2);
  font-size: var(--ds-text-sm);
  padding: 2px 0;
}


/* ----------------------------------------------------------
   7. BUTTONS
   ---------------------------------------------------------- */
.ds-btn {
  padding: 7px 16px;
  border: 1px solid var(--ds-border-muted);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-bg-surface);
  color: var(--ds-text-primary);
  cursor: pointer;
  font-family: var(--ds-font-display);
  font-size: var(--ds-text-sm);
  font-weight: 500;
  letter-spacing: .01em;
  box-shadow: var(--ds-shadow-sm);
  transition: var(--ds-transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  line-height: 1.4;
}

/* Selector/tab inactive state — used for nav tabs, format selectors, filter buttons */
/* Sidebar nav item hover */
.ds-nav-item:hover {
  background: var(--ds-bg-surface);
  color: var(--ds-text-bright) !important;
}

/* Active selector/tab — amber fill + white text. Use this (not a bare
   `bg-punch text-white`) so the button carries a "ds-" class and is excluded
   from the legacy global <button> rule that blows the font up to 1.25em/bold. */
.ds-tab-active { background: var(--ds-punch); color: #fff; }
.ds-tab-active:hover { background: var(--ds-punch-hover); }

.ds-tab-inactive {
  background: var(--ds-bg-surface);
  color: var(--ds-text-primary);
}
.ds-tab-inactive:hover {
  background: var(--ds-bg-raised);
  color: var(--ds-text-bright);
}

.ds-btn:hover {
  background: var(--ds-bg-raised);
  box-shadow: var(--ds-shadow-md);
}

.ds-btn:not(.ds-btn-punch):hover {
  border-color: var(--ds-border-muted) !important;
}

.ds-btn:active {
  transform: translateY(1px);
}

.ds-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Primary — the one focal amber glow. Warm light, not flat paint. */
.ds-btn-punch {
  background: var(--ds-punch-light);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--ds-shadow-glow);
}

.ds-btn-punch:hover {
  background: var(--ds-punch);
  border-color: transparent;
  /* No orange glow bloom on hover — the aperture fan-down (has-aperture) is the
     interactivity cue. Keep the button's resting box-shadow (no intensification). */
}

/* Outlined amber — an on-brand action that must NOT read as a solid badge
   (e.g. a contextual "Increase budget" in a card corner). Amber text + a soft
   amber wash + amber border, flat (no focal glow — that's reserved for the one
   primary CTA). Pair with border-radius:999px for the pill shape. */
.ds-btn-outline-punch {
  background: var(--ds-punch-tint-md);
  border-color: var(--ds-punch);
  color: var(--ds-punch);
  box-shadow: none;
}
.ds-btn-outline-punch:hover {
  background: var(--ds-punch-tint-strong);
  border-color: var(--ds-punch);
  box-shadow: none;
}

/* ── Aperture fan-down — the brand's primary-action motif ──────────────────
   The OpenAds logo's ring segments grow outward from the button's right cap,
   staggered top→bottom, on hover/focus. Add `has-aperture` to a .ds-btn and
   drop an <aperture-ticks /> inside it. Switches the button to a rounded pill
   (replacing the cut corner). Primary actions + loading states ONLY — keep
   nav / utility / ghost buttons clean (design system §6). */
.has-aperture {
  border-radius: 999px;
  position: relative;
  /* Keep horizontal padding SYMMETRIC so the flex-centered label stays centered;
     the ticks live in the right padding (don't reserve right-only space, which
     shoves the text off-center). */
}
.ds-ap-ticks {
  position: absolute;
  right: 0.3em;
  top: 0;
  height: 100%;
  aspect-ratio: 1 / 1;
  overflow: visible;
  pointer-events: none;
}
.ds-ap-seg {
  transform: scaleX(0);
  transform-box: fill-box;
  transform-origin: left center;
  opacity: 0;
  transition: transform .36s cubic-bezier(.2, .7, .2, 1), opacity .26s ease;
  transition-delay: var(--d, 0s);
  fill: var(--ds-punch);             /* amber on light/secondary surfaces */
}
.has-aperture:hover .ds-ap-seg,
.has-aperture:focus-visible .ds-ap-seg {
  transform: scaleX(1);
  opacity: 1;
}
.ds-btn-punch.has-aperture .ds-ap-seg,
.has-aperture.ap-white .ds-ap-seg { fill: #fff; }                /* white ticks on filled-amber buttons */
.ds-btn-punch.has-aperture:hover .ds-ap-ticks,
.ds-btn-outline-punch.has-aperture:hover .ds-ap-ticks,
.has-aperture.ap-white:hover .ds-ap-ticks {
  filter: drop-shadow(0 0 3px rgba(240, 168, 76, .7));           /* the aperture "powers up" */
}
@media (prefers-reduced-motion: reduce) {
  .ds-ap-seg { transform: scaleX(1); opacity: 1; transition: none; }  /* deployed, static */
}

/* ── Toast notifications (vanillatoasts) ───────────────────────────────────
   vanillatoasts.css ships near-white toasts (#F5F5F5) with washed-out #777
   body text — illegible on the light surface — and is linked AFTER this file,
   so these overrides are id-scoped (#vanillatoasts-container) to win on
   specificity regardless of cascade order. Tokens resolve per active scope. */
#vanillatoasts-container .vanillatoasts-toast {
  background: var(--ds-bg-surface);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  font-family: var(--ds-font-sans);
}
#vanillatoasts-container .vanillatoasts-title {
  color: var(--ds-text-bright);
  font-family: var(--ds-font-display);
}
#vanillatoasts-container .vanillatoasts-text {
  color: var(--ds-text-secondary);
}
#vanillatoasts-container .vanillatoasts-icon {
  background: var(--ds-bg-overlay);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
#vanillatoasts-container .vanillatoasts-success { border-bottom: 2px solid var(--ds-green); }
#vanillatoasts-container .vanillatoasts-warning { border-bottom: 2px solid var(--ds-yellow); }
#vanillatoasts-container .vanillatoasts-error   { border-bottom: 2px solid var(--ds-red); }
#vanillatoasts-container .vanillatoasts-info    { border-bottom: 2px solid var(--ds-blue); }
#vanillatoasts-container .vanillatoasts-toast a,
#vanillatoasts-container .vanillatoasts-toast a:hover { color: var(--ds-punch) !important; }

/* Blue primary */
.ds-btn-primary {
  background: var(--ds-blue-deep);
  border-color: var(--ds-blue-bright);
  color: var(--ds-text-bright);
}

.ds-btn-primary:hover {
  background: var(--ds-blue-bright);
}

/* Ghost buttons */
.ds-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ds-text-secondary);
}

.ds-btn-ghost:hover {
  background: var(--ds-bg-raised);
  color: var(--ds-text-primary);
}

/* Danger */
.ds-btn-danger {
  border-color: var(--ds-red);
  color: var(--ds-red);
  background: transparent;
}

.ds-btn-danger:hover {
  background: var(--ds-red-bg);
}

/* Cut-corners (geometric brand element) — always borderless to avoid clip conflicts */
.ds-cut-corners {
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  border: none;
}

/* Top-right only cut (for cards, panels) */
.ds-cut-tr-sm { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%); border: none; }
.ds-cut-tr-md { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); border: none; }
.ds-cut-tr-lg { clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%); border: none; }


/* ----------------------------------------------------------
   8. FORM INPUTS
   ---------------------------------------------------------- */
.ds-input {
  width: 100%;
  padding: 9px 13px;
  background: var(--ds-bg-input);
  border: 1px solid var(--ds-border-muted);
  border-radius: var(--ds-radius-md);
  color: var(--ds-text-primary);
  font-family: var(--ds-font-sans);
  font-size: 14px;
  transition: var(--ds-transition);
}

.ds-input:hover:not(:focus):not(:disabled) {
  border-color: var(--ds-punch-warm);
}

.ds-input:focus {
  outline: none;
  border-color: var(--ds-punch-light);
  box-shadow: 0 0 0 4px rgba(240, 96, 58, .15);
}

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

/* Override browser autofill background for dark theme */
.ds-input:-webkit-autofill,
.ds-input:-webkit-autofill:hover,
.ds-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--ds-bg-raised) inset;
  -webkit-text-fill-color: var(--ds-text-primary);
  caret-color: var(--ds-text-primary);
  transition: background-color 5000s ease-in-out 0s;
}

.ds-select {
  padding: 8px 12px;
  background: var(--ds-bg-input);
  border: 1px solid var(--ds-border-muted);
  border-radius: var(--ds-radius-sm);
  color: var(--ds-text-primary);
  font-family: inherit;
  font-size: var(--ds-text-base);
  transition: var(--ds-transition);
  cursor: pointer;
}

.ds-select:focus {
  outline: none;
  background: var(--ds-bg-raised);
}

/* Checkbox/radio with punch accent */
.ds-checkbox,
.ds-radio {
  accent-color: var(--ds-punch);
}


/* ----------------------------------------------------------
   9. DATA TABLES
   ---------------------------------------------------------- */
.ds-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--ds-text-sm);
}

.ds-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.ds-table th {
  background: var(--ds-bg-overlay);
  color: var(--ds-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: var(--ds-text-xs);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--ds-border-subtle);
  cursor: pointer;
  user-select: none;
  transition: var(--ds-transition);
}

.ds-table th:hover {
  color: var(--ds-text-primary);
  background: var(--ds-bg-surface);
}

.ds-table th:first-child {
  border-radius: var(--ds-radius-md) 0 0 0;
}

.ds-table th:last-child {
  border-radius: 0 var(--ds-radius-md) 0 0;
}

.ds-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--ds-bg-raised);
  color: var(--ds-text-primary);
  transition: var(--ds-transition);
}

.ds-table tbody tr {
  transition: var(--ds-transition);
}

.ds-table tbody tr:hover {
  background: var(--ds-bg-surface);
}

.ds-table tbody tr:hover td {
  border-bottom-color: var(--ds-border-subtle);
}

/* Sortable header indicator */
.ds-sort-indicator {
  display: inline-block;
  margin-left: 4px;
  color: var(--ds-blue);
  font-size: 9px;
}

/* Accent row (for highlighted/active items) */
.ds-table tbody tr.accent {
  border-left: 3px solid var(--ds-punch);
}


/* ----------------------------------------------------------
   10. TAGS & BADGES
   ---------------------------------------------------------- */
.ds-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  clip-path: polygon(0 0, calc(100% - var(--ds-cut-xs)) 0, 100% var(--ds-cut-xs), 100% 100%, var(--ds-cut-xs) 100%, 0 calc(100% - var(--ds-cut-xs)));
  font-size: var(--ds-text-xs);
  font-weight: 600;
  letter-spacing: 0.3px;
  line-height: 1.6;
}

.ds-tag.green  { background: rgba(34, 197, 94, 0.15);  color: var(--ds-green); }
.ds-tag.red    { background: rgba(239, 68, 68, 0.15);  color: var(--ds-red); }
.ds-tag.blue   { background: rgba(96, 165, 250, 0.15); color: var(--ds-blue); }
.ds-tag.yellow { background: rgba(234, 179, 8, 0.15);  color: var(--ds-yellow); }
.ds-tag.punch  { background: rgba(210, 78, 53, 0.15);  color: var(--ds-punch); }
.ds-tag.gray   { background: rgba(107, 114, 128, 0.15); color: var(--ds-text-muted); }


/* ----------------------------------------------------------
   11. LOG ENTRIES (pixel/event logs)
   ---------------------------------------------------------- */
.ds-log-entry {
  padding: 4px 8px;
  margin: 2px 0;
  background: var(--ds-bg-raised);
  border-radius: var(--ds-radius-sm);
  border-left: 3px solid var(--ds-text-muted);
  font-size: var(--ds-text-xs);
  font-family: var(--ds-font-mono);
}

.ds-log-entry.success { border-left-color: var(--ds-green); }
.ds-log-entry.error   { border-left-color: var(--ds-red); background: var(--ds-red-bg); }
.ds-log-entry.warn    { border-left-color: var(--ds-yellow); }
.ds-log-entry.info    { border-left-color: var(--ds-blue); }
.ds-log-entry.accent  { border-left-color: var(--ds-punch); }


/* ----------------------------------------------------------
   12. NAVBAR
   ---------------------------------------------------------- */
.ds-navbar {
  height: var(--ds-header-height);
  background: var(--ds-bg-base);
  border-bottom: 1px solid var(--ds-border-subtle);
  display: flex;
  align-items: center;
  padding: 0 var(--ds-space-4);
  position: sticky;
  top: 0;
  z-index: 100;
}

.ds-navbar-brand {
  font-size: var(--ds-text-lg);
  font-weight: 700;
  color: var(--ds-text-bright);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ds-navbar-brand span {
  color: var(--ds-punch);
}


/* ----------------------------------------------------------
   13. SIDEBAR
   ---------------------------------------------------------- */
.ds-sidebar {
  width: var(--ds-sidebar-width);
  background: var(--ds-bg-base);
  border-right: 1px solid var(--ds-border-subtle);
  padding: var(--ds-space-4);
  position: sticky;
  top: var(--ds-header-height);
  height: calc(100vh - var(--ds-header-height));
  overflow-y: auto;
  flex-shrink: 0;
}

.ds-sidebar-section {
  margin-bottom: var(--ds-space-6);
}

.ds-sidebar-section-title {
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: var(--ds-space-2);
  padding: 0 var(--ds-space-2);
}

.ds-sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--ds-space-2);
  padding: 8px var(--ds-space-2);
  border-radius: var(--ds-radius-sm);
  color: var(--ds-text-secondary);
  font-size: var(--ds-text-md);
  text-decoration: none;
  transition: var(--ds-transition);
}

.ds-sidebar-link:hover {
  background: var(--ds-bg-surface);
  color: var(--ds-text-primary);
}

.ds-sidebar-link.active {
  background: var(--ds-bg-surface);
  color: var(--ds-text-bright);
  border-left: 2px solid var(--ds-punch);
}


/* ----------------------------------------------------------
   14. MODALS
   ---------------------------------------------------------- */
.ds-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ds-modal {
  background: var(--ds-bg-surface);
  border: none;
  border-radius: var(--ds-radius-lg);
  padding: var(--ds-space-6);
  max-width: 480px;
  width: 90%;
  box-shadow: var(--ds-shadow-lg);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
}

.ds-modal-title {
  font-size: var(--ds-text-xl);
  font-weight: 700;
  color: var(--ds-text-bright);
  margin: 0 0 var(--ds-space-2) 0;
}

.ds-modal-subtitle {
  font-size: var(--ds-text-md);
  color: var(--ds-text-secondary);
  margin: 0 0 var(--ds-space-5) 0;
}


/* ----------------------------------------------------------
   15. ANIMATED CTA (geometric brand element)
   ---------------------------------------------------------- */
.ds-cta-animated {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: filter 0.3s ease;
}

.ds-cta-animated:hover {
  animation: ds-pulseShadow 1.5s ease-in-out infinite;
  filter: brightness(1.1);
}

.ds-cta-animated .ds-cta-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, var(--ds-punch), var(--ds-punch-light), var(--ds-punch), var(--ds-punch-warm), var(--ds-punch));
  background-size: 400% 400%;
  animation: ds-gradientFlow 8s ease infinite;
}

.ds-cta-animated .ds-cta-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, var(--ds-punch-glow) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 140, 90, 0.3) 0%, transparent 50%);
  animation: ds-pulseOverlay 6s ease-in-out infinite;
}

.ds-cta-animated .ds-cta-wave {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--ds-punch-glow), rgba(255, 107, 74, 0.35), rgba(255, 140, 90, 0.3), var(--ds-punch-glow));
  background-size: 200% 100%;
  animation: ds-waveFlow 10s linear infinite;
  mix-blend-mode: screen;
}

/* Corner targeting brackets */
.ds-bracket-wrapper {
  position: relative;
}

.ds-bracket-wrapper .ds-bracket {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0);
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 20;
}

.ds-bracket-wrapper .ds-bracket.tl { top: -15px; left: -15px; border-right: none; border-bottom: none; transform: translate(-80px, -80px) scale(0); }
.ds-bracket-wrapper .ds-bracket.tr { top: -15px; right: -15px; border-left: none; border-bottom: none; transform: translate(80px, -80px) scale(0); }
.ds-bracket-wrapper .ds-bracket.bl { bottom: -15px; left: -15px; border-right: none; border-top: none; transform: translate(-80px, 80px) scale(0); }
.ds-bracket-wrapper .ds-bracket.br { bottom: -15px; right: -15px; border-left: none; border-top: none; transform: translate(80px, 80px) scale(0); }

.ds-bracket-wrapper:hover .ds-bracket {
  border-color: rgba(255, 255, 255, 0.9);
  transform: translate(0, 0) scale(1);
}


/* ----------------------------------------------------------
   16. KEYFRAMES
   ---------------------------------------------------------- */
@keyframes ds-gradientFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes ds-pulseOverlay {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.05); }
}

@keyframes ds-waveFlow {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

@keyframes ds-pulseShadow {
  0%, 100% {
    box-shadow: 0 0 30px rgba(255, 107, 74, 0.8),
                0 0 60px rgba(255, 107, 74, 0.5),
                0 0 100px rgba(210, 78, 53, 0.3);
  }
  50% {
    box-shadow: 0 0 50px rgba(255, 140, 90, 0.9),
                0 0 100px rgba(255, 107, 74, 0.6),
                0 0 150px rgba(210, 78, 53, 0.4);
  }
}

@keyframes ds-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ----------------------------------------------------------
   17. UTILITY HELPERS
   ---------------------------------------------------------- */
.ds-mono { font-family: var(--ds-font-mono); }
.ds-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-text-muted { color: var(--ds-text-muted); }
.ds-text-secondary { color: var(--ds-text-secondary); }
.ds-text-bright { color: var(--ds-text-bright); }
.ds-text-punch { color: var(--ds-punch); }
.ds-text-blue { color: var(--ds-blue); }
.ds-text-green { color: var(--ds-green); }
.ds-text-red { color: var(--ds-red); }
.ds-animate-in { animation: ds-fadeIn 0.3s ease-out; }


/* ----------------------------------------------------------
   18. AUTH & FORM PAGE COMPONENTS
   ---------------------------------------------------------- */

/* Page wrapper */
.ds-page { font-family: var(--ds-font-sans); background: var(--ds-bg-base); }

/* Headings — Jost display, lean and tight. Pair with .ds-accent for the
   one Cormorant-italic amber word (the signature headline move). */
.ds-heading-xl { font-family: var(--ds-font-display); font-size: 30px; font-weight: 500; color: var(--ds-text-bright); letter-spacing: -0.02em; line-height: 1.08; margin: 0 0 6px 0; }
.ds-heading-lg { font-family: var(--ds-font-display); font-size: 23px; font-weight: 500; color: var(--ds-text-bright); letter-spacing: -0.018em; line-height: 1.12; margin: 0 0 4px 0; }
.ds-heading-md { font-family: var(--ds-font-display); font-size: 16px; font-weight: 500; color: var(--ds-text-bright); letter-spacing: -0.01em; margin: 0 0 8px 0; }

/* The Cormorant-italic accent word — amber, set inside a Jost headline */
.ds-accent { font-family: var(--ds-font-serif); font-style: italic; font-weight: 600; color: var(--ds-punch); letter-spacing: 0; }

/* Text */
.ds-subtitle { font-size: var(--ds-text-md); color: var(--ds-text-secondary); margin: 0; }
.ds-caption  { font-size: var(--ds-text-base); color: var(--ds-text-muted); }

/* Form labels */
.ds-label { display: block; font-size: var(--ds-text-base); font-weight: 500; color: var(--ds-text-secondary); margin-bottom: 6px; }

/* Form card container */
.ds-card-form {
  max-width: 400px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  background: var(--ds-bg-surface);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
  padding: 32px;
}

/* Inputs within form cards: raised bg, larger padding, punch focus */
.ds-card-form .ds-input {
  padding: 12px 14px;
  font-size: var(--ds-text-md);
  background: var(--ds-bg-raised);
  border-radius: var(--ds-radius-sm);
}
.ds-card-form .ds-input:focus {
  border-color: var(--ds-punch);
  box-shadow: 0 0 0 1px var(--ds-punch-tint-strong);
}
.ds-card-form select.ds-input {
  appearance: auto;
  cursor: pointer;
}

/* Icon badges (cut-corner) */
.ds-icon-badge {
  width: 48px; height: 48px;
  background: var(--ds-punch-tint-md);
  display: flex; align-items: center; justify-content: center;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.ds-icon-badge-lg {
  width: 56px; height: 56px;
  margin: 0 auto;
  background: var(--ds-punch-tint-md);
  display: flex; align-items: center; justify-content: center;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.ds-icon-badge.success, .ds-icon-badge-lg.success { background: var(--ds-green-bg); }
.ds-icon-badge.error,   .ds-icon-badge-lg.error   { background: var(--ds-red-bg); }

/* Links */
.ds-link-punch { color: var(--ds-punch); font-weight: 600; text-decoration: none; transition: opacity 0.15s; }
.ds-link-punch:hover { opacity: 0.8; }
.ds-link-muted { color: var(--ds-text-muted); text-decoration: none; }

/* Full-width submit button modifier */
.ds-btn-block { width: 100%; padding: 12px; font-size: var(--ds-text-md); font-weight: 600; justify-content: center; }

/* Progress steps */
.ds-progress-step { flex: 1; height: 3px; border-radius: 2px; background: var(--ds-bg-raised); transition: background 0.3s; }
.ds-progress-step.active { background: var(--ds-punch); }

/* Radio dot (custom radio button) */
.ds-radio-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ds-border-muted); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.ds-radio-dot.selected { border-color: var(--ds-punch); }
.ds-radio-dot-fill { width: 8px; height: 8px; border-radius: 50%; background: var(--ds-punch); }

/* Footer links bar */
.ds-footer-links { text-align: center; padding: 12px; font-size: 11px; }
.ds-footer-links a { color: var(--ds-text-muted); text-decoration: none; }
.ds-footer-links .ds-divider { color: var(--ds-border-muted); margin: 0 6px; }


/* Scrollbar styling */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ds-border-subtle); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ds-border-muted); }


/* ----------------------------------------------------------
   18. THE ROOM: body surface + ambient warm light
   The page is a cool station-white room. A single soft "sun"
   (upper-right, warm) plus faint fill light gives the whole
   surface depth without tinting the canvas beige. This REPLACES
   the old tactical grid + noise (which read as HUD clutter).
   ---------------------------------------------------------- */
body {
  background: var(--ds-bg-base);
  color: var(--ds-text-primary);
  font-family: var(--ds-font-sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;            /* paints over the cool ground, beneath all content */
  pointer-events: none;
  background:
    radial-gradient(85% 50% at 50% -10%, rgba(255, 254, 250, .9), transparent 60%),
    radial-gradient(52% 48% at 95% 1%, rgba(240, 170, 80, .13), transparent 70%),  /* warm sun, upper-right */
    radial-gradient(50% 50% at 2% 99%, rgba(78, 132, 176, .05), transparent 70%);  /* faint cool fill, lower-left */
}

/* Admin keeps its own opaque dark surface (see .admin-scope) so the
   ambient room light doesn't bleed through behind it. */

/* Positioned root: absolutely-positioned descendants (e.g. the live-status
   "ping" dot next to a campaign name) must resolve against the app, not the
   viewport. Restores the containing block the old body texture rule provided. */
#content { position: relative; }

/* Loading spinner (spinner.gif = the branded OpenAds "O", solid segment + ticks
   fanning out). The asset is a WHITE gif built for the old dark theme, so it
   vanishes on the light ground. Tint it to ink, but soften the opacity so
   near-black doesn't read harsh on the light surface. Admin stays dark, so
   keep the spinner white + fully opaque there. */
img[src*="spinner.gif"] { filter: brightness(0.85) invert(1); opacity: 0.6; }
.admin-scope img[src*="spinner.gif"] { filter: none; opacity: 1; }


/* ----------------------------------------------------------
   19. STAGGERED ANIMATIONS (v2)
   ---------------------------------------------------------- */
@keyframes ds-cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ds-rowIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes ds-modalIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Staggered card entrance */
.ds-stagger-in {
  opacity: 0;
  transform: translateY(12px);
  animation: ds-cardIn 0.4s ease-out forwards;
}
.ds-stagger-in:nth-child(1) { animation-delay: 0.05s; }
.ds-stagger-in:nth-child(2) { animation-delay: 0.1s; }
.ds-stagger-in:nth-child(3) { animation-delay: 0.15s; }
.ds-stagger-in:nth-child(4) { animation-delay: 0.2s; }
.ds-stagger-in:nth-child(5) { animation-delay: 0.25s; }
.ds-stagger-in:nth-child(6) { animation-delay: 0.3s; }

/* Staggered row entrance */
.ds-row-stagger {
  opacity: 0;
  transform: translateX(-8px);
  animation: ds-rowIn 0.3s ease-out forwards;
}
.ds-row-stagger:nth-child(1) { animation-delay: 0.15s; }
.ds-row-stagger:nth-child(2) { animation-delay: 0.2s; }
.ds-row-stagger:nth-child(3) { animation-delay: 0.25s; }
.ds-row-stagger:nth-child(4) { animation-delay: 0.3s; }
.ds-row-stagger:nth-child(5) { animation-delay: 0.35s; }

/* Modal entrance */
.ds-modal {
  animation: ds-modalIn 0.25s ease-out;
}


/* ----------------------------------------------------------
   20. CUT-CORNER HELPERS (v2 variable-based)
   ---------------------------------------------------------- */
.ds-cut-xs { clip-path: polygon(0 0, calc(100% - var(--ds-cut-xs)) 0, 100% var(--ds-cut-xs), 100% 100%, var(--ds-cut-xs) 100%, 0 calc(100% - var(--ds-cut-xs))); border: none; border-radius: 0; }
.ds-cut-sm { clip-path: polygon(0 0, calc(100% - var(--ds-cut-sm)) 0, 100% var(--ds-cut-sm), 100% 100%, var(--ds-cut-sm) 100%, 0 calc(100% - var(--ds-cut-sm))); border: none; border-radius: 0; }
.ds-cut-md { clip-path: polygon(0 0, calc(100% - var(--ds-cut-md)) 0, 100% var(--ds-cut-md), 100% 100%, var(--ds-cut-md) 100%, 0 calc(100% - var(--ds-cut-md))); border: none; border-radius: 0; }
.ds-cut-lg { clip-path: polygon(0 0, calc(100% - var(--ds-cut-lg)) 0, 100% var(--ds-cut-lg), 100% 100%, var(--ds-cut-lg) 100%, 0 calc(100% - var(--ds-cut-lg))); border: none; border-radius: 0; }

/* Top-right only cut */
.ds-cut-tr { clip-path: polygon(0 0, calc(100% - var(--ds-cut-sm)) 0, 100% var(--ds-cut-sm), 100% 100%, 0 100%); border: none; border-radius: 0; }


/* ----------------------------------------------------------
   21. SPARKLINES (v2)
   ---------------------------------------------------------- */
.ds-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
  opacity: 0.5;
}

.ds-sparkline .bar {
  width: 3px;
  border-radius: 1px;
  background: var(--ds-text-muted);
  transition: background 0.2s;
}

.ds-sparkline.punch .bar { background: rgba(210, 78, 53, 0.4); }
.ds-sparkline.blue .bar  { background: rgba(96, 165, 250, 0.35); }
.ds-sparkline.green .bar { background: rgba(34, 197, 94, 0.35); }


/* ----------------------------------------------------------
   22. TABLE HOVER ENHANCEMENTS (v2)
   ---------------------------------------------------------- */
.ds-table tbody tr:hover {
  background: rgba(210, 78, 53, 0.02);
}

.ds-table tbody tr:hover td:first-child {
  box-shadow: inset 2px 0 0 var(--ds-punch);
}

/* Sort arrow styling */
.ds-sort-arrow {
  color: var(--ds-punch);
  font-size: 9px;
  margin-left: 3px;
}


/* ----------------------------------------------------------
   23. STATUS BAR (v2)
   ---------------------------------------------------------- */
.ds-status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 26px;
  background: var(--ds-bg-surface);
  border-top: 1px solid var(--ds-border-subtle);
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 10px;
  color: var(--ds-text-muted);
  font-family: var(--ds-font-mono);
  gap: 20px;
  z-index: 100;
}

.ds-status-bar::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, var(--ds-punch), transparent);
}


/* ============================================================
   24. OPENADS LAYER — the new aesthetic vocabulary
   "Madison Avenue on a space station." Cool white room, warm
   light, walnut gravity. These .oa-* primitives are what the
   user-facing campaign-manager views are composed from. They
   sit on top of the (now light) --ds-* tokens.
   ============================================================ */

/* ---- Eyebrow: one Cormorant-italic line above a heading ---- */
.oa-eyebrow {
  font-family: var(--ds-font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: .01em;
  color: var(--ds-punch);
  line-height: 1.2;
}
.oa-eyebrow.cool { color: var(--ds-blue); }

/* ---- Micro-label: spaced uppercase Jost (instrumentation cue) ---- */
.oa-micro {
  font-family: var(--ds-font-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ds-text-secondary);
}

/* ---- Display headline: Jost 300, tight. Use <span class="ds-accent"> for the italic amber word ---- */
.oa-display {
  font-family: var(--ds-font-display);
  font-weight: 300;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -.025em;
  line-height: 1.04;
  color: var(--ds-text-bright);
}

/* ---- Tabular figures: precision cue for any aligned/updating numbers ---- */
.oa-figure { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---- Warm card: a lit white surface with an optional gold light-line on top ---- */
.oa-card {
  position: relative;
  background: var(--ds-bg-surface);
  border-radius: var(--ds-radius-lg);
  padding: 26px 28px;
  box-shadow: var(--ds-shadow-md);
  transition: box-shadow .3s ease, transform .3s ease;
}
.oa-card.lift:hover { box-shadow: var(--ds-shadow-lg); transform: translateY(-2px); }
.oa-card.line::before {
  content: "";
  position: absolute; top: 0; left: 26px; right: 26px; height: 2px;
  background: var(--ds-punch-warm);
  border-radius: 0 0 var(--ds-radius-xl) var(--ds-radius-xl);
  box-shadow: 0 0 10px rgba(221, 162, 83, .6);
  opacity: .55; transition: .3s;
}
.oa-card.line:hover::before { opacity: 1; left: 20px; right: 20px; }

/* ---- Icon tile: a soft amber rounded square holding a line icon ---- */
.oa-ic {
  width: 46px; height: 46px; flex: none;
  border-radius: 13px;
  background: var(--ds-punch-tint-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--ds-punch);
}

/* ---- Holographic readout: data that glows amber, lit from within ---- */
.oa-holo {
  border-radius: var(--ds-radius-md);
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(240, 96, 58, .12), rgba(221, 162, 83, .05));
  backdrop-filter: blur(8px);
  border: 1px solid rgba(240, 96, 58, .30);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .4) inset,
              0 0 26px -2px rgba(240, 168, 76, .4),
              0 20px 46px -18px rgba(240, 96, 58, .4);
}

/* ---- Walnut panel: the one heavy "engine room through a doorway" moment ---- */
.oa-walnut {
  background: var(--ds-walnut, #6E4C30);
  color: #F4EBDF;
  border-radius: var(--ds-radius-lg);
  box-shadow: 0 0 0 1px rgba(216, 160, 84, .25), 0 18px 44px -16px rgba(74, 50, 32, .6);
}

/* ---- Eyebrow + heading section header ---- */
.oa-sec-head { max-width: 760px; margin-bottom: 28px; }
.oa-sec-head h2, .oa-sec-head .h2 {
  font-family: var(--ds-font-display);
  font-weight: 300;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -.022em;
  line-height: 1.08;
  margin: 8px 0 0;
  color: var(--ds-text-bright);
}
.oa-sec-head p { color: var(--ds-text-secondary); font-size: 16px; margin-top: 10px; }

/* ---- Live indicator dot (amber pulse) ---- */
.oa-live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ds-punch-light);
  animation: oa-pulse 2s infinite;
  display: inline-block;
}
@keyframes oa-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--ds-punch-light); }
  50%      { opacity: .4; box-shadow: none; }
}

/* ---- The aperture spinner: the OpenAds logo, turning. The most
        authentic "the machine is working" state. Drop the SVG inline
        and wrap in .oa-spin. ---- */
.oa-spin svg { animation: oa-spin 1.4s linear infinite; display: block; }
@keyframes oa-spin { to { transform: rotate(360deg); } }

/* ---- Ghost/arrow link that slides on hover ---- */
.oa-arrow .ar { display: inline-block; transition: transform .25s ease; }
.oa-arrow:hover .ar { transform: translateX(4px); }

/* ---- Pill chips (status / tags) in the warm system ---- */
.oa-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--ds-font-display); font-weight: 500; font-size: 12px;
  letter-spacing: .02em;
  padding: 4px 12px; border-radius: 999px;
}
.oa-chip.amber  { background: var(--ds-punch-tint-md); color: var(--ds-punch); }
.oa-chip.walnut { background: #EADFCE; color: var(--ds-walnut-deep, #4A3220); }
.oa-chip.sky    { background: var(--ds-blue-soft, #E1E9F0); color: var(--ds-blue); }
.oa-chip.ink    { background: var(--ds-text-bright); color: #fff; }

/* Walnut tokens for the OpenAds layer */
:root {
  --ds-walnut:      #6E4C30;
  --ds-walnut-deep: #4A3220;
  --ds-walnut-soft: #9A7551;
  --ds-gold:        #DDA253;
  --ds-blue-soft:   #E1E9F0;
}

/* ---- Shared <data-table> component helpers (token-driven) ---- */
.ds-table-th:hover { color: var(--ds-text-primary) !important; }
.ds-table-divide > tr + tr { border-top: 1px solid var(--ds-border-subtle); }
.ds-table-row:hover { background: var(--ds-bg-raised); }


/* ============================================================
   25. ADMIN SCOPE — keep /admin dark & functional, untouched.
   The whole app flipped to light via the tokens above. Admin
   internal tooling is out of scope for the redesign, so we
   re-declare the ORIGINAL dark token values locally on the
   admin root (.admin-scope, added to admin.html). Admin sections
   use a mix of --ds-* tokens and hardcoded Tailwind grays
   (bg-gray-800 etc.); restoring the dark tokens keeps both
   coherent with zero per-section work.
   ============================================================ */
.admin-scope {
  --ds-bg-base:        #0f1117;
  --ds-bg-surface:     #1a1d25;
  --ds-bg-raised:      #1f2128;
  --ds-bg-overlay:     #252830;
  --ds-bg-input:       #1a1d25;

  --ds-border-subtle:  #2a2d35;
  --ds-border-muted:   #3b3f4a;
  --ds-border-focus:   #60a5fa;

  --ds-punch:          #d24e35;
  --ds-punch-hover:    #b8412b;
  --ds-punch-glow:     rgba(210, 78, 53, 0.4);
  --ds-punch-light:    #ff6b4a;
  --ds-punch-warm:     #ffaa88;
  --ds-punch-tint:     rgba(210, 78, 53, 0.04);
  --ds-punch-tint-md:  rgba(210, 78, 53, 0.12);
  --ds-punch-tint-strong: rgba(210, 78, 53, 0.15);

  --ds-blue:           #60a5fa;
  --ds-blue-deep:      #1e40af;
  --ds-blue-bright:    #3b82f6;
  --ds-green:          #22c55e;
  --ds-success:        #22c55e;
  --ds-green-bg:       #052e16;
  --ds-red:            #ef4444;
  --ds-red-bg:         #2d0a0a;
  --ds-yellow:         #eab308;
  --ds-yellow-bg:      #451a03;
  --ds-purple:         #8b5cf6;
  --ds-cyan:           #06b6d4;
  --ds-pink:           #ec4899;

  --ds-text-primary:   #e0e0e0;
  --ds-text-secondary: #9ca3af;
  --ds-text-muted:     #6b7280;
  --ds-text-bright:    #ffffff;

  --ds-font-sans:      'Outfit', sans-serif;

  /* restore the flat dark shadows (the warm gold rim looks wrong on dark) */
  --ds-shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.3);
  --ds-shadow-md:      0 2px 8px rgba(0, 0, 0, 0.4);
  --ds-shadow-lg:      0 4px 16px rgba(0, 0, 0, 0.5);
  --ds-shadow-glow:    0 0 20px rgba(210, 78, 53, 0.3);

  background: var(--ds-bg-base);
  color: var(--ds-text-primary);
  font-family: var(--ds-font-sans);
  min-height: calc(100vh - var(--ds-header-height));
}
/* admin buttons: restore the flat brand fill (no warm glow) */
.admin-scope .ds-btn { box-shadow: none; font-family: var(--ds-font-sans); }
.admin-scope .ds-btn-punch { background: var(--ds-punch); color: #fff; }
.admin-scope .ds-btn-punch:hover { background: var(--ds-punch-hover); box-shadow: var(--ds-shadow-glow); }
.admin-scope .ds-panel,
.admin-scope .ds-metric-card { box-shadow: none; }
.admin-scope .oa-card { box-shadow: var(--ds-shadow-md); }
