/* ==========================================================================
   totem.css: sistema visual del tótem ESAAB LabPoint (rediseño, propuesta A).
   Derivado del Login. Lo usan Login.aspx y Site.master, después de Bootstrap 5.3.8.
   Referencia: session-docs/rediseno-visual-totem-login-menu (01-architecture.md y prototipos).
   Secciones: 1 fuentes · 2 tokens · 3 base · 4 marco · 5 componentes · 6 páginas · 7 medios
              · 8 tema · 9 botones (propuesta A) · 10 piezas del sitio
   ========================================================================== */

/* 1. Fuentes ------------------------------------------------------------- */
@font-face { font-family: 'Roboto'; src: url('../fonts/Roboto/Roboto-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Roboto'; src: url('../fonts/Roboto/Roboto-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Roboto'; src: url('../fonts/Roboto/Roboto-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
/* Sora (títulos y botones): WOFF2 variables copiados de esaab-wms-hggb-qa/2.02/fonts (SIL OFL 1.1, ver fonts/Sora/OFL.txt). */
@font-face { font-family: 'Sora'; src: url('../fonts/Sora/Sora-latin.woff2') format('woff2'); font-weight: 600 700; font-display: swap;
             unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Sora'; src: url('../fonts/Sora/Sora-latin-ext.woff2') format('woff2'); font-weight: 600 700; font-display: swap;
             unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* 2. Tokens -------------------------------------------------------------- */
:root {
  color-scheme: light;
  /* Marca (muestreados de esaab_mkt.png) */
  --c-navy-900: #04044F; --c-blue-800: #031386; --c-blue-600: #0A5BD8; --c-blue-400: #3DA2FF; --c-blue-btn-base: #0034C4;
  --c-teal-700: #007385; --c-teal-500: #039CB6; --c-teal-300: #35D0D7; --c-teal-50: #E3F6F8;
  /* Neutros */
  --c-bg-top: #F7FAFE; --c-bg: #EEF4FC; --c-bg-bottom: #E6EFFA;
  --c-surface: #FFFFFF; --c-surface-2: #F4F8FD;
  --c-text: #04044F; --c-text-muted: #3A4A75; --c-placeholder: #5A6785;
  --c-border-control: #5B6E96; --c-border-card: #6B7FA8; --c-border-subtle: #D5DFEE;
  /* Semánticos */
  --c-green-600: #0F7A26; --c-green-soft: #E7F6EA; --c-green-ink: #0B4D1A;
  --c-red-600: #C4161C; --c-red-700: #B3261E; --c-red-soft: #FDECEC; --c-red-ink: #8A1C14;
  --c-amber-600: #B26A00; --c-amber-700: #8A5200; --c-amber-soft: #FFF4D6; --c-amber-ink: #5C3B00;
  --c-info-soft: #E6F1FD;
  --c-focus: #04044F; --c-disabled-bg: #E3E8F0; --c-disabled-ink: #5E6A85; --c-overlay: rgba(4,4,79,.55);
  /* Superficies y tintas que cambian con el tema */
  --c-heading: #04044F; --c-brand-ink: #031386; --c-chrome-bg: rgba(255,255,255,.94);
  --c-surface-raised: #FFFFFF; --c-field-bg: #FFFFFF; --c-badge-bg: #FFFFFF;
  --c-qty-bg: #04044F; --c-pressed-bg: #031386; --c-current-bg: #F2FBFC; --c-flash: #CFF3F6;
  --c-scroll-shadow: rgba(4,4,79,.16); --c-scrollbar: rgba(4,4,79,.35);
  --c-toggle-bg: #FFFFFF; --c-toggle-border: #CFE0F7; --c-toggle-ink: #1B56D6;
  --c-toggle-shadow: 0 8px 22px rgba(20,38,61,.20), 0 0 0 5px rgba(27,86,214,.07);
  --c-table-head: #04044F; --c-table-head-ink: #FFFFFF;
  --c-card-hover-bg: #F0F6FE; --c-card-hover-ink: #0A5BD8; --c-card-hover-ring: rgba(3,156,182,.22);
  --sh-card-hover: 0 0 0 1px #0A5BD8, 0 16px 32px rgba(10,91,216,.22), 0 4px 10px rgba(4,4,79,.10);
  --c-art-ink: #04044F; --c-art-accent: #0A8FA3; --c-art-divider: rgba(10,91,216,.30);
  --c-art-icon-bg: #FFFFFF; --c-art-icon-border: rgba(3,156,182,.35); --c-art-glow: rgba(10,91,216,.16);
  /* Tipografía */
  --font-display: 'Sora', 'Segoe UI', Roboto, Arial, sans-serif;
  --font-body: 'Roboto', 'Segoe UI', Arial, sans-serif;
  --fs-sm: 18px; --fs-base: 20px; --fs-md: 24px; --fs-lg: 28px; --fs-xl: 36px; --fs-2xl: 44px;
  /* Espaciado, radios, sombras */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --gutter: 32px; --content-max: 1400px;
  --r-sm: 8px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(4,4,79,.06), 0 2px 8px rgba(4,4,79,.08);
  --sh-2: 0 4px 12px rgba(4,4,79,.10), 0 12px 32px rgba(4,4,79,.10);
  --sh-pressed: inset 0 3px 6px rgba(0,0,0,.25);
  /* Táctil */
  --tap-min: 64px; --tap-lg: 80px; --tap-xl: 96px; --tap-gap: 16px;
  /* Marco (vertical por defecto) */
  --header-h: 80px; --footer-h: 76px; --action-bar-h: 128px;
  /* Capas y movimiento */
  --z-dialog: 1056; --z-toast: 1090; --z-busy: 2000;
  --dur-press: 80ms; --dur-ui: 160ms; --ease: cubic-bezier(.2,.8,.2,1);
}
/* Modo oscuro: data-theme="dark" en <html>. Paleta del modo oscuro del WMS (login-v3.css): fondo #060D1A,
   textos #E7F0FB / #AEBFD6, acentos #18B9C9 / #7EF0F7 y rojo legible #FF9AA6. Contrastes de texto >= 4,5:1. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --c-teal-700: #7EF0F7; --c-teal-500: #18B9C9; --c-teal-300: #3AD6E6; --c-teal-50: rgba(24,185,201,.16);
  --c-blue-800: #9CC2FF; --c-blue-600: #4D8DFF;
  --c-bg-top: #0A1528; --c-bg: #07101F; --c-bg-bottom: #060D1A;
  --c-surface: #0E1B31; --c-surface-2: #12223D;
  --c-text: #E7F0FB; --c-text-muted: #AEBFD6; --c-placeholder: #A6BCD8;
  --c-border-control: #6F8BB8; --c-border-card: rgba(24,185,201,.45); --c-border-subtle: #1F3352;
  --c-green-600: #3FCB6A; --c-green-soft: #0E2A1B; --c-green-ink: #BDF2CC;
  --c-red-700: #FF9AA6; --c-red-soft: #3A1420; --c-red-ink: #FFC2CA;
  --c-amber-600: #F0B043; --c-amber-700: #F5C46A; --c-amber-soft: #33270C; --c-amber-ink: #FFE3A6;
  --c-info-soft: rgba(27,86,214,.24);
  --c-focus: #7EF0F7; --c-disabled-bg: #1A2742; --c-disabled-ink: #8798BB; --c-overlay: rgba(0,0,0,.66);
  --c-heading: #E7F0FB; --c-brand-ink: #FFFFFF; --c-chrome-bg: rgba(8,16,32,.94);
  --c-surface-raised: #0F1E37; --c-field-bg: #0A1529; --c-badge-bg: #0A1529;
  --c-qty-bg: #1B56D6; --c-pressed-bg: #1B56D6; --c-current-bg: rgba(24,185,201,.10); --c-flash: rgba(24,185,201,.32);
  --c-scroll-shadow: rgba(0,0,0,.55); --c-scrollbar: rgba(174,191,214,.35);
  --c-toggle-bg: rgba(10,20,40,.92); --c-toggle-border: rgba(126,240,247,.45); --c-toggle-ink: #7EF0F7;
  --c-toggle-shadow: 0 8px 22px rgba(0,0,0,.50), 0 0 0 5px rgba(126,240,247,.08);
  --c-table-head: #16294A; --c-table-head-ink: #E7F0FB;
  --c-card-hover-bg: #132849; --c-card-hover-ink: #E7F0FB; --c-card-hover-ring: rgba(126,240,247,.18);
  --sh-card-hover: 0 0 0 1px #4D8DFF, 0 16px 32px rgba(0,0,0,.55), 0 0 28px rgba(77,141,255,.22);
  --c-art-ink: #FFFFFF; --c-art-accent: #3AD6E6; --c-art-divider: rgba(126,240,247,.30);
  --c-art-icon-bg: rgba(255,255,255,.06); --c-art-icon-border: rgba(126,240,247,.40); --c-art-glow: rgba(24,185,201,.18);
  --sh-1: 0 1px 2px rgba(0,0,0,.40), 0 2px 8px rgba(0,0,0,.35);
  --sh-2: 0 4px 12px rgba(0,0,0,.45), 0 12px 32px rgba(0,0,0,.40);
}

/* 3. Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: manipulation; }
body { font-family: var(--font-body); font-size: var(--fs-base); line-height: 1.4; color: var(--c-text);
       background: linear-gradient(180deg, var(--c-bg-top) 0%, var(--c-bg) 55%, var(--c-bg-bottom) 100%);
       -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; color: var(--c-heading); }
img { -webkit-user-drag: none; }
button, a { font: inherit; }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* 4. Marco --------------------------------------------------------------- */
.app-shell { height: 100vh; height: 100dvh; display: grid; grid-template-rows: var(--header-h) minmax(0, 1fr) var(--footer-h); }
.app-header { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5);
              padding: 0 var(--gutter); background: var(--c-chrome-bg); border-bottom: 1px solid var(--c-border-subtle); box-shadow: var(--sh-1); z-index: 2; }
.app-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px;
                     background: linear-gradient(90deg, var(--c-teal-300), var(--c-teal-500) 35%, var(--c-blue-600) 70%, var(--c-navy-900)); }
.brand { display: flex; align-items: center; gap: var(--sp-4); text-decoration: none; }
.brand img { height: 44px; }
.brand__product { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); line-height: 1; color: var(--c-brand-ink); }
.brand__product span { color: var(--c-teal-500); }
.brand__product small { display: block; font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 500; color: var(--c-teal-700); margin-top: 3px; }
.brand-partner img { height: 58px; display: block; } /* Siemens Healthineers con más protagonismo que el logo de ESAAB */
.app-main { position: relative; min-height: 0; overflow: hidden; padding: var(--sp-5) var(--gutter);
            background: url('../img/deco/smartlab-hex.svg') right -40px top -30px / 300px 260px no-repeat; }
.app-main::after { /* ola decorativa inferior, eco del Login (smartlab-wave.svg de esaab-wms-hggb-qa) */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: clamp(64px, 6vh, 120px);
  background: url('../img/deco/smartlab-wave.svg') left bottom / 100% 100% no-repeat; opacity: .9; pointer-events: none; z-index: 0; }
.app-main > :not(.modal):not(.t-dialog):not(script) { position: relative; z-index: 1; } /* los diálogos siguen fijos sobre la pantalla */
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5);
              padding: 0 var(--gutter); background: var(--c-chrome-bg); border-top: 1px solid var(--c-border-subtle); }
