/* Tirica — interfaz del sistema de facturación.
   Tokens y reglas del Manual de marca y uso de Tirica: oscuro primero (tema Noche), tema Papel opcional,
   un solo acento (tierra), Geist / Geist Mono, radios 10/14, bordes de 1 px en lugar de sombras.
   Se elige el tema con data-theme="light" en <html> (assets/js/tema.js). Sin atributo = Noche. */

@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-var-latin.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/assets/fonts/geist-mono-regular.woff") format("woff"); font-weight: 100 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/assets/fonts/geist-mono-bold.woff") format("woff"); font-weight: 600 900; font-style: normal; font-display: swap; }
/* Geist (texto): cuando se agregue assets/fonts/geist-var-latin.woff2, descomentar y listo.
@font-face { font-family: "Geist"; src: url("/assets/fonts/geist-var-latin.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
*/

:root {
  /* Marca */
  --tierra: #e5582f; --ambar: #ffb547; --noche: #0a0c10; --papel: #f6f6f4; --acero: #c9cdd5;
  /* Tema Noche (principal) */
  --texto: #f6f6f4; --texto-suave: #9ba1b0; --on-accion: #0a0c10;
  --fondo: #0a0c10; --fondo-elevado: #12151c; --fondo-hundido: #06070a;
  --borde: #232833; --borde-fuerte: #5c6474;
  --accion: #e5582f; --accion-hover: #f0704b; --enlace: #f59e7b; --foco: #ffb547;
  --exito: #4ade80; --exito-fondo: #0f2a1b;
  --alerta: #ffb547; --alerta-fondo: #2e2410;
  --peligro: #ff7a93; --peligro-fondo: #2e1219;
  --info: #7cc4ff; --info-fondo: #0f2236;
  --sombra-1: 0 1px 0 rgba(255, 255, 255, .04);
  --sombra-2: 0 16px 48px rgba(0, 0, 0, .6);
  /* Derivados de interfaz */
  --hover: rgba(246, 246, 244, .05); --hover-fuerte: rgba(246, 246, 244, .09);
  --acento-suave: rgba(229, 88, 47, .14); --acento-borde: rgba(229, 88, 47, .45);
  --velo: rgba(3, 4, 6, .68); --grilla: rgba(246, 246, 244, .055);
  --neutro-fondo: #181c25; --neutro-texto: #b9bfcc;
  --chev-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ba1b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  /* Forma, espacio y movimiento */
  --radio-sm: 6px; --radio-md: 10px; --radio-lg: 14px; --radio-xl: 20px; --radio-pill: 999px;
  --espacio-1: 4px; --espacio-2: 8px; --espacio-3: 12px; --espacio-4: 16px; --espacio-5: 24px; --espacio-6: 32px; --espacio-7: 48px;
  --dur-rapida: 120ms; --dur-base: 200ms; --curva-acecho: cubic-bezier(.2, 0, 0, 1); --curva-aterrizaje: cubic-bezier(.16, 1, .3, 1);
  /* Tipografía */
  --font-sans: Geist, Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: var(--font-sans); --mono: var(--font-mono);
  /* Ancho de la barra lateral */
  --side-w: 264px;
  /* Nombres de la versión anterior (algunos estilos en línea de la app todavía los leen) */
  --line: var(--borde); --tinta: var(--texto); --niebla: var(--fondo); --linea: var(--borde);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --texto: #0a0c10; --texto-suave: #5b6170; --on-accion: #ffffff;
  --fondo: #f6f6f4; --fondo-elevado: #ffffff; --fondo-hundido: #ecedef;
  --borde: #e2e4e9; --borde-fuerte: #7c8292;
  --accion: #c2401c; --accion-hover: #a63414; --enlace: #b23a17; --foco: #0a0c10;
  --exito: #157a42; --exito-fondo: #e3f4ea;
  --alerta: #8a5a00; --alerta-fondo: #fbefd5;
  --peligro: #b4123e; --peligro-fondo: #f9e1e6;
  --info: #1d5fb8; --info-fondo: #e2ecf8;
  --sombra-1: 0 1px 2px rgba(10, 12, 16, .06);
  --sombra-2: 0 16px 40px rgba(10, 12, 16, .12);
  --hover: rgba(10, 12, 16, .04); --hover-fuerte: rgba(10, 12, 16, .07);
  --acento-suave: rgba(194, 64, 28, .09); --acento-borde: rgba(194, 64, 28, .40);
  --velo: rgba(10, 12, 16, .46); --grilla: rgba(10, 12, 16, .075);
  --neutro-fondo: #eceef2; --neutro-texto: #4a5060;
  --chev-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6170' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  color-scheme: light;
}

/* Impresión: siempre en Papel, sin importar el tema elegido */
@media print {
  :root, :root[data-theme="dark"] {
    --texto: #0a0c10; --texto-suave: #5b6170; --on-accion: #ffffff;
    --fondo: #ffffff; --fondo-elevado: #ffffff; --fondo-hundido: #f6f6f4;
    --borde: #d9dce3; --borde-fuerte: #7c8292; --accion: #c2401c; --enlace: #b23a17;
    --exito: #157a42; --exito-fondo: #e3f4ea; --alerta: #8a5a00; --alerta-fondo: #fbefd5;
    --peligro: #b4123e; --peligro-fondo: #f9e1e6; --info: #1d5fb8; --info-fondo: #e2ecf8;
    --neutro-fondo: #eceef2; --neutro-texto: #4a5060; color-scheme: light;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/24px var(--font-sans); color: var(--texto); background: var(--fondo); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; overflow-wrap: break-word; }
a { color: var(--enlace); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 600; letter-spacing: -.02em; line-height: 1.25; margin: 0 0 .6em; color: var(--texto); }
h2 { font-size: 17px; line-height: 24px; letter-spacing: -.015em; }
h3 { font-size: 15px; line-height: 22px; margin-top: 1.1em; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
img, svg { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--borde); margin: 20px 0; }
code, kbd, samp { font-family: var(--font-mono); font-size: .88em; background: var(--neutro-fondo); color: var(--texto); padding: 2px 7px; border-radius: var(--radio-sm); overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--acento-suave); color: var(--texto); }
b, strong { font-weight: 600; }
.icon { width: 18px; height: 18px; vertical-align: -4px; flex: none; stroke-width: 1.5; }
.muted { color: var(--texto-suave); }
.small { font-size: 13px; line-height: 20px; }
.mono { font-family: var(--font-mono); font-size: .92em; font-variant-numeric: tabular-nums; }
.big { font-size: 1.3rem; }
.nowrap { white-space: nowrap; }
.yes { color: var(--exito); font-weight: 600; }
.no, .text-danger { color: var(--peligro); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.spacer { height: 12px; }
.only-light { display: none !important; }
:root[data-theme="light"] .only-dark { display: none !important; }
:root[data-theme="light"] .only-light { display: block !important; }
@media print { .only-dark { display: none !important; } .only-light { display: initial !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }

/* ---------- Estructura ---------- */
.panel { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }

/* Barra lateral: marca arriba, navegación con scroll propio, firma A53 fija abajo a la izquierda */
.side { background: var(--fondo-hundido); border-right: 1px solid var(--borde); position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 22px 12px 0; overflow: hidden; }
.side__brand { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 2px 10px 20px; text-decoration: none; color: var(--texto); flex: none; }
.side__brand img { display: block; width: 138px; height: auto; max-width: 100%; }
.side__brand span { font: 500 11px/16px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--texto-suave); }
.side__co { display: block; max-width: 100%; color: var(--texto); font: 600 14px/20px var(--font-sans); letter-spacing: -.005em; overflow-wrap: anywhere; }
.side__nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 0 14px; margin: 0 -4px; padding-inline: 4px; scrollbar-width: thin; scrollbar-color: var(--borde-fuerte) transparent; }
.side__nav::-webkit-scrollbar { width: 6px; } .side__nav::-webkit-scrollbar-thumb { background: var(--borde); border-radius: 6px; }
.side__nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 8px 12px; color: var(--texto-suave); text-decoration: none; border-radius: var(--radio-md); font: 500 14px/20px var(--font-sans); transition: background var(--dur-rapida) var(--curva-acecho), color var(--dur-rapida) var(--curva-acecho); }
.side__nav a:hover { background: var(--hover); color: var(--texto); }
.side__nav a[aria-current] { background: var(--hover-fuerte); color: var(--texto); }
.side__nav a[aria-current]::before { content: ""; position: absolute; left: -4px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--tierra); }
.side__nav a .icon { opacity: .9; }
.side__nav a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__sec { margin: 22px 12px 6px; font: 500 11px/16px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--texto-suave); opacity: .8; }
.side__nav > .side__sec:first-child { margin-top: 4px; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: var(--radio-pill); background: var(--accion); color: var(--on-accion); font: 600 11px/1 var(--font-mono); }

