/* Tamaño por defecto de todo ícono (especificidad cero: cualquier regla específica lo sustituye) */
:where(svg.i) { width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.2em; }
/* MoviMaz OS — sistema de diseño (basado en las maquetas MOVIMAZ - DASHBOARD 01..20) */
@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url(/vendor/fonts/poppins-400.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url(/vendor/fonts/poppins-500.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: url(/vendor/fonts/poppins-600.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url(/vendor/fonts/poppins-700.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 800; font-display: swap; src: url(/vendor/fonts/poppins-800.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url(/vendor/fonts/inter-400.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url(/vendor/fonts/inter-500.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url(/vendor/fonts/inter-600.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url(/vendor/fonts/inter-700.woff2) format('woff2'); }

:root {
  --navy: #0b2447; --navy-2: #0e3263; --navy-3: #13407d;
  --azul: #1f6feb; --azul-2: #1557c9; --azul-claro: #3ba4f5; --azul-50: #eaf2ff;
  --verde: #18a957; --verde-marca: #7ac943; --verde-50: #e6f7ee;
  --naranja: #f59e0b; --naranja-50: #fff4e0;
  --rojo: #e5484d; --rojo-50: #fdecec;
  --morado: #7c3aed; --morado-50: #f1eafe;
  --turquesa: #12b5a5; --turquesa-50: #e2f7f4;
  --amarillo-50: #fff8db;
  --gris-50: #f6f8fb; --gris-100: #eef2f7; --gris-200: #e3e8f0; --gris-300: #cfd7e3; --gris-500: #6b7a90; --gris-700: #364152;
  --fondo: #f3f6fb; --card: #ffffff; --texto: #0f1b33; --muted: #66758c; --borde: #e4e9f1;
  --radio: 14px; --radio-sm: 10px;
  --sombra: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 18px rgba(16, 24, 40, .06);
  --sombra-lg: 0 12px 40px rgba(11, 36, 71, .18);
  --sidebar: 248px;
  --titulos: 'Poppins', system-ui, sans-serif;
  --texto-f: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--texto-f); font-size: 14px; color: var(--texto); background: var(--fondo); -webkit-font-smoothing: antialiased; }
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--titulos); margin: 0; letter-spacing: -.01em; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[v-cloak] { display: none; }
.oculto { display: none !important; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: 0 0 var(--sidebar); background: linear-gradient(180deg, var(--navy) 0%, #0a2041 60%, #081a36 100%); color: #dbe6f7; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: hidden; z-index: 30; }
.sb-logo { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.sb-logo .m { width: 42px; height: 42px; border-radius: 10px; background: #fff url(/img/logo-m.jpg) center/150% no-repeat; flex: none; }
.sb-logo .t { line-height: 1; }
.sb-logo .t b { font-family: var(--titulos); font-weight: 700; font-size: 25px; color: #fff; letter-spacing: -.02em; }
.sb-logo .t b span { color: var(--azul-claro); }
.sb-logo .t small { display: block; font-size: 7.6px; letter-spacing: .1em; color: #b8c7de; margin-top: 4px; font-weight: 600; }
.sb-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; scrollbar-width: thin; scrollbar-color: #24477a transparent; }
.sb-grupo { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #7f95b8; padding: 14px 12px 6px; font-weight: 600; }
.sb-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #dbe6f7; font-weight: 500; font-size: 14.5px; cursor: pointer; margin-bottom: 2px; position: relative; }
.sb-item:hover { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; }
.sb-item.activo { background: linear-gradient(90deg, var(--azul) 0%, #2c7cf2 100%); color: #fff; box-shadow: 0 6px 16px rgba(31, 111, 235, .35); }
.sb-item svg { width: 20px; height: 20px; flex: none; }
.sb-item .cnt { margin-left: auto; background: var(--rojo); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.sb-pie { padding: 12px; }
.sb-promo { position: relative; border-radius: 14px; overflow: hidden; height: 150px; background: url(/img/operador.jpg) 70% 30%/cover; }
.sb-promo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 26, 54, .92) 10%, rgba(8, 26, 54, .2) 85%); }
.sb-promo p { position: absolute; z-index: 1; left: 14px; bottom: 14px; margin: 0; color: #fff; font-family: var(--titulos); font-weight: 500; font-size: 17px; line-height: 1.15; }
.sb-version { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #9fb2d0; padding: 10px 6px 0; }
.sb-version b { color: #fff; font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--borde); display: flex; align-items: center; gap: 14px; padding: 10px 26px; min-height: 62px; }
.topbar .hamb { display: none; }
.buscador { position: relative; flex: 1; max-width: 460px; }
.buscador input { width: 100%; border: 1px solid transparent; background: var(--gris-100); border-radius: 999px; padding: 10px 16px 10px 42px; outline: none; }
.buscador input:focus { background: #fff; border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-50); }
.buscador svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--gris-500); }
.buscador .res { position: absolute; top: 46px; left: 0; right: 0; background: #fff; border-radius: 12px; box-shadow: var(--sombra-lg); padding: 6px; max-height: 420px; overflow: auto; }
.buscador .res a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--texto); }
.buscador .res a:hover { background: var(--gris-50); text-decoration: none; }
.buscador .res small { color: var(--muted); }
.tb-der { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.campana { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; border: 0; background: transparent; }
.campana:hover { background: var(--gris-100); }
.campana svg { width: 22px; }
.campana .n { position: absolute; top: 3px; right: 2px; background: var(--rojo); color: #fff; font-size: 10px; font-weight: 700; border-radius: 99px; padding: 1px 5px; border: 2px solid #fff; }
.usuario-tb { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px; border-radius: 12px; position: relative; }
.usuario-tb:hover { background: var(--gris-100); }
.usuario-tb .nm { font-weight: 600; font-size: 14px; line-height: 1.15; }
.usuario-tb .rl { color: var(--muted); font-size: 12px; }
.menu-flot { position: absolute; right: 0; top: 52px; background: #fff; border-radius: 12px; box-shadow: var(--sombra-lg); min-width: 210px; padding: 6px; z-index: 50; }
.menu-flot a, .menu-flot button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--texto); }
.menu-flot a:hover, .menu-flot button:hover { background: var(--gris-50); text-decoration: none; }
.contenido { padding: 22px 26px 40px; flex: 1; }

/* ---------- Encabezados ---------- */
.hero { position: relative; display: flex; align-items: stretch; justify-content: space-between; gap: 20px; border-radius: 18px; overflow: hidden; margin-bottom: 18px; min-height: 150px; background: linear-gradient(100deg, #ffffff 0%, #f5f9ff 45%, #e7f0fc 100%); border: 1px solid var(--borde); }
.hero .txt { padding: 20px 24px; z-index: 1; max-width: 640px; }
.hero h1 { font-size: 34px; font-weight: 800; color: var(--navy); line-height: 1.08; }
.hero h2 { font-family: var(--titulos); font-size: 20px; font-weight: 500; color: #1f3a66; margin-top: 2px; }
.hero p { margin: 10px 0 0; color: var(--gris-700); }
.hero .img { flex: 0 1 560px; background: url(/img/hero-flota.jpg) center bottom/cover no-repeat; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18%); mask-image: linear-gradient(90deg, transparent 0, #000 18%); }
.hero .lema { position: absolute; right: 22px; top: 18px; text-align: right; font-family: var(--titulos); font-weight: 600; letter-spacing: .22em; font-size: 12px; color: var(--navy); line-height: 1.6; z-index: 1; text-shadow: 0 0 8px #fff, 0 0 4px #fff; }
.hero .lema::after { content: ''; display: block; width: 44px; height: 3px; background: var(--verde-marca); margin: 6px 0 0 auto; border-radius: 3px; }
.encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.encabezado h1 { font-size: 30px; font-weight: 800; color: var(--navy); }
.encabezado .sub { color: var(--muted); font-size: 15px; margin-top: 2px; }
.migas { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.migas a { color: var(--muted); }
.acciones { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 6px; }
.card-h h3 { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; color: var(--navy); }
.card-h h3 svg { width: 22px; color: var(--azul); }
.card-b { padding: 12px 18px 18px; }
.card-b.p0 { padding: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-12-8 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.g-8-4 { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); }
.mb { margin-bottom: 16px; }
.mt { margin-top: 16px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (min-width: 1100px) { .kpis.k8 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--card); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi.clic { cursor: pointer; }
.kpi.clic:hover { border-color: var(--azul-claro); }
.kpi .top { display: flex; gap: 10px; align-items: flex-start; }
.kpi .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: none; }
.kpi .ico svg { width: 22px; height: 22px; }
.kpi .lbl { font-size: 13px; color: var(--gris-700); font-weight: 500; line-height: 1.25; }
.kpi .val { font-family: var(--titulos); font-size: 27px; font-weight: 700; color: var(--texto); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .val small { font-size: 15px; font-weight: 600; color: var(--muted); }
.kpi .var { font-size: 13px; font-weight: 700; display: flex; gap: 2px 4px; align-items: center; flex-wrap: wrap; }
.kpi .var.up { color: var(--verde); }
.kpi .var.down { color: var(--rojo); }
.kpi .var.neu { color: var(--muted); }
.kpi .var span { color: var(--muted); font-weight: 400; font-size: 12px; }
.kpi .nota { font-size: 12px; color: var(--muted); }
.bg-verde { background: linear-gradient(135deg, #2bc46a, #15a052); }
.bg-azul { background: linear-gradient(135deg, #3d8bfd, #1f6feb); }
.bg-naranja { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.bg-morado { background: linear-gradient(135deg, #9b6bff, #7c3aed); }
.bg-turquesa { background: linear-gradient(135deg, #2fd0c0, #12b5a5); }
.bg-rojo { background: linear-gradient(135deg, #f87171, #e5484d); }
.bg-navy { background: linear-gradient(135deg, #1e4f91, #0b2447); }
.bg-cielo { background: linear-gradient(135deg, #5ec2ff, #2a9df4); }
.bg-lima { background: linear-gradient(135deg, #9adf5b, #5fb336); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 9px 16px; border: 1px solid var(--gris-300); background: #fff; color: var(--texto); font-weight: 600; cursor: pointer; white-space: nowrap; font-size: 14px; transition: background .12s, box-shadow .12s; }
.btn:hover { background: var(--gris-50); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn.prim { background: var(--azul); border-color: var(--azul); color: #fff; box-shadow: 0 4px 12px rgba(31, 111, 235, .28); }
.btn.prim:hover { background: var(--azul-2); }
.btn.verde { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn.verde:hover { background: #128a46; }
.btn.morado { background: var(--morado); border-color: var(--morado); color: #fff; }
.btn.rojo { background: #fff; border-color: #f3b4b6; color: var(--rojo); }
.btn.rojo:hover { background: var(--rojo-50); }
.btn.contorno { border-color: var(--azul); color: var(--azul); }
.btn.contorno:hover { background: var(--azul-50); }
.btn.fant { border-color: transparent; background: transparent; }
.btn.fant:hover { background: var(--gris-100); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.xs { padding: 3px 8px; font-size: 12px; border-radius: 7px; }
.btn.ico { padding: 7px; }
.btn.bloque { width: 100%; }

/* ---------- Píldoras de estado ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 99px; padding: 3px 10px; white-space: nowrap; line-height: 1.4; }
.pill.verde { background: var(--verde-50); color: #0f8a44; }
.pill.azul { background: var(--azul-50); color: #1557c9; }
.pill.amarillo { background: var(--amarillo-50); color: #a16207; }
.pill.naranja { background: var(--naranja-50); color: #b45309; }
.pill.rojo { background: var(--rojo-50); color: #c42d32; }
.pill.morado { background: var(--morado-50); color: #6d28d9; }
.pill.gris { background: var(--gris-100); color: var(--gris-700); }
.pill.turquesa { background: var(--turquesa-50); color: #0e8a7e; }
.pill.solida-rojo { background: var(--rojo); color: #fff; }
.pill.solida-naranja { background: #f97316; color: #fff; }
.pill.solida-amarillo { background: #fde68a; color: #854d0e; }
.pill svg { width: 13px; height: 13px; }
.demo-tag { font-size: 10px; font-weight: 700; letter-spacing: .05em; background: #fff1c2; color: #8a5a00; border-radius: 5px; padding: 1px 5px; vertical-align: middle; }

/* ---------- Tablas ---------- */
.tabla-wrap { overflow-x: auto; }
table.tabla { width: 100%; border-collapse: separate; border-spacing: 0; }
.tabla th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--gris-700); background: var(--gris-50); padding: 10px 12px; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.tabla td { padding: 10px 12px; border-bottom: 1px solid var(--gris-100); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr.clic { cursor: pointer; }
.tabla tbody tr.clic:hover td { background: #f8fbff; }
.tabla tr.sel td { background: #eef5ff; }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla .min { width: 1%; white-space: nowrap; }
.tabla small, .muted { color: var(--muted); }
.vacio { text-align: center; color: var(--muted); padding: 34px 16px; }
.vacio svg { width: 40px; height: 40px; color: var(--gris-300); display: block; margin: 0 auto 8px; }
.celda-ent { display: flex; align-items: center; gap: 10px; min-width: 0; }
.celda-ent b { font-weight: 600; display: block; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; background: var(--navy-3); }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.avatar.cuad { border-radius: 10px; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 12px 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form.c1 { grid-template-columns: 1fr; }
.form .full { grid-column: 1 / -1; }
.campo { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.campo > label { font-size: 12.5px; font-weight: 600; color: var(--gris-700); }
.campo .ayuda { font-size: 12px; color: var(--muted); }
.inp, select.inp, textarea.inp { width: 100%; border: 1px solid var(--gris-300); border-radius: 10px; padding: 9px 12px; background: #fff; outline: none; min-height: 40px; }
textarea.inp { min-height: 84px; resize: vertical; line-height: 1.45; }
.inp:focus { border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-50); }
.inp[readonly] { background: var(--gris-50); }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--azul); }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filtros .campo { min-width: 160px; }
.filtros .inp { min-height: 38px; padding: 7px 11px; }
.busq { position: relative; flex: 1; min-width: 220px; }
.busq svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--gris-500); }
.busq .inp { padding-left: 38px; }
.seg { display: inline-flex; background: var(--gris-100); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--gris-700); display: inline-flex; align-items: center; gap: 6px; }
.seg button svg { width: 16px; }
.seg button.on { background: #fff; color: var(--azul); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.seg.azul button.on { background: var(--azul); color: #fff; }

/* Pestañas */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--borde); overflow-x: auto; margin-bottom: 14px; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--gris-700); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs button.on { color: var(--azul); border-bottom-color: var(--azul); }
.tabs button .c { background: var(--gris-100); color: var(--gris-700); font-size: 11px; border-radius: 99px; padding: 1px 7px; }
.tabs button.on .c { background: var(--azul); color: #fff; }

/* Listas de definición */
.dl { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 7px 12px; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* Modal */
.modal-fondo { position: fixed; inset: 0; background: rgba(9, 24, 48, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--sombra-lg); width: 100%; max-width: 640px; }
.modal.lg { max-width: 920px; }
.modal.xl { max-width: 1180px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 8px; }
.modal-h h3 { font-size: 19px; color: var(--navy); }
.modal-b { padding: 10px 22px 18px; }
.modal-p { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px 18px; border-top: 1px solid var(--gris-100); }

/* Toasts */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; border-radius: 12px; padding: 12px 16px; box-shadow: var(--sombra-lg); max-width: 380px; font-weight: 500; animation: entra .2s ease-out; }
.toast.error { background: #b4232a; }
.toast.ok { background: #12763e; }
@keyframes entra { from { transform: translateY(10px); opacity: 0; } }

/* Avisos */
.aviso { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 11px 14px; font-size: 13.5px; border: 1px solid; }
.aviso svg { width: 19px; flex: none; margin-top: 1px; }
.aviso.info { background: #eef5ff; border-color: #cfe0fb; color: #1d4282; }
.aviso.warn { background: #fff8e6; border-color: #fbe2a6; color: #7a4d00; }
.aviso.error { background: #fdeeee; border-color: #f7c6c8; color: #8c1d22; }
.aviso.ok { background: #e9f8f0; border-color: #bfe8d0; color: #0f5e32; }

/* Lista con íconos / items */
.lista-items { display: flex; flex-direction: column; gap: 8px; }
.item-alerta { display: flex; gap: 12px; align-items: center; border-radius: 12px; padding: 10px 12px; cursor: pointer; border: 1px solid transparent; }
.item-alerta:hover { filter: brightness(.98); }
.item-alerta .ia-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.item-alerta .ia-ico svg { width: 20px; }
.item-alerta .tx { flex: 1; min-width: 0; }
.item-alerta .tx b { display: block; font-weight: 600; }
.item-alerta .tx small { color: var(--gris-700); }
.item-alerta.critica { background: #fdeeee; }
.item-alerta.critica .ia-ico { background: var(--rojo); }
.item-alerta.urgente { background: #fff6e8; }
.item-alerta.urgente .ia-ico { background: var(--naranja); }
.item-alerta.preventiva { background: #eef5ff; }
.item-alerta.preventiva .ia-ico { background: var(--azul); }

/* Línea de tiempo */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 24px; }
.timeline li::before { content: ''; position: absolute; left: 5px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--azul); box-shadow: 0 0 0 3px var(--azul-50); }
.timeline li::after { content: ''; position: absolute; left: 9.5px; top: 18px; bottom: 0; width: 1.5px; background: var(--gris-200); }
.timeline li:last-child::after { display: none; }
.timeline .t { font-size: 12px; color: var(--muted); }
.timeline .d { font-weight: 600; }

/* Stepper de etapas */
.stepper { display: flex; align-items: flex-start; overflow-x: auto; padding: 4px 2px 8px; }
.step { flex: 1; min-width: 92px; text-align: center; position: relative; }
.step::before { content: ''; position: absolute; top: 15px; left: -50%; width: 100%; height: 3px; background: var(--gris-200); z-index: 0; }
.step:first-child::before { display: none; }
.step.hecho::before, .step.actual::before { background: var(--verde); }
.step .c { width: 32px; height: 32px; border-radius: 50%; background: var(--gris-200); color: var(--gris-700); display: grid; place-items: center; font-weight: 700; margin: 0 auto 6px; position: relative; z-index: 1; font-size: 13px; }
.step.hecho .c { background: var(--verde); color: #fff; }
.step.actual .c { background: var(--azul); color: #fff; box-shadow: 0 0 0 4px var(--azul-50); }
.step .n { font-size: 12.5px; font-weight: 600; color: var(--gris-700); }
.step.actual .n { color: var(--azul); }
.step .f { font-size: 11.5px; color: var(--muted); }

/* Checklist de validaciones */
.valids { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.valids li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.valids li .ck { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.valids li.ok .ck { background: var(--verde); color: #fff; }
.valids li.no .ck { background: var(--gris-200); color: var(--gris-500); }
.valids li .ck svg { width: 13px; }

/* Tarjetas de unidad (catálogo) */
.unidades-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.u-card { background: #fff; border: 1px solid var(--borde); border-radius: 16px; overflow: hidden; box-shadow: var(--sombra); display: flex; flex-direction: column; }
.u-card .foto { height: 150px; background: #dfe8f3 center/cover no-repeat; position: relative; }
.u-card .foto .pill { position: absolute; top: 10px; right: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.u-card .foto .eco { position: absolute; left: 10px; top: 10px; background: rgba(11, 36, 71, .85); color: #fff; font-size: 11.5px; font-weight: 700; border-radius: 7px; padding: 2px 8px; }
.u-card .cuerpo { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.u-card h4 { font-size: 17px; font-weight: 700; color: var(--navy); }
.u-card .precio { font-family: var(--titulos); font-size: 21px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.u-card .precio small { font-size: 12px; color: var(--muted); font-weight: 500; }
.u-card .specs { display: flex; gap: 14px; color: var(--gris-700); font-size: 13px; flex-wrap: wrap; }
.u-card .specs span { display: inline-flex; gap: 5px; align-items: center; }
.u-card .specs svg { width: 16px; color: var(--gris-500); }
.u-card .pie { display: flex; gap: 8px; margin-top: auto; align-items: center; flex-wrap: wrap; }

/* Kanban (CRM) */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.k-col { background: var(--gris-100); border-radius: 14px; padding: 10px; min-height: 200px; }
.k-col.sobre { outline: 2px dashed var(--azul); background: var(--azul-50); }
.k-col h4 { font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 8px; color: var(--navy); }
.k-col h4 small { color: var(--muted); font-family: var(--texto-f); font-weight: 600; }
.k-card { background: #fff; border-radius: 11px; padding: 10px 11px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); cursor: grab; border: 1px solid var(--borde); font-size: 13px; }
.k-card:hover { border-color: var(--azul-claro); }
.k-card b { display: block; font-size: 13.5px; }
.k-card .fila { display: flex; justify-content: space-between; gap: 6px; align-items: center; margin-top: 5px; color: var(--muted); font-size: 12px; }

/* Calendario timeline */
.cal-wrap { overflow-x: auto; border: 1px solid var(--borde); border-radius: 12px; background: #fff; }
.cal { display: grid; min-width: 980px; position: relative; }
.cal-h { position: sticky; top: 0; background: var(--gris-50); font-size: 12px; font-weight: 600; color: var(--gris-700); border-bottom: 1px solid var(--borde); text-align: center; padding: 7px 0; }
.cal-h.hoy { color: var(--azul); }
.cal-u { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--gris-100); background: #fff; position: sticky; left: 0; z-index: 2; border-right: 1px solid var(--borde); min-height: 58px; }
.cal-u img { width: 52px; height: 30px; object-fit: cover; border-radius: 6px; }
.cal-u b { font-size: 13px; display: block; }
.cal-u small { color: var(--muted); font-size: 11.5px; }
.cal-fila { position: relative; border-bottom: 1px solid var(--gris-100); min-height: 58px; background-image: linear-gradient(90deg, var(--gris-100) 1px, transparent 1px); }
.cal-ev { position: absolute; top: 6px; bottom: 6px; border-radius: 8px; padding: 4px 8px; font-size: 11.5px; overflow: hidden; cursor: pointer; border-left: 4px solid; line-height: 1.25; }
.cal-ev b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev span { white-space: nowrap; }
.cal-ev.confirmado, .cal-ev.asignado { background: #dbe9ff; border-color: var(--azul); color: #12408f; }
.cal-ev.en_ejecucion { background: #d6f3e2; border-color: var(--verde); color: #0f5e32; }
.cal-ev.apartado_pendiente { background: #fff1c7; border-color: #eab308; color: #7a5600; }
.cal-ev.cotizado, .cal-ev.negociacion { background: #f1f5f9; border-color: #94a3b8; color: #475569; border-left-style: dashed; }
.cal-ev.mantenimiento { background: repeating-linear-gradient(135deg, #eceff4, #eceff4 6px, #e2e6ec 6px, #e2e6ec 12px); border-color: #94a3b8; color: #475569; }
.cal-ev.bloqueo { background: #ffe9d5; border-color: #f97316; color: #9a3d07; }
.cal-ev.conflicto { background: #fde2e3 !important; border-color: var(--rojo) !important; color: #8c1d22 !important; }
.cal-ahora { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--rojo); z-index: 3; pointer-events: none; }
.leyenda { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--gris-700); margin-top: 10px; }
.leyenda span { display: inline-flex; gap: 6px; align-items: center; }
.leyenda i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: #f7f9fc; overflow-y: auto; }
.msg { max-width: 78%; border-radius: 14px; padding: 9px 12px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0, 0, 0, .04); }
.msg .meta { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; justify-content: flex-end; }
.msg.in { background: #fff; align-self: flex-start; border: 1px solid var(--borde); }
.msg.out { background: #dcf3e4; align-self: flex-end; }
.msg.out.ia { background: #e8f0ff; }
.msg .autor { font-size: 11.5px; font-weight: 700; color: var(--azul); margin-bottom: 2px; }
.msg.nota { background: #fff8db; align-self: center; font-size: 12.5px; max-width: 90%; }
.msg.sistema { align-self: center; background: var(--gris-100); color: var(--gris-700); font-size: 12px; max-width: 90%; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--borde); background: #fff; border-radius: 0 0 14px 14px; }
.chat-input textarea { min-height: 42px; height: 42px; flex: 1; }

/* Documento imprimible (contratos, cotizaciones) */
.doc-prev { background: #fff; border: 1px solid var(--borde); border-radius: 10px; padding: 26px 30px; font-family: Georgia, 'Times New Roman', serif; font-size: 12.5px; line-height: 1.55; max-height: 70vh; overflow: auto; }
.doc-prev h1 { font-family: var(--titulos); font-size: 15px; text-align: center; margin-bottom: 10px; }
.doc-prev h2 { font-family: var(--titulos); font-size: 13px; margin: 12px 0 6px; }
.doc-prev table { border-collapse: collapse; width: 100%; }
.doc-prev td, .doc-prev th { border: 1px solid #ccd; padding: 4px 6px; text-align: left; }
.doc-prev .falta { background: #fff1c2; color: #8a5a00; padding: 0 3px; border-radius: 3px; font-family: var(--texto-f); font-size: 11.5px; }
.doc-prev .firmas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; text-align: center; font-size: 11px; }
.doc-prev .firmas div { border-top: 1px solid #333; padding-top: 6px; }

/* Misceláneos */
.barra { height: 8px; background: var(--gris-100); border-radius: 99px; overflow: hidden; }
.barra > i { display: block; height: 100%; background: var(--azul); border-radius: 99px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex.wrap { flex-wrap: wrap; }
.flex.entre { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.t-der { text-align: right; }
.b { font-weight: 600; }
.chico { font-size: 12.5px; }
.sep { border: 0; border-top: 1px solid var(--borde); margin: 14px 0; }
.dona-wrap { position: relative; height: 210px; }
.dona-centro { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; text-align: center; }
.dona-centro b { font-family: var(--titulos); font-size: 24px; display: block; color: var(--navy); }
.leg-tabla { width: 100%; font-size: 13px; border-collapse: collapse; }
.leg-tabla td { padding: 5px 4px; }
.leg-tabla i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.chart-box { position: relative; height: 250px; }
.cargando { display: grid; place-items: center; padding: 60px; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--gris-200); border-top-color: var(--azul); border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.fotos img, .fotos .add { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 9px; border: 1px solid var(--borde); }
.fotos .add { display: grid; place-items: center; color: var(--muted); cursor: pointer; background: var(--gris-50); }
.drop { border: 2px dashed var(--gris-300); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; }
.drop:hover { border-color: var(--azul); color: var(--azul); }
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.login .lado { background: linear-gradient(160deg, rgba(11, 36, 71, .25), rgba(11, 36, 71, .85)), url(/img/operador.jpg) 70% center/cover; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; }
.login .lado h2 { font-size: 36px; font-weight: 700; line-height: 1.1; }
.login .forma { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login .caja { width: 100%; max-width: 380px; }
.login .logo-grande { height: 100px; background: url(/img/logo-completo.jpg) center/contain no-repeat; margin-bottom: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-8-4, .g-12-8 { grid-template-columns: minmax(0, 1fr); }
  .hero .img { flex-basis: 380px; }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.abierta { transform: none; box-shadow: var(--sombra-lg); }
  .topbar .hamb { display: inline-flex; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .hero .img, .hero .lema { display: none; }
  .contenido { padding: 16px; }
  .topbar { padding: 8px 16px; }
  .usuario-tb .nm, .usuario-tb .rl { display: none; }
  .login { grid-template-columns: 1fr; }
  .login .lado { display: none; }
}
@media (max-width: 640px) {
  .form, .form.c3 { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: minmax(0, 1fr); }
  .hero h1, .encabezado h1 { font-size: 25px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .val { font-size: 21px; }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .contenido { padding: 0; }
  body { background: #fff; }
}
