/* Demo de distribución · identidad compartida: negro oliva de fondo, verde lima de acento, Inter Tight.
   La usan el sistema interno, el portal de clientes y la portada. */
@font-face { font-family: "Inter Tight"; src: url("fonts/InterTight.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --bg: #0B0C0A; --bg2: #131511; --bg3: #1A1D17; --bg4: #22261E; --line: #262A22; --line2: #353B2E;
  --text: #EEF1E6; --muted: #9EA692; --dim: #6C7363;
  --lime: #C6F135; --lime2: #A8D12A; --limesoft: #1E2710; --limeglow: rgba(198, 241, 53, .22); --olive: #7E9A3A; --ink: #0B0C0A;
  --amber: #F5B83D; --ambersoft: #2A2110; --red: #FF5C5C; --redsoft: #2C1414; --blue: #58A6FF; --bluesoft: #10203A; --teal: #3DD9B6; --tealsoft: #0F2A24;
  --font: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.23, 1, .32, 1); --r: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; }
a { color: inherit; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
/* campos a 16 px en pantallas táctiles: así el iPhone no hace zoom al tocarlos */
@media (pointer: coarse) { input, select, textarea { font-size: 16px !important; } }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
button:focus:not(:focus-visible) { outline: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; } }
.muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: 12.5px; } .tiny { font-size: 11px; } .lime { color: var(--lime); } .red { color: var(--red); } .amber { color: var(--amber); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* iconos (trazo) */
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; vertical-align: middle; }
svg.i.s { width: 15px; height: 15px; } svg.i.l { width: 22px; height: 22px; }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 10px 15px; font-weight: 700; font-size: 13.5px; background: var(--lime); color: var(--ink); white-space: nowrap; text-decoration: none; transition: transform 160ms var(--ease), background-color 160ms ease, opacity 160ms ease, border-color 160ms ease; min-height: 40px; }
.btn:active { transform: scale(.97); }
.btn.sec { background: var(--bg3); color: var(--text); border: 1px solid var(--line2); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line2); }
.btn.ok { background: #2E9E6B; color: #fff; } .btn.bad { background: #8E2222; color: #fff; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 10px; min-height: 32px; }
.btn:disabled { opacity: .4; cursor: default; }
@media (hover: hover) { .btn:hover { filter: brightness(1.06); } .btn.sec:hover, .btn.ghost:hover { border-color: var(--lime); } }

/* píldoras de estado */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--bg4); color: var(--text); white-space: nowrap; line-height: 1.4; }
.pill.lime { background: var(--limesoft); color: var(--lime); } .pill.ok { background: #12281D; color: #5FD39A; } .pill.warn { background: var(--ambersoft); color: var(--amber); }
.pill.bad { background: var(--redsoft); color: #FF8A8A; } .pill.info { background: var(--bluesoft); color: #8CC2FF; } .pill.teal { background: var(--tealsoft); color: var(--teal); } .pill.dim { background: var(--bg3); color: var(--muted); }
.pill i.pt { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.ejemplo { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; color: var(--amber); background: var(--ambersoft); border: 1px solid #4A3A18; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }

/* tarjetas */
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; min-width: 0; }
.card h3 { margin: 0 0 12px 0; font-size: 14px; font-weight: 800; letter-spacing: -.005em; display: flex; align-items: center; gap: 8px; }
.card h3 .muted { font-weight: 600; }
.card.limec { background: linear-gradient(135deg, #1B2410 0%, #141A0C 100%); border-color: #3A4A1C; }
.card.flat { background: transparent; }

/* indicadores */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.kpi { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 15px; display: flex; flex-direction: column; gap: 8px; min-width: 0; animation: sube 260ms var(--ease) both; }
.kpi:nth-child(2) { animation-delay: 30ms; } .kpi:nth-child(3) { animation-delay: 60ms; } .kpi:nth-child(4) { animation-delay: 90ms; } .kpi:nth-child(5) { animation-delay: 120ms; } .kpi:nth-child(6) { animation-delay: 150ms; }
@keyframes sube { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.kpi .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .ic { width: 34px; height: 34px; border-radius: 11px; background: var(--limesoft); color: var(--lime); display: grid; place-items: center; flex: 0 0 34px; }
.kpi .ic.warn { background: var(--ambersoft); color: var(--amber); } .kpi .ic.bad { background: var(--redsoft); color: var(--red); } .kpi .ic.info { background: var(--bluesoft); color: var(--blue); } .kpi .ic.teal { background: var(--tealsoft); color: var(--teal); }
.kpi small { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; line-height: 1.3; }
.kpi b { font-size: clamp(20px, 1.7vw, 27px); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kpi b.lime { color: var(--lime); } .kpi b.red { color: var(--red); } .kpi b.amber { color: var(--amber); }
.kpi .s { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.delta { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.up { background: #12281D; color: #5FD39A; } .delta.dn { background: var(--redsoft); color: #FF8A8A; }

/* tablas */
.tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabla th { text-align: left; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabla td { padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla td.num, .tabla th.num { text-align: right; }
.tabla tr.clic { cursor: pointer; } @media (hover: hover) { .tabla tr.clic:hover td { background: var(--bg3); } }
.tabla .nw { white-space: nowrap; }
.scrollx { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* barras */
.barra { height: 8px; border-radius: 999px; background: var(--bg4); overflow: hidden; min-width: 50px; }
.barra i { display: block; height: 100%; background: var(--lime); border-radius: 999px; }
.barra i.warn { background: var(--amber); } .barra i.bad { background: var(--red); } .barra i.info { background: var(--blue); } .barra i.teal { background: var(--teal); }

/* formularios */
.lbl { display: block; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 12px 0 6px 0; }
.txt { width: 100%; border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px; background: var(--bg); color: var(--text); font-size: 14px; min-height: 42px; }
.txt:focus { border-color: var(--lime); outline: none; }
input[type=range] { width: 100%; accent-color: var(--lime); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; background: var(--bg); }
.qty button { width: 36px; height: 36px; border: 0; background: var(--bg3); color: var(--text); font-weight: 800; font-size: 16px; }
.qty input { width: 64px; border: 0; background: transparent; text-align: center; font-weight: 700; height: 36px; font-variant-numeric: tabular-nums; }

/* chips y pestañas */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { background: var(--bg3); border: 1px solid var(--line2); color: var(--text); border-radius: 999px; padding: 7px 12px; font-size: 12.5px; font-weight: 600; transition: border-color 160ms ease, background-color 160ms ease; }
.chips button.on { background: var(--lime); color: var(--ink); border-color: var(--lime); }
@media (hover: hover) { .chips button:hover { border-color: var(--lime); } }
.seg { display: inline-flex; background: var(--bg3); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 12.5px; padding: 7px 13px; border-radius: 999px; white-space: nowrap; }
.seg button.on { background: var(--text); color: var(--ink); }

/* hoja (modal) y aviso */
.hoja-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .62); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; animation: aparece 160ms var(--ease) both; }
.hoja { background: var(--bg2); border: 1px solid var(--line2); border-radius: 22px; padding: 20px; width: 100%; max-width: 580px; max-height: min(88vh, 900px); overflow: auto; animation: brota 220ms var(--ease) both; }
.hoja.ancha { max-width: 860px; }
.hoja .cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.hoja .cab h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; line-height: 1.2; }
.hoja .cerrar { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg3); display: grid; place-items: center; flex: 0 0 38px; }
.hoja .pie { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
@media (max-width: 640px) { .hoja-bg { align-items: flex-end; padding: 0; } .hoja { border-radius: 22px 22px 0 0; max-height: 92vh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); } }
@keyframes aparece { from { opacity: 0; } } @keyframes brota { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.aviso { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: var(--ink); padding: 11px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 700; z-index: 70; animation: avisa 220ms var(--ease) both; max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.aviso.lime { background: var(--lime); }
@keyframes avisa { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }

/* chat */
.chat { display: flex; flex-direction: column; gap: 10px; }
.burbuja { max-width: 86%; border-radius: 16px; padding: 10px 13px; font-size: 13.5px; line-height: 1.5; white-space: pre-line; }
.burbuja.yo { margin-left: auto; background: var(--lime); color: var(--ink); border-bottom-right-radius: 5px; font-weight: 600; }
.burbuja.ia { background: var(--bg3); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.burbuja.ia .fuente { display: block; margin-top: 8px; font-size: 11px; color: var(--muted); }

/* vacío */
.vacio { text-align: center; padding: 28px 12px; color: var(--muted); font-size: 13.5px; }
.vacio svg.i { width: 30px; height: 30px; color: var(--dim); display: block; margin: 0 auto 8px auto; }

/* medidor, onda de combustible y brújula (tarjeta del vehículo) */
.medidor { position: relative; width: 100%; max-width: 180px; margin: 0 auto; }
.medidor svg { display: block; width: 100%; height: auto; }
.medidor .v { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; }
.medidor .v b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.medidor .v span { font-size: 11px; color: var(--muted); }
.onda { position: relative; width: 84px; height: 84px; border-radius: 50%; border: 2px solid var(--line2); overflow: hidden; background: var(--bg); flex: 0 0 84px; }
.onda .agua { position: absolute; left: -50%; width: 200%; bottom: 0; background: var(--lime); opacity: .9; }
.onda .agua::before { content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 18px; background: radial-gradient(ellipse at 50% 100%, var(--lime) 60%, transparent 62%) 0 0 / 28px 18px repeat-x; animation: ola 2.4s linear infinite; }
.onda.baja .agua, .onda.baja .agua::before { background-color: var(--amber); }
.onda.baja .agua::before { background: radial-gradient(ellipse at 50% 100%, var(--amber) 60%, transparent 62%) 0 0 / 28px 18px repeat-x; }
.onda .pct { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 17px; color: var(--text); text-shadow: 0 1px 6px rgba(0, 0, 0, .7); font-variant-numeric: tabular-nums; }
@keyframes ola { from { background-position-x: 0; } to { background-position-x: 28px; } }
.brujula { width: 84px; height: 84px; flex: 0 0 84px; }
.brujula svg { width: 100%; height: 100%; display: block; }

/* mapa */
.mapa { position: relative; width: 100%; }
.mp { width: 100%; height: auto; display: block; }
.mp-vecinos { fill: #0E100C; stroke: #1C2018; stroke-width: 1; }
.mp-pais { fill: #151812; stroke: #3A4231; stroke-width: 1.3; stroke-linejoin: round; }
.mp-punto { fill: #2A3024; }
.mp-ruta { fill: none; stroke: #3A4231; stroke-width: 1.4; stroke-dasharray: 3 5; }
.mp-ruta.on { stroke: var(--lime); stroke-width: 2.2; stroke-dasharray: 7 7; opacity: .95; filter: drop-shadow(0 0 4px rgba(198, 241, 53, .45)); animation: marcha 1.4s linear infinite; }
@keyframes marcha { to { stroke-dashoffset: -28; } }
.mp-lbl { fill: var(--muted); font-size: 14px; font-weight: 700; font-family: var(--font); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.mp-lbl.fuerte { fill: var(--text); }
.mp-veh { fill: var(--text); font-size: 12px; font-weight: 800; font-family: var(--font); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; letter-spacing: .02em; }
.mp-bod-in { fill: var(--lime); stroke: var(--bg); stroke-width: 3; }
.mp-pulso { fill: none; stroke: var(--lime); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: pulso 2.4s var(--ease) infinite; }
@keyframes pulso { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.mp-cam { cursor: pointer; }
.mp-cam .mp-dot { fill: var(--lime); stroke: var(--bg); stroke-width: 2.5; }
.mp-cam .mp-flecha { fill: var(--ink); }
.mp-cam .mp-halo { fill: rgba(198, 241, 53, .16); transform-box: fill-box; transform-origin: center; animation: halo 2s ease-in-out infinite; }
.mp-cam.sel .mp-halo { fill: rgba(198, 241, 53, .28); stroke: var(--lime); stroke-width: 1.5; }
.mp-cam.alerta .mp-dot { fill: var(--amber); } .mp-cam.alerta .mp-halo { fill: rgba(245, 184, 61, .2); }
@keyframes halo { 50% { transform: scale(1.18); } }
.mp-cedis { cursor: pointer; }
.leyenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.leyenda i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