/* Firma de A53: abajo a la izquierda, chica */
.side__foot { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 10px 16px; margin: 0 -12px; padding-inline: 22px; border-top: 1px solid var(--borde); background: var(--fondo-hundido); }
.side__foot small { font: 500 10px/14px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--texto-suave); opacity: .85; }
.side__foot img { display: block; width: 104px; height: auto; opacity: .92; }
.side__foot a { display: inline-block; line-height: 0; }
.side__foot a:hover img { opacity: 1; }

/* Barra superior */
.top { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 32px; background: var(--fondo); border-bottom: 1px solid var(--borde); position: sticky; top: 0; z-index: 5; }
.top__title { flex: 1 1 auto; min-width: 0; margin: 0; font: 600 20px/28px var(--font-sans); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top__right { display: flex; align-items: center; gap: 8px; flex: none; }
.top__right form { margin: 0; display: inline-flex; }
.top__user { display: inline-flex; align-items: center; gap: 8px; max-width: 240px; height: 36px; padding: 0 12px; color: var(--texto); text-decoration: none; font: 500 14px/20px var(--font-sans); border-radius: var(--radio-md); }
.top__user:hover { background: var(--hover); }
.top__user > *:not(.icon) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top__menu { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; background: transparent; color: var(--texto); border: 1px solid var(--borde-fuerte); border-radius: var(--radio-md); cursor: pointer; }
.tema { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; background: transparent; color: var(--texto-suave); border: 1px solid transparent; border-radius: var(--radio-md); cursor: pointer; }
.tema:hover { background: var(--hover); color: var(--texto); }
.tema .icon { width: 18px; height: 18px; }
.tema__sol { display: none; } .tema__luna { display: inline-block; }
:root[data-theme="light"] .tema__sol { display: inline-block; } :root[data-theme="light"] .tema__luna { display: none; }

.content { flex: 1 1 auto; width: 100%; max-width: 1520px; margin: 0 auto; padding: 28px 32px 56px; min-width: 0; }
.content > .small:last-child { margin: 32px 0 0; font: 400 12px/16px var(--font-mono); color: var(--texto-suave); opacity: .7; }

/* ---------- Pantallas de acceso (login, alta, recuperar) ---------- */
body.auth { position: relative; display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 40px 16px 104px; margin: 0; background-color: var(--fondo);
  background-image: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(229, 88, 47, .12), transparent 70%), radial-gradient(circle, var(--grilla) 1px, transparent 1.4px);
  background-size: 100% 100%, 24px 24px; background-attachment: scroll; }
:root[data-theme="light"] body.auth { background-image: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(194, 64, 28, .08), transparent 70%), radial-gradient(circle, var(--grilla) 1px, transparent 1.4px); }
.auth__box { position: relative; width: min(440px, 100%); background: var(--fondo-elevado); border: 1px solid var(--borde); border-radius: var(--radio-xl); padding: 36px 36px 32px; box-shadow: var(--sombra-2); }
.auth__box--wide { width: min(1000px, 100%); }
.auth__logo { display: block; width: 168px; height: auto; margin: 0 0 8px; }
.auth__tag { margin: 0 0 24px; font: 500 12px/16px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--texto-suave); }
.auth h1 { font-size: 24px; line-height: 30px; letter-spacing: -.025em; margin: 0 0 8px; }
.auth__box > p { color: var(--texto-suave); }
.auth__foot { position: absolute; left: 24px; bottom: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.auth__foot small { font: 500 10px/14px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--texto-suave); opacity: .85; }
.auth__foot img { display: block; width: 104px; height: auto; opacity: .92; }
.auth__foot a { line-height: 0; }
.auth__theme { position: absolute; right: 16px; top: 16px; }
@media (max-width: 560px) {
  body.auth { padding: 20px 12px 24px; place-items: start center; }
  .auth__box { padding: 28px 22px 26px; border-radius: var(--radio-lg); margin-top: 4vh; }
  .auth__foot { position: static; margin: 28px 0 0; align-self: start; }
}

/* ---------- Responsive de la estructura ---------- */
@media (max-width: 900px) {
  .panel { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(292px, 86vw); z-index: 20; transform: translateX(-102%); transition: transform var(--dur-base) var(--curva-acecho); box-shadow: none; }
  .side.is-open { transform: none; box-shadow: var(--sombra-2), 0 0 0 100vmax var(--velo); }
  .top__menu { display: inline-flex; }
  .top__user { display: none; }
  .top { padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .top__title { font-size: 18px; }
  .content { padding: 20px 16px 40px; }
}
@media (max-width: 640px) { .top__lbl { display: none; } }

/* ---------- App instalable (PWA): barra inferior en celular y banner de instalación ---------- */
.tabbar, .a53-pwa-banner { display: none; }
@media (max-width: 900px) {
  .panel { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--fondo-elevado); border-top: 1px solid var(--borde); }
  .tabbar__item { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 6px 2px; border: 0; background: transparent; border-radius: var(--radio-md); color: var(--texto-suave); font: 500 11px/14px var(--font-sans); text-decoration: none; cursor: pointer; }
  .tabbar__item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar__item svg { width: 22px; height: 22px; }
  .tabbar__item[aria-current] { color: var(--texto); background: var(--acento-suave); }
  .tabbar__item[aria-current] svg { color: var(--tierra); }
  .tabbar__item:focus-visible { outline-offset: -3px; }
  .a53-pwa-banner { display: flex; align-items: center; gap: 12px; position: fixed; z-index: 16; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 12px 14px; border-radius: var(--radio-lg); background: var(--fondo-elevado); border: 1px solid var(--borde-fuerte); box-shadow: var(--sombra-2); }
  .a53-pwa-banner__ico { width: 44px; height: 44px; border-radius: 12px; flex: none; }
  .a53-pwa-banner__txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.3; }
  .a53-pwa-banner__txt strong { color: var(--texto); font-size: 15px; }
  .a53-pwa-banner__txt span { color: var(--texto-suave); font-size: 13px; }
  .a53-pwa-banner__btn { flex: none; border: 0; border-radius: var(--radio-pill); padding: 10px 18px; font: 600 14px/1 var(--font-sans); background: var(--accion); color: var(--on-accion); cursor: pointer; }
  .a53-pwa-banner__x { flex: none; border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--texto-suave); padding: 0 6px; cursor: pointer; }
}
body.auth .a53-pwa-banner { bottom: calc(14px + env(safe-area-inset-bottom)); }
html.is-standalone .a53-pwa-banner { display: none !important; }

