/* static/admin-theme.css
 * Modo escuro e mapeamento semântico das variáveis legadas --ui-* para os tokens de PLANO.md (Secção 3.1).
 * Nenhuma cor solta fora da definição dos 16 tokens de html[data-theme="dark"].
 */

:root {
  color-scheme: light;
  /* Mapeamento semântico de todas as variáveis --ui-* para os tokens da Secção 3.1 */
  --ui-bg-fff: var(--surface);
  --ui-bg-ffffff: var(--surface);
  --ui-bg-faf9f5: var(--surface);
  --ui-bg-fdfbf7: var(--surface);
  --ui-bg-fdfaf6: var(--surface);
  --ui-bg-fcf9f4: var(--surface);
  --ui-bg-faf7f2: var(--surface);
  --ui-bg-f9faf8: var(--surface);
  --ui-bg-f9f7f2: var(--surface-2);
  --ui-bg-f8f6f1: var(--surface-2);
  --ui-bg-f7f8f6: var(--surface-2);
  --ui-bg-f6f7f4: var(--surface-2);
  --ui-bg-f6f6f2: var(--surface-2);
  --ui-bg-f6f5f0: var(--surface-2);
  --ui-bg-f6f4ef: var(--surface-2);
  --ui-bg-f5f0e7: var(--surface-2);
  --ui-bg-f5efe6: var(--surface-2);
  --ui-bg-f4f5f2: var(--surface-2);
  --ui-bg-f4f4f4: var(--surface-2);
  --ui-bg-f3f4f6: var(--surface-2);
  --ui-bg-f3f4f0: var(--surface-2);
  --ui-bg-f0f1ec: var(--surface-2);
  --ui-bg-efebe2: var(--surface-2);
  --ui-bg-eceee9: var(--surface-2);
  --ui-bg-eaece7: var(--surface-2);
  --ui-bg-e5e2dc: var(--surface-2);
  --ui-bg-e2e4de: var(--surface-2);
  --ui-bg-2c3033: var(--surface-2);
  --ui-bg-262a2c: var(--surface-2);
  --ui-bg-242a27: var(--surface-2);
  --ui-bg-232729: var(--surface-2);
  --ui-bg-222628: var(--surface-2);
  --ui-bg-1f2421: var(--surface-2);
  --ui-bg-17191a: var(--surface);
  --ui-bg-142b24: var(--accent);
  --ui-bg-0d5c43: var(--accent);
  --ui-bg-dbeafe: var(--info-soft);
  --ui-bg-dcfce7: var(--ok-soft);
  --ui-bg-ebf5f0: var(--ok-soft);
  --ui-bg-25d366: var(--ok);
  --ui-bg-fef08a: var(--warn-soft);
  --ui-bg-fef3c7: var(--warn-soft);
  --ui-bg-fff8ee: var(--warn-soft);
  --ui-bg-fffbeb: var(--warn-soft);
  --ui-bg-fffdf5: var(--warn-soft);
  --ui-bg-f59e0b: var(--warn);
  --ui-bg-fde8e8: var(--risk-soft);
  --ui-bg-fde9e2: var(--risk-soft);
  --ui-bg-fee2e2: var(--risk-soft);
  --ui-bg-fef2f2: var(--risk-soft);
  --ui-bg-fff5f5: var(--risk-soft);

  --ui-fg-111: var(--text);
  --ui-fg-1c1917: var(--text);
  --ui-fg-333a35: var(--text);
  --ui-fg-374151: var(--text);
  --ui-fg-4b5563: var(--text-2);
  --ui-fg-6b7280: var(--text-2);
  --ui-fg-888e88: var(--text-2);
  --ui-fg-a9aea8: var(--text-2);
  --ui-fg-c4c8c3: var(--text-2);
  --ui-fg-d5d8d2: var(--text);
  --ui-fg-e7e8e3: var(--text);
  --ui-fg-faf9f5: var(--on-solid);
  --ui-fg-fff: var(--on-solid);
  --ui-fg-ffffff: var(--on-solid);
  --ui-fg-075985: var(--info);
  --ui-fg-1e40af: var(--info);
  --ui-fg-0d5c43: var(--accent);
  --ui-fg-142b24: var(--accent);
  --ui-fg-14532d: var(--ok);
  --ui-fg-15803d: var(--ok);
  --ui-fg-166534: var(--ok);
  --ui-fg-7fd3a4: var(--ok);
  --ui-fg-78350f: var(--warn);
  --ui-fg-854d0e: var(--warn);
  --ui-fg-b45309: var(--warn);
  --ui-fg-f0a35e: var(--warn);
  --ui-fg-7a2e1a: var(--risk);
  --ui-fg-7f1d1d: var(--risk);
  --ui-fg-991b1b: var(--risk);
  --ui-fg-9b1c1c: var(--risk);
  --ui-fg-9f2020: var(--risk);
  --ui-fg-a42626: var(--risk);
  --ui-fg-b91c1c: var(--risk);
  --ui-fg-f28b8b: var(--risk);

  --ui-line-25292b: var(--border);
  --ui-line-2c3033: var(--border);
  --ui-line-34393d: var(--border);
  --ui-line-363b3e: var(--border);
  --ui-line-657169: var(--border);
  --ui-line-b9bdb5: var(--border);
  --ui-line-d5cec0: var(--border);
  --ui-line-d6d0c4: var(--border);
  --ui-line-d8c4a8: var(--border);
  --ui-line-d8d0c1: var(--border);
  --ui-line-dccbb5: var(--border);
  --ui-line-e2ded4: var(--border);
  --ui-line-e4e6e1: var(--border);
  --ui-line-e5dfd3: var(--border);
  --ui-line-e6dfd3: var(--border);
  --ui-line-ece7dc: var(--border);
  --ui-line-eceee9: var(--border);
  --ui-line-f0ede6: var(--border);
  --ui-line-0d5c43: var(--accent);
  --ui-line-142b24: var(--accent);
  --ui-line-25d366: var(--ok);
  --ui-line-86efac: var(--ok);
  --ui-line-d97706: var(--warn);
  --ui-line-dc2626: var(--risk);
  --ui-line-e02424: var(--risk);
  --ui-line-fca5a5: var(--risk);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141517;
  --surface: #1C1D20;
  --surface-2: #24262A;
  --border: #33353A;
  --text: #ECECEA;
  --text-2: #A2A5AB;
  --accent: #6FA3D6;
  --accent-soft: #1E2C3A;
  --ok: #5CC48F;
  --ok-soft: #173326;
  --warn: #E8B04B;
  --warn-soft: #36290F;
  --risk: #F07B70;
  --risk-soft: #3A1A17;
  --info: #7FA8EC;
  --info-soft: #1A2740;
  --on-solid: var(--bg);
}