.session-info { color: var(--c-text-muted); font-size: var(--fs-sm); display: flex; gap: var(--sp-5); flex-wrap: wrap; justify-content: center; }
.session-info b { color: var(--c-text); font-weight: 700; }
.brand-vendor { height: 28px; }

/* 5. Componentes --------------------------------------------------------- */
/* Botón base (la piel brillante la define cada propuesta) */
.btn-t { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-3);
         min-height: var(--tap-min); padding: 0 var(--sp-6); border: 0; border-radius: var(--r-pill); cursor: pointer;
         font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md); line-height: 1.1; text-decoration: none; white-space: nowrap;
         user-select: none; -webkit-user-select: none; transition: transform var(--dur-press) var(--ease), filter var(--dur-press), box-shadow var(--dur-press); }
.btn-t .bi { font-size: 1.1em; }
.btn-t__icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); flex: none; }
.btn-t--lg { min-height: var(--tap-lg); font-size: var(--fs-lg); }
.btn-t--xl { min-height: var(--tap-xl); font-size: var(--fs-lg); }
.btn-t--block { width: 100%; }
.btn-t--icon { width: var(--tap-lg); min-height: var(--tap-lg); padding: 0; border-radius: var(--r-lg); font-size: 32px; }
.btn-t--icon.btn-t--sm { width: var(--tap-min); min-height: var(--tap-min); border-radius: var(--r-md); font-size: 28px; }
/* Variantes planas comunes a A y B */
.btn-t--secondary { background: var(--c-surface-raised); color: var(--c-blue-800); box-shadow: inset 0 0 0 2px var(--c-border-control), var(--sh-1); }
.btn-t--outline-danger { background: var(--c-surface-raised); color: var(--c-red-700); box-shadow: inset 0 0 0 2px var(--c-red-700); }
.btn-t--secondary .btn-t__icon, .btn-t--outline-danger .btn-t__icon { box-shadow: none; width: auto; }
/* Estados */
.btn-t:active, .btn-t.is-pressed { transform: translateY(2px) scale(.985); filter: brightness(.92); }
.btn-t--secondary:active, .btn-t--secondary.is-pressed { background: var(--c-info-soft); }
.btn-t--outline-danger:active, .btn-t--outline-danger.is-pressed { background: var(--c-red-soft); }
.btn-t[aria-pressed="true"] { background: var(--c-pressed-bg); color: #fff; box-shadow: inset 0 0 0 2px var(--c-pressed-bg); }
.is-busy { pointer-events: none; }
.btn-t.is-busy .btn-t__icon .bi, .btn-t.is-busy > .bi { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Campo de texto */
.field-label { display: block; font-weight: 700; font-size: var(--fs-base); margin: 0 0 var(--sp-2); color: var(--c-heading); }
.field-t { width: 100%; height: 80px; padding: 0 var(--sp-5); border: 2px solid var(--c-border-control); border-radius: var(--r-lg);
           background: var(--c-field-bg); color: var(--c-text); font: 500 var(--fs-lg) var(--font-body); }
.field-t::placeholder { color: var(--c-placeholder); opacity: 1; }
.field-t:focus { outline: none; border: 3px solid var(--c-blue-600); box-shadow: 0 0 0 6px rgba(10,91,216,.15); }

/* Campo de escaneo (dock) */
.scan-dock { background: var(--c-surface); border: 1px solid var(--c-border-subtle); border-radius: var(--r-xl); box-shadow: var(--sh-2); padding: var(--sp-4) var(--sp-5); }
.scan-row { display: flex; gap: var(--sp-3); align-items: stretch; }
.scan-field { position: relative; flex: 1; min-width: 0; }
.scan-field .field-t { height: var(--tap-xl); padding-left: 76px; border: 3px solid var(--c-border-control); }
.scan-field .field-t:focus { border-color: var(--c-blue-600); }
.scan-field__icon { position: absolute; left: 24px; top: 50%; transform: translateY(-50%); font-size: 36px; color: var(--c-teal-700); pointer-events: none; }
.scan-status { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); margin-top: var(--sp-3); font-size: var(--fs-sm); font-weight: 500; }
.scan-status .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.scan-status__ready, .scan-status__idle, .scan-status__typing, .scan-status__busy { display: none; align-items: center; gap: var(--sp-2); }
.scan-dock:focus-within .scan-status__ready { display: inline-flex; color: var(--c-green-600); }
.scan-dock:focus-within .scan-status__ready .dot { background: var(--c-green-600); box-shadow: 0 0 0 4px rgba(15,122,38,.18); }
.scan-dock:not(:focus-within) .scan-status__idle { display: inline-flex; color: var(--c-amber-700); }
.scan-dock:not(:focus-within) .scan-status__idle .dot { background: var(--c-amber-600); }
.is-typing .scan-status__ready, .is-typing .scan-status__idle { display: none !important; }
.is-typing .scan-status__typing { display: inline-flex; color: var(--c-blue-800); }
.is-scan-busy .scan-status > span { display: none !important; }
.is-scan-busy .scan-status__busy { display: inline-flex !important; color: var(--c-blue-800); }
.scan-hint-arrow { font-size: 22px; }

/* Tarjeta genérica */
.card-t { background: var(--c-surface); border: 1px solid var(--c-border-subtle); border-radius: var(--r-xl); box-shadow: var(--sh-2); }

/* Encabezado de despacho */
.dispatch-header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5);
                   background: var(--c-surface-2); border-bottom: 1px solid var(--c-border-subtle); border-radius: var(--r-xl) var(--r-xl) 0 0; }