/* ---------- Tarjetas y grillas ---------- */
.card { background: var(--fondo-elevado); border: 1px solid var(--borde); border-radius: var(--radio-lg); padding: 22px 24px; margin-bottom: 20px; box-shadow: var(--sombra-1); min-width: 0; }
.card > :last-child { margin-bottom: 0; }
.card h2 { margin-bottom: 14px; }
.card--flush { padding: 0; overflow: hidden; }
.card--flush > h2, .card .pad, .card--flush h2 { padding: 20px 24px 0; margin-bottom: 12px; }
.card--flush > .table-wrap, .card--flush > .table { margin: 0; }
.card--warn { border-left: 3px solid var(--alerta); }
.card--ok { border-left: 3px solid var(--exito); }
.card--hl { border-color: var(--acento-borde); }
.card--off { opacity: .72; }
.card--inner { background: var(--fondo); box-shadow: none; }
.narrow { max-width: 680px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; align-items: start; }
.cols > .card { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.grid-lead { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1280px) { .grid-lead { grid-template-columns: minmax(0, 1fr); } }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar > p { margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .input { width: auto; min-width: 160px; }
.filters input[type=search] { min-width: 280px; max-width: 100%; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stack .card + .card { margin-top: 0; }

/* ---------- Indicadores ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 232px), 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { container-type: inline-size; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 18px 20px; background: var(--fondo-elevado); border: 1px solid var(--borde); border-radius: var(--radio-lg); color: var(--texto); text-decoration: none; box-shadow: var(--sombra-1); transition: border-color var(--dur-rapida) var(--curva-acecho), background var(--dur-rapida) var(--curva-acecho); }
a.kpi:hover { border-color: var(--borde-fuerte); background: var(--hover); }
.kpi span { font: 500 11px/16px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--texto-suave); overflow-wrap: anywhere; }
.kpi strong { display: block; font: 500 clamp(17px, 9.4cqw, 28px)/34px var(--font-mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--texto); white-space: nowrap; overflow: hidden; text-overflow: clip; }
.kpi small { font-size: 13px; line-height: 20px; color: var(--texto-suave); }
.kpi small b { font-weight: 600; }
.kpi--warn strong { color: var(--peligro); }
.kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpis--3 .kpi strong { font-size: 22px; line-height: 30px; }
.kpi-env { margin: 0; } .kpi-env--produccion { border-top: 3px solid var(--exito); } .kpi-env--pruebas { border-top: 3px solid var(--alerta); } .kpi-env .dl { margin: 0 0 .4rem; }
.mt { margin-bottom: 20px; border-left: 3px solid var(--exito); }
.mt--atento { border-left-color: var(--alerta); } .mt--critico { border-left-color: var(--tierra); } .mt--superado { border-left-color: var(--peligro); } .mt--sin { border-left-color: var(--borde-fuerte); }
.mt__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.mt__top strong { font: 500 28px/34px var(--font-mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mt__top span { color: var(--texto-suave); }
.mt__pct { margin-left: auto; font: 500 18px/24px var(--font-mono); }
.mt__bar { height: 10px; background: var(--neutro-fondo); border-radius: var(--radio-pill); overflow: hidden; margin: 12px 0; }
.mt__bar i { display: block; height: 100%; width: 0; background: var(--exito); border-radius: var(--radio-pill); }
.mt--atento .mt__bar i { background: var(--alerta); } .mt--critico .mt__bar i { background: var(--tierra); } .mt--superado .mt__bar i { background: var(--peligro); }
.mt__msg { margin: 4px 0 10px; }

/* Barras de avance */
progress { accent-color: var(--accion); }
progress.bar, .bar { display: block; width: 100%; height: 8px; appearance: none; -webkit-appearance: none; border: 0; border-radius: var(--radio-pill); background: var(--neutro-fondo); overflow: hidden; }
progress.bar::-webkit-progress-bar, .bar::-webkit-progress-bar { background: var(--neutro-fondo); border-radius: var(--radio-pill); }
progress.bar::-webkit-progress-value, .bar::-webkit-progress-value { background: var(--accion); border-radius: var(--radio-pill); }
progress.bar::-moz-progress-bar, .bar::-moz-progress-bar { background: var(--accion); border-radius: var(--radio-pill); }
progress.bar--near::-webkit-progress-value { background: var(--alerta); } progress.bar--near::-moz-progress-bar { background: var(--alerta); }
progress.bar--over::-webkit-progress-value { background: var(--peligro); } progress.bar--over::-moz-progress-bar { background: var(--peligro); }
progress.meter { width: 120px; height: 8px; appearance: none; -webkit-appearance: none; border: 0; background: var(--neutro-fondo); border-radius: var(--radio-pill); vertical-align: middle; overflow: hidden; }
progress.meter::-webkit-progress-bar { background: var(--neutro-fondo); border-radius: var(--radio-pill); } progress.meter::-webkit-progress-value { background: var(--accion); border-radius: var(--radio-pill); } progress.meter::-moz-progress-bar { background: var(--accion); }

.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 10px 0; border-bottom: 1px solid var(--borde); } .plain li:last-child { border-bottom: 0; }
.plain li.late { color: var(--peligro); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 6px 0; color: var(--texto-suave); display: flex; gap: 8px; align-items: flex-start; }
.checklist li.ok { color: var(--texto); }
.checklist li .icon { color: var(--peligro); margin-top: 3px; } .checklist li.ok .icon { color: var(--exito); }

/* ---------- Tablas ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 4px; border-radius: var(--radio-md); }
.card--flush { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 20px; }
.table th, .table td { padding: 12px 16px; border-bottom: 1px solid var(--borde); text-align: left; vertical-align: middle; overflow-wrap: break-word; }
.table th:first-child, .table td:first-child { padding-left: 20px; } .table th:last-child, .table td:last-child { padding-right: 20px; }
.card:not(.card--flush) .table th:first-child, .card:not(.card--flush) .table td:first-child { padding-left: 12px; }
.card:not(.card--flush) .table th:last-child, .card:not(.card--flush) .table td:last-child { padding-right: 12px; }
.table thead th { font: 500 11px/16px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--texto-suave); background: var(--fondo-hundido); border-bottom: 1px solid var(--borde); white-space: nowrap; vertical-align: bottom; }
.card:not(.card--flush) .table thead th { background: transparent; }
.table tbody th { font-weight: 500; text-align: left; color: var(--texto); }
.table tbody tr { transition: background var(--dur-rapida) var(--curva-acecho); }
.table tbody tr:hover { background: var(--hover); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table a { font-weight: 500; }
.table td:first-child > a:first-child { white-space: nowrap; }
.table .badge, .table .btn { vertical-align: middle; }
@media (max-width: 560px) { .table th, .table td { padding: 10px 12px; } .table th:first-child, .table td:first-child { padding-left: 14px; } .table th:last-child, .table td:last-child { padding-right: 14px; } .cols .table td:first-child > a:first-child { white-space: normal; } .card--flush > h2, .card--flush .pad { padding: 16px 16px 0; } }
.table td .small, .table td small { display: inline; }
.table td.small, .table th.small { font-size: 13px; }
.table td.mono, .table td.num { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .num { font-family: var(--font-mono); font-size: 13px; }
.table--compact th, .table--compact td { padding-top: 8px; padding-bottom: 8px; font-size: 13px; }
.table--compact tbody th { font-weight: 500; text-align: left; }
.table tfoot td, .table tfoot th { font-weight: 600; border-top: 1px solid var(--borde-fuerte); border-bottom: 0; }
td.neg, .neg strong { color: var(--peligro); }
.dl { display: grid; grid-template-columns: minmax(96px, 140px) minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; line-height: 20px; }
.dl dt { color: var(--texto-suave); } .dl dd { margin: 0; overflow-wrap: anywhere; }
.pre { white-space: normal; }
.totals { margin-left: auto; width: min(360px, 100%); border-collapse: collapse; }
.totals td { padding: 6px 0; font-variant-numeric: tabular-nums; } .totals td:last-child { text-align: right; font-family: var(--font-mono); }
.totals tr:last-child td { font-weight: 600; border-top: 1px solid var(--borde-fuerte); padding-top: 10px; }
.proy__res th, .proy__res td { border-top: 2px solid var(--borde-fuerte); }

/* ---------- Insignias de estado (palabra + punto + color; nunca color solo) ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 10px; min-height: 22px; border-radius: var(--radio-pill); border: 1px solid var(--borde); background: var(--neutro-fondo); color: var(--neutro-texto); font: 500 12px/18px var(--font-sans); white-space: nowrap; vertical-align: middle; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; opacity: .9; }
.badge--abierto, .badge--prospecto, .badge--unknown, .badge--borrador, .badge--l-nueva, .badge--anulada, .badge--anulado, .badge--rep-aprobado, .badge--rep-reparando, .badge--met-aprobada, .badge--met-corte, .badge--met-pintura, .badge--env-interno, .badge--env-externo, .badge--env-borrador { background: var(--info-fondo); border-color: color-mix(in srgb, var(--info) 35%, transparent); color: var(--info); }
.badge--en_curso, .badge--en_espera, .badge--esperando_cliente, .badge--pausado, .badge--emitida, .badge--p-alta, .badge--l-contactada, .badge--l-calificada, .badge--env-pruebas, .badge--rep-presupuestado, .badge--rep-canje-tasado, .badge--met-enviada, .badge--met-control, .badge--met-plegado, .badge--met-soldadura, .badge--pendiente { background: var(--alerta-fondo); border-color: color-mix(in srgb, var(--alerta) 38%, transparent); color: var(--alerta); }
.badge--resuelto, .badge--activo, .badge--up, .badge--pagada, .badge--finalizado, .badge--ok, .badge--l-convertida, .badge--env-produccion, .badge--rep-listo, .badge--rep-entregado, .badge--rep-canje-aceptado, .badge--rep-chk-ok, .badge--met-facturada, .badge--met-finalizado, .badge--cobrada { background: var(--exito-fondo); border-color: color-mix(in srgb, var(--exito) 35%, transparent); color: var(--exito); }
.badge--down, .badge--vencida, .badge--error, .badge--rep-chk-falla, .badge--met-rechazada, .badge--met-rechazado, .badge--p-critica { background: var(--peligro-fondo); border-color: color-mix(in srgb, var(--peligro) 38%, transparent); color: var(--peligro); }
.badge--cerrado, .badge--baja, .badge--l-descartada, .badge--rep-ingresado, .badge--rep-sin_reparacion, .badge--rep-cancelado, .badge--rep-canje-rechazado, .badge--rep-chk-no_probado, .badge--met-borrador, .badge--met-pendiente { background: var(--neutro-fondo); border-color: var(--borde); color: var(--neutro-texto); }
.badge--p-baja { opacity: .8; }
.sla--vencido { color: var(--peligro); font-weight: 600; } .sla--cumplido { color: var(--exito); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--borde-fuerte); margin-right: 6px; vertical-align: -1px; flex: none; }
.dot--up, .dot--ok { background: var(--exito); } .dot--down { background: var(--peligro); } .dot--unknown { background: var(--texto-suave); }
.dot--nap { background: #7048e8; border-radius: 2px; } .dot--cab { background: #4c7bf0; height: 4px; border-radius: 2px; width: 16px; vertical-align: 2px; }
.dot--spl { background: #e5484d; border-radius: 2px; transform: rotate(45deg); } .dot--pt { background: #868e96; } .dot--tech { background: var(--texto); }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form--inline { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.form--inline .input { width: auto; flex: 1 1 160px; min-width: 0; }
form.inline { display: inline; margin: 0; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .row2 { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font: 500 14px/20px var(--font-sans); color: var(--texto); }
.field > span:first-child { overflow-wrap: anywhere; }
.field small { font-weight: 400; font-size: 12px; line-height: 16px; color: var(--texto-suave); }
.field--check, .field--inline { flex-direction: row; align-items: center; gap: 10px; }
.input { display: block; width: 100%; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--borde-fuerte); border-radius: var(--radio-md); font: 400 15px/24px var(--font-sans); background-color: var(--fondo); color: var(--texto); transition: border-color var(--dur-rapida) var(--curva-acecho), background var(--dur-rapida) var(--curva-acecho); }
.input::placeholder { color: var(--texto-suave); opacity: .75; }
.input:hover { border-color: var(--texto-suave); }
.input:focus, .input:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; border-color: var(--texto-suave); }
.input:disabled, .input[readonly] { background-color: var(--fondo-hundido); color: var(--texto-suave); }
.input[readonly]:focus { outline-offset: 0; }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: var(--chev-img); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; text-overflow: ellipsis; }
select.input[multiple], select.input[size] { height: auto; padding-right: 12px; background-image: none; }
.input--mono { font-family: var(--font-mono); font-size: 14px; }
input.mono.input, textarea.mono.input { font-family: var(--font-mono); font-size: 14px; }
.input--sm { height: 32px; padding: 0 10px; font-size: 14px; width: auto; border-radius: var(--radio-md); }
.input--code { font: 500 24px/32px var(--font-mono); letter-spacing: .24em; text-align: center; height: 52px; }
.input--num, .input--qty { max-width: 8rem; }
.input--num { max-width: 200px; }
.input--r { text-align: right; font-variant-numeric: tabular-nums; }
input[type=file].input { height: auto; padding: 8px 12px; line-height: 24px; }
input[type=file].input::file-selector-button { margin-right: 12px; height: 28px; padding: 0 12px; border: 1px solid var(--borde-fuerte); border-radius: var(--radio-sm); background: var(--fondo-elevado); color: var(--texto); font: 500 13px/1 var(--font-sans); cursor: pointer; }
input[type=color].input { padding: 4px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accion); }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; line-height: 20px; }
.check input { width: 16px; height: 16px; accent-color: var(--accion); flex: none; margin: 0; }
.opts { display: grid; gap: 10px; }
.opt, .rav-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--borde); border-radius: var(--radio-md); cursor: pointer; font-size: 14px; background: var(--fondo); transition: border-color var(--dur-rapida) var(--curva-acecho); }
.opt:hover, .rav-opt:hover { border-color: var(--borde-fuerte); }
.opt input, .rav-opt input { width: 16px; height: 16px; margin: 3px 0 0; flex: none; accent-color: var(--accion); }
.opt > span, .rav-opt > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt small { color: var(--texto-suave); font-size: 13px; line-height: 18px; }
.opt:has(input:checked), .rav-opt:has(input:checked) { border-color: var(--acento-borde); background: var(--acento-suave); }
[data-conn-only][hidden] { display: none !important; }
.multi { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 8px 16px; font-weight: 400; }
.thumb { max-width: 240px; max-height: 140px; object-fit: contain; border: 1px solid var(--borde); border-radius: var(--radio-md); background: repeating-conic-gradient(var(--neutro-fondo) 0 25%, var(--fondo-elevado) 0 50%) 0 0 / 14px 14px; }
.thumb-sm { max-height: 34px; max-width: 96px; object-fit: contain; vertical-align: middle; }
.filecur { display: block; margin: 2px 0 6px; }
.editor { max-width: 960px; }
.editor--wide { max-width: 1200px; }
.editor__bar { position: sticky; bottom: 0; z-index: 3; margin-top: 8px; padding: 14px 0 4px; background: linear-gradient(to bottom, transparent, var(--fondo) 28%); border-top: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.counter { font-size: 12px; color: var(--texto-suave); font-weight: 400; } .counter.over { color: var(--peligro); font-weight: 600; }
.fgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.fgrid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fgrid__wide { grid-column: span 2; }
@media (max-width: 1180px) { .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fgrid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .fgrid, .fgrid--2, .fgrid--3, .kpis--3 { grid-template-columns: minmax(0, 1fr); } .fgrid__wide { grid-column: auto; } }
.fset { border: 1px solid var(--borde); border-radius: var(--radio-lg); padding: 14px 18px 12px; margin: 0; min-width: 0; }
.fset legend { padding: 0 8px; font: 500 13px/20px var(--font-sans); color: var(--texto-suave); }
.feat-group { border: 1px solid var(--borde); border-radius: var(--radio-lg); padding: 12px 16px 8px; margin: 0 0 12px; min-width: 0; }
.feat-group legend { font-weight: 600; padding: 0 8px; color: var(--texto); }
.feat-group .field--check { margin: 4px 0; }
details.feat-group > summary { cursor: pointer; font-weight: 600; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; list-style: none; }
details.feat-group > summary::-webkit-details-marker { display: none; }
details.feat-group[open] > summary { margin-bottom: 6px; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: var(--radio-md); border: 1px solid transparent; font: 600 14px/20px var(--font-sans); letter-spacing: -.005em; cursor: pointer; text-decoration: none; white-space: nowrap; max-width: 100%; transition: background var(--dur-rapida) var(--curva-acecho), border-color var(--dur-rapida) var(--curva-acecho), color var(--dur-rapida) var(--curva-acecho), transform var(--dur-rapida) var(--curva-acecho); -webkit-tap-highlight-color: transparent; }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; vertical-align: 0; }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: 13px; line-height: 18px; gap: 6px; }
.btn--block { width: 100%; }
.btn--dark { background: var(--accion); color: var(--on-accion); border-color: var(--accion); }
.btn--dark:hover { background: var(--accion-hover); border-color: var(--accion-hover); color: var(--on-accion); text-decoration: none; }
.btn--ghost { background: transparent; border-color: var(--borde-fuerte); color: var(--texto); }
.btn--ghost:hover { background: var(--hover); border-color: var(--texto-suave); text-decoration: none; }
.btn--danger { background: transparent; border-color: color-mix(in srgb, var(--peligro) 55%, transparent); color: var(--peligro); }
.btn--danger:hover { background: var(--peligro-fondo); border-color: var(--peligro); text-decoration: none; }
.btn--wa { background: var(--exito-fondo); border-color: color-mix(in srgb, var(--exito) 45%, transparent); color: var(--exito); }
.btn--wa:hover { border-color: var(--exito); text-decoration: none; }
.btn--pay { background: var(--info-fondo); border-color: color-mix(in srgb, var(--info) 45%, transparent); color: var(--info); }
.btn--on { background: var(--peligro) !important; color: var(--noche) !important; border-color: var(--peligro) !important; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.check-btn { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--texto-suave); border-radius: var(--radio-sm); } .check-btn:hover { color: var(--texto); } .check-btn.is-done { color: var(--exito); }

/* ---------- Avisos ---------- */
.alert { display: block; padding: 12px 16px; border-radius: var(--radio-md); border: 1px solid; margin: 0 0 16px; font-size: 14px; line-height: 20px; color: var(--texto); }
.alert > :last-child { margin-bottom: 0; }
.alert ul { margin: 0; padding-left: 20px; }
.alert a { color: inherit; font-weight: 600; }
.alert--danger { background: var(--peligro-fondo); border-color: color-mix(in srgb, var(--peligro) 45%, transparent); }
.alert--success { background: var(--exito-fondo); border-color: color-mix(in srgb, var(--exito) 40%, transparent); }
.alert--info { background: var(--info-fondo); border-color: color-mix(in srgb, var(--info) 40%, transparent); }
.alert--warn, .alert--warning { background: var(--alerta-fondo); border-color: color-mix(in srgb, var(--alerta) 42%, transparent); }

/* ---------- Chips y pestañas ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border: 1px solid var(--borde-fuerte); border-radius: var(--radio-pill); text-decoration: none; color: var(--texto); font: 500 13px/18px var(--font-sans); background: transparent; }
.chip:hover { background: var(--hover); text-decoration: none; }
.chip.is-on { background: var(--texto); color: var(--fondo); border-color: var(--texto); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 8px; }
button.chip { cursor: pointer; }
.tabs { display: flex; gap: 4px 4px; flex-wrap: wrap; border-bottom: 1px solid var(--borde); margin: 0 0 20px; }
.tabs a { position: relative; padding: 10px 14px; text-decoration: none; color: var(--texto-suave); font: 500 14px/20px var(--font-sans); border-radius: var(--radio-md) var(--radio-md) 0 0; }
.tabs a:hover { color: var(--texto); background: var(--hover); }
.tabs a[aria-current] { color: var(--texto); }
.tabs a[aria-current]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--tierra); border-radius: 2px; }
.codes { columns: 2; list-style: none; padding: 0; font: 500 15px/28px var(--font-mono); }
.qr img, .qrbox img { image-rendering: pixelated; }
.qr img { width: 200px; height: 200px; border: 1px solid var(--borde); padding: 8px; background: #fff; border-radius: var(--radio-md); }
.qrbox { margin: 8px 0 12px; display: inline-block; padding: 8px; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio-md); }
.copybox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copybox code { flex: 1 1 220px; min-width: 0; padding: 9px 12px; }
.step { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 50%; background: var(--accion); color: var(--on-accion); font: 600 13px/1 var(--font-mono); }
pre.code { background: var(--fondo-hundido); color: var(--texto); border: 1px solid var(--borde); padding: 14px 16px; border-radius: var(--radio-md); overflow-x: auto; white-space: pre-wrap; word-break: break-all; font: 400 13px/20px var(--font-mono); }

/* ---------- Mensajes de tickets y chat ---------- */
.msg { border: 1px solid var(--borde); border-radius: var(--radio-lg); padding: 14px 16px; background: var(--fondo-elevado); margin-bottom: 12px; }
.msg--contact { border-left: 3px solid var(--info); } .msg--user { border-left: 3px solid var(--tierra); }
.msg--internal { background: var(--alerta-fondo); border-style: dashed; } .msg--system { background: var(--fondo-hundido); color: var(--texto-suave); font-size: 13px; }
.msg__head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--texto-suave); margin-bottom: 8px; }
.msg__body { white-space: pre-wrap; word-break: break-word; }
.chatbox__log { max-height: 55vh; min-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 12px; }
.chatmsg { max-width: min(82%, 640px); padding: 10px 14px; border-radius: var(--radio-lg); background: var(--fondo); border: 1px solid var(--borde); }
.chatmsg--visitante { align-self: flex-start; }
.chatmsg--equipo { align-self: flex-end; background: var(--acento-suave); border-color: var(--acento-borde); }
.chatmsg--sistema { align-self: center; max-width: 92%; background: transparent; border-style: dashed; color: var(--texto-suave); font-size: 13px; }
.chatmsg__who { font-size: 12px; color: var(--texto-suave); margin-bottom: 2px; }
.chatmsg__txt { white-space: pre-wrap; word-break: break-word; }
.chatbox__form { border-top: 1px solid var(--borde); padding-top: 14px; }
.spark { display: flex; gap: 2px; align-items: flex-end; height: 28px; } .spark i { flex: 1; background: var(--exito); min-height: 3px; border-radius: 2px; } .spark i.bad { background: var(--peligro); }

