/* OMS's design tokens (the one palette, type, spacing, radius and sizes): every screen of index.html, oms/*.css, pos/*.css and v3/kit.css
   reads these names. Loaded before any other CSS.
   App v3 (15-nov): the palette and sizes of the new design (03_app/research/pos-diseno-nuevo-2026-11-14/prueba/style.css, «Prueba 4»):
   flat, no relief; depth from three tones (fondo, panel, control) and a 1 px line; corners almost square (3 / 4 px); one colour per level
   (blue actions, green done, purple only for Bebidas). Dark first, as the prueba; light when the system asks for it
   (data-theme="claro" / "oscuro" forces one, as ?tema= in the prueba). The old names stay, pointing to the new values, so the screens
   that still use them follow. */
/* Manrope local (auditoría 19-nov, E8; Marquito: «Sí, bájala»): latin, variable 500–700, from Google Fonts (OFL). Same file next to
   each copy of this sheet (oms/web and pos/www), so it works without internet */
@font-face { font-family: Manrope; font-style: normal; font-weight: 500 700; font-display: swap; src: url('manrope.woff2') format('woff2'); }

/* App v3.2 (16-nov): la paleta OSCURA es la de Polo Tab, medida de sus pantallas (03_app/research/polotab-junta-2026-11-16): fondo
   #000000, panel #0A0A0A, tarjeta y campo #1C1C1C, botón #2C2C2C, azul de acción #0066FF, rojo de acción #FF0000; esquinas redondas
   (10 controles, 18 paneles) y el azul plano, sin filo. El CLARO sigue con los valores del 15-nov: pendiente (Marquito, 16-nov:
   «empezamos solo por el modo oscuro»). */
/* ── The new palette (prueba style.css :root), dark ── */
:root {
  color-scheme: dark;
  --bg: #000000;      /* fondo */
  --panel: #0A0A0A;   /* panel */
  --tile: #2C2C2C;    /* botón */
  --well: #1C1C1C;    /* tarjeta y campo */
  --line: rgba(255, 255, 255, .08); /* la raya de 1 px */
  --text: #FFFFFF;
  --muted: #8A8A8A;
  --faint: #5C5C5C;
  --blue: #0066FF;    /* acciones, elegido, contadores */
  --green: #2E9E5B;   /* hecho, avance */
  --bad: #FF5C5C;     /* texto en rojo */
  --bad-fill: #FF0000; /* relleno rojo (botón rojo), los dos temas */
  --busy: #2B62C4;
  --drink: #8B5CF6;   /* morado: solo Bebidas */
  --kds-red: #EF4138; /* el rojo del semáforo del KDS */
  --mix: 20%;         /* cuánto color lleva el relleno de lo elegido */
  --r: 10px;          /* controles */
  --rp: 18px;         /* paneles y tarjetas */
  --side: 384px;      /* paneles laterales: menú izquierdo, cuenta, turnos */
  --v3-font: 500 14px/1.3 Manrope, system-ui, sans-serif;
  /* Old names that only change with the theme */
  --soft: #C9C9CF;
  --strike: rgba(255, 255, 255, .5);
  --ring: rgba(255, 255, 255, .25);
  --accent: #F7A79B;
  --accent-line: #F7A79B;
  --bad-soft: #380000;
  --late-line: rgba(232, 106, 90, .7);
  --coral-soft: rgba(239, 65, 56, .2);
  --shadow: rgba(0, 0, 0, .35);
  --pill-bg: var(--tile);
  --pill-line: rgba(255, 255, 255, .85);
  --logo: url('logo-light.png');
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="oscuro"]) {
    color-scheme: light;
    --bg: #ECEEF0; --panel: #FFFFFF; --tile: #F1F2F4; --well: #E9EBEE; --line: rgba(15, 23, 32, .12);
    --text: #14171A; --muted: #56606A; --faint: #8A929A;
    --blue: #2460F0; --green: #1F8A4C; --bad: #C23A2A; --busy: #2B62C4;
    --mix: 12%;
    --soft: #4A5258;
    --strike: rgba(17, 21, 24, .5);
    --ring: #BFC5CA;
    --accent: #C23A2A;
    --accent-line: #EF4138;
    --bad-soft: #FDECE8;
    --late-line: #C23A2A;
    --coral-soft: #FDECEB;
    --shadow: rgba(17, 21, 24, .12);
        --pill-line: #EF4138;
    --logo: url('logo-dark.png');
  }
}
:root[data-theme="claro"] {
  color-scheme: light;
  --bg: #ECEEF0; --panel: #FFFFFF; --tile: #F1F2F4; --well: #E9EBEE; --line: rgba(15, 23, 32, .12);
  --text: #14171A; --muted: #56606A; --faint: #8A929A;
  --blue: #2460F0; --green: #1F8A4C; --bad: #C23A2A; --busy: #2B62C4;
  --mix: 12%;
  --soft: #4A5258;
  --strike: rgba(17, 21, 24, .5);
  --ring: #BFC5CA;
  --accent: #C23A2A;
  --accent-line: #EF4138;
  --bad-soft: #FDECE8;
  --late-line: #C23A2A;
  --coral-soft: #FDECEB;
  --shadow: rgba(17, 21, 24, .12);
  --pill-line: #EF4138;
  --logo: url('logo-dark.png');
}

