/* Identidad oficial: docs/marca/REFERENCIA-MARCA.md. Recursos locales originales. */
@font-face {
  font-family: 'Andere Archivo';
  src: url('brand/Archivo-Variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Andere Kurdis';
  src: url('brand/Kurdis-Regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
}
@font-face {
  font-family: 'Andere Kurdis';
  src: url('brand/Kurdis-SemiBold.woff2') format('woff2');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Andere Kurdis';
  src: url('brand/Kurdis-Bold.woff2') format('woff2');
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
}

/* Selector compacto de las dos variantes oficiales de Andere. */
.theme-picker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  flex-shrink: 0;
  color: var(--muted);
  font: 600 12px var(--sans);
}
.theme-options { display: inline-flex; align-items: center; gap: 4px; }
.theme-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border-strong, var(--color-border-strong));
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: 700 11px var(--sans);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.theme-option svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-option:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--accent); }
.theme-option.active { background: var(--accent); border-color: var(--accent); color: var(--ink-contrast); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.theme-option:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.theme-picker-floating { position: fixed; top: 16px; right: 16px; z-index: 10; }
.brand-mark { display: none; }
.brand-mark-light { display: none; }
.login-brand { display: none; }

html:is([data-theme="andere"], [data-theme="andere-dark"]) {
  color-scheme: light;
  --brand-petrol: #1d4852;
  --brand-orange: #e85d31;
  --brand-black: #11171d;
  --brand-gray: #e3e3e1;
  --font-display: 'Andere Kurdis', 'Archivo', ui-sans-serif, sans-serif;
  --font-body: 'Andere Archivo', ui-sans-serif, sans-serif;
  --display: var(--font-display);
  --sans: var(--font-body);

  /* Tokens de Pagos/Inicio y sus equivalentes de Comercial, Bancos y Empleados. */
  --color-bg: #f2f2f0;
  --color-surface: #fff;
  --color-surface-sunken: var(--brand-gray);
  --color-border: #d4dad8;
  --color-border-strong: #a9b7b7;
  --color-ink: var(--brand-petrol);
  --color-ink-contrast: #fff;
  --color-text: var(--brand-black);
  --color-muted: #536568;
  --color-faint: #667779;
  --color-info: var(--brand-petrol);
  --color-info-bg: #eaf0ef;
  --color-info-border: #becfcd;
  --color-scrollbar: rgba(83, 101, 104, .4);
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --surface-raised: #fff;
  --card: var(--color-surface);
  --border: var(--color-border);
  --border-strong: var(--color-border-strong);
  --ink: var(--brand-petrol);
  --ink-contrast: #fff;
  --text: var(--brand-black);
  --text-contrast: #fff;
  --text-hover: var(--brand-petrol);
  --muted: var(--color-muted);
  --accent: var(--brand-petrol);
  --accent-bg: var(--color-info-bg);
  --accent-bg-hover: #dde7e5;
  --accent-border: var(--color-info-border);
  --orange: var(--brand-orange);
  --table-header: var(--brand-petrol);
  --table-header-text: #fff;
  --hero-start: var(--brand-petrol);
  --hero-end: var(--brand-petrol);
  --hero-title: #fff;
  --hero-text: var(--brand-gray);
  --hero-accent: #ffc3a6;
  --shadow-sm: 0 2px 4px rgba(17, 23, 29, .04);
  --shadow-md: 0 6px 20px rgba(29, 72, 82, .09);
  --shadow-focus: 0 0 0 3px rgba(29, 72, 82, .2);
}

/* Mismos recursos de marca, con superficies y estados adaptados al fondo oscuro. */
html[data-theme="andere-dark"] {
  color-scheme: dark;
  --color-bg: var(--brand-black);
  --color-surface: #19252c;
  --color-surface-sunken: #142027;
  --color-border: #34474e;
  --color-border-strong: #536b72;
  --color-ink: #f2f3ef;
  --color-ink-contrast: var(--brand-black);
  --color-text: var(--brand-gray);
  --color-muted: #a9babc;
  --color-faint: #8fa3a6;
  --color-info: #9bc9cc;
  --color-info-bg: #203a42;
  --color-info-border: #46676e;
  --color-success: #85cda6;
  --color-success-hover: #a1dfbc;
  --color-success-bg: #1c332b;
  --color-success-border: #3b634e;
  --color-warning: #edb66f;
  --color-warning-hover: #f6ca90;
  --color-warning-bg: #382c20;
  --color-warning-border: #725435;
  --color-danger: #f1948e;
  --color-danger-bg: #3b2529;
  --color-danger-border: #74474c;
  --color-scrollbar: rgba(169, 186, 188, .45);
  --surface-raised: #22323a;
  --ink: var(--color-ink);
  --ink-contrast: var(--color-ink-contrast);
  --text: var(--color-text);
  --text-contrast: var(--color-ink-contrast);
  --text-hover: #fff;
  --accent: var(--color-info);
  --accent-bg-hover: #2a4750;
  --accent2: var(--color-success);
  --accent2-bg: var(--color-success-bg);
  --ok: var(--color-success);
  --ok-bg: var(--color-success-bg);
  --warn: var(--color-warning);
  --warn-bg: var(--color-warning-bg);
  --warn-border: var(--color-warning-border);
  --danger: var(--color-danger);
  --danger-bg: var(--color-danger-bg);
  --danger-border: var(--color-danger-border);
  --success-row-bg: rgba(133, 205, 166, .06);
  --success-row-hover: rgba(133, 205, 166, .11);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, .16);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .24);
  --shadow-focus: 0 0 0 3px rgba(155, 201, 204, .25);
}
html[data-theme="andere-dark"] .brand-mark-color { display: none; }
html[data-theme="andere-dark"] .brand-mark-light { display: inline; }
html[data-theme="andere-dark"] mark { background: #654d1d; color: #ffe7ac; }

html:is([data-theme="andere"], [data-theme="andere-dark"]) header {
  background: var(--brand-petrol);
  border-top: 4px solid var(--brand-orange);
  border-radius: 12px;
  padding: 12px 22px 20px;
  align-items: center;
}
html:is([data-theme="andere"], [data-theme="andere-dark"]) header .logo {
  color: var(--brand-gray);
  font-size: 12px;
}
html:is([data-theme="andere"], [data-theme="andere-dark"]) .brand-text { display: none; }
html:is([data-theme="andere"], [data-theme="andere-dark"]) .brand-mark {
  display: block;
  width: 218px;
  height: auto;
  max-width: 100%;
}
html:is([data-theme="andere"], [data-theme="andere-dark"]) header .brand-mark-color { display: none; }
html:is([data-theme="andere"], [data-theme="andere-dark"]) header .brand-mark-light { display: inline; }
html:is([data-theme="andere"], [data-theme="andere-dark"]) header .theme-picker { color: var(--brand-gray); }
html:is([data-theme="andere"], [data-theme="andere-dark"]) header .theme-option {
  background: rgba(255,255,255,.08);
  color: var(--brand-gray);
  border-color: rgba(255,255,255,.28);
}
html:is([data-theme="andere"], [data-theme="andere-dark"]) header .theme-option.active {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  color: var(--brand-black);
}
html:is([data-theme="andere"], [data-theme="andere-dark"]) header .theme-option:focus-visible {
  outline-color: var(--brand-gray);
}
html:is([data-theme="andere"], [data-theme="andere-dark"]) header .btn-ghost {
  background: var(--surface);
  color: var(--color-ink);
  border-color: transparent;
}
html:is([data-theme="andere"], [data-theme="andere-dark"]) header .btn-danger {
  background: var(--danger-bg, var(--color-danger-bg));
  color: var(--danger, var(--color-danger));
}
html:is([data-theme="andere"], [data-theme="andere-dark"]) .module-card {
  --module-accent: var(--color-info);
  --module-tint: var(--color-info-bg);
  --module-border: var(--color-info);
  border-top: 3px solid var(--brand-orange);
}
html:is([data-theme="andere"], [data-theme="andere-dark"]) .module-card h3 { font-weight: 700; }
html:is([data-theme="andere"], [data-theme="andere-dark"]) .module-card:hover .module-arrow {
  background: var(--brand-orange);
  color: var(--brand-black);
  border-color: var(--brand-orange);
}
html:is([data-theme="andere"], [data-theme="andere-dark"]) .home-section-heading h1 { font-size: 20px; }
html:is([data-theme="andere"], [data-theme="andere-dark"]) .login .brand-mark { margin: 0 auto 12px; }
html:is([data-theme="andere"], [data-theme="andere-dark"]) .login-brand { display: block; }

@media (max-width: 560px) {
  .theme-option { width: 42px; height: 42px; }
  html:is([data-theme="andere"], [data-theme="andere-dark"]) header { padding: 10px 16px 16px; gap: 16px; }
  html:is([data-theme="andere"], [data-theme="andere-dark"]) header .auth-bar { flex-wrap: wrap; }
  html:is([data-theme="andere"], [data-theme="andere-dark"]) .brand-mark { width: 190px; }
}
@media print {
  .theme-picker, .theme-picker-floating { display: none !important; }
  html:is([data-theme="andere"], [data-theme="andere-dark"]) header { background: #fff; color: #11171d; }
  html:is([data-theme="andere"], [data-theme="andere-dark"]) header .logo { color: #11171d; }
  html:is([data-theme="andere"], [data-theme="andere-dark"]) header .brand-mark-light { display: none; }
  html:is([data-theme="andere"], [data-theme="andere-dark"]) header .brand-mark-color { display: inline; }
}
