/* Sistema NetPlus — estilos compartidos (identidad visual 2026: morado #5F1880, cian #00ADD8, tinta #202536) */
@font-face { font-family: 'DejaVu Sans'; src: url('/DejaVuSans.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DejaVu Sans'; src: url('/DejaVuSans-Bold.woff') format('woff'); font-weight: 600 900; font-display: swap; }
:root {
  --purple: #5F1880;
  --purple-dark: #4A1264;
  --navy: #202536;
  --cyan: #00ADD8;
  --ink: #202536;
  --muted: #687184;
  --bg: #EDEFF3;
  --line: #DDE1E8;
  --lavender: #E5DAF5;
  --green: #16a66a;
  --orange: #f59e0b;
  --red: #b52b43;
  --font: "DejaVu Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}
p { margin: 0; color: var(--muted); }
h1 { font-size: 25px; line-height: 1.1; margin: 4px 0 2px; }
h2 { font-size: 20px; margin: 3px 0; }
h3 { margin: 22px 0 8px; }
a { color: var(--purple); }
.hidden { display: none !important; }
.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; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--purple); }
.error { color: #a91f38 !important; }

/* ── Barra superior, secciones y menús ── */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  height: 64px; padding: 0 14px;
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-bottom: 3px solid var(--cyan);
}
.brand-logo { display: block; height: 38px; width: auto; max-width: 42vw; object-fit: contain; }
.nav-ico { width: 20px; height: 20px; flex: none; }
.nav-ico.small { width: 16px; height: 16px; }
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--lavender); color: var(--purple); display: inline-grid; place-items: center; font: 800 13px/1 var(--font); flex: none; }
.main-nav-item { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 10px; color: #4a5164; text-decoration: none; font: 600 15px/1 var(--font); white-space: nowrap; }
.main-nav-item:hover { background: #f3f0f8; color: var(--purple); }
.main-nav-item.active { background: var(--lavender); color: var(--purple-dark); font-weight: 800; }
.site-navigation { position: relative; display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
.current-section { font-size: 15px; font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-btn { display: none; align-items: center; gap: 8px; border: 1px solid #e3e5ee; background: #fff; border-radius: 999px; padding: 4px 10px 4px 4px; cursor: pointer; font: 700 14px/1 var(--font); color: var(--navy); }
.user-btn:hover { background: #f6f4fa; }
.menu-toggle {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0; cursor: pointer;
  border: 1px solid #dce0ea; border-radius: 10px; background: #f3f4f9; color: var(--navy);
  padding: 9px 12px; font: 700 16px/1.2 var(--font);
}
.site-menu {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 1100;
  width: 300px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 100px); overflow: auto;
  padding: 10px; background: #fff; border: 1px solid #dce0ea; border-radius: 14px; box-shadow: 0 16px 44px #20253630;
}
.user-menu { width: 260px; }
.menu-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; border-bottom: 1px solid #e7e9f1; margin-bottom: 6px; }
.menu-user strong { display: block; color: var(--navy); }
.menu-user small { color: var(--muted); }
.site-menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  border: 0; border-radius: 10px; background: transparent; color: #202536; text-decoration: none;
  font: 600 16px/1.3 var(--font); padding: 11px 10px;
}
.site-menu-item small { display: block; font-weight: 500; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.site-menu-item:hover { background: #f1eef7; }
.site-menu-item.active { background: var(--lavender); color: var(--purple-dark); }
.site-menu-item.active small { color: var(--purple); }
.site-menu-item.logout { color: var(--red); }
.menu-personal { border-top: 1px solid #e7e9f1; margin-top: 6px; padding-top: 6px; }
.menu-personal .site-menu-item { font-size: 15px; padding: 9px 10px; }
.menu-toggle:focus-visible, .site-menu-item:focus-visible, .main-nav-item:focus-visible, .sub-tab:focus-visible, .bottom-item:focus-visible, .user-btn:focus-visible { outline: 3px solid #8755cb; outline-offset: 2px; }
/* Pestañas de la sección */
.sub-tabs { position: sticky; top: 64px; z-index: 900; background: #fff; border-bottom: 1px solid var(--line); }
.sub-tabs-in { display: flex; gap: 22px; max-width: 1120px; margin: 0 auto; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.sub-tabs-in::-webkit-scrollbar { display: none; }
.sub-tab { padding: 12px 0 10px; color: #5b6272; text-decoration: none; font: 600 15px/1 var(--font); white-space: nowrap; border-bottom: 3px solid transparent; }
.sub-tab:hover { color: var(--purple); }
.sub-tab.active { color: var(--purple-dark); border-bottom-color: var(--purple); font-weight: 800; }
/* Barra de abajo (técnicos en el celular) */
.bottom-bar { display: none; }
@media (min-width: 960px) {
  .user-btn { display: inline-flex; }
}
@media (max-width: 959px) {
  .user-menu { display: none; }
  body.field-user .user-menu:not(.hidden) { display: block; position: fixed; right: 12px; left: 12px; width: auto; top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.field-user .bottom-bar {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 20px #2025360f;
  }
  body.field-user main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .bottom-item { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; border: 0; background: transparent; color: #5b6272; font: 600 12px/1.1 var(--font); padding: 6px 2px; border-radius: 10px; cursor: pointer; }
  .bottom-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; letter-spacing: -.2px; }
  .bottom-item .nav-ico { width: 24px; height: 24px; }
  .bottom-item.active { color: var(--purple-dark); background: var(--lavender); }
}

/* ── Menú lateral ── */
:root { --side-w: 236px; --side-mini: 64px; --top-h: 64px; }
.env-test { --top-h: 92px; }
.menu-toggle { padding: 8px; border: 0; background: transparent; border-radius: 10px; }
.menu-toggle:hover { background: #f1eef7; }
.menu-toggle .nav-ico { width: 24px; height: 24px; }
.current-section { min-width: 0; }
.crumb-sec { color: var(--muted); font-weight: 600; }
.side-nav {
  position: fixed; left: 0; top: var(--top-h); bottom: 0; z-index: 950; width: var(--side-w);
  background: #fff; border-right: 1px solid var(--line); overflow-y: auto; overflow-x: hidden;
  padding: 10px 8px calc(16px + env(safe-area-inset-bottom)); transition: width .18s, transform .2s;
  display: flex; flex-direction: column;
}
.side-nav:empty { display: none; }
.side-secs { display: grid; gap: 2px; }
.side-sec {
  display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; cursor: pointer;
  padding: 10px 11px; border-radius: 10px; color: #2a3042; text-decoration: none; font: 700 15px/1.2 var(--font); white-space: nowrap; text-align: left;
}
.side-sec:hover { background: #f3f0f8; }
.side-sec.active { color: var(--purple-dark); }
a.side-sec.active, .side-mini .side-sec.active { background: var(--lavender); }
.side-chev { margin-left: auto; transition: transform .18s; color: var(--muted); }
.side-sec.open .side-chev { transform: rotate(180deg); }
.side-subs { display: none; padding: 2px 0 6px 32px; }
.side-sec.open + .side-subs { display: grid; gap: 1px; }
.side-item { display: block; padding: 8px 10px; border-radius: 8px; color: #5b6272; text-decoration: none; font: 600 14.5px/1.25 var(--font); }
.side-item:hover { background: #f3f0f8; color: var(--purple); }
.side-item.active { background: var(--lavender); color: var(--purple-dark); font-weight: 800; }
.side-sec:focus-visible, .side-item:focus-visible { outline: 3px solid #8755cb; outline-offset: -2px; }
.side-user, .side-personal { display: none; }
.side-backdrop { display: none; }
@media (min-width: 960px) {
  body.has-side { padding-left: var(--side-w); transition: padding-left .18s; }
  body.has-side.side-mini { padding-left: var(--side-mini); }
  .side-mini .side-nav { width: var(--side-mini); }
  .side-mini .side-lbl, .side-mini .side-chev, .side-mini .side-subs { display: none !important; }
  .side-mini .side-sec { justify-content: center; padding: 11px 0; }
  .topbar { margin-left: calc(-1 * var(--side-w)); }
  body.side-mini .topbar { margin-left: calc(-1 * var(--side-mini)); }
  .env-banner { margin-left: calc(-1 * var(--side-w)); }
  body.side-mini .env-banner { margin-left: calc(-1 * var(--side-mini)); }
}
@media (max-width: 959px) {
  .side-nav { width: min(300px, 86vw); top: 0; z-index: 1300; transform: translateX(-105%); box-shadow: 0 0 40px #20253640; padding-top: 14px; }
  body.side-open .side-nav { transform: none; }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 1250; background: #1a1f2e66; }
  .side-user { display: flex; }
  .side-personal { display: block; margin-top: auto; }
  .current-section { flex: 1; }
}
/* ── Estructura ── */
main { max-width: 760px; margin: auto; padding: 16px 16px calc(28px + env(safe-area-inset-bottom)); }
.section-head, .form-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-head { margin-bottom: 12px; }
.count { min-width: 38px; height: 38px; padding: 0 10px; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 800; display: grid; place-items: center; }
.message { text-align: center; font-size: 13px; line-height: 1.45; padding: 10px 12px 0; }
.empty-state { background: #fff; border: 1px dashed #cfd4e2; border-radius: 16px; padding: 22px; text-align: center; }
.empty-state strong { display: block; margin-bottom: 6px; }

/* ── Botones y formularios ── */
.primary {
  display: block; width: 100%; text-align: center; text-decoration: none; cursor: pointer;
  border: 0; border-radius: 15px; background: var(--purple); color: #fff;
  font: 800 16px var(--font); padding: 16px; margin-top: 12px; box-shadow: 0 8px 20px #4A126432;
}
.primary:active { transform: translateY(1px); }
.primary:disabled, .secondary:disabled { opacity: .6; }
.secondary {
  width: 100%; cursor: pointer; border: 1px solid #dce0ea; border-radius: 15px; background: #eef0f6; color: var(--navy);
  font: 800 16px var(--font); padding: 14px; margin-top: 12px;
}
.mini-btn { border: 0; border-radius: 10px; background: #EFE7F8; color: var(--purple); font: 800 14px var(--font); padding: 9px 12px; cursor: pointer; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 17px; margin-bottom: 14px; }
.form-card form { margin-top: 12px; }
.form-card label, .field { display: block; color: #41495a; font-size: 14px; font-weight: 700; margin-top: 12px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; border: 1px solid #d8dce6; background: #fafbfe; border-radius: 12px;
  padding: 13px; font: 16px var(--font); color: var(--ink); outline: none;
}
textarea { min-height: 85px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px #5F188018; }
.coord-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-message { text-align: center; font-size: 14px; margin-top: 10px; min-height: 20px; color: var(--green); }
summary { font-size: 18px; font-weight: 700; cursor: pointer; color: var(--navy); }
.hint { font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 6px; }

/* ── Alineador ── */
.tower-card { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tower-select { display: block; max-width: 280px; border: 0; background: transparent; color: var(--ink); font: 800 24px/1.1 var(--font); margin: 3px 0 1px; padding: 0 24px 0 0; box-shadow: none; }
.tower-icon { width: 45px; height: 45px; border-radius: 14px; background: var(--purple); display: grid; place-items: center; color: #fff; font-size: 28px; flex: none; }
#map { height: 34vh; min-height: 260px; max-height: 390px; background: #dfe4ee; border-radius: 20px; overflow: hidden; box-shadow: 0 8px 24px #26305618; }
.leaflet-control-attribution { font-size: 10px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.metrics.three { grid-template-columns: repeat(3, 1fr); }
.metrics article { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 12px 6px; text-align: center; min-width: 0; }
.metrics span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.metrics strong { font-size: 19px; color: var(--navy); white-space: nowrap; }
.aim-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: center; }
.compass { width: 128px; height: 128px; border: 8px solid #edf0f6; border-radius: 50%; position: relative; background: radial-gradient(circle, #fff 0 53%, #f5f7fb 54%); }
.compass > span { position: absolute; font-size: 11px; font-weight: 800; color: #7c8491; }
.north { top: 3px; left: 50%; transform: translateX(-50%); color: var(--purple) !important; }
.south { bottom: 3px; left: 50%; transform: translateX(-50%); }
.east { right: 5px; top: 50%; transform: translateY(-50%); }
.west { left: 5px; top: 50%; transform: translateY(-50%); }
.target-arrow { position: absolute; inset: 13px; transition: transform .2s ease; }
.target-arrow::before { content: ""; position: absolute; left: 50%; top: 1px; transform: translateX(-50%); border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 45px solid var(--cyan); filter: drop-shadow(0 3px 3px #0892b65c); }
.target-arrow i { position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%); border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 36px solid #dce0e9; }
.compass.aligned { border-color: #c9f0dc; }
.compass.aligned .target-arrow::before { border-bottom-color: var(--green); }
.center-dot { width: 15px; height: 15px; border-radius: 50%; background: var(--navy); position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 4px #fff; }
.instruction { display: flex; align-items: flex-start; gap: 10px; }
.instruction strong { font-size: 18px; display: block; line-height: 1.25; }
.instruction small { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; margin-top: 4px; }
.status-dot { width: 11px; height: 11px; flex: none; border-radius: 50%; background: var(--orange); margin-top: 6px; box-shadow: 0 0 0 5px #f59e0b1e; }
.status-dot.ok { background: var(--green); box-shadow: 0 0 0 5px #16a66a22; }
.sensor-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12px; font-weight: 700; color: var(--navy); background: #eef0f6; border-radius: 999px; padding: 5px 9px; }
.chip.warn { color: #8a4b00; background: #fff4df; }
.inline-setting { display: flex; align-items: center; gap: 10px; margin-top: 12px; background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 10px 14px; }
.inline-setting label { flex: 1; font-size: 14px; font-weight: 700; color: #41495a; }
.inline-setting input { width: 92px; margin: 0; padding: 10px; text-align: center; }

/* ── Listas de torres y enlaces ── */
.tower-list { display: grid; gap: 9px; margin-bottom: 16px; }
.tower-row { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; display: flex; align-items: center; gap: 12px; }
.pin { width: 36px; height: 36px; border-radius: 11px; background: #EFE7F8; color: var(--purple); display: grid; place-items: center; font-size: 19px; flex: none; }
.tower-info { min-width: 0; flex: 1; }
.tower-info strong { display: block; font-size: 16px; }
.tower-info span { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: flex; gap: 5px; }
.row-btn { border: 0; background: #f0f2f7; color: var(--navy); border-radius: 9px; padding: 9px 10px; font: 700 14px var(--font); cursor: pointer; }
.row-btn.delete { color: var(--red); background: #fff0f2; }
.link-row { border-left: 4px solid var(--cyan); }
.point-b-head { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 16px; border-top: 1px solid #e6e8ef; }
.point-b-head strong { font-size: 18px; }

/* ── Enlaces y perfil ── */
#linkMap { height: 300px; border-radius: 20px; overflow: hidden; background: #dfe4ee; }
.fresnel-card { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: var(--purple); color: #fff; border-radius: 17px; padding: 15px; margin: 0 0 12px; }
.fresnel-card div { background: #ffffff12; border: 1px solid #ffffff1c; border-radius: 12px; padding: 11px; }
.fresnel-card span { display: block; font-size: 12px; color: #cdd6ef; margin-bottom: 4px; }
.fresnel-card strong { font-size: 21px; }
.fresnel-card p { grid-column: 1 / -1; color: #d8dcef; font-size: 12px; line-height: 1.4; margin: 2px 3px 0; }
.profile-card { background: #fff; border: 1px solid #e1e5ee; border-radius: 20px; padding: 15px; margin-bottom: 12px; }
.profile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.profile-status { font-size: 12px; font-weight: 800; color: var(--purple); background: #eee8f7; border-radius: 999px; padding: 7px 9px; white-space: nowrap; }
.profile-status.error { color: #a32d42; background: #fff0f2; }
.profile-legend { display: flex; flex-wrap: wrap; gap: 11px; margin: 13px 0 8px; color: var(--muted); font-size: 12px; }
.profile-legend span { display: flex; align-items: center; gap: 5px; }
.profile-legend i { width: 17px; height: 4px; border-radius: 4px; display: inline-block; }
.terrain-key { background: #66745f; } .los-key { background: #00ADD8; } .fresnel-key { background: #7b2cbf; }
.profile-wrap { position: relative; background: linear-gradient(#151824, #0e1220); border-radius: 15px; overflow: hidden; touch-action: none; }
.profile-wrap svg { display: block; width: 100%; height: auto; }
.profile-cursor { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; pointer-events: none; box-shadow: 0 0 0 1px #20253666; }
.profile-help { text-align: center; font-size: 12px; margin: 9px 0; color: var(--muted); }
.terrain-point { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 1px solid #e6e9f0; padding-top: 11px; }
.terrain-point div { background: #f5f7fb; border-radius: 11px; padding: 9px; }
.terrain-point span { display: block; font-size: 11px; color: var(--muted); }
.terrain-point strong { display: block; font-size: 14px; margin-top: 2px; }
.maps-button { grid-column: 1 / -1; text-align: center; text-decoration: none; border-radius: 12px; background: #edf1f7; color: var(--navy); font-weight: 800; padding: 12px; }
.profile-grid { stroke: #ffffff18; stroke-width: 1; }
.profile-axis { fill: #aeb7c9; font-size: 11px; }
.profile-terrain { fill: #82917b; stroke: #aab8a2; stroke-width: 2; }
.profile-fresnel { fill: #7b2cbf35; stroke: #a24fe0; stroke-width: 2; }
.profile-los { fill: none; stroke: #16c6ed; stroke-width: 3; }
.profile-point { fill: #fff; stroke: #5F1880; stroke-width: 4; }
.align-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 12px; }
.align-actions .secondary { margin-top: 0; }

/* ── Operación técnica ── */
.ops { max-width: 1100px; }
.toolbar { display: flex; gap: 12px; margin: 16px 0; }
.toolbar input { flex: 1; min-width: 0; margin: 0; }
.toolbar select { max-width: 220px; margin: 0; }
.work-card { background: #fff; border: 1px solid #dfe3ed; border-radius: 14px; padding: 18px; margin: 12px 0; }
.work-card h2 { font-size: 1.12rem; margin: 0 0 8px; }
.work-card p { margin: 6px 0; overflow-wrap: anywhere; }
.work-card .secondary { width: auto; padding: 11px 16px; margin-top: 10px; }
.work-card.inactive { opacity: .6; }
.badge { display: inline-block; padding: 5px 10px; background: #F0E9F8; color: #4A1264; border-radius: 6px; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.badge.s-asignada { background: #F0E9F8; } .badge.s-en-curso { background: #e3f6fc; color: #075c70; }
.badge.s-pendiente-de-revision { background: #fff4df; color: #8a4b00; }
.badge.s-requiere-correccion { background: #fff0f2; color: #a32d42; } .badge.s-completada { background: #e3f6ec; color: #0f6b44; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.actions .primary, .actions .secondary { width: auto; flex: 1; margin-top: 0; }
dialog { width: min(760px, 94vw); max-height: 92dvh; overflow: auto; border: 0; border-radius: 16px; padding: 22px; color: #202536; }
dialog::backdrop { background: #09142d99; }
.close { float: right; padding: 10px 12px; background: #eef0f8; border: 0; border-radius: 8px; font: 16px var(--font); cursor: pointer; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.photo-grid img { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; }
.report-data { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.report-data div { padding: 10px; background: #f4f5fa; border-radius: 8px; overflow-wrap: anywhere; }
.report-data small { display: block; font-size: 13px; color: #586176; }
.protected { white-space: pre-wrap; overflow-wrap: anywhere; background: #eef0f8; padding: 12px; border-radius: 8px; margin-top: 8px; }
.empty { padding: 35px 20px; color: #566078; text-align: center; }
.ops #message { white-space: pre-wrap; min-height: 1.2em; }

/* ── Login ── */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px; box-shadow: 0 18px 40px #20253614; }
.login-card .brand-logo { margin: 10px auto 26px; height: 70px; width: auto; max-width: 100%; }
.login-card h1 { text-align: center; font-size: 22px; }
.login-card > p { text-align: center; margin-bottom: 8px; }

@media (max-width: 600px) {
  .toolbar { flex-direction: column; }
  .toolbar select { max-width: none; }
  .report-data { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .ops { padding: 14px; }
  dialog { padding: 16px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics.three { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 430px) {
  main { padding-left: 12px; padding-right: 12px; }
  .topbar { padding: 0 10px; }
  .brand-logo { height: 34px; }
  .current-section { font-size: 14px; max-width: 110px; }
  .menu-toggle { padding: 9px 10px; }
  .aim-card { grid-template-columns: 116px 1fr; padding: 13px; gap: 12px; }
  .compass { width: 112px; height: 112px; }
  .align-actions, .terrain-point { grid-template-columns: 1fr; }
  #linkMap { height: 260px; }
}
@media (max-width: 360px) {
  .coord-grid { grid-template-columns: 1fr; }
  .brand-logo { height: 30px; }
  .current-section { max-width: 80px; }
}

/* ── Usuarios ── */
.user-card { display: flex; align-items: center; gap: 14px; }
.user-card .user-info { flex: 1; min-width: 0; }
.user-card .user-info h2 { margin-bottom: 2px; }
.user-card > .secondary { width: auto; margin: 0; padding: 11px 18px; flex: none; }
.avatar { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; flex: none; background: #EFE7F8; color: var(--purple); display: grid; place-items: center; font-weight: 800; font-size: 20px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.avatar.big { width: 92px; height: 92px; font-size: 30px; }
.user-head { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.user-head h2 { margin: 0 0 4px; }
.new-password { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #e3f6ec; border: 1px solid #b9e6cd; border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
.new-password small { width: 100%; color: #0f6b44; font-weight: 700; }
.new-password strong { font: 700 22px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; color: #0b3d27; flex: 1; user-select: all; }
.secondary.danger { color: var(--red); background: #fff0f2; border-color: #f3c9d1; }
@media (max-width: 430px) {
  .user-card { flex-wrap: wrap; }
  .user-card > .secondary { width: 100%; }
}

/* ── Órdenes ── */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0 10px; }
.stat strong, .stat span { overflow-wrap: anywhere; }
.stat { cursor: pointer; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; text-align: center; font-family: var(--font); color: var(--ink); }
.stat strong { display: block; font-size: 24px; color: var(--navy); }
.stat span { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.stat.alert { background: #fff0f2; border-color: #f3c9d1; }
.stat.alert strong, .stat.alert span { color: var(--red); }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filter-chip { flex: none; cursor: pointer; border: 1px solid #d8dce6; background: #fff; color: var(--navy); border-radius: 999px; padding: 9px 15px; font: 700 14px var(--font); }
.filter-chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.toolbar select#techFilter { max-width: 220px; }
.order-card { cursor: pointer; border-left: 4px solid #d8dce6; transition: box-shadow .15s; }
.order-card:hover, .order-card:focus-visible { box-shadow: 0 6px 18px #20253614; outline: none; }
.order-card.late { border-left-color: var(--red); }
.order-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.order-top .badge { margin-bottom: 0; }
.folio { font: 800 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--purple); letter-spacing: .03em; margin: 0; }
.badge.urgent { background: #fff4df; color: #8a4b00; }
.badge.late-badge { background: #fff0f2; color: #a32d42; }
.order-card .order-when { color: var(--ink); }
.order-address { color: var(--muted); }
.order-tech { font-size: 14px; }
.contact-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 4px; }
.contact-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; line-height: 1.2; text-decoration: none; background: #F1F2F6; color: var(--ink); border-radius: 12px; padding: 10px 4px; font-weight: 700; font-size: 13px; min-height: 64px; }
.contact-btn svg { width: 22px; height: 22px; flex: none; }
.contact-btn.call { color: var(--ink); } .contact-btn.call svg { color: var(--purple); }
.contact-btn.wa { background: #1FAF5A; color: #fff; }
.contact-btn.maps { background: #FDECEC; color: #B3261E; }
.contact-btn.waze { background: #33CCFF; color: #0B3A4A; }
.contact-btn:active { transform: scale(.97); }
.new-client { border: 1px dashed #cfd4e2; border-radius: 14px; padding: 4px 14px 14px; margin: 12px 0 0; }
.new-client legend { font-weight: 800; color: var(--purple); padding: 0 6px; }
.cancel-form { background: #fff7f8; border: 1px solid #f3c9d1; border-radius: 14px; padding: 4px 14px 14px; margin-top: 12px; }
.primary.danger-bg { background: linear-gradient(135deg, #c0354f, #8e1f35); box-shadow: none; }
#orderForm { margin-top: 6px; }
@media (max-width: 600px) {
  .toolbar select#techFilter { max-width: none; }
  .contact-row { gap: 6px; }
  .contact-btn { font-size: 12px; padding: 9px 2px; }
}
@media (max-width: 380px) {
  .stat strong { font-size: 20px; }
  .stat span { font-size: 11px; }
}

/* ── Avisos ── */
.toasts { position: fixed; top: 78px; left: 50%; transform: translateX(-50%); z-index: 3000; width: min(460px, calc(100vw - 20px)); display: grid; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #E5DAF5; border-left: 5px solid var(--purple); border-radius: 16px; padding: 12px 12px 12px 14px; box-shadow: 0 14px 36px #20253633; animation: toast-in .25s ease-out; }
.toast.leaving { opacity: 0; transform: translateY(-8px); transition: all .2s; }
.toast-icon { font-size: 22px; flex: none; }
.toast-text { flex: 1; min-width: 0; }
.toast-text strong { display: block; color: var(--navy); font-size: 15px; }
.toast-text span { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.toast-actions { display: flex; gap: 6px; flex: none; }
.toast-open { border: 0; border-radius: 10px; background: var(--purple); color: #fff; font: 800 14px var(--font); padding: 9px 14px; cursor: pointer; }
.toast-close { border: 0; border-radius: 10px; background: #eef0f6; color: var(--navy); font: 700 14px var(--font); padding: 9px 11px; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.notify-banner { display: flex; align-items: center; gap: 10px; background: #f1ecfa; border: 1px solid #E5DAF5; border-radius: 16px; padding: 12px 12px 12px 14px; margin-bottom: 14px; }
.notify-banner > span { font-size: 22px; }
.notify-banner p { flex: 1; color: var(--ink); font-size: 14px; }
.notify-help { max-width: 440px; }
.notify-help ol { padding-left: 20px; line-height: 1.6; }
.notify-help p { margin: 8px 0; color: var(--ink); }

/* ── Monitoreo y llegada ── */
.badge.s-en-camino { background: #e8f0ff; color: #1f4fb5; }
.arrival { background: #F6F1FB; border: 1px solid #e0d6f2; border-radius: 16px; padding: 4px 16px 16px; margin-top: 16px; }
.arrival h3 { margin-top: 14px; }
.enroute-form { margin-top: 4px; }
.enroute-form .secondary { margin-top: 10px; }
.enroute-done { font-weight: 700; color: #1f4fb5; margin: 8px 0; }
.arrival-distance { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 12px; color: var(--ink); font-size: 15px; }
.arrival-distance small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.arrival-distance.ok { background: #e3f6ec; border-color: #b9e6cd; color: #0f6b44; font-weight: 700; }
.manual-checkin { margin-top: 12px; }
.manual-checkin summary { font-size: 14px; color: var(--muted); }
.monitor { border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px 16px; margin-top: 18px; background: #fff; }
.monitor h3 { color: var(--navy); }
.timeline { list-style: none; padding: 0; margin: 10px 0 18px; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.timeline::before { content: ""; position: absolute; left: 10%; right: 10%; top: 44px; height: 3px; background: #dfe3ed; }
.timeline li { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.t-date { font-size: 11px; color: var(--muted); line-height: 1.3; min-height: 29px; }
.t-dot { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #cfd4e2; position: relative; z-index: 1; }
.t-label { font-size: 12px; font-weight: 800; color: #9aa2b4; }
.timeline li.done .t-dot { background: var(--cyan); border-color: var(--cyan); }
.timeline li.done .t-label { color: #0895b5; }
.timeline li.alert .t-dot { background: var(--orange); border-color: var(--orange); }
.timeline li.alert .t-label { color: #8a4b00; }
.monitor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.monitor-grid div { background: #f5f7fb; border-radius: 10px; padding: 9px 11px; font-size: 14px; overflow-wrap: anywhere; }
.monitor-grid span { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.warn { color: #b25a00; font-weight: 700; }
.monitor-note { margin-top: 8px; font-size: 13px; }
.log { margin-top: 12px; }
.log summary { font-size: 14px; color: var(--navy); }
.log ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.log li { font-size: 13px; color: var(--ink); background: #f5f7fb; border-radius: 8px; padding: 8px 10px; }
.log li span { color: var(--muted); font-size: 12px; }
@media (max-width: 480px) {
  .monitor-grid { grid-template-columns: 1fr; }
  .t-label { font-size: 11px; }
  .t-date { font-size: 10px; }
}

/* ── Formularios de reporte ── */
.q-num { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 8px; background: #EFE7F8; color: var(--purple); font-size: 12px; font-weight: 800; margin-right: 4px; }
#reportForm label small.hint, #reportForm legend small.hint { display: block; font-weight: 500; }
.q-group { border: 1px solid #d8dce6; border-radius: 12px; padding: 8px 12px 12px; margin: 12px 0 0; }
.q-group legend, .q-group .legend { font-size: 14px; font-weight: 700; color: #41495a; padding: 0 4px; display: block; }
.q-group .legend { margin: 4px 0 8px; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-top: 10px; cursor: pointer; }
label.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--purple); }
.q-group.yesno { display: flex; flex-wrap: wrap; gap: 0 22px; }
.q-group.yesno legend { width: 100%; }
.signature-pad { display: block; width: 100%; height: 160px; background: #fff; border: 2px dashed #cfd4e2; border-radius: 12px; touch-action: none; }
.q-group .mini-btn { margin-top: 8px; }
.answers { padding-left: 0; list-style: none; counter-reset: q; display: grid; gap: 8px; margin-top: 12px; }
.answers li { counter-increment: q; background: #f5f7fb; border-radius: 10px; padding: 10px 12px; }
.answers li > strong { display: block; font-size: 13px; color: #34405a; }
.answers li > strong::before { content: counter(q) ") "; color: var(--purple); }
.answers li > div { margin-top: 4px; overflow-wrap: anywhere; }
.answers .photo-grid { margin-top: 6px; }
.signature-img { max-width: 280px; width: 100%; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.secret { font-weight: 700; color: var(--muted); }
.secret.revealed { color: var(--ink); background: #fff4df; border-radius: 6px; padding: 2px 6px; }
.muted { color: var(--muted); }
.field-editor { list-style: none; padding: 0; display: grid; gap: 10px; }
.field-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fbfbfe; }
.field-row-head { display: flex; align-items: center; gap: 8px; }
.field-row-head .fe-label { margin: 0; flex: 1; min-width: 0; }
.field-row-body { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-top: 8px; }
.field-row-body select { margin: 0; }
.field-row-body label.check { margin: 0; font-size: 14px; }
.field-row-body .fe-options, .field-row-body .fe-help, .field-row-body .inline { grid-column: 1 / -1; margin: 0; }
.field-row-body .inline { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.field-row-body .inline input { width: 90px; margin: 0; }
.row-btn:disabled { opacity: .35; }
.answers .photo-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.answers .photo-grid img { height: 96px; }

/* ── Selector de ubicación ── */
.loc-picker { border: 1px solid #d8dce6; border-radius: 14px; padding: 6px 12px 12px; margin: 14px 0 0; }
.loc-picker legend { font-weight: 800; color: var(--purple); padding: 0 6px; }
.loc-row { display: flex; gap: 8px; margin-top: 8px; }
.loc-row input { margin: 0; flex: 1; min-width: 0; }
.loc-row .mini-btn { flex: none; }
.loc-results { display: grid; gap: 6px; margin-top: 6px; }
.loc-result { text-align: left; border: 1px solid #E5DAF5; background: #F6F1FB; border-radius: 10px; padding: 9px 11px; font: 14px var(--font); color: var(--ink); cursor: pointer; }
.loc-map { height: 280px; border-radius: 12px; overflow: hidden; margin-top: 10px; background: #dfe4ee; }
.loc-map .hint { padding: 14px; }
.loc-status { text-align: left; }
.loc-gmaps { font-size: 14px; font-weight: 700; }
.toolbar .filter-chip { flex: none; }
@media (max-width: 600px) { .loc-map { height: 240px; } }

/* ── Inicio (tablero) ── */
.home-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.home-stats.tech { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat.money { cursor: default; }
.stat.money strong { font-size: 19px; color: #0f6b44; }
.home-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 4px 16px 16px; margin-top: 14px; }
.home-card h2 { font-size: 18px; margin: 14px 0 8px; display: flex; align-items: center; gap: 8px; }
.home-card h3 { font-size: 14px; color: var(--muted); margin: 14px 0 6px; }
.home-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.money-total { font-size: 24px; color: #0f6b44; margin-top: 8px; }
.money-list { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; }
.money-list li { display: flex; align-items: baseline; gap: 10px; background: #f5f7fb; border-radius: 10px; padding: 9px 12px; }
.money-list li span { font-weight: 700; flex: 1; }
.money-list li small { color: var(--muted); }
.team-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.team-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: #f5f7fb; border-left: 4px solid #cfd4e2; }
.team-row.on_site { border-left-color: var(--green); }
.team-row.en_route { border-left-color: #1f4fb5; }
.team-row .avatar { width: 46px; height: 46px; font-size: 16px; }
.team-info { min-width: 0; flex: 1; display: grid; gap: 2px; }
.team-state { font-size: 14px; font-weight: 700; color: var(--navy); }
.team-row.on_site .team-state { color: #0f6b44; }
.team-row.en_route .team-state { color: #1f4fb5; }
.team-info small { color: var(--muted); font-size: 12px; }
.home-map { height: 300px; border-radius: 14px; overflow: hidden; background: #dfe4ee; }
.map-legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.map-legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-left: 6px; }
.dot.done { background: var(--green); } .dot.pending { background: var(--purple); } .dot.warn { background: var(--orange); }
.home-line { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: #f5f7fb; border: 0; border-radius: 12px; padding: 10px 12px; margin-top: 6px; cursor: pointer; font-family: var(--font); color: var(--ink); }
.home-line:hover { background: #eef0f8; }
.home-line.warn { background: #fff7e8; }
.home-line-main { flex: 1; min-width: 0; display: grid; }
.home-line-main strong { font-size: 15px; }
.home-line-main small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.home-line .chev { font-size: 22px; color: #9aa2b4; }
.home-line .badge { margin: 0; }
.count.small { min-width: 26px; height: 26px; font-size: 13px; border-radius: 9px; background: var(--red); }
.next-card { border: 2px solid #E5DAF5; background: linear-gradient(180deg, #F6F1FB, #fff 60%); }
.next-card h2 { font-size: 22px; margin-top: 4px; }
.next-card .eyebrow { margin-top: 14px; }
@media (max-width: 600px) {
  .home-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-map { height: 240px; }
}
.attention-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.attention-head h3 { margin-bottom: 0; }
.alert-row { display: flex; align-items: stretch; gap: 6px; margin-top: 6px; transition: opacity .2s, transform .2s; }
.alert-row .home-line { margin-top: 0; flex: 1; min-width: 0; }
.alert-row.leaving { opacity: 0; transform: translateX(20px); }
.ack-btn { flex: none; border: 1px solid #b9e6cd; background: #e3f6ec; color: #0f6b44; border-radius: 12px; padding: 0 12px; font: 800 13px var(--font); cursor: pointer; }
.ack-btn:disabled { opacity: .5; }
.ack-done { display: inline-block; color: #0f6b44; font-weight: 700; margin-left: 6px; }
@media (max-width: 480px) { .ack-btn { padding: 0 9px; font-size: 12px; } }

/* ── Red e IPs ── */
.install-fields { border: 1px dashed #cfd4e2; border-radius: 14px; padding: 4px 14px 10px; margin: 12px 0 0; }
.install-fields legend { font-weight: 800; color: var(--purple); padding: 0 6px; }
.sector-card { cursor: pointer; }
.sector-card.selected { outline: 3px solid var(--cyan); }
.sector-card code, .section-head code { font-size: 13px; color: var(--muted); }
.badge.s-libre { background: #e3f6ec; color: #0f6b44; }
.badge.s-apartada { background: #e8f0ff; color: #1f4fb5; }
.badge.s-ocupada { background: #F0E9F8; color: #4A1264; }
.badge.s-reservada { background: #f1f2f5; color: #4b5263; }
.badge.s-investigacion { background: #fff0f2; color: #a32d42; }
#ipSearch { width: 100%; margin: 6px 0 10px; }
.ip-table { display: grid; gap: 4px; max-height: 60vh; overflow-y: auto; }
.ip-row { display: grid; grid-template-columns: 9.5em auto 1fr; gap: 10px; align-items: center; text-align: left; width: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; color: var(--ink); cursor: pointer; }
.ip-row:hover { border-color: var(--cyan); }
.ip-row .badge { margin: 0; }
.ip-addr { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; }
.ip-note { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.plan-row.inactive { opacity: .55; }
@media (max-width: 520px) {
  .ip-row { grid-template-columns: 1fr auto; }
  .ip-note { grid-column: 1 / -1; white-space: normal; }
}
.recovery-tag { color: #8a4b00; }
.range-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 8px; font-size: 14px; }
.range-form input { width: 5.5em; padding: 6px 8px; }
.range-form .form-message { margin: 0; }
.badge.super-badge { background: var(--purple); color: #fff; }
.perm-group { margin: 10px 0; }
.perm-group .check { align-items: flex-start; font-weight: 500; }

/* ── Solicitudes, rendimiento y bitácora ── */
.request-row { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.request-row .actions { flex-shrink: 0; }
.request-box { background: #fff8eb; border: 1px solid #f3dfb3; border-radius: 12px; padding: 4px 12px; margin: 8px 0; }
.request-box p { margin: 8px 0; }
.home-section-title { margin: 22px 0 6px; font-size: 18px; color: var(--navy); }
.perf-card h2 { margin-bottom: 8px; }
.perf-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.perf-grid div { background: var(--bg); border-radius: 10px; padding: 8px; text-align: center; }
.perf-grid strong { display: block; font-size: 18px; color: var(--navy); }
.perf-grid span { font-size: 12px; color: var(--muted); }
.perf-grid .bad { background: #fff0f2; } .perf-grid .bad strong { color: var(--red); }
.perf-grid .warn { background: #fff4df; } .perf-grid .warn strong { color: #8a4b00; }
.audit-row { display: flex; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; }
.audit-row p { margin: 2px 0 0; }
.audit-icon { font-size: 18px; width: 24px; text-align: center; }
.audit-diff { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
@media (max-width: 560px) {
  .perf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .request-row { flex-direction: column; }
}
#requestsCount { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; margin-left: 6px; } #requestsCount:empty { display: none; }
.cash-tech { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.cash-tech:first-of-type { border-top: 0; margin-top: 0; }
.cash-item { align-items: flex-start; font-weight: 500; }

/* Ficha técnica del cliente */
.ficha-changes { border-left: 4px solid #f0a020; background: #fff8e8; padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; }
.ficha-changes ul { margin: 6px 0; padding-left: 18px; }
.ficha-form { display: grid; gap: 8px; }
.new-ip-box { border-left: 4px solid #2a7de1; background: #eef5ff; padding: 10px 12px; border-radius: 8px; margin: 10px 0; display: grid; gap: 6px; }
.badge.s-en-pausa { background: #fff1d6; color: #7a4b00; }
.pause-box { border-left: 4px solid #f0a020; background: #fff8e8; padding: 10px 12px; border-radius: 8px; margin: 10px 0; }
.pause-box p { margin-top: 4px; color: inherit; }
.pause-line { color: #7a4b00; font-size: .9rem; margin-top: 4px; }
.pause-form { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 8px 0; }
.pause-form, .pause-form .coord-grid > * { min-width: 0; }
.pause-form input, .pause-form select, .pause-form textarea { max-width: 100%; box-sizing: border-box; }

/* Identidad 2026: hover de botones y acento cian */
.primary:hover:not(:disabled) { background: var(--purple-dark); }
.login-card { border-top: 4px solid var(--cyan); }
.brand-link { display: block; flex-shrink: 0; border-radius: 8px; }
.brand-link:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.plan-alert { border: 2px solid #f0a020; background: #fff; border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.plan-changed { color: #8a4b00; }

/* ── Orden de trabajo (diseño 2026) ── */
.ot-head { padding-right: 90px; }
.ot-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ot-chips .badge { margin: 0; border-radius: 999px; font-size: 12px; padding: 3px 10px; }
.ot-folio { font: 700 13px ui-monospace, Menlo, Consolas, monospace; color: var(--purple); letter-spacing: .04em; }
.ot-name { font-size: 22px; margin: 8px 0 2px; line-height: 1.2; }
.ot-meta { font-size: 14px; color: var(--muted); }
.ot-meta strong { color: var(--ink); }
.ot-alert { background: #F4F5F8; border-radius: 10px; padding: 9px 12px; margin: 10px 0 0; color: var(--ink); }
.ot-alert.danger { background: #FDE8EC; color: #8E1F35; }
.ot-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 16px -22px 0; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.ot-tabs button { flex: none; border: 0; background: none; padding: 11px 12px 9px; font: 700 14px var(--font); color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
.ot-tabs button.on { color: var(--purple); border-color: var(--purple); }
.ot-tabs em { font-style: normal; background: var(--cyan); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; margin-left: 2px; }
.ot-body { background: #F7F8FA; margin: 0 -22px; padding: 16px 22px 6px; min-height: 120px; }
.ot-body > section > :first-child { margin-top: 0; }
.ot-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.ot-label { margin: 0 0 10px; font-size: 12px; letter-spacing: .07em; color: var(--muted); text-transform: uppercase; }
.ot-note { background: #FFF8E6; border: 1px solid #F5DFA8; border-radius: 12px; padding: 11px 14px; margin-bottom: 12px; white-space: pre-wrap; }
.ot-note small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .07em; color: #8A5A00; margin-bottom: 2px; white-space: normal; }
.ot-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; }
.ot-kv small { display: block; font-size: 12px; color: var(--muted); }
.ot-kv strong { font-size: 15px; overflow-wrap: anywhere; }
.ot-kv .big strong { font-size: 17px; color: var(--purple); }
.ot-kv code { font: 700 16px ui-monospace, Menlo, Consolas, monospace; }
.ot-lock { margin-top: 12px; width: 100%; border: 1px dashed #CFC3E3; background: #F3EDFA; color: #4A1264; border-radius: 10px; padding: 10px; font: 700 14px var(--font); cursor: pointer; }
.ot-addr { display: flex; gap: 10px; align-items: flex-start; }
.ot-addr > span { font-size: 18px; }
.ot-addr small { display: block; color: var(--muted); margin-top: 3px; }
.ot-steps { list-style: none; display: flex; justify-content: space-between; margin: 0; padding: 0; position: relative; }
.ot-steps::before { content: ''; position: absolute; left: 10%; right: 10%; top: 7px; height: 3px; background: var(--line); }
.ot-steps li { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); text-align: center; }
.ot-steps li span { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--line); }
.ot-steps li.done { color: var(--ink); font-weight: 700; }
.ot-steps li.done span { background: var(--cyan); border-color: var(--cyan); }
.ot-steps li.alert span { background: #f59e0b; border-color: #f59e0b; }
.ot-steps small { font-weight: 400; color: var(--muted); }
.ot-review .actions { margin-top: 8px; }
.ot-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); margin: 0 -22px -22px; padding: 12px 22px; background: #fff; position: sticky; bottom: -22px; }
.ot-actions .secondary { margin: 0; width: auto; padding: 10px 14px; }
.ot-more { margin-left: auto; position: relative; }
.ot-more summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-weight: 700; background: #fff; }
.ot-more summary::-webkit-details-marker { display: none; }
.ot-menu { position: absolute; right: 0; bottom: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px #0002; padding: 6px; width: 250px; z-index: 5; }
.ot-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px; border-radius: 8px; font: 14px var(--font); color: var(--ink); cursor: pointer; }
.ot-menu button:hover { background: #F4F5F8; }
.ot-menu .danger-text { color: #A32D42; }
#cancelBox:not(:empty), #pauseBox:not(:empty), #requestBox:not(:empty) { margin-top: 12px; }
@media (max-width: 600px) {
  .ot-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ot-name { font-size: 20px; }
  .ot-tabs, .ot-body { margin-left: -16px; margin-right: -16px; }
  .ot-tabs { padding: 0 8px; }
  .ot-tabs button { padding: 11px 8px 9px; font-size: 13px; }
  .ot-head { padding-right: 76px; }
  .ot-body { padding-left: 16px; padding-right: 16px; }
  .ot-actions { margin: 0 -16px -16px; padding-left: 16px; padding-right: 16px; bottom: -16px; }
  .ot-actions .secondary { flex: 1; }
}

/* Sistema de pruebas */
.env-banner { position: sticky; top: 0; z-index: 1100; background: repeating-linear-gradient(135deg, #F0A020 0 14px, #E89400 14px 28px); color: #2A1A00; font: 700 12px var(--font); text-align: center; padding: 0 10px; height: 28px; line-height: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.env-test .topbar { top: 28px; }

/* ── Cobranza ── */
.bill-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.bill-stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.bill-stat small { display: block; color: var(--muted); font-size: 12px; }
.bill-stat strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.bill-stat.ok strong { color: #0F6B44; } .bill-stat.warn strong { color: #8A5A00; } .bill-stat.bad strong { color: #A32D42; }
.bill-bar { height: 8px; background: #F1F2F6; border-radius: 9px; margin-top: 8px; overflow: hidden; } .bill-bar i { display: block; height: 100%; background: #0F6B44; }
.bill-dates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bill-date { border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; } .bill-date b { font-size: 15px; } .bill-date small { display: block; color: var(--muted); font-size: 12px; }
.bill-date.now { border-color: var(--purple); background: #F6F1FB; }
.bill-two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.bill-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.bill-table th { text-align: left; color: var(--muted); font-size: 12px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.bill-table td { padding: 8px 4px; border-bottom: 1px solid #F1F2F6; vertical-align: middle; }
.bill-table .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.c-bad { background: #FDE8EC; color: #A32D42; } .c-warn { background: #FFF4DF; color: #8A5A00; } .c-sus { background: #202536; color: #fff; }
.btn.b-wa, a.b-wa { display: inline-block; background: #1FAF5A; color: #fff; border-radius: 9px; padding: 6px 10px; font: 700 12.5px var(--font); text-decoration: none; white-space: nowrap; }
.link-btn { border: 0; background: none; color: var(--purple); font: 700 13px var(--font); cursor: pointer; padding: 0; text-transform: none; letter-spacing: 0; text-align: left; }
.link-btn.strong { color: var(--ink); }
.ot-label .link-btn { float: right; }
.bal-box { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-radius: 14px; padding: 12px 14px; margin: 14px 0 6px; }
.bal-box small { display: block; font-size: 12px; } .bal-box strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.bal-box.bad { background: #FDE8EC; color: #A32D42; } .bal-box.ok { background: #E3F6EC; color: #0F6B44; }
.bal-box span { font-size: 13px; font-weight: 700; text-align: right; }
.bill-actions { margin: 8px 0 12px; align-items: center; }
.bill-actions .primary, .bill-actions .secondary { width: auto; margin: 0; padding: 11px 16px; }
.bill-form { display: grid; gap: 8px; }
.mv { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid #F1F2F6; }
.mv:last-child { border: 0; } .mv small { display: block; color: var(--muted); font-size: 12px; }
.mv .amt { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; } .mv .amt.pos { color: #0F6B44; }
.mv.off { opacity: .45; text-decoration: line-through; }
.x-btn { border: 0; background: none; color: var(--muted); cursor: pointer; margin-left: 6px; font-size: 13px; }
.bill-facts { margin: 10px 0; padding-left: 18px; } .bill-start { display: grid; gap: 8px; max-width: 420px; }
@media (max-width: 760px) {
  .bill-stats, .bill-dates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bill-two { grid-template-columns: 1fr; }
  .bill-two .ot-card { overflow-x: auto; }
  .bill-table th:nth-child(2), .bill-table td:nth-child(2) { display: none; }
  .bill-table td:nth-child(4) .chip { display: block; margin: 2px 0; text-align: center; }
}
.ucrm-card p { margin: 0 0 8px; color: var(--ink); } .ucrm-score { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .c-ok { background: #E3F6EC; color: #0F6B44; }
.c-wait { background: #fff4d6; color: #8a5a00; }
.ucrm-filter { margin: 8px 0 4px; font-size: .9rem; }
.seg { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; width: max-content; }
.seg label { display: flex; align-items: center; gap: 6px; padding: 7px 14px; margin: 0; cursor: pointer; font-weight: 600; }
.seg label:has(input:checked) { background: var(--purple); color: #fff; }
.seg input { accent-color: #fff; margin: 0; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 14px; font-weight: 700; cursor: pointer; }
.chip-btn:hover { border-color: var(--purple); color: var(--purple); }
.disc-preview { margin: 0; color: var(--ink); }
.note-form { display: flex; gap: 8px; margin-bottom: 10px; }
.note-form input { flex: 1; min-width: 0; }
.log-list { list-style: none; margin: 0; padding: 0; }
.log-list li { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.log-list li:first-child { border-top: 0; }
.log-ico { width: 22px; text-align: center; flex: none; }
.log-text { color: var(--ink); }
.log-nota .log-text { font-weight: 600; }
.log-diff { display: block; color: var(--muted); margin: 2px 0; word-break: break-word; }
.log-diff s { color: var(--red); }
.note-form button.primary { width: auto; flex: none; padding: 10px 18px; margin: 0; }

/* Perfil del cliente */
dialog.wide { width: min(1120px, 96vw); background: var(--bg); }
.pf h2 { margin: 0; font-size: 1.35rem; }
.pf-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 0 40px 12px 0; }
.pf-avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--lavender); color: var(--purple); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; flex: none; }
.pf-title { flex: 1; min-width: 200px; }
.pf-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pf-tag { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.pf-ok { background: #E3F6EC; color: #0F6B44; } .pf-warn { background: #fff4d6; color: #8a5a00; } .pf-off { background: #eceef2; color: #5b6272; }
.pf-sector { background: var(--lavender); color: var(--purple-dark); }
.pf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-actions .secondary, .pf-actions .btn { margin: 0; width: auto; }
.pf-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pf-metric { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.pf-metric small { display: block; color: var(--muted); font-size: 12px; }
.pf-metric strong { font-size: 1.2rem; }
.pf-metric.bad strong { color: var(--red); } .pf-metric.ok strong { color: var(--green); }
.pf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.pf-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.pf-row:first-of-type { border-top: 0; }
.pf-row span { color: var(--muted); flex: none; }
.pf-row strong { text-align: right; overflow-wrap: anywhere; font-weight: 600; }
.pf-map { margin: 10px 0 8px; border-radius: 10px; overflow: hidden; background: var(--bg); }
#profileMap { height: 200px; }
.pf-map .hint { padding: 14px; margin: 0; }
.pf-list { list-style: none; margin: 0; padding: 0; }
.pf-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.pf-list li:first-child { border-top: 0; }
.pf-list li > div { flex: 1; min-width: 0; }
.pf-list small { display: block; color: var(--muted); }
.pf-ico { width: 22px; text-align: center; flex: none; }
.pf-pos { color: var(--green); font-weight: 700; } .pf-late { color: var(--red); }
.pf-click { cursor: pointer; } .pf-click:hover { background: var(--bg); }
.ot-label .link-btn { float: right; text-transform: none; letter-spacing: 0; }
.pf-reports { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.pf-reports summary { cursor: pointer; font-weight: 700; }
.pf-name { font: inherit; font-size: inherit; text-align: left; padding: 0; color: inherit; }
@media (max-width: 760px) { .pf-grid { grid-template-columns: 1fr; } .pf-head { margin-right: 0; } }
.pf-actions .btn { display: inline-flex; align-items: center; padding: 10px 16px; border-radius: 12px; }
@media (max-width: 760px) {
  .pf-head { margin: 40px 0 12px; padding: 12px; gap: 10px; }
  .pf-avatar { width: 44px; height: 44px; font-size: 1rem; }
  .pf h2 { font-size: 1.1rem; }
  .pf-actions { width: 100%; }
  .pf-actions > * { flex: 1; justify-content: center; padding: 9px 8px; font-size: .9rem; }
  .pf-metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pf-metric strong { font-size: 1rem; }
}
.speed-note { display: flex; gap: 10px; align-items: flex-start; background: #fff4d6; color: #6b4600; border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; }
.speed-note.promo { background: var(--lavender); color: var(--purple-dark); }
.speed-note > div { flex: 1; } .speed-note small { display: block; opacity: .85; }
.pf-svc-actions { margin-top: 10px; flex-wrap: wrap; }
.pf-svc-actions .secondary { width: auto; margin: 0; }
.bill-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan-preview .bill-facts { margin: 4px 0; }
.ot-cost strong { display: block; font-size: 1.2rem; color: var(--green); }

/* Nada debe salirse de la pantalla hacia los lados en el celular */
html, body { max-width: 100%; overflow-x: clip; }
@media (max-width: 430px) {
  .stat-row:not(.home-stats) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat strong { font-size: 20px; }
}
.list-foot { text-align: center; margin: 14px 0 4px; }

/* Bajas y aviso de clientes que ya existen */
.baja-banner { display: flex; gap: 10px; align-items: flex-start; background: #eceef2; color: #3d4352; border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; }
.baja-banner > div { flex: 1; } .baja-banner small { display: block; color: var(--muted); }
.danger-soft { color: var(--red) !important; }
.similar-box:empty { display: none; }
.similar-box { background: #fff4d6; border: 1px solid #f1d58a; border-radius: 12px; padding: 10px 12px; margin: 8px 0 12px; }
.similar-box p { margin: 0 0 6px; }
.similar-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid #f1d58a; }
.similar-row > div { flex: 1; min-width: 0; } .similar-row small { display: block; color: #6b5a2a; overflow-wrap: anywhere; }

/* Borradores en el celular */
.draft-note { background: #e8f3ff; color: #0b4a86; border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; font-weight: 600; }
.draft-files { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 12px; }
.draft-file { display: inline-flex; align-items: center; gap: 4px; background: var(--lavender); color: var(--purple-dark); border-radius: 999px; padding: 4px 6px 4px 10px; font-size: 13px; font-weight: 700; }
.draft-file button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 13px; padding: 2px 4px; }
.draft-badge { background: #e8f3ff; color: #0b4a86; }

/* Sin señal y bandeja de pendientes */
.offline-banner { position: sticky; top: 64px; z-index: 950; background: #333a4d; color: #fff; text-align: center; font-weight: 700; font-size: 14px; padding: 8px 12px; }
.outbox-chip { position: fixed; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 1001; border: 0; border-radius: 999px; padding: 11px 16px; background: var(--purple); color: #fff; font: 800 14px/1 var(--font); box-shadow: 0 8px 22px #20253640; cursor: pointer; }
.outbox-chip.bad { background: var(--red); }
@media (max-width: 959px) { body.field-user .outbox-chip { bottom: calc(80px + env(safe-area-inset-bottom)); } }
.outbox-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Soporte remoto y «Probar conexión» */
.net-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.net-tools a.mini-btn { text-decoration: none; display: inline-block; }
.ping-result { font: 700 14px var(--font); }
.ping-ok { color: #0f6b44; }
.ping-bad { color: #b42318; }
.remote-new { margin: 10px 0; }
.remote-new summary { cursor: pointer; font-weight: 800; color: var(--purple); }
.remote-new-form { display: grid; gap: 8px; margin-top: 8px; }
.remote-visit { border: 1px solid #f0c36d; background: #fff8e8; border-radius: 12px; padding: 10px 12px; margin: 12px 0; }
.remote-visit legend { font-weight: 800; padding: 0 6px; }
.team-row.remote { border-left-color: var(--cyan); }
.team-row.remote .team-state { color: #00799a; }
.ping-result small { display: block; font-weight: 600; margin-top: 2px; }
.ping-detail { color: var(--muted, #667085); }
.ping-warn { color: #b54708; }

/* Red en vivo */
.live-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; background: #b8b8c0; flex: none; }
.live-dot.ok { background: #2e9d4f; } .live-dot.warn { background: #f0a020; } .live-dot.bad { background: #d93a3a; }
.live-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin: 4px 0 12px; }
.live-legend .live-dot { margin-right: 4px; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.live-card { display: flex; flex-direction: column; gap: 4px; text-align: left; background: #fff; border: 1px solid #e3dcec; border-radius: 14px; padding: 12px 14px; cursor: pointer; font: inherit; color: inherit; min-width: 0; }
.live-card.on { border: 2px solid var(--purple); padding: 11px 13px; }
.live-name { font-weight: 800; font-size: 15px; }
.live-card small { color: #667085; }
.bad-text { color: #b42318; }
.live-detail { margin-top: 14px; background: #fff; border: 1px solid #e3dcec; border-radius: 14px; padding: 12px 14px; }
.live-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.live-head h2 { margin: 0; font-size: 18px; }
.live-row { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; border-top: 1px solid #eee8f3; padding: 10px 2px; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.live-row .grow, .live-client .grow { flex: 1; min-width: 0; }
.live-row small, .live-client small { display: block; color: #667085; font-weight: 500; overflow-wrap: anywhere; }
.live-n { font-weight: 800; color: #475467; }
.live-ap.open .chev { transform: rotate(90deg); }
.live-clients { padding: 0 0 8px 20px; }
.live-client { display: flex; align-items: center; gap: 6px; padding: 7px 0; border-top: 1px dashed #eee8f3; }
.live-ap-pick { max-width: 140px; font-size: 13px; padding: 4px 6px; }
.live-ap-actions { margin: 6px 0; align-items: center; flex-wrap: wrap; gap: 6px; }
.ap-test-result small { display: block; }
.live-add { margin-top: 10px; }
.live-home { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.live-home-title { font-weight: 800; font-size: 16px; }
.live-home small { color: #667085; }
@media (max-width: 480px) { .live-clients { padding-left: 6px; } .live-ap-pick { max-width: 110px; } }

/* Flecha de «Actualizar» girando mientras carga */
.spin-ico { display: inline-block; }
.spinning .spin-ico { animation: np-spin 0.8s linear infinite; }
@keyframes np-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinning .spin-ico { animation-duration: 2.4s; } }
.cred-list { list-style: none; padding: 0; margin: 6px 0 10px; }
.cred-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid #eee8f3; }
.edit-banner { background: #fff8e8; border: 1px solid #f0c36d; border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.5; }
.edit-banner .mini-btn { margin-top: 6px; }

/* Equipos por recuperar */
.pending-card { display: grid; gap: 6px; }
.pending-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px; }
.pending-items .badge { background: #fff1d6; color: #7a4b00; }
.pending-action summary { cursor: pointer; font-weight: 800; color: var(--purple); margin-top: 4px; }
.pending-action form { display: grid; gap: 8px; margin-top: 8px; }
.warn-box { background: #fff8e8; border-color: #f0c36d; }

/* Solicitudes de cambio como lista desplegable */
.requests-card > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.requests-title { font-size: 18px; font-weight: 800; }
.requests-sum { display: inline-flex; gap: 8px; align-items: center; }
.requests-done { margin-top: 8px; }
.requests-done > summary { cursor: pointer; font-weight: 700; color: var(--purple); padding: 6px 0; }
.requests-sum .hint { display: inline; margin: 0; }
.requests-card > summary { list-style: none; }
.requests-card > summary::-webkit-details-marker { display: none; }
.requests-card > summary::before { content: '▸'; font-size: 16px; color: var(--purple); width: 14px; }
.requests-card[open] > summary::before { content: '▾'; }

/* Pasarelas de pago */
.pay-card > summary { font-size: 16px; }
.pay-card .bill-form { border-top: 1px solid #eee8f3; padding-top: 10px; margin-top: 10px; display: grid; gap: 8px; }
.pay-card h4, #payLinkForm h4 { margin: 4px 0; display: flex; gap: 8px; align-items: center; }
.copy-row { display: flex; gap: 6px; align-items: center; }
.copy-row input { flex: 1; min-width: 0; font-size: 13px; }
#payLinkResult { display: grid; gap: 8px; margin-top: 8px; }

/* ── Perfil del cliente en página completa ── */
.pf-page .pf-head { margin: 0 0 12px; }
.pf-back { display: inline-flex; align-items: center; gap: 6px; width: auto; margin: 0 0 10px; padding: 7px 12px; border: 1px solid var(--line); background: #fff; border-radius: 10px; color: var(--purple-dark); font: 700 14px/1 var(--font); cursor: pointer; }
.pf-back:hover { background: #f3f0f8; }
.pf-tabs { position: sticky; top: var(--top-h, 64px); z-index: 20; display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; background: var(--bg); border-bottom: 1px solid var(--line); margin: 0 0 12px; padding: 0 4px; }
.pf-tabs::-webkit-scrollbar { display: none; }
.pf-tabs button { flex: none; width: auto; margin: 0; padding: 12px 2px 10px; background: transparent; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: #5b6272; font: 700 15px/1 var(--font); cursor: pointer; }
.pf-tabs button:hover { color: var(--purple); }
.pf-tabs button.active { color: var(--purple-dark); border-bottom-color: var(--purple); font-weight: 800; }
.pf-tabs small { background: var(--lavender); color: var(--purple-dark); border-radius: 999px; padding: 1px 7px; font-size: 11px; }
.pf-pane > .ot-card + .ot-card, .pf-pane .pf-col > .ot-card + .ot-card { margin-top: 12px; }
.pf-col { display: grid; gap: 12px; align-content: start; }
.pf-col > .ot-card + .ot-card { margin-top: 0 !important; }
.pf-pane .ot-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pf-bill-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.pf-bill-actions .primary, .pf-bill-actions .secondary { width: auto; margin: 0; padding: 9px 14px; }
.pf-more { position: relative; }
.pf-more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 100%; padding: 10px 14px; border: 1px solid #dce0ea; border-radius: 12px; background: #f3f4f9; font-weight: 800; font-size: 18px; line-height: 1; }
.pf-more > summary::-webkit-details-marker { display: none; }
.pf-more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 230px; background: #fff; border: 1px solid #dce0ea; border-radius: 12px; box-shadow: 0 16px 44px #20253630; padding: 6px; display: grid; }
.pf-more-item { width: 100%; margin: 0; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 8px; font: 600 15px/1.2 var(--font); color: var(--navy); cursor: pointer; }
.pf-more-item:hover { background: #f3f0f8; }
.pf-more-item.danger-soft { color: var(--red); }
.acc-meta { display: block; font-weight: 600; opacity: .85; margin-top: 2px; }
.bill-search { position: relative; margin: 0 0 12px; }
.bill-search input { width: 100%; }
#billSearchResults:not(:empty) { display: grid; gap: 4px; margin-top: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.bill-hit { display: block; width: 100%; margin: 0; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.bill-hit:hover { background: #f3f0f8; }
.bill-hit small { display: block; color: var(--muted); }
@media (max-width: 720px) {
  .pf-page .pf-head { margin: 0 0 12px; }
  .pf-page .pf-grid { grid-template-columns: 1fr; }
  .pf-more { flex: 0 0 auto !important; }
  .pf-tabs { gap: 16px; }
  .pf-tabs button { font-size: 14px; }
}
.pf-bill-actions button, .bill-actions button { white-space: nowrap; flex: 1 1 auto; font-size: 14px; }
.bill-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bill-actions .b-wa, .bill-actions a { flex: 1 1 auto; text-align: center; }
.bill-actions .b-wa { display: inline-flex; align-items: center; justify-content: center; padding: 11px 14px; margin: 0; }

/* Historial de cortes */
.out-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.out-stat { background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.out-stat small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.2; }
.out-stat strong { font-size: 1.1rem; }
.out-stat.ok strong { color: var(--green); } .out-stat.warn strong { color: #8a5a00; } .out-stat.bad strong { color: var(--red); }
.out-dur { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 430px) { .out-stats { grid-template-columns: 1fr 1fr; } }
.use-up { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.use-chart { display: flex; align-items: flex-end; gap: 3px; height: 84px; margin: 6px 0 2px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.use-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 3px; }
.use-bar i { display: block; width: 100%; background: var(--purple); border-radius: 3px 3px 0 0; opacity: .8; }
.use-bar:hover i { opacity: 1; }
.use-axis { display: flex; justify-content: space-between; margin: 0 0 6px; }
.pay-done main { max-width: 460px; margin: 12vh auto 0; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 22px; }
.pay-done .brand-logo { margin: 0 auto 10px; height: 46px; }
.ap-cred-pick { width: auto; max-width: 260px; padding: 6px 8px; font-size: 13px; }

/* Órdenes por sector y ruta del día */
.order-views { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; }
.order-views button { flex: 1 1 auto; width: auto; margin: 0; padding: 9px 12px; border: 1px solid #dce0ea; background: #fff; border-radius: 10px; font: 700 14px/1.1 var(--font); color: #4a5164; cursor: pointer; white-space: nowrap; }
.order-views button.active { background: var(--lavender); color: var(--purple-dark); border-color: var(--purple); }
.sector-head { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 1.05rem; }
.sector-head small { background: var(--lavender); color: var(--purple-dark); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.route-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.route-bar label { flex: 1 1 160px; }
.route-start { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.route-start > div { flex: 1; min-width: 0; }
.route-sum { margin: 10px 0 6px; }
.route-maps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.b-maps { display: inline-flex; align-items: center; padding: 10px 14px; border-radius: 12px; background: #e8f1ff; color: #174ea6; font-weight: 700; text-decoration: none; }
.route-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.route-stop { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.route-stop.lost { border-style: dashed; }
.route-n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--purple); color: #fff; display: grid; place-items: center; font-weight: 800; }
.route-main { flex: 1; min-width: 0; cursor: pointer; display: grid; gap: 2px; }
.route-main small { color: var(--muted); }
.route-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.route-eta { font-weight: 600; }
.route-move { display: grid; gap: 4px; flex: none; }
.route-move .mini-btn { padding: 6px 10px; }
.route-tags { align-items: center; } .route-tags .pf-tag, .route-tags .badge { line-height: 1.4; }
.order-views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.order-views button { white-space: normal; min-width: 0; padding: 9px 6px; }
@media (max-width: 430px) { .order-views button { font-size: 13px; } }

/* Reportes de clientes (portal) */
.report-item { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); }
.report-item:first-child { border-top: 0; }
.report-item.is-new { background: #FFF8F0; border-radius: 10px; padding: 10px; }
.report-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.report-text { color: var(--ink); }
.report-photo { max-width: 160px; max-height: 120px; border-radius: 8px; display: block; }
.report-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
