/* ════════════════════════════════════════════════════════════════
   MOBILE DESIGN SYSTEM (Mx) — Flota móvil / tablet (tema claro)
   Prefijo .mx- . Tokens en el contenedor raíz .mx.
   ════════════════════════════════════════════════════════════════ */

.mx {
    /* ── Superficies / fondos ── */
    --ax-bg: #F2F2F7;             /* systemGroupedBackground */
    --ax-surface: #FFFFFF;        /* card / row */
    --ax-bg-elevated: #FFFFFF;

    /* ── Texto (labels) ── */
    --ax-label: #1C1C1E;
    --ax-label-2: rgba(60, 60, 67, 0.62);
    --ax-label-3: rgba(60, 60, 67, 0.40);
    --ax-label-4: rgba(60, 60, 67, 0.26);

    /* ── Separadores / fills ── */
    --ax-separator: rgba(60, 60, 67, 0.16);
    --ax-fill: rgba(120, 120, 128, 0.10);
    --ax-fill-2: rgba(120, 120, 128, 0.16);

    /* ── Color de marca (tint) + semánticos ── */
    --ax-tint: #23519E;           /* marca, reemplaza el azul del sistema */
    --ax-tint-rgb: 35, 81, 158;   /* para sombras rgba(var(--ax-tint-rgb), x) */
    --ax-tint-strong: #1A3D7A;
    --ax-tint-soft: rgba(35, 81, 158, 0.14);
    --ax-accent: #F18A25;
    --ax-accent-soft: rgba(241, 138, 37, 0.18);
    --ax-green: #2FB457;
    --ax-green-soft: rgba(47, 180, 87, 0.18);
    --ax-amber: #F18A25;
    --ax-amber-soft: rgba(241, 138, 37, 0.18);
    --ax-red: #DC2626;
    --ax-red-soft: rgba(220, 38, 38, 0.20);

    /* ── Radios / sombras ── */
    --ax-r-card: 16px;
    --ax-r-row: 14px;
    --ax-r-pill: 999px;
    --ax-shadow-hairline: 0 1px 2px rgba(13, 25, 48, 0.04);
    --ax-shadow: 0 1px 2px rgba(13, 25, 48, 0.04), 0 8px 24px rgba(13, 25, 48, 0.06);

    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
                 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    color: var(--ax-label);
    background: var(--ax-bg);
}

/* ── Layout de pantalla ──
   En teléfono el MobileShell ya aporta 12px laterales; aquí solo un respiro.
   En pantallas grandes (iPad/standalone) sí controla su propio padding. */
.mx-screen {
    min-height: 100%;
    padding: 6px 4px max(16px, env(safe-area-inset-bottom));
    box-sizing: border-box;
}

/* ── Titulo grande de pantalla ── */
.mx-largetitle {
    padding: 12px 4px 6px;
}
.mx-largetitle__eyebrow {
    font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
    color: var(--ax-tint);
    text-transform: uppercase;
}
.mx-largetitle__title {
    font-size: 32px; font-weight: 800; letter-spacing: -0.02em;
    line-height: 1.1; margin: 2px 0 0; color: var(--ax-label);
}
.mx-largetitle__subtitle {
    font-size: 15px; color: var(--ax-label-2); margin-top: 4px;
}
.mx-largetitle--row { display: flex; align-items: flex-end; justify-content: space-between; }

/* ── Section header ── */
.mx-section {
    margin: 22px 0 8px;
    padding: 0 6px;
    display: flex; align-items: baseline; justify-content: space-between;
}
.mx-section__title {
    font-size: 13px; font-weight: 600; letter-spacing: 0.03em;
    text-transform: uppercase; color: var(--ax-label-2);
}
.mx-section__action {
    font-size: 14px; font-weight: 600; color: var(--ax-tint);
    text-decoration: none; background: none; border: none; cursor: pointer;
    padding: 2px 4px;
}
.mx-section__action--danger { color: var(--ax-red); }
.mx-section__count {
    font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
    background: var(--ax-fill); color: var(--ax-label-2);
    border-radius: 8px; padding: 1px 8px; align-self: center;
}

/* ════════ Glance cards (KPIs) ════════ */
.mx-glance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.mx-glance {
    all: unset; box-sizing: border-box; cursor: default;
    display: flex; flex-direction: column; gap: 10px;
    background: var(--ax-surface);
    border: 1px solid var(--ax-separator);
    border-radius: var(--ax-r-card);
    padding: 16px;
    box-shadow: var(--ax-shadow-hairline);
    min-height: 96px;
    transition: transform 140ms cubic-bezier(0.22,1,0.36,1), box-shadow 160ms ease;
}
.mx-glance--tappable { cursor: pointer; }
.mx-glance--tappable:active { transform: scale(0.98); }
.mx-glance__top { display: flex; align-items: center; justify-content: space-between; }
.mx-glance__icon {
    width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}
.mx-glance__icon .mud-icon-root { font-size: 19px !important; }
.mx-glance__value {
    font-size: 30px; font-weight: 800; letter-spacing: -0.02em;
    line-height: 1; font-variant-numeric: tabular-nums; color: var(--ax-label);
}
.mx-glance__label { font-size: 13.5px; font-weight: 500; color: var(--ax-label-2); }

/* Tints semánticos para icono de glance */
.mx-tint-blue   { background: var(--ax-tint-soft);  color: var(--ax-tint); }
.mx-tint-green  { background: var(--ax-green-soft);  color: var(--ax-green); }
.mx-tint-amber  { background: var(--ax-amber-soft);  color: var(--ax-amber); }
.mx-tint-red    { background: var(--ax-red-soft);    color: var(--ax-red); }
.mx-tint-accent { background: var(--ax-accent-soft); color: var(--ax-accent); }

/* ════════ Hero (tasa de disponibilidad) — mismo lienzo azul del shell ════════ */
.mx-hero {
    background: linear-gradient(135deg, #13203A 0%, #0E1A2E 60%, #0A1222 100%);
    border: 0.5px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--ax-r-card);
    padding: 20px; color: #fff;
    box-shadow: 0 12px 30px rgba(5, 10, 20, 0.35);
    position: relative; overflow: hidden;
}
.mx-hero::after {
    content: ""; position: absolute; right: -40px; top: -40px;
    width: 160px; height: 160px; border-radius: 50%;
    background: rgba(241, 138, 37, 0.16); filter: blur(26px);
}
.mx-hero__label { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.85; }
.mx-hero__value { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.mx-hero__meta { font-size: 13.5px; opacity: 0.85; margin-top: 8px; position: relative; z-index: 1; }
.mx-hero__bar { margin-top: 12px; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.18); overflow: hidden; position: relative; z-index: 1; }
.mx-hero__bar-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, #F79A3E, #F18A25);
    box-shadow: 0 0 10px rgba(241, 138, 37, 0.55);
}