/* ---------- Cuadro de confirmación (reemplaza el diálogo nativo) ---------- */
.dlg { border: 0; padding: 0; background: transparent; max-width: calc(100vw - 32px); overflow: visible; color: var(--texto); }
.dlg::backdrop { background: var(--velo); backdrop-filter: blur(2px); }
.dlg__card { width: 440px; max-width: 100%; background: var(--fondo-elevado); border: 1px solid var(--borde-fuerte); border-radius: var(--radio-xl); padding: 28px 28px 22px; box-shadow: var(--sombra-2); text-align: center; animation: dlg-in var(--dur-base) var(--curva-aterrizaje); }
.dlg__ico { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 700 22px/1 var(--font-sans); background: var(--info-fondo); color: var(--info); }
.dlg--danger .dlg__ico { background: var(--peligro-fondo); color: var(--peligro); }
.dlg__title { margin: 0 0 8px; font-size: 18px; line-height: 26px; color: var(--texto); }
.dlg__text { margin: 0 0 18px; color: var(--texto-suave); font-size: 14px; line-height: 22px; }
.dlg__row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.dlg__text + .dlg__row { margin-top: 0; }
.dlg__row .btn { min-width: 124px; }
.dlg .btn--danger { background: var(--peligro); border-color: var(--peligro); color: var(--noche); } .dlg .btn--danger:hover { filter: brightness(1.08); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Formulario de comprobante: renglones ---------- */
.items { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.item { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr) 84px minmax(112px, .75fr) minmax(112px, .75fr) 40px; gap: 12px; align-items: end; padding: 14px; border: 1px solid var(--borde); border-radius: var(--radio-md); background: var(--fondo); min-width: 0; }
.items--noiva .item { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.8fr) 84px minmax(120px, .8fr) 40px; }
.item__c { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-weight: 400; }
.item__l { font: 500 11px/14px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--texto-suave); white-space: normal; overflow-wrap: anywhere; min-height: 28px; display: flex; align-items: flex-end; }
.item .input { width: 100%; min-width: 0; text-overflow: ellipsis; }
.item__x { height: 40px; width: 40px; border: 1px solid var(--borde-fuerte); background: transparent; border-radius: var(--radio-md); cursor: pointer; color: var(--texto-suave); display: inline-grid; place-items: center; padding: 0; }
.item__x:hover { border-color: var(--peligro); color: var(--peligro); background: var(--peligro-fondo); }
@media (max-width: 1280px) {
  .item, .items--noiva .item { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .item__svc, .item__desc { grid-column: 1 / -1; }
  .item__l { min-height: 0; }
  .item__x { justify-self: end; }
}
.totalsbar { display: flex; justify-content: flex-end; align-items: baseline; gap: 16px; padding: 14px 4px 4px; margin-top: 8px; border-top: 1px solid var(--borde); }
.totalsbar span { color: var(--texto-suave); font: 500 12px/16px var(--font-mono); text-transform: uppercase; letter-spacing: .1em; }
.totalsbar strong { font: 500 28px/34px var(--font-mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.big-total { font: 500 24px/30px var(--font-mono); } .w-qty { width: 5.5em; } .w-disc { width: 4.5em; } .w30 { width: 30%; }
.logo-ficha { max-height: 56px; max-width: 160px; object-fit: contain; float: right; margin: 0 0 8px 12px; }
.logogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 8px 0 14px; }
.logogrid figure { margin: 0; border: 1px solid var(--borde); border-radius: var(--radio-md); padding: 12px; background: #fff; display: flex; flex-direction: column; align-items: center; gap: 8px; color: #0a0c10; }
.logogrid img { max-width: 100%; max-height: 54px; object-fit: contain; }
.mbars { display: grid; grid-template-columns: 90px minmax(0, 1fr) 120px; gap: 8px 12px; align-items: center; font-size: 14px; }
.mbars progress { width: 100%; height: 8px; appearance: none; -webkit-appearance: none; border: 0; background: var(--neutro-fondo); border-radius: var(--radio-pill); overflow: hidden; }
.mbars progress::-webkit-progress-bar { background: var(--neutro-fondo); border-radius: var(--radio-pill); } .mbars progress::-webkit-progress-value { background: var(--accion); border-radius: var(--radio-pill); } .mbars progress::-moz-progress-bar { background: var(--accion); }
.mbars progress.paid::-webkit-progress-value { background: var(--exito); } .mbars progress.paid::-moz-progress-bar { background: var(--exito); }
.uso { display: grid; grid-template-columns: minmax(120px, 220px) minmax(80px, 1fr) auto auto; align-items: center; gap: 12px; margin: 8px 0; font-size: 14px; }
@media (max-width: 560px) { .uso { grid-template-columns: 1fr 1fr; } }

/* ---------- Planes y cobros ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; align-items: stretch; margin-bottom: 20px; }
.plan { background: var(--fondo-elevado); border: 1px solid var(--borde); border-radius: var(--radio-lg); padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.plan--now { border-color: var(--acento-borde); background: linear-gradient(var(--acento-suave), var(--acento-suave)), var(--fondo-elevado); }
.plan--hl { border-color: var(--acento-borde); }
.plan h3 { margin: 0; font-size: 18px; line-height: 26px; }
.plan__price { font: 500 22px/30px var(--font-mono); margin: 0; letter-spacing: -.02em; }
.plan__price span { display: block; font: 400 13px/20px var(--font-sans); color: var(--texto-suave); letter-spacing: 0; }
.plan ul { margin: 0; padding-left: 20px; font-size: 14px; line-height: 22px; flex: 1; }
.plan ul li { margin: 3px 0; }
.plan form { margin-top: 6px; }

/* ---------- Comparador de planes ---------- */
.cmp { overflow: auto; max-height: 78vh; background: var(--fondo-elevado); border: 1px solid var(--borde); border-radius: var(--radio-lg); margin-bottom: 20px; -webkit-overflow-scrolling: touch; }
.cmp__t { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 680px; font-size: 14px; }
.cmp__t th, .cmp__t td { padding: 11px 14px; border-bottom: 1px solid var(--borde); text-align: center; vertical-align: middle; }
.cmp__t thead th { position: sticky; top: 0; z-index: 3; background: var(--fondo-elevado); vertical-align: top; border-bottom: 1px solid var(--borde-fuerte); }
.cmp__t .cmp__h { text-align: left; font-weight: 500; position: sticky; left: 0; z-index: 2; background: var(--fondo-elevado); min-width: 190px; max-width: 280px; }
.cmp__t thead .cmp__h { z-index: 4; }
.cmp__p { min-width: 150px; font-size: 15px; }
.cmp__price { display: block; font: 400 13px/20px var(--font-mono); color: var(--texto-suave); margin-top: 2px; }
.cmp__tag { display: block; width: fit-content; margin: 6px auto 0; padding: 1px 10px; border-radius: var(--radio-pill); background: var(--accion); color: var(--on-accion); font: 600 10px/16px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.cmp__tag--now { background: var(--exito); color: var(--noche); }
.cmp__p--hl, .cmp__c--hl { background: var(--acento-suave); }
.cmp__p--hl { box-shadow: inset 0 3px 0 var(--tierra); } .cmp__p--now { box-shadow: inset 0 3px 0 var(--exito); }
.cmp__g th { background: var(--fondo-hundido) !important; text-align: left !important; font: 500 11px/16px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--texto-suave); position: static !important; }
.cmp__c--ok { color: var(--exito); font-weight: 700; font-size: 16px; } .cmp__c--no { color: var(--borde-fuerte); }
.cmp__badge { display: inline-block; padding: 1px 10px; border-radius: var(--radio-pill); border: 1px dashed var(--borde-fuerte); color: var(--texto-suave); font-size: 12px; }
.cmp__soon .cmp__h { color: var(--texto-suave); }
@media (max-width: 640px) { .cmp__t .cmp__h { min-width: 130px; font-size: 13px; } .cmp__p { min-width: 120px; } }

/* ---------- Proveedor: planes, empresas, chequeos, proyección ---------- */
.pl-h { margin: 28px 0 12px; font-size: 17px; }
.pl-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 16px; overflow-x: auto; padding: 2px 2px 14px; margin-bottom: 6px; scroll-snap-type: x proximity; }
.pl-card { background: var(--fondo-elevado); border: 1px solid var(--borde); border-radius: var(--radio-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; scroll-snap-align: start; min-width: 0; }
.pl-card--hl { border-color: var(--acento-borde); } .pl-card--off { background: var(--fondo-hundido); }
.pl-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pl-card h3 { margin: 0; font-size: 16px; } .pl-card h3 a { text-decoration: none; color: var(--texto); }
.pl-card__desc { margin: 0; min-height: 3.6em; }
.pl-card__price { margin: 0; font: 500 22px/30px var(--font-mono); letter-spacing: -.02em; }
.pl-card__price span { display: block; font: 400 13px/18px var(--font-sans); color: var(--texto-suave); letter-spacing: 0; }
.pl-card__list { margin: 0; padding-left: 20px; font-size: 14px; flex: 1; }
.pl-card footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--borde); padding-top: 12px; }
.pl-edit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.pl-edit > .card { margin-bottom: 0; }
.pl-sub { font-size: 15px; margin: 16px 0 8px; }
.pl-save { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--fondo) 30%); padding: 20px 0 14px; display: flex; gap: 8px; margin-top: 8px; z-index: 3; }
@media (max-width: 1280px) { .pl-edit { grid-template-columns: minmax(0, 1fr); } }
.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; margin-bottom: 20px; }
.emp-card { display: flex; gap: 14px; align-items: flex-start; background: var(--fondo-elevado); border: 1px solid var(--borde); border-radius: var(--radio-lg); padding: 16px 18px; text-decoration: none; color: var(--texto); min-width: 0; transition: border-color var(--dur-rapida) var(--curva-acecho); }
.emp-card:hover { border-color: var(--borde-fuerte); background: var(--hover); }
.emp-card__logo { flex: none; width: 64px; height: 64px; border-radius: var(--radio-md); border: 1px solid var(--borde); background: #fff; display: grid; place-items: center; overflow: hidden; }
.emp-card__logo img { width: 100%; height: 100%; object-fit: contain; }
.emp-card__logo > span { font: 700 20px/1 var(--font-sans); color: #0a0c10; }
.emp-card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.emp-card__body strong, .emp-card__body .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.emp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; margin-bottom: 12px; }
.chk { border: 1px solid var(--borde); border-left-width: 3px; border-radius: var(--radio-md); padding: 14px 16px; background: var(--fondo-elevado); min-width: 0; }
.chk p { margin: 4px 0; } .chk form { margin-top: 8px; }
.chk__h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.chk--ok { border-left-color: var(--exito); } .chk--warn { border-left-color: var(--alerta); } .chk--bad { border-left-color: var(--peligro); } .chk--off { border-left-color: var(--borde-fuerte); background: var(--fondo-hundido); }
details.usr { border: 1px solid var(--borde); border-radius: var(--radio-md); padding: 12px 16px; margin-bottom: 10px; background: var(--fondo-elevado); }
details.usr > summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
details.usr[open] > summary { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--borde); }
.usr__t { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
details.usr--new { border-style: dashed; } details.usr .actions { margin-top: 12px; }
.proy { display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); gap: 20px; align-items: start; }
.proy__g { display: grid; grid-template-columns: minmax(0, 1fr) 110px 72px auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.proy__escs { list-style: none; padding: 0; margin: 12px 0 0; } .proy__escs li { display: flex; gap: 8px; align-items: center; padding: 6px 0; flex-wrap: wrap; }
.proy-chart { width: 100%; height: auto; max-height: 220px; }
.proy-chart__axis { stroke: var(--borde); stroke-width: 1; }
.proy-chart__n { fill: var(--borde-fuerte); } .proy-chart__r { fill: var(--exito); } .proy-chart__r--neg { fill: var(--peligro); }
.proy-chart__t { font-size: 8px; fill: var(--texto-suave); }
.proy-legend span { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 12px; }
.proy-legend__n { background: var(--borde-fuerte); } .proy-legend__r { background: var(--exito); }
.proy__pl { display: grid; grid-template-columns: minmax(0, 1fr) 100px 76px 76px; gap: 8px; align-items: center; margin-bottom: 8px; font-size: 14px; }
.proy__pl > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proy__pl--h span:not(:first-child) { text-align: right; }
#por-plan progress.bar { display: inline-block; width: 90px; vertical-align: middle; }
@media (max-width: 1280px) { .proy { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .proy__g { grid-template-columns: 1fr 90px; } }

/* ---------- Alta: elegir el tipo de negocio ---------- */
.rb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 14px; margin: 20px 0; }
.rb-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--borde); border-radius: var(--radio-lg); text-decoration: none; color: var(--texto); background: var(--fondo); transition: border-color var(--dur-base) var(--curva-acecho), background var(--dur-base) var(--curva-acecho), transform var(--dur-base) var(--curva-acecho); }
.rb-card:hover, .rb-card:focus-visible { border-color: var(--acento-borde); background: var(--acento-suave); transform: translateY(-2px); text-decoration: none; }
.rb-card__ico { width: 40px; height: 40px; border-radius: var(--radio-md); display: grid; place-items: center; background: var(--acento-suave); color: var(--tierra); }
.rb-card__ico .icon { width: 22px; height: 22px; }
.rb-card strong { font-size: 16px; line-height: 22px; } .rb-card span.small { color: var(--texto-suave); line-height: 20px; }
.rb-card em { font: normal 600 13px/18px var(--font-sans); color: var(--enlace); margin-top: auto; }
.rb-pick { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--borde); border-radius: var(--radio-md); margin-bottom: 16px; background: var(--fondo); }
.rb-pick div { flex: 1; min-width: 0; }
@media (prefers-reduced-motion: reduce) { .rb-card:hover { transform: none; } }