.dispatch-header h2 { font-size: var(--fs-lg); }
.dispatch-header p { margin: 2px 0 0; color: var(--c-text-muted); font-size: var(--fs-sm); }
.chip { display: inline-block; vertical-align: middle; margin-left: var(--sp-2); padding: 2px 12px; border-radius: var(--r-pill);
        background: var(--c-teal-50); color: var(--c-teal-700); font: 700 var(--fs-sm)/1.4 var(--font-body); letter-spacing: .04em; text-transform: uppercase; }

/* Lista e ítems de pedido */
.order-card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.order-items { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-4) var(--sp-5);
               display: flex; flex-direction: column; gap: var(--sp-3);
               background: linear-gradient(var(--c-surface) 30%, transparent) top / 100% 40px no-repeat local,
                           linear-gradient(transparent, var(--c-surface) 70%) bottom / 100% 40px no-repeat local,
                           radial-gradient(farthest-side at 50% 0, var(--c-scroll-shadow), transparent) top / 100% 14px no-repeat scroll,
                           radial-gradient(farthest-side at 50% 100%, var(--c-scroll-shadow), transparent) bottom / 100% 14px no-repeat scroll; }
.order-items::-webkit-scrollbar { width: 12px; } .order-items::-webkit-scrollbar-thumb { background: var(--c-scrollbar); border-radius: 6px; }
.order-item { display: grid; grid-template-columns: 76px minmax(0, 1fr) var(--tap-min); gap: var(--sp-4); align-items: center;
              padding: var(--sp-4); border: 2px solid var(--c-border-subtle); border-radius: var(--r-lg); background: var(--c-surface-raised); }
.order-item:first-of-type { border-color: var(--c-teal-500); background: var(--c-current-bg); }
.order-item.just-added { animation: flash 600ms var(--ease); }
@keyframes flash { from { background: var(--c-flash); } to { background: var(--c-current-bg); } }
.order-item__qty { width: 76px; height: 76px; border-radius: 50%; background: var(--c-qty-bg); color: #fff; display: grid; place-content: center; text-align: center;
                   font: 700 var(--fs-lg)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.order-item__qty small { display: block; font: 500 14px/1.2 var(--font-body); opacity: .9; margin-top: 2px; }
.order-item__name { margin: 0; font-weight: 700; font-size: var(--fs-md); line-height: 1.2; }
.order-item__meta { list-style: none; margin: var(--sp-1) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px var(--sp-4); color: var(--c-text-muted); font-size: var(--fs-sm); }
.order-item__meta b { color: var(--c-text); font-weight: 500; }
.order-item__meta .bi { color: var(--c-teal-700); margin-right: 4px; }
.order-empty { display: none; }
.order-empty:only-child { display: flex; }
.empty-state { flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3); text-align: center; color: var(--c-text-muted); padding: var(--sp-7) var(--sp-5); flex: 1; }
.empty-state .bi { font-size: 64px; color: var(--c-teal-700); }
.empty-state strong { font-size: var(--fs-md); color: var(--c-heading); }

