/* ============================================================
   OPTICOM — Panel de diagnóstico (dashboard responsive)
   Sidebar azul de marca + área clara con widgets.
   Azul #1733DB · Naranja #FF5412 · Sora / Manrope / Space Mono
   ============================================================ */

:root {
  --blue: #1733db;
  --blue-deep: #0b22b0;
  --navy: #0a1556;
  --orange: #ff5412;
  --orange-soft: #ff7a1a;
  --green: #15a862;
  --amber: #f79009;
  --red: #e5484d;
  --ink: #0f1b33;
  --muted: #8a97ad;
  --muted-2: #a6b0c2;
  --line: #eef1f7;
  --bg: #eef2f8;
  --card: #ffffff;
  --card-shadow: 0 1px 2px rgba(15, 27, 51, 0.04), 0 8px 24px rgba(15, 27, 51, 0.06);
  --soft-blue: #eaf1ff;
  --soft-green: #e4f6ee;
  --soft-amber: #fef3e2;
  --soft-red: #fdecec;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
input, button { font-family: inherit; }
input:focus { outline: none; }

/* ════════════ Shell (sidebar + main) ════════════ */
.shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  background: radial-gradient(120% 60% at 0% 0%, #1b3cec 0%, #122a9e 45%, #0a1556 100%);
  color: #fff;
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar__brand { display: flex; align-items: center; gap: 13px; }
.brand-avatar {
  width: 48px; height: 48px; border-radius: 15px; overflow: hidden; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.14);
  display: flex; align-items: center; justify-content: center;
}
.brand-avatar img { width: 130%; height: 130%; object-fit: cover; object-position: 50% 30%; }
.wordmark { font-family: "Sora"; font-weight: 800; font-size: 21px; letter-spacing: -0.5px; color: #fff; }
.wordmark span { color: var(--orange-soft); }
.brand-sub { font-size: 12px; color: rgba(255, 255, 255, 0.6); font-weight: 600; margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border: none; border-radius: 13px; cursor: pointer;
  background: transparent; color: rgba(255, 255, 255, 0.72);
  font-size: 14.5px; font-weight: 700; text-align: left; transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-item.active { background: #fff; color: var(--blue); box-shadow: 0 6px 16px rgba(5, 12, 48, 0.25); }

.sidebar__foot {
  margin-top: auto; display: flex; align-items: center; gap: 9px;
  font-size: 12px; color: rgba(255, 255, 255, 0.6); font-weight: 600;
}
.dot-ok { width: 8px; height: 8px; border-radius: 50%; background: #28d17c; box-shadow: 0 0 0 3px rgba(40, 209, 124, 0.2); }

/* ── Main ── */
.main { display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 30px; border-bottom: 1px solid var(--line); background: #fff;
}
.topbar__title { font-family: "Sora"; font-weight: 800; font-size: 22px; letter-spacing: -0.4px; margin: 0; }
.topbar__sub { font-size: 13.5px; color: var(--muted); margin: 3px 0 0; }
.badge-soporte {
  font-size: 12px; font-weight: 700; color: var(--blue);
  background: var(--soft-blue); padding: 7px 13px; border-radius: 999px; white-space: nowrap;
}

.content { flex: 1; overflow-y: auto; padding: 28px 30px 40px; }

/* ════════════ Tipografía / utilidades ════════════ */
.sora { font-family: "Sora"; }
.mono { font-family: "Space Mono", monospace; }

/* Card base */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--card-shadow); }
.card-title {
  font-family: "Sora"; font-weight: 700; font-size: 13px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 12px;
}

/* Botones */
.btn-primary {
  position: relative; overflow: hidden; width: 100%; height: 54px; border: none;
  border-radius: 14px; background: var(--blue); color: #fff; font-family: "Sora";
  font-weight: 700; font-size: 16px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; gap: 9px;
  box-shadow: 0 10px 22px rgba(23, 51, 219, 0.24); transition: filter 0.15s;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: 0.7; cursor: default; }
.btn-ghost {
  height: 46px; padding: 0 18px; border: 1.5px solid #e6ecf5; border-radius: 12px;
  background: #fff; font-family: "Sora"; font-weight: 700; font-size: 14.5px;
  color: var(--blue); cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
}
.btn-ghost:hover { background: #f8fafd; }
.btn-icon {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; border: 1.5px solid #e6ecf5; cursor: pointer;
  background: #fff; color: var(--blue); display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: #f8fafd; }
.link { color: var(--blue); font-weight: 700; cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ════════════ Paneles centrados (search / verif / loading / error) ════════════ */
.panel { max-width: 460px; margin: 24px auto; }
.empty { text-align: center; }
.empty__art {
  width: 150px; height: 150px; object-fit: contain; margin: 0 auto 6px; display: block;
  filter: drop-shadow(0 12px 20px rgba(11, 26, 134, 0.18));
}
.empty h2 { font-family: "Sora"; font-weight: 800; font-size: 23px; letter-spacing: -0.4px; margin: 4px 0 8px; }
.empty p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 auto 22px; max-width: 380px; }

/* Inicio: pasos 1·2·3 y sellos de confianza */
.welcome { max-width: 480px; }
.steps { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 18px; }
.step { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.step.active { color: var(--blue); }
.step-n { width: 24px; height: 24px; border-radius: 50%; background: #e6ecf5; color: var(--muted); display: flex; align-items: center; justify-content: center; font-family: "Sora"; font-weight: 800; font-size: 12px; }
.step.active .step-n { background: var(--blue); color: #fff; box-shadow: 0 4px 10px rgba(23, 51, 219, 0.28); }
.step-line { width: 22px; height: 2px; background: #dde5f5; border-radius: 2px; flex-shrink: 0; }
.trust { display: flex; align-items: center; justify-content: center; gap: 14px 16px; flex-wrap: wrap; margin-top: 16px; }
.trust-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.trust-item svg { flex-shrink: 0; }

.form-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--card-shadow); padding: 24px; text-align: left; }
.label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.2px; margin-bottom: 9px; }
.input-wrap {
  display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px;
  border-radius: 14px; background: #f4f7fc; border: 1.5px solid #e6ecf5; transition: border-color 0.15s;
}
.input-wrap:focus-within { border-color: var(--blue); }
.input-wrap.error { border-color: var(--red); }
.input-wrap input {
  flex: 1; border: none; background: transparent; font-size: 17px; font-weight: 700;
  letter-spacing: 0.4px; color: var(--ink); min-width: 0;
}
.field-error { display: flex; align-items: center; gap: 7px; margin-top: 11px; color: var(--red); font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.hint { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 14px; color: var(--muted-2); font-size: 12px; font-weight: 600; text-align: center; }

/* Verificación */
.verif-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 17px; background: var(--soft-blue); display: flex; align-items: center; justify-content: center; }
.verif-icon svg path { stroke: var(--blue); }
.code-wrap { justify-content: center; }
.code-input {
  text-align: center; font-family: "Space Mono", monospace !important; font-size: 26px !important;
  letter-spacing: 10px !important; font-weight: 700; width: 100%; padding-left: 10px;
}
.code-input::placeholder { letter-spacing: 6px; color: #c2ccdd; }

/* Loading / error */
.loading { min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.spinner { width: 44px; height: 44px; border: 4px solid #dbe3f0; border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; }
.spinner-sm { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.loading .lt { font-family: "Sora"; font-weight: 700; font-size: 18px; color: var(--ink); }
.loading .ls { font-size: 13.5px; color: var(--muted); margin-top: 6px; max-width: 280px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(21, 168, 98, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(21, 168, 98, 0); }
  100% { box-shadow: 0 0 0 0 rgba(21, 168, 98, 0); }
}
.errbox { max-width: 440px; margin: 28px auto; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 30px 24px; text-align: center; box-shadow: var(--card-shadow); }
.errbox .icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%; background: var(--soft-red); display: flex; align-items: center; justify-content: center; }
.errbox h2 { font-family: "Sora"; font-weight: 800; font-size: 20px; margin: 0; }
.errbox p { font-size: 14px; color: #5c6b85; margin: 8px 0 18px; line-height: 1.5; }

/* ════════════ Resultado (dashboard) ════════════ */
.result__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.result__head .who { display: flex; align-items: center; gap: 14px; }
.avatar-ring {
  width: 52px; height: 52px; border-radius: 16px; overflow: hidden; flex-shrink: 0;
  background: var(--soft-blue); display: flex; align-items: center; justify-content: center;
}
.avatar-ring img { width: 140%; height: 140%; object-fit: cover; object-position: 50% 30%; }
.result__head .name { font-family: "Sora"; font-weight: 800; font-size: 22px; letter-spacing: -0.4px; }
.result__head .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Diagnóstico destacado */
.diag { display: flex; align-items: center; gap: 18px; border-radius: 18px; padding: 22px 24px; margin-bottom: 18px; border: 1px solid transparent; }
.diag .icon { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.diag h2 { font-family: "Sora"; font-weight: 800; font-size: 19px; margin: 0; }
.diag p { font-size: 14px; color: #5c6b85; margin: 5px 0 0; line-height: 1.45; }
.diag .caso-tag { font-size: 11px; font-weight: 700; margin-top: 8px; display: inline-block; }
.diag .consejos-lead { font-size: 13.5px; font-weight: 700; color: var(--ink); margin: 6px 0 10px; }
.consejos-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.consejos-scroll::-webkit-scrollbar { height: 6px; }
.consejos-scroll::-webkit-scrollbar-thumb { background: #d9e1ee; border-radius: 999px; }
.consejo-card { flex: 0 0 220px; scroll-snap-align: start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.consejo-dot { width: 12px; height: 12px; border-radius: 50%; }
.consejo-txt { font-size: 13px; color: #5c6b85; line-height: 1.45; }

/* KPI row */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--card-shadow); padding: 16px 18px; }
.kpi .k-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.kpi .k-dot { width: 8px; height: 8px; border-radius: 50%; }
.kpi .k-val { font-family: "Sora"; font-weight: 800; font-size: 20px; margin-top: 8px; }
.kpi .k-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* Widgets grid */
.widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.widget { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--card-shadow); padding: 18px 20px; }

/* Filas k/v */
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row .k { font-size: 13.5px; color: var(--muted); font-weight: 600; flex-shrink: 0; }
.row .v { font-size: 13.5px; color: var(--ink); font-weight: 700; text-align: right; }

/* Métricas de señal */
.metric { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.metric:last-child { border-bottom: none; }
.metric .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.metric .body { flex: 1; min-width: 0; }
.metric .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.metric .ml { font-family: "Sora"; font-weight: 700; font-size: 14px; color: var(--ink); }
.metric .tags { display: inline-flex; align-items: center; gap: 7px; }
.metric .tag { font-size: 12px; font-weight: 700; }
.metric .tech { font-family: "Space Mono", monospace; font-size: 11px; color: var(--muted-2); background: #f4f7fc; padding: 2px 6px; border-radius: 6px; }
.metric .friendly { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

/* Badges */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }

.advert { margin-top: 18px; border-radius: 14px; padding: 14px 16px; background: var(--soft-amber); border: 1px solid #fce7c4; display: flex; gap: 10px; font-size: 13px; color: #6b5a38; line-height: 1.45; }

/* ════════════ Gestión de ONU (acciones + gráficos) ════════════ */
.onu-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.onu-btn {
  height: 50px; border-radius: 13px; border: 1.5px solid #e6ecf5; background: #fff;
  color: var(--ink); cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 9px; font-family: "Sora"; font-weight: 700; font-size: 14.5px;
  transition: border-color 0.15s, background 0.15s, filter 0.15s;
}
.onu-btn svg { flex-shrink: 0; }
.onu-btn:hover:not(:disabled) { border-color: var(--blue); background: #f8fafd; }
.onu-btn:disabled { opacity: 0.6; cursor: default; }
.onu-btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 8px 18px rgba(23, 51, 219, 0.22); }
.onu-btn.primary:hover:not(:disabled) { filter: brightness(1.07); background: var(--blue); }

.onu-msg {
  display: none; align-items: flex-start; gap: 9px; margin-top: 12px;
  padding: 11px 13px; border-radius: 12px; font-size: 13.5px; font-weight: 600; line-height: 1.4;
}
.onu-msg svg { flex-shrink: 0; margin-top: 1px; }
.onu-msg.info, .onu-msg.ok, .onu-msg.warn, .onu-msg.err { display: flex; }
.onu-msg.info { background: var(--soft-blue); color: var(--blue); }
.onu-msg.ok { background: var(--soft-green); color: #0f7a4a; }
.onu-msg.warn { background: var(--soft-amber); color: #8a5a14; }
.onu-msg.err { background: var(--soft-red); color: var(--red); }

.onu-sub { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin: 18px 0 10px; }
.onu-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid #e6ecf5;
  background: #fff; cursor: pointer; font-family: "Sora"; font-weight: 700; font-size: 13px;
  color: var(--muted); display: inline-flex; align-items: center; gap: 6px; transition: all 0.15s;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.active { background: var(--soft-blue); border-color: var(--blue); color: var(--blue); }

.graph-box:not(:empty) { margin-top: 12px; }
.graph-frame { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #f8fafd; }
.graph-frame img { width: 100%; display: block; }
.graph-state { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 30px 16px; color: var(--muted); font-size: 13.5px; font-weight: 600; text-align: center; }

.onu-msg-note { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; opacity: 0.85; }

.onu-clave { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.onu-clave .onu-btn { grid-column: 1 / -1; }
.onu-input {
  height: 46px; border-radius: 11px; border: 1.5px solid #e6ecf5; background: #f8fafd;
  padding: 0 13px; font-size: 14px; font-weight: 600; color: var(--ink); font-family: inherit; min-width: 0;
}
.onu-input::placeholder { color: var(--muted-2); font-weight: 500; }
.onu-input:focus { border-color: var(--blue); outline: none; }
@media (max-width: 480px) { .onu-clave { grid-template-columns: 1fr; } }
.onu-hint { font-size: 13px; color: var(--muted); line-height: 1.5; }
.wifi-band-h { display: flex; align-items: center; gap: 7px; font-family: "Sora"; font-weight: 700; font-size: 13px; color: var(--ink); margin: 0 0 9px; }
.wifi-band-h svg { flex-shrink: 0; }
.wifi-hist-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.wifi-hist-row:last-child { border-bottom: none; }
.wifi-hist-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wifi-hist-t { font-family: "Sora"; font-weight: 700; font-size: 13px; color: var(--ink); }
.wifi-hist-w { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* Prueba de velocidad */
.speed-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.speed-row:last-child { border-bottom: none; }
.speed-row svg { flex-shrink: 0; }
.speed-t { font-family: "Sora"; font-weight: 700; font-size: 13.5px; color: var(--ink); }
.speed-d { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

/* Aviso de caída (banner del administrador) */
.aviso { display: flex; align-items: flex-start; gap: 11px; border: 1px solid; border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.aviso svg { flex-shrink: 0; margin-top: 1px; }
.aviso .aviso-t { font-family: "Sora"; font-weight: 800; font-size: 14.5px; }
.aviso .aviso-m { font-size: 13px; color: #5c6b85; margin-top: 3px; line-height: 1.45; }

/* Tip (recomendación) */
.tip-box { display: flex; align-items: flex-start; gap: 9px; background: var(--soft-amber); border-radius: 12px; padding: 11px 13px; font-size: 12.5px; color: #6b5a38; line-height: 1.5; }
.tip-box svg { flex-shrink: 0; margin-top: 1px; }

/* Simulador de escaneo LAN */
.lansim-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.lansim-controls { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.lansim-subnet { width: auto; min-width: 160px; height: 46px; }
.lansim-controls .onu-btn { width: auto; padding: 0 18px; }
.lansim-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #f8fafd; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-size: 13px; color: #5c6b85; }
.lansim-note b { color: var(--ink); }
.lansim-why { margin-top: 8px; background: var(--soft-blue); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: #41507a; line-height: 1.5; }
.lansim-status { margin: 14px 0 12px; display: flex; align-items: center; gap: 8px; font-family: "Sora"; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.lansim-status.done { color: var(--green); }
.lansim-status.scanning { color: var(--blue); }
.lansim-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.lansim-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; background: #f8fafd; animation: bubble-in 0.3s ease both; }
.lansim-ic { width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; background: var(--soft-blue); display: flex; align-items: center; justify-content: center; }
.lansim-body { flex: 1; min-width: 0; }
.lansim-name { font-family: "Sora"; font-weight: 700; font-size: 13.5px; color: var(--ink); }
.lansim-net { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.lansim-net b { color: var(--ink); }
.lansim-ms { flex-shrink: 0; font-family: "Space Mono", monospace; font-size: 11.5px; font-weight: 700;
  color: var(--green); background: var(--soft-green); padding: 4px 9px; border-radius: 8px; }

/* Apps recomendadas para ver dispositivos conectados */
.app-row {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 9px;
  background: #f8fafd; transition: border-color 0.15s, background 0.15s;
}
.app-row:last-child { margin-bottom: 0; }
.app-row:hover { border-color: var(--blue); background: #fff; }
.app-ic { width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; background: var(--soft-blue); display: flex; align-items: center; justify-content: center; }
.app-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.app-name { font-family: "Sora"; font-weight: 700; font-size: 14px; color: var(--ink); }
.app-desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* Equipos en tu red */
.eq-row { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 12px; }
.eq-row:last-child { margin-bottom: 0; }
.eq-row svg { flex-shrink: 0; margin-top: 1px; }
.eq-txt { font-size: 13px; color: #5c6b85; line-height: 1.5; }

/* ════════════ Equipo y conexiones (router ONU) ════════════ */
.router-art { display: flex; align-items: center; gap: 16px; padding: 4px 0 14px; }
.router-art svg { flex-shrink: 0; filter: drop-shadow(0 8px 14px rgba(15, 27, 51, 0.10)); }
.router-meta .router-model { font-family: "Sora"; font-weight: 800; font-size: 16px; color: var(--ink); }
.router-meta .router-mode { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.lan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin: 0 0 12px; }
.lan-port { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafd; }
.lan-led { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.lan-name { font-family: "Sora"; font-weight: 700; font-size: 12.5px; color: var(--ink); }
.lan-state { margin-left: auto; font-size: 11.5px; font-weight: 700; }
.lan-empty { grid-column: 1 / -1; color: var(--muted); font-size: 13px; padding: 6px 0; }

/* ════════════ Historial ════════════ */
.hist-row { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.hist-row:last-child { border-bottom: none; }
.hist-row .led { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.hist-row .meta { flex: 1; min-width: 0; }
.hist-row .top { font-family: "Sora"; font-weight: 700; font-size: 14px; color: var(--ink); }
.hist-row .when { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hist-row .ced { font-family: "Space Mono", monospace; font-size: 12px; color: var(--muted-2); }
.hist-empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* ════════════ Selección de servicio (cédula con varios) ════════════ */
.serv-list { display: flex; flex-direction: column; gap: 10px; }
.serv-card {
  position: relative; display: flex; align-items: flex-start; gap: 13px; cursor: pointer;
  border: 1.5px solid #e6ecf5; border-radius: 14px; padding: 14px 16px; transition: border-color 0.15s, background 0.15s;
}
.serv-card:hover { border-color: #c7d3ea; background: #f8fafd; }
.serv-card input { position: absolute; opacity: 0; pointer-events: none; }
.serv-radio { flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; border: 2px solid #c7d0df; transition: all 0.15s; position: relative; }
.serv-card input:checked ~ .serv-radio { border-color: var(--blue); }
.serv-card input:checked ~ .serv-radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--blue); }
.serv-card:has(input:checked) { border-color: var(--blue); background: var(--soft-blue); }
.serv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.serv-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.serv-num { font-family: "Sora"; font-weight: 800; font-size: 15px; color: var(--ink); }
.serv-plan { font-size: 13.5px; font-weight: 700; color: var(--blue); line-height: 1.35; }
.serv-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.serv-user { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }

/* ════════════ Secciones numeradas (jerarquía visual) ════════════ */
.sec { display: flex; align-items: center; gap: 12px; margin: 30px 0 14px; }
.sec:first-of-type { margin-top: 6px; }
.sec-num {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 9px; background: var(--blue); color: #fff;
  font-family: "Sora"; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.sec-ic { width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; background: var(--soft-blue); display: flex; align-items: center; justify-content: center; }
.sec-t { font-family: "Sora"; font-weight: 800; font-size: 17px; letter-spacing: -0.3px; }
.sec-s { font-size: 13px; color: var(--muted); margin-top: 1px; }

/* Dos columnas para secciones con varias tarjetas (escritorio) */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }

/* Indicador de calidad de fibra (4 segmentos) */
.sq { margin-bottom: 14px; }
.sq-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sq-label { font-family: "Sora"; font-weight: 700; font-size: 14px; color: var(--ink); }
.sq-bar { display: flex; gap: 6px; }
.sq-seg { flex: 1; height: 9px; border-radius: 5px; }
.sq-scale { font-size: 11.5px; font-weight: 600; color: var(--muted-2); margin-top: 7px; }

/* Latencia real en la prueba de velocidad */
.lat-box { display: flex; align-items: center; gap: 9px; background: var(--soft-green); border-radius: 12px; padding: 11px 13px; margin-bottom: 12px; font-size: 13.5px; color: #0f7a4a; font-weight: 600; }

/* Selector de banda WiFi (2.4 / 5 GHz) */
.wifi-tabs { display: flex; gap: 8px; background: #e6ebf3; border-radius: 13px; padding: 5px; margin-bottom: 12px; }
.wifi-tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px; border: none; border-radius: 9px; background: transparent; cursor: pointer;
  font-family: "Sora"; font-weight: 700; font-size: 14px; color: var(--muted); transition: all 0.15s;
}
.wifi-tab.active { background: #fff; color: var(--blue); box-shadow: 0 2px 6px rgba(15, 27, 51, 0.08); }
.band-adv { display: flex; align-items: flex-start; gap: 9px; background: var(--soft-blue); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 13px; color: #41507a; line-height: 1.5; }

/* Guías rápidas */
.guide-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.guide-row:last-child { border-bottom: none; }
.guide-ic { width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; background: var(--soft-blue); display: flex; align-items: center; justify-content: center; }
.guide-t { font-family: "Sora"; font-weight: 700; font-size: 14px; color: var(--ink); }
.guide-d { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }

/* Preguntas frecuentes (acordeón nativo) */
.faq { border-bottom: 1px solid var(--line); }
.faq:last-child { border-bottom: none; }
.faq summary {
  list-style: none; cursor: pointer; padding: 13px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: "Sora"; font-weight: 700; font-size: 14.5px; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "▾"; color: var(--muted); transition: transform 0.2s; }
.faq[open] summary::after { transform: rotate(180deg); }
.faq-a { font-size: 13.5px; color: #5c6b85; line-height: 1.55; padding: 0 0 13px; }

/* ════════════ Capicom — mascota protagonista ════════════ */
/* Capicom es el carpincho de OPTICOM. Aparece en bienvenida, carga y error
   con animación y un globo de diálogo para darle personalidad. */
@keyframes capi-bob   { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-9px) rotate(1deg); } }
@keyframes capi-pop   { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
@keyframes capi-wave  { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(14deg); } 75% { transform: rotate(-8deg); } }
@keyframes bubble-in  { 0% { transform: translateY(8px) scale(0.92); opacity: 0; } 100% { transform: translateY(0) scale(1); opacity: 1; } }

/* Bienvenida con globo de diálogo */
.capi-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 6px; }
.capi-hero .capi-img {
  width: 132px; height: 132px; border-radius: 50%; object-fit: cover; object-position: 50% 28%;
  background: var(--soft-blue); border: 4px solid #fff;
  box-shadow: 0 14px 30px rgba(11, 26, 134, 0.22);
  animation: capi-bob 4s ease-in-out infinite;
}
.capi-bubble {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 11px 16px; max-width: 320px; box-shadow: var(--card-shadow);
  font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.45; text-align: center;
  animation: bubble-in 0.4s ease both 0.15s;
}
.capi-bubble b { color: var(--blue); }
.capi-bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%) rotate(45deg);
  width: 13px; height: 13px; background: #fff; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.capi-wave { display: inline-block; transform-origin: 70% 70%; animation: capi-wave 1.6s ease-in-out infinite; }

/* Carga: Capicom en un aro orbital */
.capi-stage { position: relative; width: 124px; height: 124px; display: grid; place-items: center; }
.capi-orbit {
  position: absolute; inset: 0; border-radius: 50%;
  border: 4px solid #dde5f5; border-top-color: var(--blue); border-right-color: var(--orange-soft);
  animation: spin 0.9s linear infinite;
}
.capi-loader {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover; object-position: 50% 28%;
  background: var(--soft-blue); animation: capi-bob 1.8s ease-in-out infinite;
}

/* Error: Capicom apenado con distintivo de alerta */
.capi-err { position: relative; width: 108px; height: 108px; margin: 0 auto 8px; }
.capi-err img {
  width: 108px; height: 108px; border-radius: 50%; object-fit: cover; object-position: 50% 28%;
  background: var(--soft-red); filter: saturate(0.75);
}
.capi-err .badge {
  position: absolute; right: -4px; bottom: -4px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--red); border: 3px solid #fff; display: flex; align-items: center; justify-content: center;
  animation: capi-pop 0.4s ease both 0.2s;
}

/* Éxito: Capicom contento con distintivo de check (mismo patrón que .capi-err) */
.capi-ok { position: relative; width: 108px; height: 108px; margin: 0 auto 8px; }
.capi-ok img {
  width: 108px; height: 108px; border-radius: 50%; object-fit: cover; object-position: 50% 28%;
  background: var(--soft-green);
}
.capi-ok .badge {
  position: absolute; right: -4px; bottom: -4px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--green); border: 3px solid #fff; display: flex; align-items: center; justify-content: center;
  animation: capi-pop 0.4s ease both 0.2s;
}

/* Capicom asomando en el chat vacío / invitando a escribir (solo lado cliente) */
.chat-empty-capi { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 18px 10px; }
.chat-empty-capi img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: 50% 28%; background: var(--soft-blue); }
.chat-empty-capi span { color: var(--muted); font-size: 12.5px; max-width: 240px; line-height: 1.5; }

.sup-empty-capi { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--card-shadow); }
.sup-empty-capi img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: 50% 28%; background: var(--soft-blue); flex-shrink: 0; }
.sup-empty-capi p { font-size: 13px; color: var(--ink); font-weight: 600; line-height: 1.45; margin: 0; }

/* ════════════ Responsive ════════════ */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0; height: auto; flex-direction: row; align-items: center;
    gap: 14px; padding: 12px 16px; z-index: 20;
  }
  .sidebar__brand { gap: 10px; }
  .brand-avatar { width: 40px; height: 40px; border-radius: 12px; }
  .brand-text .brand-sub { display: none; }
  .nav { flex-direction: row; gap: 6px; margin-left: auto; }
  .nav-item span { display: none; }
  .nav-item { padding: 10px; }
  .sidebar__foot { display: none; }
  .topbar { padding: 16px 18px; }
  .content { padding: 18px 16px 32px; }
  .topbar__title { font-size: 19px; }
}
@media (max-width: 560px) {
  .topbar__sub { display: none; }
  .badge-soporte { display: none; }
  .diag { flex-direction: column; text-align: center; }
}

/* ════════════════════════════════════════════════════════════
   Refinamientos de diseño (v2) — pulido, profundidad y accesibilidad.
   Bloque aditivo: solo mejora el acabado, no cambia la estructura.
   ════════════════════════════════════════════════════════════ */

/* ── Accesibilidad: foco visible SOLO por teclado (no molesta al mouse) ── */
:where(button, a, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.nav-item:focus-visible { outline-color: #fff; }        /* sobre el sidebar azul */
.input-wrap:focus-within { box-shadow: 0 0 0 4px rgba(23, 51, 219, 0.12); }
.onu-input:focus, .code-input:focus { box-shadow: 0 0 0 4px rgba(23, 51, 219, 0.12); }

/* ── Profundidad: lavado sutil de color en el área de trabajo ── */
.content {
  background:
    radial-gradient(1100px 380px at 100% -6%, rgba(23, 51, 219, 0.05), transparent 60%),
    radial-gradient(820px 360px at -8% 112%, rgba(255, 84, 18, 0.035), transparent 55%),
    var(--bg);
}

/* ── Micro-interacciones: elevación suave de tarjetas y KPIs ── */
.card, .kpi, .widget { transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.kpi:hover, .widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(15, 27, 51, 0.05), 0 16px 34px rgba(15, 27, 51, 0.10);
  border-color: #e2e9f5;
}

/* ── Botones: realce al pasar y respuesta táctil al presionar ── */
.btn-primary { transition: filter 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 30px rgba(23, 51, 219, 0.30); }
.btn-primary:active { transform: translateY(0); filter: brightness(0.98); box-shadow: 0 6px 14px rgba(23, 51, 219, 0.24); }
.onu-btn:active:not(:disabled), .btn-ghost:active, .chip:active, .btn-icon:active { transform: translateY(1px); }

/* ── Navegación: barra de acento naranja en el ítem activo ── */
.nav-item { position: relative; }
.nav-item.active::before {
  content: ""; position: absolute; left: -20px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--orange-soft);
}

/* ── Entrada suave del contenido al cambiar de pantalla ── */
#screen > * { animation: screen-in 0.35s ease both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── Separación sutil del topbar y barra de scroll discreta ── */
.topbar { box-shadow: 0 1px 0 rgba(15, 27, 51, 0.04); }
.content::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb { background: #d9e1ee; border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
.content::-webkit-scrollbar-thumb:hover { background: #c7d3ea; background-clip: padding-box; }

/* ── Respeto a quienes prefieren menos movimiento ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ── Etiquetas de sección: distinguen ACCIÓN (modifica el equipo) de INFORMATIVO (solo lectura) ── */
.sec-t { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sec-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: "Manrope"; font-weight: 800; font-size: 10.5px; letter-spacing: 0.4px;
  text-transform: uppercase; padding: 3px 9px 3px 7px; border-radius: 999px; white-space: nowrap;
}
.sec-tag svg { flex-shrink: 0; }
.sec-tag--accion { background: var(--soft-amber); color: #b45309; box-shadow: inset 0 0 0 1px #f6d9a8; }
.sec-tag--info { background: #eef1f7; color: var(--muted); box-shadow: inset 0 0 0 1px #e2e8f2; }

/* ════════════════════════════════════════════════════════════
   Pestañas del resultado (Inicio / Servicio / Equipo / WiFi / Señal /
   Velocidad / Soluciona / Soporte / Planes / Referidos) — mismas
   secciones que la app móvil, organizadas en pestañas horizontales.
   ════════════════════════════════════════════════════════════ */
.result-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.result-tab {
  display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: #fff;
  color: var(--muted); border-radius: 999px; padding: 9px 16px; font-family: "Sora"; font-weight: 700;
  font-size: 13.5px; cursor: pointer; transition: all 0.15s;
}
.result-tab:hover { border-color: var(--blue); color: var(--blue); }
.result-tab.active { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(23, 51, 219, 0.22); }

/* Cabecera simple de cada pestaña (reemplaza a .sec numerado cuando cada
   sección ya vive en su propia pestaña, sin necesidad de un paso 1-2-3). */
.tab-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.tab-head-ic { width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; background: var(--soft-blue); display: flex; align-items: center; justify-content: center; }
.tab-head-t { font-family: "Sora"; font-weight: 800; font-size: 17px; letter-spacing: -0.3px; }
.tab-head-s { font-size: 13px; color: var(--muted); margin-top: 1px; }

/* ── Pestaña Inicio: portada tipo "perfil" (igual que el panel admin y la app móvil) ── */
.dash-cover { border-radius: 20px; overflow: hidden; box-shadow: var(--card-shadow); margin-bottom: 18px; background: #fff; border: 1px solid var(--line); }
.dash-cover-banner { height: 84px; background: linear-gradient(120deg, #1b3cec 0%, #3552f2 45%, #ff5412 130%); position: relative; overflow: hidden; }
.dash-cover-accent { position: absolute; right: -30px; top: -30px; width: 130px; height: 130px; border-radius: 65px; background: #fff; opacity: 0.14; }
.dash-cover-body { padding: 0 22px 20px; margin-top: -32px; }
.dash-avatar { width: 64px; height: 64px; border-radius: 18px; border: 4px solid #fff; background: #fff; box-shadow: var(--card-shadow); overflow: hidden; }
.dash-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.dash-hi { font-family: "Sora"; font-weight: 800; font-size: 19px; color: var(--ink); margin-top: 12px; }
.dash-sub { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.5; max-width: 480px; }
.dash-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Tarjetas de resumen (Cuenta / Conexión / Señal) */
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.dash-stat {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--card-shadow);
  padding: 16px; text-align: center; cursor: pointer; font-family: inherit; transition: transform 0.12s, box-shadow 0.12s;
}
.dash-stat:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(15, 27, 51, 0.1); }
.dash-stat-v { display: block; font-family: "Sora"; font-weight: 800; font-size: 15px; }
.dash-stat small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 4px; }

.dash-title { font-family: "Sora"; font-weight: 800; font-size: 16px; color: var(--ink); margin: 0 0 12px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.dash-tile {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--card-shadow);
  padding: 18px 10px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; font-family: "Sora"; font-weight: 700; font-size: 12.5px; color: var(--ink); text-align: center;
  transition: transform 0.12s, box-shadow 0.12s;
}
.dash-tile:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(15, 27, 51, 0.1); }
.dash-tile-ic { width: 44px; height: 44px; border-radius: 13px; background: var(--soft-blue); display: flex; align-items: center; justify-content: center; }

/* ── Pestaña Soporte: elegir área → tipo de problema → detalle opcional ── */
.area-tile { display: flex; align-items: center; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.area-tile:last-child { border-bottom: none; }
.area-ic { width: 42px; height: 42px; flex-shrink: 0; border-radius: 13px; display: flex; align-items: center; justify-content: center; }
.area-tile-body { flex: 1; min-width: 0; }
.area-tile-t { font-family: "Sora"; font-weight: 700; font-size: 15px; color: var(--ink); }
.area-tile-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.area-mini-tag { display: inline-flex; align-items: center; font-family: "Sora"; font-weight: 800; font-size: 11px; border-radius: 999px; padding: 3px 9px; }

.sup-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.sup-row:last-child { border-bottom: none; }
.sup-row-t { font-family: "Sora"; font-weight: 700; font-size: 14.5px; color: var(--ink); }
.sup-row-meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sup-chevron { font-family: "Sora"; font-weight: 800; font-size: 20px; color: var(--muted-2); }
.sup-sending { text-align: center; padding-top: 10px; font-size: 12.5px; color: var(--muted); font-weight: 600; }

.back-row { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; }

.textarea {
  width: 100%; min-height: 84px; border-radius: 12px; background: #f4f7fc; border: 1.5px solid #e6ecf5;
  padding: 12px 14px; font-family: "Manrope"; font-size: 14px; color: var(--ink); resize: vertical;
}
.textarea:focus { outline: none; border-color: var(--blue); }
.textarea-hint { font-size: 11.5px; color: var(--muted); margin-top: 8px; line-height: 1.4; }

.sup-btns { display: flex; gap: 12px; margin: 4px 0 18px; flex-wrap: wrap; }
.sup-btn {
  flex: 1; min-width: 160px; border-radius: 16px; padding: 16px; text-align: center; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.sup-btn span { font-size: 20px; }
.sup-btn div { font-family: "Sora"; font-weight: 700; font-size: 14px; }
.sup-btn small { font-size: 11.5px; font-weight: 600; }
.sup-btn.wa { background: var(--soft-green); color: #0f7a4a; }
.sup-btn.call { background: var(--soft-blue); color: var(--blue); }

.ok-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--soft-green); display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.ticket-box { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #f4f7fc; border-radius: 13px; padding: 12px 16px; margin: 14px auto 0; max-width: 320px; font-size: 13px; }
.p-muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
.p-msg { font-size: 13px; font-weight: 600; margin: 8px 0; }

.admin-input {
  width: 100%; height: 48px; border-radius: 12px; background: #f4f7fc; border: 1.5px solid #e6ecf5;
  padding: 0 14px; font-family: "Manrope"; font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 11px;
}
.admin-input:focus { outline: none; border-color: var(--blue); }
.admin-input::placeholder { color: var(--muted-2); font-weight: 500; }

/* ── Pestaña Planes ── */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.plan-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--card-shadow); overflow: hidden; display: flex; flex-direction: column; }
.plan-img { width: 100%; height: 140px; object-fit: cover; }
.plan-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.plan-t { font-family: "Sora"; font-weight: 800; font-size: 16px; color: var(--ink); }
.plan-vel { font-size: 13px; font-weight: 700; color: var(--blue); }
.plan-desc { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 2px 0 8px; flex: 1; }
.plan-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.plan-price { font-family: "Sora"; font-weight: 800; font-size: 17px; color: var(--ink); }
.plan-btn { height: 42px; padding: 0 18px; width: auto; text-decoration: none; }

@media (max-width: 640px) {
  .result-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .result-tab { flex-shrink: 0; }
}

/* ── Chat de soporte (ticket): texto / imagen / video / audio ── */
.chat-box {
  display: flex; flex-direction: column; gap: 10px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  max-height: 320px; overflow-y: auto; margin-top: 6px;
}
.chat-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 14px 0; }
.chat-msg { display: flex; flex-direction: column; max-width: 82%; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.other { align-self: flex-start; align-items: flex-start; }
.chat-bubble { border-radius: 14px; padding: 8px 12px; font-size: 13.5px; line-height: 1.45; word-break: break-word; }
.chat-msg.mine .chat-bubble { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.other .chat-bubble { background: #fff; border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 4px; }
.chat-bubble img { max-width: 220px; border-radius: 10px; display: block; }
.chat-bubble video { max-width: 240px; border-radius: 10px; display: block; }
.chat-bubble audio { width: 220px; }
.chat-hora { font-size: 10.5px; color: var(--muted); margin-top: 3px; padding: 0 3px; }
.chat-compose { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.chat-text {
  flex: 1; height: 42px; border-radius: 999px; background: #f4f7fc; border: 1.5px solid #e6ecf5;
  padding: 0 15px; font-family: "Manrope"; font-size: 13.5px; color: var(--ink);
}
.chat-text:focus { outline: none; border-color: var(--blue); }
.chat-attach, .chat-send {
  width: 40px; height: 40px; border-radius: 50%; border: none; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.chat-attach { background: var(--soft-blue); }
.chat-send { background: var(--blue); }
.chat-send:disabled, .chat-attach:disabled { opacity: 0.5; cursor: default; }

/* Fila de "Mis reportes": pista de que se puede tocar para chatear */
.sup-chat-hint { font-size: 11.5px; font-weight: 700; color: var(--blue); margin-top: 6px; }

/* ── Chat en vivo del cliente con su ticket (overlay a pantalla completa) ── */
.chat-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.chat-modal {
  width: 100%; max-width: 520px; height: 88vh; height: 88dvh; max-height: 720px;
  background: #fff; border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
}
.chat-modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.chat-modal-back {
  width: 34px; height: 34px; border-radius: 50%; border: none; background: #f4f7fc;
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.chat-modal-info { flex: 1; min-width: 0; }
.chat-modal-t { font-family: "Sora"; font-weight: 800; font-size: 14.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-modal-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.chat-modal-box { flex: 1; margin: 12px 16px; max-height: none; }
.chat-cerrado {
  display: flex; align-items: center; gap: 8px; margin: 0 16px 14px; padding: 10px 12px;
  background: #f4f7fc; border-radius: 12px; color: var(--muted); font-size: 12px; line-height: 1.5;
}
.chat-modal .chat-compose { margin: 0 16px 16px; }

@media (max-width: 560px) {
  .chat-overlay { padding: 0; }
  .chat-modal { max-width: none; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
}

/* ── Portal de agentes: layout de conversaciones (estilo WhatsApp Web) ── */
.wa-shell { display: flex; height: 100vh; height: 100dvh; background: #fff; overflow: hidden; }
.wa-sidebar { width: 360px; flex-shrink: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: #fbfcfe; }
.wa-sb-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; }
.wa-sb-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wa-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-family: "Sora"; font-weight: 800; font-size: 16px; flex-shrink: 0; }
.wa-sb-name { font-family: "Sora"; font-weight: 800; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.wa-sb-area { font-size: 12px; color: var(--muted); margin-top: 1px; }
.wa-disponible {
  margin: 0 16px 12px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center; gap: 8px; font-family: "Manrope"; font-weight: 700;
  font-size: 12.5px; color: var(--muted); cursor: pointer;
}
.wa-disponible .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); }
.wa-disponible.on { border-color: var(--green); color: var(--green); background: var(--soft-green); }
.wa-disponible.on .dot { background: var(--green); }
.wa-disponible.off .dot { background: var(--muted-2); }
.wa-search { margin: 0 16px 10px; display: flex; align-items: center; gap: 8px; background: #f4f7fc; border-radius: 10px; padding: 0 12px; height: 38px; }
.wa-search input { flex: 1; border: none; background: transparent; font-family: "Manrope"; font-size: 13px; color: var(--ink); outline: none; }
.wa-tabs { display: flex; gap: 6px; padding: 0 16px 10px; }
.wa-tab { flex: 1; border: none; background: #f1f4fa; color: var(--muted); border-radius: 999px; padding: 7px 0; font-family: "Manrope"; font-weight: 700; font-size: 12px; cursor: pointer; }
.wa-tab.active { background: var(--blue); color: #fff; }
.wa-conv-list { flex: 1; overflow-y: auto; border-top: 1px solid var(--line); }
.wa-conv-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 30px 16px; }
.wa-conv { display: flex; gap: 10px; padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--line); }
.wa-conv:hover { background: #f4f7fc; }
.wa-conv.active { background: var(--soft-blue); }
.wa-conv-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: "Sora"; font-weight: 800; font-size: 13px; flex-shrink: 0; text-transform: uppercase; }
.wa-conv-body { flex: 1; min-width: 0; }
.wa-conv-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.wa-conv-name { font-family: "Sora"; font-weight: 700; font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-conv-time { font-size: 10.5px; color: var(--muted); flex-shrink: 0; }
.wa-conv-preview { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-conv-tags { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.wa-tag-unassigned { font-size: 10.5px; font-weight: 800; color: var(--red); background: var(--soft-red); border-radius: 999px; padding: 2px 8px; }
.wa-tag-owner { font-size: 10.5px; font-weight: 700; color: var(--muted); }

.wa-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.wa-empty { margin: auto; text-align: center; color: var(--muted); font-family: "Manrope"; font-weight: 600; font-size: 14px; }
.wa-empty-ic { font-size: 40px; margin-bottom: 10px; }
.wa-chat { flex: 1; display: flex; flex-direction: row; min-height: 0; }
.wa-chat-col { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.wa-chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.wa-chat-title { font-family: "Sora"; font-weight: 800; font-size: 15.5px; color: var(--ink); }
.wa-chat-sub { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
/* Panel de detalles: columna fija a la derecha del chat, siempre visible. */
.wa-details { width: 320px; flex-shrink: 0; background: #fff; border-left: 1px solid var(--line); padding: 18px; overflow-y: auto; }
.wa-details-sep { height: 1px; background: var(--line); margin: 14px 0; }
.wa-chat-box { flex: 1; max-height: none; margin: 14px 18px; }

@media (max-width: 860px) {
  .wa-shell { flex-direction: column; height: auto; }
  .wa-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--line); max-height: 46vh; }
  .wa-main { min-height: 60vh; }
  .wa-chat { flex-direction: column; }
  .wa-details { width: 100%; flex-shrink: 1; border-left: none; border-top: 1px solid var(--line); max-height: 40vh; }
}

/* ── Panel de WiFi: campos con ojo, reglas en vivo y estado "sin WiFi" ── */
.wifi-capi { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.wifi-capi img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 28%; background: var(--soft-blue); flex-shrink: 0; }
.wifi-capi p { margin: 0; font-size: 13px; color: var(--ink); font-weight: 600; line-height: 1.45; }

.onu-pass-wrap { position: relative; display: flex; }
.onu-pass-wrap .onu-input { width: 100%; padding-right: 44px; }
.onu-pass-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: none; background: transparent; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.onu-pass-eye:hover { background: #eef2f8; }
.onu-input.is-espejo { background: #eef2f8; color: var(--muted); cursor: not-allowed; }

.wifi-misma { display: flex; align-items: center; gap: 9px; margin: 12px 0 4px; cursor: pointer; font-size: 13px; color: var(--ink); font-weight: 600; }
.wifi-misma input { width: 17px; height: 17px; accent-color: var(--blue); cursor: pointer; }

.wifi-reglas { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; }
.wifi-reglas:empty { margin: 0; }
.wifi-regla { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }

.wifi-sin { text-align: center; padding: 26px 20px; }
.wifi-sin img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; object-position: 50% 28%; background: var(--soft-blue); }
.wifi-sin h3 { font-family: "Sora"; font-weight: 800; font-size: 18px; color: var(--ink); margin: 14px 0 8px; }
.wifi-sin p { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin: 0 auto; max-width: 380px; }
.wifi-sin-modelo { margin-top: 12px; font-size: 12px; color: var(--muted-2); }
.wifi-sin .btn-ghost { margin-left: auto; margin-right: auto; }