/* ── Old names, pointing to the new values (the same in both themes: they follow the palette above) ── */
:root {
  font-variant-numeric: tabular-nums; /* cifras del mismo ancho, en toda la app (la prueba lo pone en body) */
  --coral: #EF4138;   /* rojo de marca (Marquito, 10-nov): rayas, puntos, letras grandes */
  --on-fill: #fff;
  --scrim: rgba(0, 0, 0, .6);
  /* The black screens of Cobrar (Marquito, 20-nov): Cambio and «Paga al repartidor», black in both themes */
  --done-bg: #000;
  --done-text: #fff;
  --done-soft: rgba(255, 255, 255, .6);
  --done-btn: rgba(255, 255, 255, .14);
  /* Its reminder cards (20-nov: «Este pedido lleva bebidas»): the purple of Bebidas (--drink) as a calm veil and line on the black */
  --done-rem-bg: rgba(239, 65, 56, .16);
  --done-rem-line: rgba(239, 65, 56, .6);
  --done-rem-rule: rgba(239, 65, 56, .45);
  --card: var(--panel);
  --pop: var(--panel);
  --pop-panel: var(--panel);
  --menu: var(--panel);
  --edge: var(--line);
  --row: var(--tile);
  --chip: var(--tile);
  --well-2: var(--tile);
  --ok: var(--green);
  --ok-soft: color-mix(in srgb, var(--green) 18%, transparent);
  --alert-go: var(--green);
  --alert-late: var(--kds-red);
  --on-soon: #2A1E00;
  --takeover: var(--bg);
  /* Botones: gris de control (plano, un tono sobre el panel y la raya), azul de acción con filo leve, rojo */
  --btn-bg: var(--tile);
  --btn-shadow: inset 0 0 0 1px var(--line);
  --btn-press: inset 0 0 0 1px var(--line);
  --go-bg: var(--blue);
  --go-shadow: none;
  --go-press: none;
  /* Elegido: relleno del color, borde de 2 y halo de 4 (prueba .b.on) */
  --on-text: var(--text);
  --on-bg: color-mix(in srgb, var(--blue) var(--mix), var(--panel));
  --on-shadow: inset 0 0 0 2px var(--blue), 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent);
  --danger-bg: var(--bad-fill);
  --danger-shadow: none;
  --key-ok-bg: var(--blue);
  --key-ok-shadow: none;
  --sel-bg: color-mix(in srgb, var(--blue) var(--mix), var(--panel));
  --sel-line: var(--blue);
  /* Letra: Manrope en todo (la prueba no usa otra) */
  --font-body: Manrope, system-ui, sans-serif;
  --font-display: Manrope, system-ui, sans-serif;
  /* Type: body 14 (prueba body); the rest as before, the prueba uses 12 13 15 16 18 20 24 28 */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 17px;
  --fs-xl: 20px;   /* títulos de tarjeta (prueba .ohead b, .cfgt) */
  --fs-2xl: 24px;
  --fs-num: 28px;
  /* Spacing: 4 8 12 16 24 32 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  /* Radius: casi rectas (prueba --r 3 y --rp 4); --r-pill para lo redondo (interruptor, puntos) */
  --r-sm: var(--r);
  --r-md: var(--rp);
  --r-lg: var(--rp);
  --r-pill: 999px;
  /* Controls (prueba: campos y botones de 48, recuadro de icono 40 × 40) */
  --h-field: 48px;
  --btn-w: 240px;
  --btn-h: 44px; /* Marquito, 25-nov: botón con texto de 44 en toda la app (antes 48) */
  --h-icon-sm: 36px;
  --h-icon: 40px;
  --h-key: 44px;
  --h-head: 56px;
  --h-dock: 32px;
  --dlg-sm: 540px;   /* prueba .card */
  --dlg-md: 760px;   /* prueba .card.wide */
  --dlg-lg: 1100px;
  --dlg-slim: 400px; /* prueba .card.slim (estilo Opciones) */
  --state-w: 128px;
  --cuenta-w: var(--side);
  --h-pay: 48px;
}