/* Barra de acción */
.action-bar { display: flex; align-items: center; gap: var(--sp-5); padding: var(--sp-4) var(--sp-5); }
.total { display: flex; flex-direction: column; line-height: 1.1; min-width: 120px; }
.total span { font-size: var(--fs-sm); color: var(--c-text-muted); font-weight: 500; }
.total b { font: 700 var(--fs-2xl)/1 var(--font-display); color: var(--c-heading); font-variant-numeric: tabular-nums; }
.action-bar__primary { flex: 1; display: flex; justify-content: flex-end; }
.action-bar__primary > * { flex: 1; }

/* Avisos */
.toast-region { position: fixed; z-index: var(--z-toast); left: 50%; transform: translateX(-50%); bottom: calc(var(--footer-h) + 24px);
                width: min(760px, calc(100vw - 32px)); display: flex; flex-direction: column-reverse; gap: var(--sp-3); pointer-events: none; }
.toast-region[data-page="picking"] { left: auto; right: var(--gutter); transform: none; width: min(720px, calc(100vw - 2 * var(--gutter)));
                                     bottom: calc(var(--footer-h) + var(--action-bar-h) + var(--dock-h, 160px) + 40px); }
.toast-t { pointer-events: auto; display: grid; grid-template-columns: 40px 1fr var(--tap-min); gap: var(--sp-3); align-items: start;
           padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-5); border-radius: var(--r-lg); box-shadow: var(--sh-2); border-left: 8px solid;
           animation: toast-in var(--dur-ui) var(--ease); }
.toast-t .bi { font-size: 32px; line-height: 1; margin-top: 2px; }
.toast-t strong { display: block; font: 700 var(--fs-md)/1.2 var(--font-display); }
.toast-t p { margin: 2px 0 0; font-size: var(--fs-base); white-space: pre-line; }
.toast-t button { width: var(--tap-min); height: var(--tap-min); border: 0; border-radius: var(--r-md); background: transparent; color: inherit; font-size: 28px; cursor: pointer; }
.toast-t--success { background: var(--c-green-soft); color: var(--c-green-ink); border-color: var(--c-green-600); } .toast-t--success .bi { color: var(--c-green-600); }
.toast-t--danger  { background: var(--c-red-soft); color: var(--c-red-ink); border-color: var(--c-red-700); }   .toast-t--danger .bi { color: var(--c-red-700); }
.toast-t--warning { background: var(--c-amber-soft); color: var(--c-amber-ink); border-color: var(--c-amber-600); } .toast-t--warning .bi { color: var(--c-amber-700); }
.toast-t--info    { background: var(--c-info-soft); color: var(--c-heading); border-color: var(--c-blue-600); } .toast-t--info .bi { color: var(--c-blue-600); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Diálogo propio del tótem */
.t-dialog { position: fixed; inset: 0; z-index: var(--z-dialog); display: grid; place-items: center; padding: var(--sp-5); background: var(--c-overlay); }
.t-dialog[hidden] { display: none; }
.t-dialog__panel { width: min(680px, 100%); background: var(--c-surface); border-radius: var(--r-xl); box-shadow: var(--sh-2); padding: var(--sp-6); }
.t-dialog__icon { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; font-size: 44px; margin-bottom: var(--sp-4); }
.t-dialog__icon--danger { background: var(--c-red-soft); color: var(--c-red-700); }
.t-dialog h2 { font-size: var(--fs-xl); margin-bottom: var(--sp-3); }
.t-dialog p { margin: 0 0 var(--sp-6); font-size: var(--fs-md); color: var(--c-text-muted); line-height: 1.35; }
.t-dialog p b { color: var(--c-heading); }
.t-dialog__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.t-dialog__actions .btn-t { min-height: 88px; font-size: var(--fs-lg); }
.t-dialog--confirm .t-dialog__panel { text-align: left; }

/* Capa de bloqueo */
.busy-overlay { position: fixed; inset: 0; z-index: var(--z-busy); cursor: progress; }
.busy-overlay[hidden] { display: none; }

/* 6. Páginas ------------------------------------------------------------- */
.page-title { font-size: var(--fs-xl); }
.page-sub { margin: var(--sp-2) 0 0; color: var(--c-text-muted); display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-base); }
.page-sub::before { content: ""; width: 40px; height: 3px; background: var(--c-teal-500); border-radius: 2px; flex: none; }
.page-sub--center { justify-content: center; }
.page-sub--center::after { content: ""; width: 40px; height: 3px; background: var(--c-teal-500); border-radius: 2px; flex: none; }

/* Menú (bodegas / módulos) */
.menu { height: 100%; display: flex; flex-direction: column; gap: var(--sp-5); }
.menu__header { text-align: center; flex: none; }
.menu__scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; justify-content: safe center; padding: var(--sp-4) var(--sp-3) var(--sp-6); }
.menu-grid { --cols: 2; --card-h: 220px; --badge: 104px; width: 100%; max-width: var(--content-max); margin: 0 auto;
             display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-5); }
.menu-card { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--sp-5)) / var(--cols)); min-height: var(--card-h);
             display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3); padding: var(--sp-5) var(--sp-4);
             background: var(--c-surface-raised); border: 2px solid var(--c-border-card); border-radius: var(--r-xl); box-shadow: var(--sh-2);
             color: var(--c-heading); text-decoration: none; text-align: center; user-select: none; -webkit-user-select: none;
             transition: transform var(--dur-ui) var(--ease), background var(--dur-ui), border-color var(--dur-ui), box-shadow var(--dur-ui); }
.menu-card:active, .menu-card.is-pressed { transform: scale(.985); background: var(--c-info-soft); border-color: var(--c-blue-600); border-width: 3px; transition-duration: var(--dur-press); }
.menu-card__badge { width: var(--badge); height: var(--badge); border-radius: 50%; background: var(--c-badge-bg); display: grid; place-items: center; flex: none;
                    box-shadow: 0 6px 18px rgba(4,4,79,.14), inset 0 0 0 1px var(--c-border-subtle); color: var(--c-teal-700); font-size: calc(var(--badge) * .46);
                    transition: transform var(--dur-ui) var(--ease), box-shadow var(--dur-ui); }
.menu-card__title { font: 700 26px/1.2 var(--font-display); overflow-wrap: anywhere; transition: color var(--dur-ui); }
.menu-card__hint { display: none; color: var(--c-text-muted); font-size: var(--fs-base); }
.menu-card.is-busy .menu-card__badge .bi { animation: spin .9s linear infinite; }
.menu-card.is-busy .menu-card__hint { display: block; }
/* Cantidades: 9 a 12 → tarjetas más bajas; 13 o más → 3 columnas */
a.menu-card:first-of-type:nth-last-of-type(n+9), a.menu-card:first-of-type:nth-last-of-type(n+9) ~ a.menu-card { --card-h: 180px; --badge: 80px; }
a.menu-card:first-of-type:nth-last-of-type(n+13), a.menu-card:first-of-type:nth-last-of-type(n+13) ~ a.menu-card { --cols: 3; --card-h: 170px; --badge: 72px; }
/* Opción única */
a.menu-card:only-of-type { flex-basis: min(100%, 720px); --card-h: 380px; --badge: 168px; }
a.menu-card:only-of-type .menu-card__title { font-size: var(--fs-2xl); }
a.menu-card:only-of-type .menu-card__hint { display: block; }
.menu-empty { display: none; }
.menu-empty:only-child { display: flex; }
.menu-scroll-hint { display: none; text-align: center; color: var(--c-text-muted); font-size: var(--fs-sm); margin-top: calc(-1 * var(--sp-3)); }
.menu.has-overflow .menu-scroll-hint { display: block; }

