/* NOX ATAK — panel de mando. Tema rojo y negro por defecto, claro opcional. */
:root {
  --bg: #050506;
  --panel: #0e0e10;
  --panel-2: #161618;
  --line: #2a2a2e;
  --text: #ececee;
  --muted: #8e8e97;
  --accent: #e3162b;
  --accent-ink: #ffffff;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #ff5a5f;
  --bad-bg: #3a0d10;
  --friendly: #3b82f6;
  --hostile: #ef4444;
  --neutral: #22c55e;
  --unknown: #eab308;
  --shadow: 0 8px 28px rgba(0, 0, 0, .6);
  --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f1f1f2;
  --panel: #ffffff;
  --panel-2: #f6f6f7;
  --line: #dcdcdf;
  --text: #121214;
  --muted: #62626b;
  --accent: #c8102e;
  --accent-ink: #ffffff;
  --bad: #d92d20;
  --bad-bg: #fde8e8;
  --shadow: 0 8px 28px rgba(0, 0, 0, .16);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.spacer { flex: 1; }

/* ---------- Controles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; }
.btn-danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { background: none; border: 0; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 16px; }
.icon-btn:hover { background: var(--panel-2); }
input, select, textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
label { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--text); font-size: 14px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 13px; }
label.check input { width: auto; margin: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { background: var(--bad-bg); color: var(--bad); border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; font-size: 13px; }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; letter-spacing: .08em; white-space: nowrap; color: var(--text); text-decoration: none; }
.brand img { width: 26px; height: 26px; }
.brand b { color: var(--accent); font-weight: 800; }

/* ---------- Página de ingreso (siempre oscura, ES/EN) ---------- */
.landing { --bg: #050506; --panel: #0e0e10; --panel-2: #141416; --line: #26262b; --text: #f2f2f3; --muted: #9a9aa3;
  --accent: #e3162b; --accent-ink: #fff; --bad: #ff5a5f; --bad-bg: #3a0d10; color-scheme: dark;
  min-height: 100%; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }
.landing h1, .landing h2, .landing h3 { line-height: 1.12; margin: 0; letter-spacing: -.01em; }
.landing h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; }
.landing h3 { font-size: 17px; font-weight: 700; }
.landing a { text-decoration: none; }
.l-wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.landing .btn:not(.btn-sm) { padding: 11px 20px; font-weight: 700; }
.landing .btn-primary:hover { background: #ff2438; border-color: #ff2438; }
.btn-ghost { background: transparent; border-color: #44444b; color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: #fff; }
.btn-light { background: #fff; border-color: #fff; color: #0a0a0b; }
.btn-light:hover { background: #050506; border-color: #050506; color: #fff; }

.l-nav { position: sticky; top: 0; z-index: 50; background: rgba(5, 5, 6, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.l-nav-in { height: 64px; display: flex; align-items: center; gap: 28px; }
.l-links { display: flex; gap: 22px; }
.l-links a { color: var(--muted); font-size: 14px; font-weight: 500; }
.l-links a:hover { color: #fff; }
.l-lang { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.l-lang button { background: none; border: 0; padding: 5px 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; color: var(--muted); cursor: pointer; }
.l-lang button.active { background: var(--accent); color: #fff; }

.l-eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--accent); font-size: 12.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.l-eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent); flex-shrink: 0; }

.l-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line);
  background: radial-gradient(900px 520px at 85% 10%, rgba(227, 22, 43, .22), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 48px), var(--bg); }
.l-hero-in { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 56px; align-items: center; padding-top: 84px; padding-bottom: 92px; }
.l-hero h1 { font-size: clamp(34px, 5.4vw, 64px); font-weight: 900; letter-spacing: -.025em; }
.l-hero h1 em { font-style: normal; color: var(--accent); }
.l-lead { color: #c4c4cb; font-size: clamp(16px, 1.6vw, 18.5px); margin: 22px 0 30px; max-width: 620px; }
.l-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.l-tags { list-style: none; padding: 0; margin: 34px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: 13.5px; }
.l-tags li::before { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--accent); margin-right: 8px; vertical-align: 2px; }

.login-card { position: relative; width: 100%; background: rgba(14, 14, 16, .94); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 10px; padding: 30px 28px 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .65); }
.login-card h2 { font-size: 26px; }
.login-card .l-eyebrow { margin-bottom: 10px; }
.login-card .muted { margin: 6px 0 22px; font-size: 14px; }
.login-card label > input:not([type="checkbox"]) { background: #070708; padding: 10px 12px; }
.l-anchor { position: absolute; top: -90px; }
.l-fine { margin: 16px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.l-section { padding: 96px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 64px; }
.l-alt { background: #0a0a0c; }
.l-sub { color: #b9b9c1; font-size: 16.5px; max-width: 640px; margin: 16px 0 0; }
.l-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 44px; }
.l-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 24px 22px; transition: border-color .15s, transform .15s; }
.l-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.l-card p { color: var(--muted); margin: 10px 0 0; font-size: 14.5px; }
.l-num { display: block; font-family: var(--mono); color: var(--accent); font-size: 13px; font-weight: 700; margin-bottom: 16px; }
.l-callout { margin: 28px 0 0; padding: 16px 20px; border-left: 3px solid var(--accent); background: linear-gradient(90deg, rgba(227, 22, 43, .1), transparent); color: #d6d6dc; }

.l-visual { margin: 0; padding: 72px 0; border-bottom: 1px solid var(--line); background: radial-gradient(700px 300px at 50% 0%, rgba(227, 22, 43, .14), transparent 70%), var(--bg); }
.l-screen { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.l-visual figcaption { margin-top: 14px; color: var(--muted); font-size: 13.5px; text-align: center; }

.l-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.l-checks { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 12px; }
.l-checks li { position: relative; padding-left: 30px; color: #d6d6dc; }
.l-checks li::before { content: ""; position: absolute; left: 1px; top: 6px; width: 13px; height: 7px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }
.l-spec { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.l-spec div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.l-spec div:last-child { border-bottom: 0; }
.l-spec dt { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .1em; padding-top: 2px; }
.l-spec dd { margin: 0; font-family: var(--mono); font-size: 14px; }

.l-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin-top: 44px; }
.l-cols > div { border-top: 2px solid var(--accent); padding-top: 20px; }
.l-cols p { color: var(--muted); margin: 10px 0 0; }

.l-faq { max-width: 860px; }
.l-faq h2 { margin-bottom: 28px; }
.l-faq details { border-bottom: 1px solid var(--line); }
.l-faq summary { list-style: none; cursor: pointer; padding: 20px 40px 20px 0; position: relative; font-size: 17px; font-weight: 650; }
.l-faq summary::-webkit-details-marker { display: none; }
.l-faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-size: 26px; font-weight: 400; color: var(--accent); }
.l-faq details[open] summary::after { content: "\2212"; }
.l-faq details p { margin: 0 0 22px; color: #b9b9c1; }

.l-band { background: var(--accent); color: #fff; padding: 56px 0; }
.l-band-in { display: flex; align-items: center; gap: 24px; justify-content: space-between; flex-wrap: wrap; }
.l-band p { margin: 8px 0 0; color: rgba(255, 255, 255, .88); }
.l-foot { padding: 28px 0 36px; color: var(--muted); font-size: 13px; }
.l-foot-in { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.l-foot p { margin: 0; }

@media (max-width: 980px) {
  .l-links { display: none; }
  .l-nav-in { gap: 12px; }
  .l-hero-in { grid-template-columns: 1fr; gap: 40px; padding-top: 56px; padding-bottom: 64px; }
  .login-card { max-width: 460px; }
  .l-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .l-split, .l-cols { grid-template-columns: 1fr; gap: 32px; }
  .l-section { padding: 72px 0; }
}
@media (max-width: 560px) {
  .l-cards { grid-template-columns: 1fr; }
  .l-spec div { grid-template-columns: 1fr; gap: 2px; }
  .l-cta .btn { flex: 1; }
  .login-card { padding: 24px 18px 20px; }
  .l-nav .brand img { display: none; }
}

/* ---------- Estructura ---------- */
.app { height: 100%; display: flex; flex-direction: column; }
.topbar { height: 52px; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: var(--panel); border-bottom: 2px solid var(--accent); flex-shrink: 0; }
.conn { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.conn i { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); }
.conn.ok i { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.conn.bad i { background: var(--bad); }
.chips { display: flex; gap: 6px; }
.chip { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; color: var(--muted); }
.chip b { color: var(--text); }
.chip-alert { background: var(--bad); border-color: var(--bad); color: #fff; cursor: pointer; animation: pulse 1.2s infinite; }
.chip-alert b { color: #fff; }
.main { flex: 1; display: flex; min-height: 0; position: relative; }

.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 6px; cursor: pointer; font-weight: 600; }
.team-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7); display: inline-block; flex-shrink: 0; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 1200; padding: 6px; }
.dropdown-head { padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.dropdown button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px; border-radius: 6px; cursor: pointer; }
.dropdown button:hover { background: var(--panel-2); }

/* ---------- Panel lateral ---------- */
.sidebar { width: 390px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; z-index: 500; }
.tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); flex-shrink: 0; scrollbar-width: none; }
.tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: 11px 8px; cursor: pointer; color: var(--muted); font-size: 13px; white-space: nowrap; position: relative; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.badge { background: var(--bad); color: #fff; border-radius: 999px; font-size: 10.5px; padding: 0 5px; margin-left: 2px; }
.panels { flex: 1; min-height: 0; position: relative; }
.panel { position: absolute; inset: 0; overflow-y: auto; padding: 12px; display: none; }
.panel.active { display: block; }
.panel.chat-panel.active { display: flex; flex-direction: column; padding: 0; }
.panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.panel-head h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); flex: 1; }
.section-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 8px; }
.search { margin-bottom: 10px; }
.empty { color: var(--muted); text-align: center; padding: 26px 8px; font-size: 13px; }

.list { display: flex; flex-direction: column; gap: 6px; }
.row-card { display: flex; gap: 10px; align-items: center; padding: 9px 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.row-card:hover { border-color: var(--accent); }
.row-card .grow { flex: 1; min-width: 0; }
.row-card .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-card .sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-card.stale { opacity: .5; }
.row-card .sym { width: 26px; height: 26px; flex-shrink: 0; display: grid; place-items: center; }
.row-card .right { text-align: right; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.bat { font-size: 11.5px; }
.bat.low { color: var(--bad); }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; font-size: 13px; margin: 8px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- Chat ---------- */
.chat-top { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.chat-top select { margin: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 85%; align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px 10px 10px 2px; padding: 6px 10px; }
.msg.mine { align-self: flex-end; background: color-mix(in srgb, var(--accent) 22%, var(--panel-2)); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 10px 10px 2px 10px; }
.msg .meta { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.msg .meta b { color: var(--text); }
.msg .body { white-space: pre-wrap; word-break: break-word; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-form textarea { min-height: 40px; height: 40px; margin: 0; }

/* ---------- Alertas ---------- */
.alert-banner { background: var(--bad); color: #fff; padding: 8px 14px; display: flex; gap: 12px; align-items: center; font-weight: 600; animation: pulse 1.2s infinite; flex-shrink: 0; z-index: 900; }
.alert-banner button { background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .4); color: #fff; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.alert-card { border-left: 4px solid var(--bad); }
.alert-card.resolved { border-left-color: var(--line); opacity: .65; }
@keyframes pulse { 50% { filter: brightness(1.25); } }

/* ---------- Mapa ---------- */
.map-wrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: #0a0a0c; }
.map-tools { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 800; display: flex; gap: 6px; }
.map-tools button { background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 6px 10px; cursor: pointer; box-shadow: var(--shadow); font-size: 12.5px; }
.map-tools button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.coords { position: absolute; left: 10px; bottom: 22px; z-index: 800; background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; font-family: var(--mono); font-size: 12px; display: flex; gap: 12px; pointer-events: none; }
#coords-mgrs { color: var(--accent); }

.leaflet-container { font: 13px/1.4 var(--font); }
.tiles-dark { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.6); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 12px 14px; min-width: 230px; }
.leaflet-popup-content h4 { margin: 0 0 2px; font-size: 15px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-bar a, .leaflet-control-layers, .leaflet-control-layers-toggle { background-color: var(--panel); color: var(--text); border-color: var(--line); }
.leaflet-control-layers { color: var(--text); }
:root:not([data-theme="light"]) .leaflet-control-layers-toggle, :root:not([data-theme="light"]) .leaflet-pm-toolbar .control-icon { filter: invert(1) hue-rotate(180deg); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--panel) 80%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--muted); }

.sym-icon { background: none; border: 0; }
.unit-icon { background: none; border: 0; }
.unit-icon .lbl, .sym-icon .lbl { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 1px; white-space: nowrap; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 2px #000; pointer-events: none; }
.unit-icon.stale { opacity: .45; }
.alert-pulse { border-radius: 50%; background: rgba(239, 68, 68, .35); border: 2px solid #ef4444; animation: ring 1.4s infinite; }
@keyframes ring { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.rb-label { background: var(--panel); color: var(--text); border: 1px solid var(--accent); border-radius: 6px; padding: 3px 7px; font-family: var(--mono); font-size: 12px; white-space: nowrap; box-shadow: var(--shadow); }

/* ---------- Modal y avisos ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 2000; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.modal-wide { max-width: 640px; }
.modal header { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal header h3 { margin: 0; font-size: 16px; flex: 1; }
.modal .content { padding: 16px 18px; }
.modal footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.aff-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 12px; }
.aff-picker button { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.aff-picker button.sel { border-color: var(--accent); outline: 1px solid var(--accent); }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 10px 14px; box-shadow: var(--shadow); max-width: 360px; animation: slidein .2s ease-out; }
.toast.bad { border-left-color: var(--bad); }
.toast.ok { border-left-color: var(--ok); }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } }

table.grid { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.grid th, table.grid td { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid th { color: var(--muted); font-weight: 600; }
.subtabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.subtabs button { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 12.5px; }
.subtabs button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.stat b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 11.5px; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; }
.file-link { cursor: pointer; color: var(--accent); text-decoration: underline; background: none; border: 0; padding: 0; }

.only-mobile { display: none; }
@media (max-width: 820px) {
  .only-mobile { display: inline-block; }
  .chips, .conn span { display: none; }
  .topbar { gap: 8px; padding: 0 8px; }
  .sidebar { position: absolute; inset: 0 auto 0 0; width: min(390px, 92vw); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .map-tools { left: auto; right: 54px; transform: none; top: 10px; flex-direction: column; align-items: flex-end; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .alert-banner { font-size: 12.5px; padding: 6px 10px; gap: 8px; }
  .alert-banner > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
  .alert-banner .spacer { display: none; }
  .alert-banner button { white-space: nowrap; padding: 3px 8px; }
  .coords { bottom: 30px; font-size: 11px; flex-direction: column; gap: 0; }
}

/* ---------- Funciones tácticas (v1.1) ---------- */
.sym-icon > div > svg { display: block; overflow: visible; }
.sym-badge { position: absolute; top: -4px; right: -8px; min-width: 15px; height: 15px; border-radius: 8px; background: var(--accent); color: #fff; font: 800 10px/15px var(--font); text-align: center; border: 1.5px solid #000; }
.ring-label { background: none; border: 0; color: #fff; font: 600 11px var(--mono); text-shadow: 0 0 3px #000, 0 0 3px #000; white-space: nowrap; transform: translate(-50%, -120%); }
.grid-label { background: none; border: 0; white-space: nowrap; font: 700 11px var(--mono); text-shadow: 0 0 3px #000, 0 0 3px #000; pointer-events: none; }
.grid-label-e, .grid-label-n { color: #fff; transform: translate(4px, -16px); }
.grid-label-sq { color: #ff4757; font-size: 15px; transform: translate(-50%, -50%); }
.sym-row { display: flex; gap: 12px; align-items: center; margin: 4px 0 6px; }
.sym-row .grow { flex: 1; min-width: 0; }
.sym-preview { width: 76px; height: 76px; flex-shrink: 0; display: grid; place-items: center; background: #f2f2f3; border-radius: 8px; border: 1px solid var(--line); }
.sym-preview svg { max-width: 70px; max-height: 70px; }
.checks { display: flex; flex-direction: column; gap: 6px; justify-content: center; padding-top: 14px; }
.checks label.check { margin: 0; }
fieldset.fence { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 4px; margin: 0 0 10px; }
fieldset.fence legend { color: var(--accent); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; padding: 0 6px; }
.checkpoints { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 8px; max-height: 180px; overflow-y: auto; }
.form-grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.form-grid-5 label { font-size: 11.5px; }
.report-form details { margin: 4px 0 10px; }
.report-form summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.report-line { display: flex; align-items: center; gap: 10px; margin: 6px 0 6px; font-size: 13px; font-weight: 600; }
.report-line b { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
.report-line .mono { margin-left: auto; color: var(--accent); }
pre.readout { background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; padding: 8px 10px; margin: 8px 0; font: 12px/1.45 var(--mono); white-space: pre-wrap; max-height: 260px; overflow: auto; }
table.legs { margin: 6px 0; font-size: 12px; }
table.legs td, table.legs th { padding: 4px 5px; }
.pkg-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.pkg-list label.check { margin: 0; }
.nv-btn.active { background: var(--accent); color: #fff; }
.map-tools button[data-tool="medevac"] { color: #ff6b78; }

/* Visión nocturna: rojo monocromo atenuado sobre toda la interfaz. */
:root[data-nv="1"] body { filter: grayscale(1) sepia(1) saturate(7) hue-rotate(-38deg) brightness(.62) contrast(1.15); background: #000; }

@media (max-width: 820px) {
  .form-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .checkpoints { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sym-row { flex-direction: column; align-items: stretch; }
  .sym-preview { align-self: center; }
}
.row-card .sym { position: relative; }
.form-grid-5 label { display: flex; flex-direction: column; justify-content: flex-end; }
.l-cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 980px) { .l-cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .l-cards-3 { grid-template-columns: 1fr; } }
#interop .l-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 980px) { #interop .l-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { #interop .l-cols { grid-template-columns: 1fr; } }

/* ---------- Terreno (v1.2) ---------- */
#coords-elev { color: #f2f2f3; }
#coords-elev:not(:empty)::before { content: "▲ "; color: var(--accent); }
.profile-chart { color: var(--text); margin: 8px 0; min-height: 120px; }
.profile-svg { display: block; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.los-verdict { padding: 8px 12px; border-radius: 6px; font-weight: 650; margin: 4px 0 6px; font-size: 13.5px; }
.los-verdict.ok { background: rgba(34, 197, 94, .14); color: #4ade80; border: 1px solid rgba(34, 197, 94, .4); }
.los-verdict.bad { background: var(--bad-bg); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent); }
.modal .stat-grid .stat b { font-size: 16px; }
.map-tools { width: max-content; max-width: calc(100% - 140px); flex-wrap: wrap; justify-content: center; }
.map-tools button { white-space: nowrap; }
@media (max-width: 820px) { .map-tools { width: auto; max-width: none; } }

/* ---------- Fuego y sensores (v1.3) ---------- */
.danger-box { border-radius: 6px; padding: 7px 10px; margin: 6px 0; font-size: 12.5px; border: 1px solid var(--line); }
.danger-box.hot { background: var(--bad-bg); color: #fff; border-color: var(--bad); animation: pulse 1.2s infinite; }
.danger-box.hot b { color: var(--bad); margin-right: 4px; }
.danger-box.ok { background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .4); }
.danger-box.warn { background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .45); color: var(--text); }
.danger-text { color: var(--bad) !important; font-weight: 700; }
.target-line { font-size: 12.5px; margin: 4px 0; }
.target-line b { color: var(--accent); font-family: var(--mono); }
.danger-label { color: #ff8a95; }
.danger-label.hot { color: #fff; background: #e3162b; padding: 1px 5px; border-radius: 4px; text-shadow: none; }
.bpha-label { background: none; border: 0; color: #fff; font: 700 11px var(--mono); text-shadow: 0 0 3px #000, 0 0 3px #000; transform: translate(-50%, -50%); white-space: nowrap; }
.polar-out { margin-top: 4px; min-height: 18px; font-size: 12.5px; }
.munitions-grid input { padding: 4px 6px; min-width: 80px; font-size: 12.5px; }
.munitions-grid td { padding: 3px; }
.tabs button { padding: 11px 6px; font-size: 12.5px; flex: 1 0 auto; }