/* ── Navegador viejo (15-nov): el WebView de la iMin de KDS-COCINA (Android viejo) no entiende color-mix() (Chrome 111): la declaración
   queda sin valor y lo elegido se veía plano (Terminados en el KDS). Solo ahí entra este bloque; cada regla con color-mix() lleva junto su
   respaldo «@supports not (color: color-mix(…))» con estos colores en rgb (rgba(var(--blue-rgb), .18) = color-mix(blue 18 %, transparent);
   el relleno de lo elegido, la capa rgba sobre --panel). Un Chrome nuevo no lee nada de esto. ── */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  :root {
    --blue-rgb: 0, 102, 255; --green-rgb: 46, 158, 91; --bad-rgb: 255, 92, 92;
    --text-rgb: 255, 255, 255; --muted-rgb: 138, 138, 138; --drink-rgb: 139, 92, 246;
    --mix-a: .2;          /* --mix (20 %) como opacidad */
    --blue-62w: #61A0FF;  /* color-mix(in srgb, --blue 62 %, #fff) */
    --ok-soft: rgba(var(--green-rgb), .18);
    --on-bg: linear-gradient(rgba(var(--blue-rgb), var(--mix-a)), rgba(var(--blue-rgb), var(--mix-a))) var(--panel);
    --on-shadow: inset 0 0 0 2px var(--blue), 0 0 0 4px rgba(var(--blue-rgb), .18);
    --sel-bg: linear-gradient(rgba(var(--blue-rgb), var(--mix-a)), rgba(var(--blue-rgb), var(--mix-a))) var(--panel);
  }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="oscuro"]) {
      --blue-rgb: 36, 96, 240; --green-rgb: 31, 138, 76; --bad-rgb: 194, 58, 42;
      --text-rgb: 20, 23, 26; --muted-rgb: 86, 96, 106; --mix-a: .12; --blue-62w: #779CF6;
    }
  }
  :root[data-theme="claro"] {
    --blue-rgb: 36, 96, 240; --green-rgb: 31, 138, 76; --bad-rgb: 194, 58, 42;
    --text-rgb: 20, 23, 26; --muted-rgb: 86, 96, 106; --mix-a: .12; --blue-62w: #779CF6;
  }
  /* Lo que pinta con --sc otro color que el azul (Bebidas: --sc var(--drink), venta-cuenta.js y venta-producto.js) */
  [style*="var(--drink)"] { --sc-rgb: var(--drink-rgb); }
}