html[data-theme="dark"] :is(input, select, textarea)::placeholder {
  color: var(--text-2);
  opacity: 1;
}

html[data-theme="dark"] :not(img):not(svg)[style*="background:#fff" i],
html[data-theme="dark"] :not(img):not(svg)[style*="background: #fff" i],
html[data-theme="dark"] :not(img):not(svg)[style*="background:#ffffff" i],
html[data-theme="dark"] :not(img):not(svg)[style*="background: #ffffff" i] {
  background: var(--surface) !important;
}

html[data-theme="dark"] [style*="#dcfce7" i] {
  background: var(--ok-soft) !important;
  color: var(--ok) !important;
}
html[data-theme="dark"] [style*="#fee2e2" i],
html[data-theme="dark"] [style*="#fef2f2" i],
html[data-theme="dark"] [style*="#fde8e8" i] {
  background: var(--risk-soft) !important;
  color: var(--risk) !important;
}
html[data-theme="dark"] [style*="#fef3c7" i],
html[data-theme="dark"] [style*="#fffbeb" i] {
  background: var(--warn-soft) !important;
  color: var(--warn) !important;
}
html[data-theme="dark"] [style*="#dbeafe" i],
html[data-theme="dark"] [style*="#e0f2fe" i] {
  background: var(--info-soft) !important;
  color: var(--info) !important;
}

@media print {
  .ui-preferences {
    display: none !important;
  }
  html[data-theme="dark"] body,
  html[data-theme="dark"] .main {
    background: var(--surface) !important;
    color: var(--text) !important;
  }
  html[data-theme="dark"] .main * {
    color: var(--text) !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border-color: var(--border) !important;
  }
}