/* PrepararPedidos: vertical = intro / pedido / dock / acción */
.picking { height: 100%; display: grid; gap: var(--sp-4); grid-template-columns: minmax(0, 1fr);
           grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-areas: "intro" "order" "scan" "summary"; }
.picking__intro { grid-area: intro; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); }
.picking__order { grid-area: order; }
.picking__scan { grid-area: scan; }
.picking__summary { grid-area: summary; }
.picking.is-typing { grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-areas: "intro" "order" "summary" "scan"; } /* el campo queda justo encima del teclado propio */
.picking.is-typing .scan-dock { border-color: var(--c-blue-600); box-shadow: 0 0 0 4px rgba(10,91,216,.18), var(--sh-2); }

/* Login */
/* Copia de la imagen de marketing sin el logo de Siemens: el logo va en HTML (.login-art__partner), más grande. */
.login-page { background: var(--c-bg) url('../img/esaab_mkt_sin_siemens.jpg') center / cover no-repeat; }
.login-page { --s: max(100vw / 1024, 100vh / 1536); }
.login-wrapper { position: absolute; left: 50%; transform: translateX(-50%);
                 top: calc(50vh - 768 * var(--s) + 690 * var(--s)); min-height: calc(300 * var(--s));
                 width: min(calc(560 * var(--s)), calc(100vw - 64px)); display: flex; flex-direction: column; justify-content: center; gap: var(--sp-4); }
.login-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* en vertical la imagen ya dice "Bienvenido" */
.login-instr { margin: 0; display: flex; align-items: center; justify-content: center; gap: var(--sp-2); text-align: center;
               font: 600 var(--fs-md)/1.2 var(--font-display); color: var(--c-heading); }
.login-instr .bi { color: var(--c-teal-700); }
.login-wrapper .field-t { height: 88px; font-size: var(--fs-lg); text-align: center; }
.login-wrapper .field-t.with-label { text-align: left; }
.login-actions { display: flex; gap: var(--sp-4); align-items: stretch; }
.login-actions > :first-child { flex: 1; }
.login-actions .btn-t { min-height: 88px; font-size: var(--fs-lg); }
.login-actions .btn-t--icon { width: 88px; flex: none; }
.login-message { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
                 background: var(--c-red-soft); color: var(--c-red-ink); font-weight: 500; font-size: var(--fs-base); }
.login-message:empty { display: none; }
.login-message .bi { font-size: 26px; color: var(--c-red-700); }
.login-fieldset { display: flex; flex-direction: column; gap: var(--sp-2); }

/* 7. Medios -------------------------------------------------------------- */
@media (max-width: 899px) { :root { --gutter: 24px; --fs-xl: 32px; } .menu-card__title { font-size: 24px; } }
@media (max-width: 699px) { .menu-grid { --cols: 1; } }
@media (orientation: landscape) and (min-width: 1024px) {
  :root { --header-h: 72px; --footer-h: 68px; }
  .brand-partner img { height: 52px; }
  .menu-grid { --cols: 3; }
  a.menu-card:first-of-type:nth-last-of-type(n+7), a.menu-card:first-of-type:nth-last-of-type(n+7) ~ a.menu-card { --cols: 4; --card-h: 190px; --badge: 80px; }
  a.menu-card:first-of-type:nth-last-of-type(2), a.menu-card:first-of-type:nth-last-of-type(2) ~ a.menu-card,
  a.menu-card:first-of-type:nth-last-of-type(4), a.menu-card:first-of-type:nth-last-of-type(4) ~ a.menu-card { --cols: 2; max-width: 640px; }
  .picking { grid-template-columns: minmax(0, 7fr) minmax(440px, 5fr); grid-template-rows: auto auto minmax(0, 1fr) auto;
             grid-template-areas: "order intro" "order scan" "order ." "order summary"; }
  .picking.is-typing { grid-template-areas: "order intro" "order scan" "order ." "order summary"; }
  .scan-row { flex-wrap: wrap; } .scan-field { flex: 1 1 100%; }
  .action-bar { flex-wrap: wrap; } .action-bar__primary { flex: 1 1 100%; }
  .toast-region[data-page="picking"] { left: var(--gutter); right: auto; width: min(720px, 52vw); bottom: calc(var(--footer-h) + 24px); }
}
.menu-card { position: relative; }
@media (orientation: landscape) and (max-height: 820px) { :root { --header-h: 64px; --footer-h: 64px; --tap-xl: 88px; --fs-xl: 32px; } .brand-partner img { height: 46px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .btn-t, .menu-card { border: 2px solid ButtonText; } .btn-t::before { display: none; } }
/* Con mouse (escritorio o equipos con puntero), la tarjeta se eleva y se resalta. En el tótem táctil manda el estado presionado. */
@media (hover: hover) and (pointer: fine) {
  .menu-card:hover { transform: translateY(-6px); background: var(--c-card-hover-bg); border-color: var(--c-blue-600); box-shadow: var(--sh-card-hover); }
  .menu-card:hover .menu-card__badge { transform: scale(1.06); box-shadow: 0 0 0 8px var(--c-card-hover-ring), 0 8px 20px rgba(4,4,79,.16), inset 0 0 0 1px var(--c-border-subtle); }
  .menu-card:hover .menu-card__title { color: var(--c-card-hover-ink); }
  .menu-card:hover:active, .menu-card.is-pressed:hover { transform: translateY(-2px) scale(.985); background: var(--c-info-soft); }
}
/* Login en modo teclado: dos campos; se compacta para no invadir los íconos de la imagen */
.login-wrapper--keyboard { gap: var(--sp-3); }
.login-wrapper--keyboard .field-t { height: 80px; }
.login-wrapper--keyboard .field-label { margin-bottom: 4px; }
/* Login en pantallas más anchas que la imagen (horizontal o casi cuadradas): una sola composición a pantalla completa.
   La imagen de marketing es vertical y no cubre una pantalla ancha sin recortarse, así que la composición se arma
   con HTML (.login-art, sección 8) sobre el fondo del login claro del WMS (login-smartlab.css): foto de laboratorio
   (lab-bg.jpg, Unsplash, libre de uso) con un velo blanco más denso al centro, red hexagonal en la mitad superior
   y la ola abajo. Conserva las posiciones de la imagen, así que el formulario queda en el mismo lugar. */
@media (min-aspect-ratio: 4/5) {
  .login-page { --s: calc(100vh / 1536);
                background: radial-gradient(ellipse 80% 84% at 50% 42%, rgba(255,255,255,.80) 0%, rgba(255,255,255,.64) 26%,
                                            rgba(255,255,255,.38) 60%, rgba(255,255,255,.14) 100%),
                            var(--c-bg) url('../img/lab-bg.jpg') center / cover no-repeat; }
  .login-page::before, .login-page::after { content: ""; position: fixed; z-index: 0; pointer-events: none; }
  .login-page::before { inset: 0; background: url('../img/deco/smartlab-hex.svg') repeat;
                        -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.35) 45%, transparent 70%);
                        mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.35) 45%, transparent 70%); }
  .login-page::after { inset: auto 0 0 0; height: clamp(140px, 20vh, 300px); background: url('../img/deco/smartlab-wave.svg') center bottom / 100% 100% no-repeat; }
  .login-wrapper { z-index: 1; gap: calc(14 * var(--s)); }
  .login-instr { font-size: max(15px, calc(26 * var(--s))); }
  .login-wrapper .field-t, .login-wrapper--keyboard .field-t { height: max(40px, calc(76 * var(--s))); font-size: max(15px, calc(24 * var(--s))); }
  .login-actions .btn-t { min-height: max(40px, calc(76 * var(--s))); font-size: max(15px, calc(24 * var(--s))); }
  .login-actions .btn-t--icon { width: max(40px, calc(76 * var(--s))); }
  .login-actions .btn-png { --h: max(40px, calc(76 * var(--s))); }
  .login-message { padding: calc(10 * var(--s)) calc(16 * var(--s)); gap: calc(10 * var(--s)); font-size: max(14px, calc(20 * var(--s))); line-height: 1.25; }
  .login-message .bi { font-size: max(18px, calc(24 * var(--s))); }
  .login-wrapper--keyboard { gap: calc(8 * var(--s)); }
  .login-wrapper--keyboard .field-t { height: max(40px, calc(66 * var(--s))); }
  .login-wrapper--keyboard .login-actions .btn-t { min-height: max(40px, calc(66 * var(--s))); }
  .login-wrapper--keyboard .login-actions .btn-t--icon { width: max(40px, calc(66 * var(--s))); }
  .login-wrapper--keyboard .login-actions .btn-png { --h: max(40px, calc(66 * var(--s))); }
  .login-wrapper--keyboard .field-label { font-size: max(14px, calc(18 * var(--s))); line-height: 1.2; margin-bottom: 2px; }
}