/* ════════ Cabecera inmersiva de documento (MxFlowHeader) ════════
   Ocupa el borde superior de la pantalla, safe-area incluida, y la hoja de
   contenido monta encima con .mx-sheet. Mismo gesto que el modal BPM de
   escritorio, donde la navegación de pestañas se solapa sobre la zona azul. */
.mx-fh {
    background: linear-gradient(160deg, var(--ax-tint-strong) 0%, #172E5C 55%, #13203A 100%);
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 20px 40px;
    color: #fff;
    position: relative; overflow: hidden;
}
/* Halo cálido arriba a la derecha: da profundidad al plano y evita que el azul
   se lea como un bloque plano. Es el mismo recurso de .mx-hero::after. */
.mx-fh::after {
    content: ""; position: absolute; right: -60px; top: -70px;
    width: 220px; height: 220px; border-radius: 50%;
    background: rgba(241, 138, 37, 0.20); filter: blur(40px);
    pointer-events: none;
}
.mx-fh > * { position: relative; z-index: 1; }

.mx-fh__nav { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.mx-fh__back {
    all: unset; box-sizing: border-box; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px; padding-right: 8px;
    color: rgba(255, 255, 255, 0.92); font-size: 15px; font-weight: 600;
    -webkit-tap-highlight-color: transparent;
}
.mx-fh__back .mud-icon-root { font-size: 17px !important; }
.mx-fh__back:active { opacity: 0.55; }
.mx-fh__nav > :last-child:not(.mx-fh__back) { margin-left: auto; }
.mx-fh__action {
    all: unset; box-sizing: border-box; cursor: pointer; flex-shrink: 0;
    width: 40px; height: 40px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.14); color: #fff;
    -webkit-tap-highlight-color: transparent;
    transition: background 150ms ease, transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
}
.mx-fh__action:active { background: rgba(255, 255, 255, 0.26); transform: scale(0.92); }
.mx-fh__action .mud-icon-root { font-size: 20px !important; }

.mx-fh__id { margin-top: 10px; }
.mx-fh__eyebrow {
    display: block;
    font-size: 12px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}
.mx-fh__code {
    margin: 4px 0 0; color: #fff;
    font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.08;
    font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.mx-fh__status { margin-top: 10px; }

.mx-fh__meta {
    display: flex; align-items: baseline; gap: 10px;
    margin-top: 16px; padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.mx-fh__figure {
    font-size: 1.5rem; font-weight: 800; color: #fff;
    font-variant-numeric: tabular-nums; flex-shrink: 0; letter-spacing: -0.01em;
}
.mx-fh__facts {
    font-size: 12.5px; line-height: 1.4; color: rgba(255, 255, 255, 0.72);
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mx-fh__flow { margin-top: 16px; }
.mx-fh--skeleton { height: 250px; }

/* Hoja de contenido montada sobre la cabecera. */
.mx-sheet {
    position: relative; z-index: 2;
    margin-top: -28px;
    background: var(--ax-bg);
    border-radius: 28px 28px 0 0;
    padding: 14px 12px 0;
    box-shadow: 0 -12px 28px rgba(5, 10, 20, 0.22);
    min-height: 60vh;
}

/* ════════ Avance por pasos (MxFlowProgress) — para heros OSCUROS ════════
   Misma gramática que .mx-hero__bar: pista translúcida y relleno de acento con
   glow. Segmentada porque así se sigue viendo CUÁNTOS pasos hay sin necesidad de
   etiquetas, que es lo que no cabe en 390px. */
/* Hasta 2 líneas y no una con puntos suspensivos: la descripción del estatus es
   larga a propósito ("Pendiente aprobación final Gerente de Área") y truncarla
   deja fuera justo el matiz que distingue una responsabilidad de otra. */
.mx-flow__now {
    font-size: 15px; font-weight: 600; color: #fff; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; overflow-wrap: anywhere;
}
.mx-flow__foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
/* Ámbar #FFC07A y no --ax-accent: el naranja de marca sobre este azul da 3,07:1
   y no pasa AA para texto; este llega a 4,77:1 y sigue leyéndose como el mismo
   acento del segmento activo. */
.mx-flow__count {
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    color: #FFC07A; flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.mx-flow__track { display: flex; gap: 4px; flex: 1 1 auto; min-width: 0; }
/* Carril OSCURO y no blanco translúcido: el hero del detalle es azul medio
   (#1A3D7A→#23519E), no el azul casi negro del hero de Flota. Con carril blanco
   al 18% el límite contra el relleno ámbar queda en 1,98:1, por debajo del 3:1
   que pide WCAG 1.4.11 para bordes de componente; en oscuro sube a 4,26:1. */
.mx-flow__seg {
    flex: 1 1 0; height: 6px; border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
    transition: background 220ms ease;
}
.mx-flow__seg--done { background: rgba(255, 255, 255, 0.85); }
.mx-flow__seg--current {
    background: linear-gradient(90deg, #F79A3E, #F18A25);
    box-shadow: 0 0 10px rgba(241, 138, 37, 0.55);
}

/* ════════ Status pill ════════ */
.mx-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: var(--ax-r-pill);
    font-size: 12px; font-weight: 700; letter-spacing: 0.01em;
    line-height: 1.4;
    white-space: nowrap;
}
.mx-pill__dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.mx-pill__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mx-pill--green  { background: var(--ax-green-soft); color: var(--ax-green); }
.mx-pill--green  .mx-pill__dot { background: var(--ax-green); }
.mx-pill--amber  { background: var(--ax-amber-soft); color: var(--ax-amber); }
.mx-pill--amber  .mx-pill__dot { background: var(--ax-amber); }
.mx-pill--red    { background: var(--ax-red-soft);   color: var(--ax-red); }
.mx-pill--red    .mx-pill__dot { background: var(--ax-red); }
.mx-pill--blue   { background: var(--ax-tint-soft);  color: var(--ax-tint); }
.mx-pill--blue   .mx-pill__dot { background: var(--ax-tint); }
.mx-pill--gray   { background: var(--ax-fill-2);     color: var(--ax-label-2); }
.mx-pill--gray   .mx-pill__dot { background: var(--ax-label-3); }

/* ════════ Inset grouped list ════════ */
.mx-group {
    background: var(--ax-surface);
    border-radius: var(--ax-r-card);
    box-shadow: var(--ax-shadow);
    overflow: hidden;
}
.mx-row {
    all: unset; box-sizing: border-box; cursor: pointer;
    display: flex; align-items: center; gap: 14px;
    padding: 13px 16px; width: 100%;
    min-height: 56px; position: relative;
    transition: background 120ms ease;
}
.mx-row + .mx-row::before {
    content: ""; position: absolute; top: 0; left: 60px; right: 0;
    height: 1px; background: var(--ax-separator);
}
.mx-row:active { background: var(--ax-fill); }
.mx-row__icon {
    width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.mx-row__icon .mud-icon-root { font-size: 20px !important; }
.mx-row__body { flex: 1; min-width: 0; }
.mx-row__title { font-size: 16px; font-weight: 600; color: var(--ax-label); line-height: 1.25; }
.mx-row__sub { font-size: 13px; color: var(--ax-label-2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-row__trail { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mx-row__chevron { color: var(--ax-label-4); }
.mx-row__chevron .mud-icon-root { font-size: 19px !important; }

/* ════════ Quick actions ════════ */
.mx-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mx-action {
    all: unset; box-sizing: border-box; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 14px 6px; text-align: center;
    background: var(--ax-surface); border-radius: var(--ax-r-row);
    border: 1px solid var(--ax-separator);
    box-shadow: var(--ax-shadow-hairline);
    -webkit-tap-highlight-color: transparent;
    transition: transform 140ms cubic-bezier(0.22,1,0.36,1);
}
.mx-action:active { transform: scale(0.96); }
.mx-action__icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.mx-action__icon .mud-icon-root { font-size: 22px !important; }
.mx-action__label { font-size: 11.5px; font-weight: 600; color: var(--ax-label); line-height: 1.2; }

/* ════════ Search field ════════ */
.mx-search {
    display: flex; align-items: center; gap: 7px;
    background: var(--ax-fill); border-radius: 12px;
    padding: 0 12px; height: 44px; /* target táctil mínimo */
}
.mx-search__icon { color: var(--ax-label-3); display: flex; }
.mx-search__icon .mud-icon-root { font-size: 19px !important; }
.mx-search__input {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: 16px; color: var(--ax-label);
    font-family: inherit; min-width: 0;
}
.mx-search__input::placeholder { color: var(--ax-label-3); }
.mx-search__clear {
    all: unset; cursor: pointer; color: var(--ax-label-3);
    display: flex; align-items: center;
}
.mx-search__clear .mud-icon-root { font-size: 18px !important; }

/* ════════ Segmented control / carrusel ════════ */
/* Carrusel reutilizable que se desliza ←→ (inspección de OT, filtros de estado…):
   mantiene el efecto de scroll horizontal, pero PULIDO — snap a cada chip, scroll
   suave y targets táctiles de 44px. Una sola fuente; mejora todos los usos a la vez. */
.mx-seg {
    display: flex; gap: 2px; padding: 2px;
    background: var(--ax-fill); border-radius: 10px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
}
.mx-seg::-webkit-scrollbar { display: none; }
.mx-seg__item {
    all: unset; cursor: pointer; white-space: nowrap;
    flex: 1 0 auto; text-align: center;
    padding: 10px 14px; border-radius: 8px;
    min-height: 44px; box-sizing: border-box;   /* target táctil mínimo */
    scroll-snap-align: center;
    font-size: 13px; font-weight: 600; color: var(--ax-label-2);
    transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.mx-seg__item--active {
    background: var(--ax-surface); color: var(--ax-label);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 0 0 0.5px rgba(0,0,0,0.04);
}
.mx-seg__count {
    font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
    background: var(--ax-fill-2); color: var(--ax-label-2);
    border-radius: 8px; padding: 0 6px; min-width: 16px;
}
.mx-seg__item--active .mx-seg__count { background: var(--ax-tint-soft); color: var(--ax-tint); }

/* ── Add button (circular) ── */
.mx-add-btn {
    all: unset; cursor: pointer;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--ax-tint); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(var(--ax-tint-rgb), 0.30);
    transition: transform 140ms cubic-bezier(0.22,1,0.36,1);
}
.mx-add-btn:active { transform: scale(0.92); }
.mx-add-btn .mud-icon-root { font-size: 22px !important; }

/* ── Empty / list states ── */
.mx-empty { text-align: center; padding: 56px 20px; color: var(--ax-label-2); }
.mx-empty__icon { color: var(--ax-label-4); }
.mx-empty__icon .mud-icon-root { font-size: 44px !important; }
.mx-empty__title { font-size: 16px; font-weight: 600; color: var(--ax-label); margin-top: 10px; }
.mx-empty__sub { font-size: 13.5px; margin-top: 4px; }

.mx-trail-meta { font-size: 12px; color: var(--ax-label-3); font-variant-numeric: tabular-nums; }
.mx-trail-col { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* ── Cargar más / spinner de paginación (listas con infinite scroll) ── */
.mx-loadmore { display: flex; justify-content: center; padding: 16px 0 4px; }
.mx-loadmore-btn {
    all: unset; cursor: pointer; display: block; width: 100%;
    text-align: center; padding: 13px; margin-top: 10px;
    border-radius: 13px; background: var(--ax-fill);
    color: var(--ax-tint); font-size: 14px; font-weight: 600;
}
.mx-loadmore-btn:active { background: var(--ax-fill-2); }

/* Popover de MudSelect en móvil: por encima del tab bar (z-index 1200) y header */
.mx-mud-popover { z-index: 3000 !important; }

/* Solo en móvil: cap al viewport (sin tocar box-sizing/overflow del .mud-popover,
   que rompe la medición de ancho de MudBlazor 8 y agranda el select en desktop). */
/* Layout movil: cap de ancho de los popovers. Mismo criterio que el layout
   (<html data-touch-layout>, ver index.html). */
:where(html[data-touch-layout="1"]) .mx-mud-popover.mud-popover,
:where(html[data-touch-layout="1"]) .mud-popover {
    max-width: calc(100vw - 24px) !important; 
    z-index: 3000 !important;
}

/* Texto de opciones con elipsis (no fuerza el ancho del popover). */
.mx-mud-popover .mud-list-item-text,
.mx-mud-popover .mud-list-item-text .mud-typography {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Tarjeta del panel de filtros (aloja AppSelect/MudSelect; sin overflow hidden) */
.mx-filtercard {
    background: var(--ax-surface);
    border-radius: var(--ax-r-card);
    box-shadow: var(--ax-shadow);
    padding: 14px;
    display: flex; flex-direction: column; gap: 14px;
    margin-top: 10px;
}

/* ── Botones de ícono en el header (acciones) ── */
.mx-header-actions { display: flex; align-items: center; gap: 8px; }
.mx-icon-btn {
    all: unset; cursor: pointer; position: relative;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--ax-fill); color: var(--ax-tint);
    display: flex; align-items: center; justify-content: center;
    transition: background 150ms ease, transform 140ms cubic-bezier(0.22,1,0.36,1);
}
.mx-icon-btn:active { transform: scale(0.92); }
.mx-icon-btn--active { background: var(--ax-tint); color: #fff; }
.mx-icon-btn .mud-icon-root { font-size: 20px !important; }
.mx-icon-btn__badge {
    position: absolute; top: -2px; right: -2px;
    min-width: 17px; height: 17px; border-radius: 9px;
    background: var(--ax-accent); color: #fff;
    font-size: 10.5px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; border: 2px solid var(--ax-bg);
}

/* ════════ Pantallas de detalle (compartido por MJobDetailView / MVehicleDetailView) ════════ */
.mx-back {
    all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 2px;
    color: var(--ax-tint); font-size: 16px; font-weight: 600; padding: 6px 4px 6px 0;
    -webkit-tap-highlight-color: transparent;
}
.mx-back .mud-icon-root { font-size: 22px !important; }

.mx-detailhero {
    background: linear-gradient(135deg, var(--ax-tint-strong), var(--ax-tint));
    border-radius: var(--ax-r-card); padding: 18px; color: #fff; margin-top: 6px;
    box-shadow: 0 10px 28px rgba(var(--ax-tint-rgb), 0.28);
}
.mx-detailhero__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mx-detailhero__code { font-size: 1.25rem; font-weight: 800; letter-spacing: 0.5px; font-variant-numeric: tabular-nums; }
.mx-detailhero__line { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 0.95rem; font-weight: 600; }
.mx-detailhero__line .mud-icon-root { font-size: 18px !important; opacity: 0.9; }
.mx-detailhero__sub { font-size: 0.8rem; opacity: 0.8; margin-top: 4px; }

.mx-kv {
    position: relative; display: flex; align-items: center; gap: 12px;
    padding: 13px 16px; min-height: 48px;
}
.mx-kv + .mx-kv::before {
    content: ""; position: absolute; top: 0; left: 16px; right: 0;
    height: 1px; background: var(--ax-separator);
}
.mx-kv__k { font-size: 15px; color: var(--ax-label-2); flex-shrink: 0; }
.mx-kv__v {
    margin-left: auto; font-size: 15px; font-weight: 600; color: var(--ax-label);
    text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.mx-kv--total .mx-kv__k { font-weight: 700; color: var(--ax-label); }
.mx-kv--total .mx-kv__v { color: var(--ax-tint); font-size: 17px; font-weight: 800; }

.mx-cta {
    all: unset; box-sizing: border-box; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: 50px; margin-top: 22px;
    border-radius: var(--ax-r-row); background: var(--ax-tint); color: #fff;
    font-size: 16px; font-weight: 600;
    box-shadow: 0 6px 16px rgba(var(--ax-tint-rgb), 0.3);
    -webkit-tap-highlight-color: transparent;
    transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
}
.mx-cta:active { transform: scale(0.98); }

/* ── KPI strip compacto (listas con indicadores) ── */
.mx-kpis {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    margin-bottom: 12px;
}
.mx-kpi {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: var(--ax-surface); border-radius: var(--ax-r-row); padding: 10px 6px;
    box-shadow: var(--ax-shadow);
}
.mx-kpi__value { font-size: 1.15rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.mx-kpi__label {
    font-size: 0.58rem; font-weight: 600; color: var(--ax-label-2);
    text-transform: uppercase; letter-spacing: 0.04em;
}

/* ── Estados de carga / vacío ── */
.mx-skeleton {
    background: linear-gradient(100deg, var(--ax-fill) 30%, var(--ax-fill-2) 50%, var(--ax-fill) 70%);
    background-size: 200% 100%;
    animation: axShimmer 1.3s ease-in-out infinite;
    border-radius: 8px;
}
@keyframes axShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ════════════════════════════════════════════════
   RESPONSIVE — iPad / pantallas grandes
   ════════════════════════════════════════════════ */
@media (min-width: 700px) {
    .mx-screen { padding: 16px 24px; max-width: 1100px; margin: 0 auto; }
    .mx-glance-grid { grid-template-columns: repeat(4, 1fr); }
    .mx-largetitle__title { font-size: 38px; }
    .mx-actions { grid-template-columns: repeat(8, 1fr); }
    /* En iPad: dashboard a dos columnas (KPIs + hero | listas) */
    .mx-ipad-cols {
        display: grid;
        grid-template-columns: 1.4fr 1fr;
        gap: 24px;
        align-items: start;
    }
}
@media (min-width: 1024px) {
    .mx-largetitle__title { font-size: 42px; }
}

/* ════════════════════════════════════════════════════════════════
   OrderLineItemsPanel en MÓVIL — scope .olm (el panel se renderiza
   con class="ol-panel mx olm" cuando DeviceLayout.IsMobile, y emite
   markup de lista agrupada en lugar de la MudTable).
   Tokens disponibles vía .mx. Especificidad ≥ (0,2,0) para ganarle
   a los estilos inline del componente (que viven en el <body>).
   ════════════════════════════════════════════════════════════════ */
/* El body blanco lo pinta el wizard (igual que el paso Generales); el panel
   es transparente y sus tarjetas se definen con hairline border sobre blanco. */
.ol-panel.olm { gap: 4px; background: transparent; }

/* ── Filtros (Categoría · Subcategoría · Buscar) = tarjeta con hairline ── */
.olm .ol-filters {
    background: var(--ax-surface);
    border: 1px solid var(--ax-separator);
    border-radius: var(--ax-r-card);
    box-shadow: var(--ax-shadow-hairline);
    padding: 14px 18px;
}

/* Grupos de lista y resumen sobre body blanco: hairline en vez de sombra */
.olm .mx-group {
    border: 1px solid var(--ax-separator);
    box-shadow: var(--ax-shadow-hairline);
}
.olm .ol-toolbar-custom,
.olm .ol-header { margin-bottom: 6px; }

/* ── Encabezado de sección de la lista ── */
.olm .mx-section { margin: 16px 0 8px; }

/* ── Ítems de la lista agrupada ── */
.olm-item { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
.olm-item + .olm-item::before {
    content: ""; position: absolute; top: 0; left: 14px; right: 0;
    height: 1px; background: var(--ax-separator);
}
.olm-item__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.olm-item__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.olm-item__title {
    font-size: 15.5px; font-weight: 600; color: var(--ax-label);
    line-height: 1.3; letter-spacing: -0.01em;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.olm-item__meta {
    font-size: 12.5px; color: var(--ax-label-2);
    font-family: 'SF Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.olm-item__amount {
    font-size: 15px; font-weight: 700; color: var(--ax-label);
    font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.olm-item__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.olm-item__actions { display: flex; align-items: center; gap: 4px; }
/* Acciones planas: sin tile de color, glifo en tint (rojo solo Eliminar),
   target táctil 44px. !important para ganarle al Style inline y al :hover del CSS scoped. */
.olm-item__actions .action-icon-btn {
    background: transparent !important;
    width: 44px !important; height: 44px !important; margin: 0 !important;
    color: var(--ax-tint) !important;
}
.olm [data-testid="order-line-delete"] .action-icon-btn { color: var(--ax-red) !important; }
.olm .olm-item__actions .action-icon-btn:hover:not(:disabled),
.olm .olm-item__actions .action-icon-btn:active {
    background: transparent !important;
    transform: none !important;
    box-shadow: none !important;
}
.olm-qty { font-size: 14px; font-weight: 600; color: var(--ax-label-2); font-variant-numeric: tabular-nums; }

/* ── Pill de estatus tocable (cabecera del ítem) ── */
.olm-pillbtn { all: unset; cursor: pointer; flex-shrink: 0; -webkit-tap-highlight-color: transparent; }
.olm-pillbtn:not(:disabled):active { opacity: 0.6; }
.olm-pillbtn:disabled { cursor: default; }

/* ── Estado vacío compacto (es una sub-lista del paso, no una pantalla) ── */
.olm .mx-empty { padding: 26px 18px; }
.olm .mx-empty__icon .mud-icon-root { font-size: 34px !important; }
.olm .mx-empty__title { font-size: 15px; }

/* ── Stepper de cantidad, look compacto (gana a los estilos del componente) ── */
.olm .ol-stepper { height: 40px; border: none; border-radius: 10px; background: var(--ax-fill); }
.olm .ol-stepper:hover,
.olm .ol-stepper:focus-within { border: none; box-shadow: none; }
.olm .ol-stepper-btn { width: 42px; height: 40px; font-size: 18px; color: var(--ax-tint); }
.olm .ol-stepper-btn:hover:not(:disabled) { background: transparent; color: var(--ax-tint); }
.olm .ol-stepper-input { width: 46px; }
.olm .ol-stepper-input input { font-size: 16px !important; height: 38px !important; } /* ≥16px: sin zoom al enfocar */

/* ── Fila "Asignar operario" (abre diálogo de selección) ── */
.olm-assign {
    display: flex; align-items: center; gap: 8px;
    width: 100%; min-height: 44px; padding: 10px 12px; box-sizing: border-box;
    border: none; border-radius: 11px;
    background: var(--ax-fill); color: var(--ax-label);
    font-size: 15px; font-weight: 600; font-family: inherit;
    cursor: pointer; text-align: left;
    -webkit-tap-highlight-color: transparent;
    transition: background 120ms ease;
}
.olm-assign:active { background: var(--ax-fill-2); }
.olm-assign:disabled { opacity: 0.55; cursor: default; }
.olm-assign--empty .olm-assign__label { color: var(--ax-label-3); font-weight: 500; }
.olm-assign__icon { font-size: 19px !important; color: var(--ax-tint); flex-shrink: 0; }
.olm-assign__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.olm-assign__chev { font-size: 18px !important; color: var(--ax-label-4); flex-shrink: 0; }

/* ── Resumen financiero (insumos): tarjeta con filas clave/valor ── */
.olm .ol-summary {
    flex-direction: column; align-items: stretch; gap: 0;
    margin-top: 14px; padding: 2px 14px;
    background: var(--ax-surface);
    border: 1px solid var(--ax-separator); border-radius: var(--ax-r-card);
    box-shadow: var(--ax-shadow-hairline);
}
.olm .ol-summary-item,
.olm .ol-summary-total {
    position: relative; flex-direction: row; align-items: center;
    justify-content: space-between; gap: 8px;
    width: auto; margin: 0; padding: 12px 0; border: none;
}
.olm .ol-summary-item + .ol-summary-item::before,
.olm .ol-summary-item + .ol-summary-total::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0;
    height: 1px; background: var(--ax-separator);
}
.olm .ol-summary-total-value { font-size: 1.15rem; }

/* ════════════════════════════════════════════════════════════════
   MÓDULO MIS TAREAS (móvil) — scope .mtk
   Bandeja BPM: chips de filtro, fila de tarea con riel de urgencia,
   hero con stepper del flujo y tarjeta de historial.
   ════════════════════════════════════════════════════════════════ */

/* ── Ritmo vertical del módulo ──
   .mx-seg y .mx-search no traen margen propio (en Flota siempre van dentro de
   bloques que lo aportan), así que aquí segmentado, buscador y chips quedaban
   pegados unos a otros. */
.mtk .mx-seg { margin-top: 12px; }
.mtk .mx-search { margin-top: 12px; }
.mtk .mtk-chips { margin-top: 12px; }
.mtk .mx-filtercard { margin-top: 10px; }

/* ── Chips de filtro con conteo (tipo de documento / antigüedad) ── */
.mtk-chips {
    display: flex; gap: 8px; padding: 2px 2px 4px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.mtk-chips::-webkit-scrollbar { display: none; }
.mtk-chip {
    all: unset; box-sizing: border-box; cursor: pointer; flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px; padding: 0 14px;
    border-radius: var(--ax-r-pill);
    background: var(--ax-surface); border: 0.5px solid var(--ax-separator);
    font-size: 13.5px; font-weight: 600; color: var(--ax-label-2);
    -webkit-tap-highlight-color: transparent;
    transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1), background 150ms ease, color 150ms ease;
}
.mtk-chip:active { transform: scale(0.96); }
.mtk-chip__count {
    font-size: 11.5px; font-weight: 700; padding: 1px 7px;
    border-radius: var(--ax-r-pill); background: var(--ax-fill); color: var(--ax-label-2);
}
.mtk-chip--on { background: var(--ax-tint); border-color: var(--ax-tint); color: #fff; }
.mtk-chip--on .mtk-chip__count { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* ── KPI tocable (mismo aspecto que .mx-kpi, pero es un <button>) ── */
.mtk-kpi {
    all: unset; box-sizing: border-box; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 6px; text-align: center;
    background: var(--ax-surface); border-radius: var(--ax-r-row);
    box-shadow: var(--ax-shadow);
    -webkit-tap-highlight-color: transparent;
    transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
}
.mtk-kpi:active { transform: scale(0.96); }

/* ── Fila de la bandeja ── */
.mtk-row {
    all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
    position: relative; display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 14px 12px 18px; min-height: 68px;
    -webkit-tap-highlight-color: transparent;
    transition: background 120ms ease;
}
.mtk-row + .mtk-row::before {
    content: ""; position: absolute; top: 0; left: 18px; right: 0;
    height: 1px; background: var(--ax-separator);
}
.mtk-row:active { background: var(--ax-fill); }
.mtk-row__rail {
    position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px;
    border-radius: 0 3px 3px 0; background: var(--ax-label-4);
}
.mtk-row__rail--red { background: var(--ax-red); }
.mtk-row__rail--amber { background: var(--ax-amber); }
.mtk-row__rail--blue { background: var(--ax-tint); }
.mtk-row__rail--gray { background: var(--ax-label-4); }
.mtk-row__icon {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; margin-top: 2px;
    display: flex; align-items: center; justify-content: center;
}
.mtk-row__icon .mud-icon-root { font-size: 19px !important; }
.mtk-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.mtk-row__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mtk-row__code {
    font-size: 15.5px; font-weight: 700; color: var(--ax-label); letter-spacing: -0.01em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mtk-row__when {
    font-size: 12px; font-weight: 600; color: var(--ax-label-3);
    flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.mtk-row__sub {
    font-size: 13px; color: var(--ax-label-2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Grid y no flex: la píldora de estatus es nowrap y como ítem flex no baja de su
   min-content, así que un nombre largo ("Rechazada por Gerencia General") empujaba
   el monto fuera de la fila y .mx-group lo recortaba. */
.mtk-row__foot {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    align-items: center; gap: 10px;
    /* Sin esto la píldora se estira a toda la columna 1fr en vez de ceñirse al texto. */
    justify-items: start;
}
.mtk-row__foot .mx-pill { min-width: 0; max-width: 100%; overflow: hidden; }
.mtk-row__foot .mtk-row__amount { justify-self: end; }
.mtk-row__amount {
    font-size: 14px; font-weight: 700; color: var(--ax-label); font-variant-numeric: tabular-nums;
}
.mtk-row .mx-row__chevron { align-self: center; }

/* ── Hero del detalle: el stepper del flujo vive en el degradado ── */




/* ── Modo selección de la bandeja ── */
.mtk-row--on { background: var(--ax-tint-soft); }
.mtk-row__check {
    width: 34px; height: 34px; flex-shrink: 0; margin-top: 2px;
    display: flex; align-items: center; justify-content: center;
    color: var(--ax-tint);
}
.mtk-row__check .mud-icon-root { font-size: 24px !important; }
.mtk-row--on .mtk-row__check { color: var(--ax-tint-strong); }

/* Dock de aprobación por lote: por encima de la cápsula de navegación. */
.mtk-batchbar {
    position: fixed; z-index: 1210;
    left: 12px; right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    display: flex; align-items: center; gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
    border: 0.5px solid rgba(13, 25, 48, 0.08);
    border-radius: 22px;
    box-shadow: 0 4px 10px rgba(13, 25, 48, 0.06), 0 18px 44px rgba(13, 25, 48, 0.18);
}
.mtk-batchbar__all {
    all: unset; box-sizing: border-box; cursor: pointer; flex: 1 1 auto; min-width: 0;
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px;
    font-size: 13.5px; font-weight: 600; color: var(--ax-label);
    -webkit-tap-highlight-color: transparent;
}
.mtk-batchbar__all .mud-icon-root { font-size: 22px !important; color: var(--ax-tint); }
.mtk-batchbar__all span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtk-batchbar__cta {
    all: unset; box-sizing: border-box; cursor: pointer; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 44px; padding: 0 18px; border-radius: 14px;
    background: linear-gradient(180deg, #3AC36A 0%, #2FB457 55%, #269C4A 100%);
    color: #fff; font-size: 0.95rem; font-weight: 700;
    box-shadow: 0 6px 16px rgba(47, 180, 87, 0.34);
    -webkit-tap-highlight-color: transparent;
    transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
}
.mtk-batchbar__cta:active { transform: scale(0.97); }
.mtk-batchbar__cta .mud-icon-root { font-size: 1.15rem !important; }
.mtk-batchbar__cta[disabled] {
    background: var(--ax-fill-2); color: var(--ax-label-3);
    box-shadow: none; cursor: default; transform: none;
}

/* Exportar dentro de la tarjeta de filtros */
.mtk-export { display: flex; justify-content: center; padding: 12px 16px; }

/* ── Encabezado de grupo crítico (Vencidas) ── */
.mtk-section--danger .mx-section__title { color: var(--ax-red); }
.mtk-section--danger .mx-section__count { background: var(--ax-red-soft); color: var(--ax-red); }

/* ── Aviso de tarea vencida ── */
.mtk-alert {
    display: flex; align-items: center; gap: 12px; margin-top: 14px;
    padding: 14px 16px; border-radius: var(--ax-r-card); background: var(--ax-red-soft);
}
.mtk-alert .mud-icon-root { font-size: 24px !important; color: var(--ax-red); flex-shrink: 0; }
.mtk-alert__title { font-size: 15px; font-weight: 700; color: var(--ax-label); }
.mtk-alert__sub { font-size: 13px; line-height: 1.45; color: var(--ax-label-2); margin-top: 2px; }
.mtk-alert--info { background: var(--ax-tint-soft); }
.mtk-alert--info .mud-icon-root { color: var(--ax-tint); }


/* ── Tarjetas de decisión (Aprobar / Rechazar) ── */
.mtk-choices { display: flex; flex-direction: column; gap: 10px; }
.mtk-choice {
    all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
    display: flex; align-items: flex-start; gap: 12px;
    padding: 15px 16px; border-radius: var(--ax-r-card);
    background: var(--ax-surface); border: 1.5px solid var(--ax-separator);
    box-shadow: var(--ax-shadow-hairline);
    -webkit-tap-highlight-color: transparent;
    transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1), border-color 150ms ease, background 150ms ease;
}
.mtk-choice:active { transform: scale(0.985); }
.mtk-choice__mark { flex-shrink: 0; color: var(--ax-label-4); display: flex; margin-top: 1px; }
.mtk-choice__mark .mud-icon-root { font-size: 24px !important; }
.mtk-choice__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: left; }
.mtk-choice__title { font-size: 16px; font-weight: 700; color: var(--ax-label); }
.mtk-choice__desc { font-size: 13px; line-height: 1.4; color: var(--ax-label-2); }
.mtk-choice--on { border-color: var(--ax-tint); background: var(--ax-tint-soft); }
.mtk-choice--go.mtk-choice--on { border-color: var(--ax-green); background: var(--ax-green-soft); }
.mtk-choice--go.mtk-choice--on .mtk-choice__mark { color: var(--ax-green); }
.mtk-choice--stop.mtk-choice--on { border-color: var(--ax-red); background: var(--ax-red-soft); }
.mtk-choice--stop.mtk-choice--on .mtk-choice__mark { color: var(--ax-red); }
.mtk-choice--stop.mtk-choice--on .mtk-choice__title { color: var(--ax-red); }

/* ── Selección única de motivo: etiqueta a la izquierda, check a la derecha ── */
.mtk-pick {
    all: unset; box-sizing: border-box; cursor: pointer; width: 100%; position: relative;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; min-height: 52px;
    -webkit-tap-highlight-color: transparent;
}
.mtk-pick + .mtk-pick::before {
    content: ""; position: absolute; top: 0; left: 16px; right: 0;
    height: 1px; background: var(--ax-separator);
}
.mtk-pick:active { background: var(--ax-fill); }
.mtk-pick__label { font-size: 16px; color: var(--ax-label); line-height: 1.3; }
.mtk-pick--on .mtk-pick__label { font-weight: 600; }
.mtk-pick .mud-icon-root { font-size: 21px !important; color: var(--ax-tint); flex-shrink: 0; }

/* ── Campos nativos (≥16px: sin zoom automático al enfocar) ── */
.mtk-field {
    background: var(--ax-surface); border-radius: var(--ax-r-card);
    box-shadow: var(--ax-shadow); overflow: hidden;
}
.mtk-field--inline { box-shadow: none; border-radius: 0; }
.mtk-field__input {
    display: block; width: 100%; box-sizing: border-box;
    border: none; outline: none; resize: none;
    padding: 14px 16px; background: transparent;
    font-family: inherit; font-size: 16px; line-height: 1.45; color: var(--ax-label);
}
.mtk-field__input::placeholder { color: var(--ax-label-3); }
.mtk-field--error { box-shadow: 0 0 0 1.5px var(--ax-red); }
.mtk-field__error { font-size: 13px; color: var(--ax-red); padding: 6px 8px 0; }

/* ── Fila de captura: etiqueta a la izquierda, control a la derecha ──
   Mismo ritmo que .mx-kv, para que el formulario de la fase se lea como una
   ficha más y no como un formulario pegado encima. El <select> nativo abre la
   rueda del teléfono: en una lista larga (bancos, términos) gana a un dropdown. */
.mtk-inp {
    position: relative; display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; min-height: 52px;
}
.mtk-inp + .mtk-inp::before,
.mtk-inp + .mx-kv::before,
.mx-kv + .mtk-inp::before {
    content: ""; position: absolute; top: 0; left: 16px; right: 0;
    height: 1px; background: var(--ax-separator);
}
.mtk-inp__k { font-size: 15px; color: var(--ax-label-2); flex-shrink: 0; }
.mtk-inp__v {
    flex: 1; min-width: 0; width: 100%;
    border: none; outline: none; background: transparent;
    font-family: inherit; font-size: 16px; color: var(--ax-label);
    text-align: right; text-align-last: right;
    padding: 4px 0; -webkit-appearance: none; appearance: none;
}
.mtk-inp__v::placeholder { color: var(--ax-label-3); }
.mtk-inp__v--num { font-variant-numeric: tabular-nums; }
.mtk-inp select.mtk-inp__v { color: var(--ax-tint); }
.mtk-inp__v:focus { color: var(--ax-label); }

/* ── Panel del modal reutilizado dentro de la hoja móvil ──
   Los paneles de costeo/afiliación de Cotización se comparten con escritorio;
   aquí solo se les quita el ancho fijo y se les deja desbordar en horizontal
   para que la tabla no empuje la página entera. */
.mtk-embed {
    background: var(--ax-surface); border-radius: var(--ax-r-card);
    box-shadow: var(--ax-shadow); overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding: 12px;
}
.mtk-embed .mud-input-control,
.mtk-embed .mud-select { min-width: 0; }
.mtk-embed .mud-grid-item { padding: 4px !important; }
.mtk-embed .mud-input-slot,
.mtk-embed input, .mtk-embed textarea { font-size: 16px !important; }

.mtk-note--scroll { max-height: 180px; overflow-y: auto; }

/* ── Adjuntos ── */
.mtk-upload {
    position: relative; display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; min-height: 60px; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mtk-upload + .mtk-upload::before {
    content: ""; position: absolute; top: 0; left: 16px; right: 0;
    height: 1px; background: var(--ax-separator);
}
.mtk-upload:active { background: var(--ax-fill); }
/* El <input> va a opacity:0 sobre toda la fila: sin esto el foco de teclado no
   se ve en ninguna de las dos filas de adjuntar. */
.mtk-upload:focus-within { background: var(--ax-fill); box-shadow: inset 0 0 0 2px var(--ax-tint); }
.mtk-upload__icon {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--ax-tint-soft); color: var(--ax-tint);
}
.mtk-upload__icon .mud-icon-root { font-size: 19px !important; }
.mtk-upload__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mtk-upload__title { font-size: 16px; font-weight: 600; color: var(--ax-label); }
.mtk-upload__sub { font-size: 13px; color: var(--ax-label-2); }
/* El input cubre la fila entera: el toque abre el selector nativo. */
.mtk-upload__input {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
    font-size: 16px; width: 100%; height: 100%;
}
.mtk-attached { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.mtk-attached + .mtk-field--inline { border-top: 1px solid var(--ax-separator); }
.mtk-attached__icon {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--ax-green-soft); color: var(--ax-green);
}
.mtk-attached__icon .mud-icon-root { font-size: 19px !important; }
.mtk-attached__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mtk-attached__name {
    font-size: 15px; font-weight: 600; color: var(--ax-label);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mtk-attached__size { font-size: 12.5px; color: var(--ax-label-2); font-variant-numeric: tabular-nums; }
.mtk-attached__remove {
    all: unset; box-sizing: border-box; cursor: pointer; flex-shrink: 0;
    width: 44px; height: 44px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ax-fill); color: var(--ax-label-2);
    -webkit-tap-highlight-color: transparent;
}
.mtk-attached__remove .mud-icon-root { font-size: 18px !important; }

/* ── Líneas del documento (insumos / productos) ── */
.mtk-line { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 13px 16px; }
.mtk-line + .mtk-line::before {
    content: ""; position: absolute; top: 0; left: 16px; right: 0;
    height: 1px; background: var(--ax-separator);
}
.mtk-line__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mtk-line__code {
    font-size: 15px; font-weight: 700; color: var(--ax-tint);
    font-family: 'SF Mono', 'JetBrains Mono', Consolas, monospace; letter-spacing: 0.01em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mtk-line__amount {
    font-size: 15px; font-weight: 700; color: var(--ax-label);
    font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.mtk-line__desc { font-size: 13.5px; line-height: 1.4; color: var(--ax-label-2); }
.mtk-line__qty { font-size: 13px; color: var(--ax-label-3); font-variant-numeric: tabular-nums; }

/* ── Observación / nota ── */
.mtk-note {
    background: var(--ax-surface); border-radius: var(--ax-r-card);
    padding: 14px 16px; box-shadow: var(--ax-shadow);
    font-size: 14.5px; line-height: 1.5; color: var(--ax-label); white-space: pre-wrap;
}

/* ── Proceso completado ── */
.mtk-done {
    display: flex; align-items: center; gap: 12px; margin-top: 14px;
    padding: 16px; border-radius: var(--ax-r-card); background: var(--ax-green-soft);
}
.mtk-done .mud-icon-root { font-size: 26px !important; color: var(--ax-green); flex-shrink: 0; }
.mtk-done__title { font-size: 15px; font-weight: 700; color: var(--ax-label); }
.mtk-done__sub { font-size: 13px; color: var(--ax-label-2); margin-top: 2px; }

/* ── Historial: el timeline del modal BPM reencajado en tarjeta ── */
.mtk-history {
    margin-top: 10px; background: var(--ax-surface);
    border-radius: var(--ax-r-card); box-shadow: var(--ax-shadow); overflow: hidden;
}
/* (0,3,0): html[data-touch-layout="1"] .bpm-body-content es (0,2,1) y ganaba. */
.mtk .mtk-history .bpm-body-content { padding: 8px 14px; }
.mtk-history .pohistory { max-height: none; }

/* Texto libre: una URL pegada o un SKU largo es un token indivisible que se sale
   de su tarjeta — y .mtk-note no está dentro de .mx-group, así que arrastraría
   la página en horizontal. */
.mtk-note, .mtk-line__desc, .mtk-choice__desc, .mtk-alert__sub, .mtk-done__sub {
    overflow-wrap: anywhere;
}

/* Los valores del resumen llevan nombres de proveedor: sin nowrap el
   text-overflow es inerte y el valor envuelve en 2-3 líneas contra una clave
   centrada. Se acota al módulo para no tocar las pantallas de Flota. */
.mtk .mx-kv__v { white-space: nowrap; }

/* ════════════════════════════════════════════════════════════════
   MODALES BPM EN TÁCTIL — hoja de acción a pantalla completa
   Los estilos base viven en <style> dentro de los .razor, que se
   inyectan en el <body> y por tanto ganan en empate de especificidad:
   estos selectores llevan el atributo de <html> SIN :where() para
   quedar estrictamente por encima.
   ════════════════════════════════════════════════════════════════ */
/* ── Chrome del modal: sin barra de título vacía y sin recortes ── */
html[data-touch-layout="1"] .mud-dialog:has(.bpm-shell) .mud-dialog-title {
    display: none !important;
}
html[data-touch-layout="1"] .mud-dialog:has(.bpm-shell) .mud-dialog-content {
    max-height: 100dvh !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Solo scrollea .bpm-body: header y pie quedan fijos como en una hoja nativa. */
html[data-touch-layout="1"] .bpm-shell {
    height: 100dvh; max-height: 100dvh;
}

/* ── Header azul ── */
html[data-touch-layout="1"] .bpm-header {
    /* 54px abajo = el solape de -40px de .bpm-nav-wrapper + aire */
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 54px;
}
html[data-touch-layout="1"] .bpm-header__row { gap: 10px; }
html[data-touch-layout="1"] .bpm-header__icon { width: 36px; height: 36px; border-radius: 11px; }
html[data-touch-layout="1"] .bpm-header__code { font-size: 1rem; }
/* Un estatus largo empujaba la X fuera de pantalla. */
html[data-touch-layout="1"] .bpm-header__status {
    max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: 4px 10px;
}
/* Las pills se desplazan en una línea: envueltas hacían crecer el header 3 filas. */
html[data-touch-layout="1"] .bpm-header__pills {
    flex-wrap: nowrap; gap: 6px; margin-top: 12px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
html[data-touch-layout="1"] .bpm-header__pills::-webkit-scrollbar { display: none; }
html[data-touch-layout="1"] .bpm-pill { flex-shrink: 0; }
html[data-touch-layout="1"] .bpm-header__stepper { margin-top: 14px; }

/* ── Pestañas ── centradas + padding 28px no caben en 390: se alinean e scrollean */
html[data-touch-layout="1"] .bpm-nav-wrapper { border-radius: 24px 24px 0 0; margin-top: -40px; }
html[data-touch-layout="1"] .bpm-nav {
    justify-content: flex-start; padding: 0 6px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
html[data-touch-layout="1"] .bpm-nav::-webkit-scrollbar { display: none; }
html[data-touch-layout="1"] .bpm-nav__btn {
    flex-shrink: 0; min-height: 48px; padding: 14px 14px;
    font-size: 0.64rem; letter-spacing: 0.08em; gap: 6px;
}

/* ── Cuerpo ── el min-height de 340px dejaba un hueco muerto bajo el form */
html[data-touch-layout="1"] .bpm-body-content { padding: 18px 16px 10px; min-height: 0; }
html[data-touch-layout="1"] .ct-form-body { padding: 16px 16px 4px; }
html[data-touch-layout="1"] .bpm-shell .mud-button-root { min-height: 44px; }

/* ── Pie ── la CTA manda: ocupa el ancho y el enlace secundario se encoge */
html[data-touch-layout="1"] .bpm-footer {
    gap: 10px; padding: 12px 14px max(12px, env(safe-area-inset-bottom));
}
html[data-touch-layout="1"] .bpm-footer > .d-flex { flex: 1 1 auto; min-width: 0; }
html[data-touch-layout="1"] .bpm-footer > .d-flex > .mud-button-root {
    width: 100%; padding: 12px 18px !important; border-radius: 16px !important;
}
html[data-touch-layout="1"] .bpm-footer > .mud-button-root:first-child { flex: 0 0 auto; }

/* ── Panel de acción ── */
html[data-touch-layout="1"] .bpm-decisions {
    grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px;
}
html[data-touch-layout="1"] .bpm-action { padding: 15px 16px; border-radius: var(--ax-r-row); }
html[data-touch-layout="1"] .bpm-action__title { font-size: 0.95rem; }
html[data-touch-layout="1"] .bpm-action__desc { font-size: 0.78rem; }
html[data-touch-layout="1"] .bpm-motivo { border-radius: var(--ax-r-row); padding: 12px 12px 14px; }

/* ── Tab Detalle ──
   La tabla de líneas (SKU · Descripción · Cant. · Precio · Subtotal) mide ~600px:
   en el teléfono se convierte en lista de tarjetas. Las etiquetas se inyectan por
   posición para no tocar el markup compartido por OC y Pedido. */
html[data-touch-layout="1"] .podetail-items { border-radius: var(--ax-r-card); }
html[data-touch-layout="1"] .podetail-table--lines thead { display: none; }
html[data-touch-layout="1"] .podetail-table--lines,
html[data-touch-layout="1"] .podetail-table--lines tbody { display: block; width: 100%; }
html[data-touch-layout="1"] .podetail-table--lines tbody tr {
    display: block; padding: 12px 14px; border-bottom: 1px solid #F1F3F7;
    background: #fff !important;
}
html[data-touch-layout="1"] .podetail-table--lines tbody tr:last-child { border-bottom: none; }
html[data-touch-layout="1"] .podetail-table--lines td {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    padding: 2px 0; text-align: right !important; border: none;
}
html[data-touch-layout="1"] .podetail-table--lines td::before {
    font-size: 0.66rem; font-weight: 700; color: #94A3B8;
    text-transform: uppercase; letter-spacing: 0.06em;
    flex-shrink: 0; text-align: left;
}
/* El modificador --lines solo lo llevan OC y Pedido, que comparten exactamente
   estas 5 columnas; la tabla de Tarifa tiene 7 distintas y por eso NO se
   convierte en tarjetas (se desplaza, ver la regla de abajo). */
html[data-touch-layout="1"] .podetail-table--lines td:nth-child(1)::before { content: "SKU"; }
html[data-touch-layout="1"] .podetail-table--lines td:nth-child(2)::before { content: "Descripción"; }
html[data-touch-layout="1"] .podetail-table--lines td:nth-child(3)::before { content: "Cantidad"; }
html[data-touch-layout="1"] .podetail-table--lines td:nth-child(4)::before { content: "Precio"; }
html[data-touch-layout="1"] .podetail-table--lines td:nth-child(5)::before { content: "Subtotal"; }
/* SKU manda visualmente en la tarjeta; la descripción se envuelve. */
html[data-touch-layout="1"] .podetail-table--lines td.podetail-table__sku { font-size: 0.9rem; }
html[data-touch-layout="1"] .podetail-table--lines td.podetail-table__desc { white-space: normal; }
/* Cualquier otra tabla de detalle (Tarifa, afiliaciones CT) se desplaza en su caja
   en vez de desbordar el diálogo. */
html[data-touch-layout="1"] .bpm-body-content table:not(.podetail-table--lines) {
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
}

