/* ════════════════════════════════════════════════════════════════
   theme-apple-fixes.css — Zadanie 5: sprzątanie twardych kolorów
   --------------------------------------------------------------------
   Późna warstwa "overrides" (jedyna dozwolona wg masterplanu §Faza 1).
   Naprawia zakodowane #fff/#e5e9f0/... z !important, które łamały dark
   mode i spójność Apple. Każdy wpis = realny selektor zlokalizowany w
   styles.css. Używamy !important TYLKO dlatego, że oryginał ma !important.

   ŚWIADOMIE POMINIĘTE (mają zostać białe — druk na papierze):
     #leave-print-modal, .printing-* (styles.css ~11144, ~11209)

   POZOSTAŁY SWEEP (iteracyjnie, 1 moduł = 1 commit, per masterplan):
     pozostałe ~80 wystąpień "#fff !important" w t166/t175/t182 — do
     przejścia modułami: Dashboard → Order Manager → MES → RCP → AI Center.
   ════════════════════════════════════════════════════════════════ */

/* Sidebar: hover pozycji menu był wymuszany na biały (styles.css ~11449) */
.sidebar .pill:hover,
nav .pill:hover {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
}

/* User info na dole sidebara (styles.css ~11524) */
.user-info,
.account-info {
  background: var(--bg-2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}

/* Ghost buttons — były wymuszane na białe tło + szary tekst (styles.css ~16346) */
.btn.ghost {
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--text-2) !important;
}
.btn.ghost:hover {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
}

/* Drobne, wspólne powierzchnie często hardkodowane na biały z !important
   (styles.css ~10586, ~10964) — bezpieczne zmapowanie na token powierzchni.
   W light mode = #fff (bez zmian), w dark = poprawny ciemny panel. */
.settings-card,
.kpi-card,
.stat-card {
  background: var(--bg-2) !important;
}


/* Light-only Apple UI: dark mode is intentionally disabled for this product. */
:root[data-theme="dark"],
body.dark,
html.dark {
  color-scheme: light !important;
  --bg: #f5f5f7 !important;
  --bg-2: #ffffff !important;
  --surface: #ffffff !important;
  --surface-2: #ffffff !important;
  --surface-3: #f5f5f7 !important;
  --surface-hover: #f0f0f3 !important;
  --border: rgba(0,0,0,.10) !important;
  --border-2: rgba(0,0,0,.16) !important;
  --border-strong: rgba(0,0,0,.24) !important;
  --text: #1d1d1f !important;
  --text-2: #424245 !important;
  --muted: #6e6e73 !important;
  --muted-2: #86868b !important;
  --accent: #0071e3 !important;
  --accent-2: #0066cc !important;
  --accent-soft: rgba(0,113,227,.10) !important;
  --accent-soft-2: rgba(0,113,227,.16) !important;
  --accent-glow: rgba(0,113,227,.25) !important;
  --green: #34c759 !important;
  --green-soft: rgba(52,199,89,.12) !important;
  --red: #ff3b30 !important;
  --red-soft: rgba(255,59,48,.10) !important;
  --amber: #ff9500 !important;
  --amber-soft: rgba(255,149,0,.12) !important;
  --glass-bg: rgba(255,255,255,.72) !important;
  --brand-50: rgba(0,113,227,.08) !important;
  --brand-100: rgba(0,113,227,.14) !important;
  --brand-500: #0071e3 !important;
  --brand-600: #0066cc !important;
  --brand-700: #0059b3 !important;
  --ink-900: #1d1d1f !important;
  --ink-700: #424245 !important;
  --ink-500: #6e6e73 !important;
  --ink-300: #c7c7cc !important;
  --ink-100: #f0f0f3 !important;
  --ink-50: #f5f5f7 !important;
}

:root[data-theme="dark"] body,
body.dark {
  background: var(--bg) !important;
  color: var(--text) !important;
}

#t171-panel {
  --t171-accent: #0071e3;
  --t171-accent-h: #0066cc;
  --t171-bg: #ffffff;
  --t171-bg2: #f5f5f7;
  --t171-border: rgba(0,0,0,.10);
  --t171-text: #1d1d1f;
  --t171-muted: #6e6e73;
  --t171-user-bg: #0071e3;
  --t171-user-txt: #ffffff;
  --t171-asst-bg: #f5f5f7;
  --t171-asst-txt: #1d1d1f;
  --t171-err-bg: #fff2f2;
  --t171-err-txt: #d70015;
  --t171-sys-bg: #f0fff4;
  --t171-sys-txt: #248a3d;
  --t171-shadow: 0 24px 70px rgba(0,0,0,.16), 0 4px 18px rgba(0,0,0,.08);
  --t171-radius: 22px;
}

#t171-panel,
.t173-drawer,
dialog,
.modal,
.card,
.settings-card,
.mes-section {
  color-scheme: light !important;
}