/* 8. Tema claro/oscuro ---------------------------------------------------- */
/* Conmutador: mismo aspecto que el del WMS (ThemeHead.ascx), con 64 px para uso táctil. Cambia el tema sin recargar. */
.header-tools { display: flex; align-items: center; gap: var(--sp-5); }
.theme-toggle { width: var(--tap-min); height: var(--tap-min); flex: none; display: grid; place-items: center; padding: 0; cursor: pointer;
                border-radius: 50%; border: 2px solid var(--c-toggle-border); background: var(--c-toggle-bg); color: var(--c-toggle-ink);
                box-shadow: var(--c-toggle-shadow); font-size: 28px; line-height: 1; transition: transform var(--dur-press) var(--ease); }
.theme-toggle:active { transform: scale(.94); }
.login-page .theme-toggle { position: fixed; top: 24px; right: 24px; z-index: 5; }
/* Logos sobre fondo oscuro: ESAAB en su variante clara (logo-esaab-light.svg del WMS); Siemens y Zettavision en blanco, como el WMS. */
:root[data-theme="dark"] .brand img, :root[data-theme="dark"] .login-art__logo { content: url('../img/logo-esaab-light.svg'); }
:root[data-theme="dark"] .brand-partner img, :root[data-theme="dark"] .brand-vendor, :root[data-theme="dark"] .login-art__partner { filter: brightness(0) invert(1); }
:root[data-theme="dark"] .app-main::after { opacity: .45; }

/* Login armado con HTML (.login-art): completo en modo oscuro (la imagen de marketing es clara) y en claro en pantallas
   anchas (sección 7); en vertical claro solo el logo de Siemens, porque la imagen ya trae los textos.
   Reproduce las posiciones de la imagen, así que el formulario no se mueve. */
.login-art { display: block; position: absolute; z-index: 0; left: 50%; top: calc(50vh - 768 * var(--s));
  width: calc(1024 * var(--s)); height: calc(1536 * var(--s)); transform: translateX(-50%); pointer-events: none;
  color: var(--c-heading); text-align: center; font-family: var(--font-display); }
@media not all and (min-aspect-ratio: 4/5) {
  :root:not([data-theme="dark"]) .login-art > :not(.login-art__partner) { visibility: hidden; }
}
:root[data-theme="dark"] .login-page {
  background: radial-gradient(ellipse 60% 45% at 18% 26%, rgba(27,86,214,.55), transparent 70%),
              radial-gradient(ellipse 45% 40% at 82% 14%, rgba(24,185,201,.40), transparent 65%),
              radial-gradient(ellipse 55% 40% at 55% 82%, rgba(19,49,127,.65), transparent 70%),
              radial-gradient(ellipse 40% 50% at 88% 64%, rgba(58,214,230,.22), transparent 65%),
              #060D1A; }
:root[data-theme="dark"] .login-page::before, :root[data-theme="dark"] .login-page::after {
  content: ""; position: fixed; z-index: 0; pointer-events: none; -webkit-mask-image: none; mask-image: none; }
:root[data-theme="dark"] .login-page::before { inset: 0 auto auto 0; width: min(48vw, 560px); height: min(42vw, 490px);
  background: url('../img/deco/smartlab-hex.svg') left top / contain no-repeat; opacity: .5; }
:root[data-theme="dark"] .login-page::after { inset: auto 0 0 0; width: auto; height: 24vh;
  background: url('../img/deco/smartlab-wave.svg') center bottom / 100% 100% no-repeat; opacity: .45; }
.login-art > * { position: absolute; left: 0; right: 0; margin: 0 auto; }
.login-art__logo { top: calc(120 * var(--s)); width: calc(620 * var(--s)); }
.login-art__product { top: calc(272 * var(--s)); font-size: calc(128 * var(--s)); font-weight: 700; line-height: 1; letter-spacing: -.01em; color: var(--c-art-ink); }
.login-art__product span { color: var(--c-art-accent); }
.login-art__line { top: calc(406 * var(--s)); font-size: calc(52 * var(--s)); font-weight: 600; line-height: 1; color: var(--c-art-accent); }
.login-art__rule { top: calc(478 * var(--s)); width: calc(96 * var(--s)); height: calc(4 * var(--s)); border-radius: 2px; background: var(--c-teal-500); }
.login-art__welcome { top: calc(516 * var(--s)); font-size: calc(98 * var(--s)); font-weight: 700; line-height: 1.05; color: var(--c-art-ink); }
.login-art__tagline { top: calc(638 * var(--s)); display: flex; align-items: center; justify-content: center; gap: calc(22 * var(--s));
  font: 400 calc(32 * var(--s))/1.2 var(--font-body); color: var(--c-text-muted); }
.login-art__tagline::before, .login-art__tagline::after { content: ""; width: calc(64 * var(--s)); height: 2px; background: var(--c-teal-500); }
.login-art__features { top: calc(1004 * var(--s)); width: calc(760 * var(--s)); padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); }
.login-art__features li { display: grid; justify-items: center; gap: calc(14 * var(--s)); font: 400 calc(29 * var(--s))/1.25 var(--font-body); color: var(--c-text-muted); }
.login-art__features li + li { border-left: 2px solid var(--c-art-divider); }
.login-art__features b { display: block; font: 600 calc(29 * var(--s))/1.25 var(--font-display); color: var(--c-art-ink); }
.login-art__features span { width: calc(104 * var(--s)); height: calc(104 * var(--s)); border-radius: 50%; display: grid; place-items: center;
  background: var(--c-art-icon-bg); border: 1px solid var(--c-art-icon-border); box-shadow: 0 0 calc(30 * var(--s)) var(--c-art-glow);
  color: var(--c-teal-700); font-size: calc(48 * var(--s)); }