/* ---------- Taller de reparaciones ---------- */
.rep-pct { width: 5.5rem; }
.rep-repuesto, .rep-accion { border-top: 1px solid var(--borde); padding-top: .8rem; margin-top: .8rem; }
.rep-accion { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.rep-accion .input { flex: 1 1 220px; }
.rep-hoja-body { background: #fff; color: #0a0c10; }
.rep-hoja { max-width: 760px; margin: 0 auto; padding: 24px 16px; }
.rep-hoja th { text-align: left; width: 28%; vertical-align: top; }
.rep-firmas { display: flex; justify-content: space-between; gap: 32px; margin-top: 48px; }
.rep-firmas div { flex: 1; border-top: 1px solid #000; padding-top: 6px; font-size: 13px; }
.rep-hoja header .doc-logo { margin: 0 auto 8px; }

/* ---------- Metalúrgica ---------- */
.met-num { width: 7.5rem; text-align: right; } .met-nombre { min-width: 12rem; }
.met-calc { background: var(--fondo); border: 1px solid var(--borde); border-radius: var(--radio-md); padding: 12px 16px; }
.met-etapas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.met-etapa { background: var(--fondo); border: 1px solid var(--borde); border-radius: var(--radio-lg); padding: 12px; }
.met-etapa h3 { margin: 0 0 10px; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.met-tarjeta { display: block; background: var(--fondo-elevado); border: 1px solid var(--borde); border-radius: var(--radio-md); padding: 10px 12px; margin-bottom: 8px; text-decoration: none; color: inherit; }
.met-tarjeta:hover { border-color: var(--borde-fuerte); } .met-tarjeta.atrasada { border-color: color-mix(in srgb, var(--peligro) 55%, transparent); }
.met-dolar strong { font: 500 28px/34px var(--font-mono); } .met-wrap { overflow-x: auto; }

/* ---------- Inmobiliaria ---------- */
.inmo-head { display: flex; align-items: center; gap: 16px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--borde); flex-wrap: wrap; }
.inmo-head strong { font-size: 17px; }
.inmo-logo, .doc-logo { max-width: 200px; max-height: 80px; height: auto; width: auto; }
.doc-logo { display: block; margin: 0 0 8px; } .doc-head { margin-bottom: 14px; }
.ichart { width: 100%; height: auto; } .ibar { fill: var(--tierra); } .ibar--c { fill: var(--texto-suave); opacity: .55; } .ilbl { font-size: 10px; fill: var(--texto-suave); }
.pubwrap { max-width: 760px; margin: 0 auto; padding: 1rem; } .pubwrap--wide { max-width: 960px; }
.vid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.vid-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--texto); padding: 0 0 14px; overflow: hidden; }
.vid-card strong, .vid-card .vid-price, .vid-card .small { padding: 0 16px; }
.vid-cover { width: 100%; height: 190px; object-fit: cover; display: block; background: var(--neutro-fondo); }
.vid-cover--none { display: flex; align-items: center; justify-content: center; color: var(--texto-suave); }
.vid-price { font: 500 16px/24px var(--font-mono); }
.vid-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; margin: 12px 0; }
.vid-photo { width: 100%; height: auto; border-radius: var(--radio-sm); display: block; }
.vid-text { white-space: pre-wrap; font-family: inherit; font-size: 15px; margin: 12px 0; }
.ot-check { padding: .7rem .9rem; margin-bottom: .5rem; }
.contract { white-space: pre-wrap; line-height: 1.55; }
.thumbs { display: flex; flex-wrap: wrap; gap: .6rem; } .thumbs img { width: 150px; height: 110px; object-fit: cover; border-radius: var(--radio-md); border: 1px solid var(--borde); }
.map { position: relative; height: 320px; border: 1px solid var(--borde); border-radius: var(--radio-lg); overflow: hidden; background: #e8ecf2; touch-action: none; cursor: grab; }
.map__tiles, .map__pins { position: absolute; inset: 0; } .map__tiles img { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; }
.map__pin { position: absolute; transform: translate(-50%, -100%); color: #d6336c; font-size: 26px; line-height: 1; text-decoration: none; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.map__ctl, .gmap__ctl { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; }
.map__ctl button, .gmap__ctl button { width: 34px; height: 34px; border: 1px solid #c4cad4; border-radius: var(--radio-sm); background: #fff; color: #0a0c10; font-size: 18px; cursor: pointer; }
.map__att, .gmap__att { position: absolute; right: 4px; bottom: 2px; font-size: 11px; background: rgba(255, 255, 255, .85); color: #333; padding: 0 4px; border-radius: 3px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gallery figure { margin: 0; border: 1px solid var(--borde); border-radius: var(--radio-md); overflow: hidden; background: var(--fondo-elevado); }
.gallery img { display: block; width: 100%; height: 110px; object-fit: cover; }
.gallery figcaption { padding: 8px; font-size: 13px; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

/* ---------- WhatsApp y avisos ---------- */
.rav-sec { margin: 8px 0 14px; }
.rav-estado__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px 24px; }
.rav-estado__list li { display: flex; flex-direction: column; gap: 4px; } .rav-estado__list .badge { align-self: flex-start; }
.rav-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.rav-opt.is-off { opacity: .6; cursor: not-allowed; }
.rav-save { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--borde); }
.wae-vinc { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; margin: 8px 0 14px; }
.wae-qr img { display: block; width: 260px; height: 260px; max-width: 100%; border: 1px solid var(--borde); border-radius: var(--radio-md); background: #fff; padding: 8px; }
.wae-code, .wat-codigo { font: 600 28px/1.2 var(--font-mono); letter-spacing: .12em; margin: 4px 0; }
.wat-codigo { font-size: 32px; letter-spacing: .25rem; font-weight: 700; margin: .5rem 0 1rem; }
.wae-acc { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; } .wae-acc .input--sm { width: 220px; max-width: 100%; }
.wat-head { padding-bottom: 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; } .wat-head h2 { margin: 0 0 .25rem; }
.wat-nuevo { padding: 14px 24px 18px; display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; border-top: 1px solid var(--borde); } .wat-nuevo .field { margin: 0; min-width: min(100%, 16rem); }

/* ---------- Tutorial guiado ---------- */
.tour__spot { position: fixed; z-index: 1000; border-radius: var(--radio-md); box-shadow: 0 0 0 9999px var(--velo), 0 0 0 2px var(--ambar); pointer-events: none; transition: left .2s, top .2s, width .2s, height .2s; }
.tour__pop { position: fixed; z-index: 1001; width: 380px; max-width: calc(100vw - 24px); background: var(--fondo-elevado); color: var(--texto); border: 1px solid var(--borde-fuerte); border-radius: var(--radio-lg); padding: 18px 20px; box-shadow: var(--sombra-2); }
.tour__count { margin: 0 0 4px; font: 500 11px/16px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--texto-suave); }
.tour__title { margin: 0 0 6px; font-size: 17px; } .tour__text { margin: 0 0 14px; color: var(--texto-suave); }
.tour__row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.tour-offer { border-left: 3px solid var(--tierra); } .tour-list li { margin-bottom: 8px; }
@media (max-width: 900px) { .tour__pop { left: 12px; right: 12px; bottom: 12px; top: auto; width: auto; max-width: none; } }
@media (prefers-reduced-motion: reduce) { .tour__spot { transition: none; } }

/* ---------- Cobros y varios ---------- */
.badge--env-produccion, .badge--env-pruebas { font-weight: 500; }
.hp-note { display: none; }
@media print {
  .side, .top, .filters, .spacer, .alert, .btn, .editor__bar, .cols > div, .tabbar, .a53-pwa-banner, .tema, .auth__foot { display: none !important; }
  .panel { display: block; } .main { margin: 0 !important; }
  .card { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
  .content { max-width: none; padding: 0; }
  .noprint { display: none !important; } .rep-hoja { padding: 0; } .pubwrap .btn, .pubwrap .actions { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Gestión de red ISP ---------- */
.port { display: inline-block; min-width: 26px; margin: 2px; padding: 3px 6px; text-align: center; font: 500 12px/16px var(--font-mono); border-radius: var(--radio-sm); border: 1px solid var(--borde); text-decoration: none; }
.port--libre { background: var(--exito-fondo); border-color: color-mix(in srgb, var(--exito) 40%, transparent); color: var(--exito); }
.port--ocupado { background: var(--peligro-fondo); border-color: color-mix(in srgb, var(--peligro) 40%, transparent); color: var(--peligro); }
.port--cortado { background: var(--alerta-fondo); border-color: color-mix(in srgb, var(--alerta) 40%, transparent); color: var(--alerta); }
svg.chart { display: block; width: 100%; max-width: 100%; }
.chart__down { fill: var(--tierra); } .chart__up { fill: var(--texto-suave); opacity: .55; }
.chart__axis { stroke: var(--borde); stroke-width: 1; }
.chart__legend { font-size: 12px; color: var(--texto-suave); }
.chart__legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 12px; vertical-align: baseline; }
.chart__legend i.d { background: var(--tierra); } .chart__legend i.u { background: var(--texto-suave); opacity: .55; }

/* Mapa de la red, fibra y técnico en campo */
.gmap { position: relative; height: 340px; border: 1px solid var(--borde); border-radius: var(--radio-lg); overflow: hidden; background: #e8ecf2; touch-action: none; cursor: grab; }
.gmap--big { height: 62vh; min-height: 380px; } .gmap--track { height: 60vh; min-height: 320px; margin: .6rem 0; }
.gmap__tiles, .gmap__pins, .gmap__cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.gmap__pins { pointer-events: none; }
.gmap__tiles img { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; }
.gmap__pop { position: absolute; z-index: 5; max-width: 220px; background: var(--fondo-elevado); color: var(--texto); border: 1px solid var(--borde-fuerte); border-radius: var(--radio-md); padding: 8px 12px; font-size: 13px; box-shadow: var(--sombra-2); cursor: default; }
.gmap__pin { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; }
.gmap__pin i { font-style: normal; font-size: 26px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.gmap__pin b { background: var(--noche); color: var(--papel); font: 500 11px/16px var(--font-mono); padding: 1px 8px; border-radius: var(--radio-pill); white-space: nowrap; margin-top: 2px; }
.gmap__pin--old { opacity: .45; } .gmap__pin--me i { color: #1c7ed6; font-size: 22px; }
.layers { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: .5rem 0; }
.tec__row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .6rem 0; }
.tec__ot { padding: 1rem 1.1rem; margin-bottom: .75rem; }
.track__state { font-size: 18px; font-weight: 600; padding: .8rem 1rem; border-radius: var(--radio-md); background: var(--neutro-fondo); }
.track__state--go { background: var(--info-fondo); color: var(--info); } .track__state--ok { background: var(--exito-fondo); color: var(--exito); }

/* Fibra óptica: los colores siguen el código estándar de fibras (no se tematizan) */
.fiber { display: inline-block; min-width: 1.8em; padding: 0 .4em; border: 1px solid rgba(0, 0, 0, .35); border-radius: var(--radio-sm); text-align: center; font: 700 12px/20px var(--font-mono); }
.fiber--d { color: #fff; } .fiber--l { color: #1a1a1a; } .fiber sup { font-size: .6em; }
.fiber--c0 { background: #1E5AA8; } .fiber--c1 { background: #F28C28; } .fiber--c2 { background: #2E9B4E; } .fiber--c3 { background: #7B4A2A; }
.fiber--c4 { background: #8A8F98; } .fiber--c5 { background: #F4F4F4; } .fiber--c6 { background: #D63B2F; } .fiber--c7 { background: #1A1A1A; }
.fiber--c8 { background: #F2D12B; } .fiber--c9 { background: #7B3FA0; } .fiber--c10 { background: #F08FB5; } .fiber--c11 { background: #46C6E8; }
.fibers { display: flex; flex-wrap: wrap; gap: .5rem 1rem; } .fibers__it { display: inline-flex; gap: .4rem; align-items: center; font-size: 14px; }
.buf { margin-bottom: .9rem; } .buf__h { display: flex; gap: .5rem; align-items: center; margin-bottom: .4rem; } .buf__f { display: flex; flex-wrap: wrap; gap: .5rem; }
.fcell { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 76px; padding: .4rem .5rem; border: 1px solid var(--borde); border-radius: var(--radio-md); text-decoration: none; color: inherit; background: var(--fondo-elevado); }
.fcell__t { font-size: 11px; color: var(--texto-suave); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcell--activo { border-color: var(--exito); } .fcell--reserva { border-style: dashed; border-color: var(--alerta); } .fcell--danado { border-color: var(--peligro); background: var(--peligro-fondo); } .fcell--sel { outline: 2px solid var(--foco); outline-offset: 2px; }
.fiberstate { padding: 0 .5rem; border-radius: var(--radio-sm); font-size: 12px; } .fiberstate--reserva { border: 1px dashed var(--alerta); } .fiberstate--danado { border: 1px solid var(--peligro); background: var(--peligro-fondo); }
.napbox { overflow: auto; border: 1px solid var(--borde); border-radius: var(--radio-lg); background: var(--fondo-hundido); }
.napsvg { width: 100%; min-width: 640px; height: auto; touch-action: none; display: block; }
.napnode rect { fill: var(--fondo-elevado); stroke: var(--borde-fuerte); stroke-width: 1.5; cursor: move; }
.napnode--entrada rect { fill: var(--info-fondo); } .napnode--splitter rect { fill: var(--alerta-fondo); } .napnode--salida rect { fill: var(--exito-fondo); }
.napnode--sel rect { stroke: var(--foco); stroke-width: 3; }
.napnode__t { font-size: 14px; font-weight: 700; fill: var(--texto); pointer-events: none; } .napnode__s { font-size: 11px; fill: var(--texto-suave); pointer-events: none; } .napnode__ok { fill: var(--exito); font-weight: 700; }
.napprops { margin-top: .9rem; padding: 1rem; border: 1px solid var(--borde); border-radius: var(--radio-lg); }
