/* Loaded AFTER theme-v2.css. Holds dark-mode fixes + design-audit polish.
   Scoped overrides; equal-or-higher specificity than the base !important rules. */

/* ============================================================
   DARK MODE P0 fixes (DESIGN-AUDIT items 1 & 2)
   ============================================================ */

/* 1. Sticky table headers: were hardcoded #fff, glowing white in dark mode. */
html[data-theme="dark"] .v2 .table-wrap thead tr{
  background:var(--bg-panel)!important;
}
html[data-theme="dark"] .v2 .table-wrap thead th{
  background:var(--bg-panel)!important;
  box-shadow:0 -18px 0 var(--bg-panel), inset 0 -1px 0 var(--border)!important;
}

/* 2. Text inputs: rendered white box + near-white text (invisible typing) in dark mode. */
html[data-theme="dark"] .v2 input,
html[data-theme="dark"] .v2 select,
html[data-theme="dark"] .v2 textarea{
  background:var(--bg-elev)!important;
  color:var(--text)!important;
  border-color:var(--border)!important;
}

/* ============================================================
   DESIGN POLISH (DESIGN-AUDIT P1)
   ============================================================ */

/* #9 De-blue: one solid-accent action per view. Active filters/tabs use a soft
   tint instead of the solid gradient, so the real primary buttons stand out. */
.v2 .chip.active{ background:var(--accent-soft)!important; color:var(--accent)!important; box-shadow:none!important; }

.v2 .pl-col-count{ background:var(--bg-elev)!important; color:var(--text-dim)!important; }

/* #customer: the "+ Add name" alias button is a secondary action, so accent-soft
   (theme-v2 forces #alias-add to solid accent; override it here, loaded last). */
.v2 #alias-add{ background:var(--accent-soft)!important; color:var(--accent)!important; border:1px solid transparent!important; }

/* #9 "Set" buttons become ghost (Adjust is already ghost), so a row has no solid blue. */
.v2 .stock-btn.primary{ background:var(--accent-soft)!important; color:var(--accent)!important; box-shadow:none!important; }
.v2 .stock-btn.primary:hover{ filter:brightness(.97); }

/* Invoices / costs: drop the full-row status tint. The status pill already carries
   the state, and the tint silently disappeared in dark mode (inconsistent). */
.v2 table.invoices tbody tr.is-outstanding,
.v2 table.invoices tbody tr.is-partial{ background:transparent!important; }

/* #customer: drag grips are hidden by default and appear only on card hover. */
.v2 .grip{ opacity:0!important; transition:opacity .15s; }
.v2 .card:hover .grip,
.v2 [data-card-id]:hover .grip,
.v2 .grip:hover{ opacity:.6!important; }

/* Unified data-provenance flag pill. Replaces the old placeholder/guessed/Example/REAL
   styles. Two variants: neutral (guessed/placeholder) and real (green). */
.tag-flag{ display:inline-flex; align-items:center; font-size:9px; font-weight:700; letter-spacing:.03em;
  text-transform:none; padding:2px 8px; border-radius:999px; vertical-align:middle; line-height:1.6; }
.tag-flag.neutral{ background:var(--bg-elev); color:var(--text-dim); }
.tag-flag.real{ background:rgba(22,163,74,.12); color:var(--pos); }