.login-art__partner { top: calc(1256 * var(--s)); height: calc(104 * var(--s)); } /* 1,5 veces el logo que traía la imagen */

/* 9. Botones brillantes (propuesta A, elegida el 2026-10-17) ---------------- */
.btn-t--primary, .btn-t--confirm, .btn-t--danger { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.btn-t--primary::before, .btn-t--confirm::before, .btn-t--danger::before {
  content: ""; position: absolute; left: 4px; right: 4px; top: 3px; height: 46%;
  border-radius: 999px 999px 40% 40% / 999px 999px 20px 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.50), rgba(255,255,255,.04)); pointer-events: none; }
.btn-t--icon.btn-t--primary::before { border-radius: 16px 16px 40% 40% / 16px 16px 20px 20px; }
.btn-t--primary { background: linear-gradient(180deg, #3DA2FF 0%, #1173F0 24%, #0A5BD8 50%, #0747CC 74%, #0034C4 100%);
                  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.20), 0 6px 16px rgba(8,92,227,.35); }
.btn-t--confirm { background: linear-gradient(180deg, #45C25A 0%, #1E9A38 24%, #0F7A26 50%, #0B6A1F 74%, #075716 100%);
                  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.20), 0 6px 16px rgba(15,122,38,.35); }
.btn-t--danger  { background: linear-gradient(180deg, #F25A4F 0%, #DA2A22 24%, #C4161C 50%, #A81016 74%, #8E0A10 100%);
                  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.20), 0 6px 16px rgba(196,22,28,.30); }
.btn-t--primary:active, .btn-t--primary.is-pressed,
.btn-t--confirm:active, .btn-t--confirm.is-pressed,
.btn-t--danger:active, .btn-t--danger.is-pressed { box-shadow: inset 0 0 0 2px rgba(255,255,255,.25), inset 0 3px 6px rgba(0,0,0,.25), 0 2px 6px rgba(4,4,79,.25); }
.btn-t--primary:active::before, .btn-t--primary.is-pressed::before,
.btn-t--confirm:active::before, .btn-t--confirm.is-pressed::before { opacity: .5; }

/* 10. Piezas del sitio que el prototipo no tenía ---------------------------- */
p.menu-empty, .empty-state { margin: 0; }
.menu-card__badge img { width: 64%; height: 64%; object-fit: contain; }
.total .total__value { font: 700 var(--fs-2xl)/1 var(--font-display); color: var(--c-heading); font-variant-numeric: tabular-nums; }

/* Login: el servidor alterna los contenedores; el del lector no agrega caja propia */
#divLoginBarCodeInput.login-scan { display: contents; }
.login-mode-scan { display: none; }
.login-wrapper--keyboard .login-mode-kbd { display: none; }
.login-wrapper--keyboard .login-mode-scan { display: inline-block; }
.login-message::before { content: "\f336"; font-family: 'bootstrap-icons'; font-size: 26px; line-height: 1; color: var(--c-red-700); }
@media (min-aspect-ratio: 4/5) { .login-message::before { font-size: max(18px, calc(24 * var(--s))); } }

/* Diálogos de Bootstrap con la piel del tótem (buscador y orden procesada) */
.modal-backdrop { --bs-backdrop-bg: #04044F; --bs-backdrop-opacity: .55; }
.modal-t .modal-content { background: var(--c-surface); color: var(--c-text); border: 0; border-radius: var(--r-xl); box-shadow: var(--sh-2); }
.modal-t .modal-header { padding: var(--sp-5) var(--sp-6); gap: var(--sp-4); border-bottom: 1px solid var(--c-border-subtle); }
.modal-t .modal-title { margin: 0; font: 700 var(--fs-xl)/1.15 var(--font-display); color: var(--c-heading); }
.modal-t__close { margin-left: auto; width: var(--tap-min); height: var(--tap-min); flex: none; display: grid; place-items: center; padding: 0; cursor: pointer;
                  border: 0; border-radius: var(--r-md); background: var(--c-surface-2); color: var(--c-heading); font-size: 28px; }
.modal-t .modal-body { padding: var(--sp-5) var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-4); }
.modal-t .modal-body > .field-label { margin: 0; }
.search-row { display: flex; gap: var(--sp-3); align-items: stretch; }
.search-row .field-t { flex: 1; min-width: 0; }
.search-row .btn-t { min-height: var(--tap-lg); }
.search-results { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--c-border-subtle); border-radius: var(--r-lg); background: var(--c-surface-raised); }
.search-help { display: none; margin: 0; padding: var(--sp-6) var(--sp-5); text-align: center; color: var(--c-text-muted); font-size: var(--fs-base); }
.search-help:only-child { display: block; }
.table-t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-base); color: var(--c-text); }
.table-t th { position: sticky; top: 0; z-index: 1; padding: var(--sp-3) var(--sp-4); text-align: left; white-space: nowrap;
              background: var(--c-table-head); color: var(--c-table-head-ink); font: 600 var(--fs-sm)/1.2 var(--font-body); }
.table-t td { height: 56px; padding: var(--sp-2) var(--sp-4); vertical-align: middle; border-bottom: 1px solid var(--c-border-subtle); }
.table-t tbody tr:nth-child(even) td { background: var(--c-surface-2); }
.table-t th:last-child, .table-t td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.table-t td.table-t__empty { text-align: center; font-weight: 400; color: var(--c-text-muted); padding: var(--sp-6) var(--sp-5); }
.modal-t__done { text-align: center; align-items: center; }
.modal-t__done-icon { font-size: 96px; line-height: 1; color: var(--c-green-600); }
.modal-t__lead { margin: 0; font-size: var(--fs-md); color: var(--c-text-muted); }
.order-summary-list { width: 100%; display: grid; gap: 4px; text-align: left; }
.order-summary-list p { display: flex; justify-content: space-between; gap: var(--sp-4); margin: 0; padding: var(--sp-3) var(--sp-4);
                        border-radius: var(--r-md); background: var(--c-surface-2); font-size: 22px; }
.order-summary-list strong { font-weight: 500; color: var(--c-text-muted); }
.modal-t .modal-footer.modal-t__actions { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: var(--sp-4); padding: var(--sp-2) var(--sp-6) var(--sp-6); border-top: 0; }
.modal-t__actions > .btn-t { margin: 0; min-height: var(--tap-lg); }

/* Diálogos propios con campos (lote y serie) */
.t-dialog__fields { display: grid; gap: var(--sp-4); margin-bottom: var(--sp-6); }
.form-field { display: flex; flex-direction: column; gap: var(--sp-1); }
.form-field .field-label { margin: 0; }
.t-dialog .field-t { height: var(--tap-lg); }
.t-dialog__actions--wide { grid-template-columns: 1fr 2fr; }
.t-dialog p.field-error { display: flex; align-items: center; gap: var(--sp-2); margin: calc(-1 * var(--sp-3)) 0 var(--sp-5); padding: var(--sp-3) var(--sp-4);
                          border-radius: var(--r-md); background: var(--c-red-soft); color: var(--c-red-ink); font-size: var(--fs-base); font-weight: 500; }
.t-dialog p.field-error[hidden] { display: none; }
.field-error .bi { color: var(--c-red-700); }

/* 11. Teclado propio en pantalla (totemOsk en totem.js) --------------------
   El tótem no tiene teclado físico y el lector USB cuenta como uno, así que Windows no abre el teclado táctil.
   Fijo abajo y sobre los diálogos; el marco, el buscador y los diálogos se acortan lo que mide (--osk-h), así el
   campo queda a la vista. Mientras está abierto se oculta el pie, para que "Salir del sistema" no quede pegado a las teclas. */
html.osk-open .app-shell { height: calc(100dvh - var(--osk-h, 0px)); grid-template-rows: var(--header-h) minmax(0, 1fr); }
html.osk-open .app-footer { display: none; }
html.osk-open .modal { height: calc(100% - var(--osk-h, 0px)); }
html.osk-open .t-dialog { bottom: var(--osk-h, 0px); overflow: auto; align-items: safe center; }
/* Login: lo que queda bajo el teclado no se muestra a medias, y si el formulario tuvo que subir, tampoco la bajada */
html.osk-open .login-art__features, html.osk-open .login-art__partner, html.osk-lifted .login-art__tagline { visibility: hidden; }
@media (orientation: landscape) and (min-width: 1024px) {
  html.osk-open .toast-region[data-page="picking"] { bottom: calc(var(--osk-h, 0px) + 24px); }
}
.osk { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1080; padding: var(--sp-4) var(--gutter) var(--sp-5);
       background: var(--c-chrome-bg); border-top: 1px solid var(--c-border-subtle); box-shadow: 0 -10px 28px var(--c-scroll-shadow); }
.osk[hidden] { display: none; }
.osk__rows { max-width: 1240px; margin: 0 auto; display: grid; gap: var(--sp-3); }
.osk__row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: var(--sp-3); }
.osk__key { position: relative; overflow: hidden; min-width: 0; height: 80px; padding: 0; border: 0; border-radius: var(--r-md);
            display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); white-space: nowrap; cursor: pointer;
            touch-action: manipulation; user-select: none; -webkit-user-select: none;
            background: var(--c-surface-raised); color: var(--c-heading); font: 700 30px/1 var(--font-display);
            box-shadow: inset 0 0 0 2px var(--c-border-subtle), 0 3px 0 var(--c-border-subtle); transition: transform var(--dur-press) var(--ease); }
.osk__key:active, .osk__key.is-pressed { transform: translateY(2px); background: var(--c-info-soft); box-shadow: inset 0 0 0 2px var(--c-blue-600); }
.osk__key--fn { background: var(--c-surface-2); color: var(--c-blue-800); font: 600 var(--fs-base)/1 var(--font-display); }
.osk__key--fn[aria-pressed="true"] { background: var(--c-pressed-bg); color: #fff; box-shadow: inset 0 0 0 2px var(--c-pressed-bg); }
.osk__key .bi { font-size: 26px; }
.osk__key--wide { grid-column: span 2; }
.osk__key--space { grid-column: span 3; }
.osk__row--sym, .osk.is-sym .osk__row--abc { display: none; }
.osk.is-sym .osk__row--sym { display: grid; }
.osk__key--enter, .osk__key--enter:active, .osk__key--enter.is-pressed {
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); font: 600 var(--fs-base)/1 var(--font-display);
  background: linear-gradient(180deg, #45C25A 0%, #1E9A38 24%, #0F7A26 50%, #0B6A1F 74%, #075716 100%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.20); }
.osk__key--enter::before { content: ""; position: absolute; left: 4px; right: 4px; top: 3px; height: 46%; pointer-events: none;
  border-radius: 12px 12px 40% 40% / 12px 12px 20px 20px; background: linear-gradient(180deg, rgba(255,255,255,.50), rgba(255,255,255,.04)); }
.osk__key--enter:active, .osk__key--enter.is-pressed { filter: brightness(.92); box-shadow: inset 0 3px 6px rgba(0,0,0,.25); }
@media (orientation: landscape) { .osk { padding-block: var(--sp-3) var(--sp-4); } .osk__key { height: 64px; } }
@media (orientation: landscape) and (max-height: 820px) {
  .osk__rows, .osk__row { gap: var(--sp-2); } .osk__key { height: 48px; font-size: 24px; }
  /* Poca altura: mientras se escribe quedan el pedido y el campo; el título y "Procesar orden" vuelven al cerrar el teclado. */
  .picking.is-typing .picking__intro, .picking.is-typing .picking__summary { display: none; }
}
@media (max-width: 699px) { .osk { padding-inline: var(--sp-2); } .osk__rows, .osk__row { gap: 6px; } .osk__key { height: 56px; font-size: 22px; }
                            .osk__key--wide span { display: none; } }
