/* ============================================================
   OPTICOM — Portal del cliente ("Mi cuenta"), tema oscuro.
   Menú lateral con perfil + barra superior con menú de usuario
   + tarjetas de indicadores. Rubik / Space Mono.
   ============================================================ */

:root {
  --bg: #000000;
  --card: #191c24;
  --card-2: #12151e;
  --line: #2c2e33;
  --ink: #ffffff;
  --text: #c9cce0;
  --muted: #6c7293;
  --muted-2: #8f94b3;
  --blue: #4f6bff;
  --sky: #0090e7;
  --green: #00d25b;
  --amber: #ffab00;
  --red: #fc424a;
  --purple: #8f5fe8;
  --orange: #ff7a1a;
  --soft-blue: rgba(79, 107, 255, 0.12);
  --soft-green: rgba(0, 210, 91, 0.12);
  --soft-amber: rgba(255, 171, 0, 0.12);
  --soft-red: rgba(252, 66, 74, 0.12);
  --radius: 6px;
  --side-w: 244px;
  --side-mini: 70px;
  --nav-h: 70px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
input, button, select { font-family: inherit; }
input:focus { outline: none; }
a { color: inherit; }
.mono { font-family: "Space Mono", monospace; }

/* ════════════ Marca ════════════ */
.wordmark { font-weight: 700; font-size: 22px; letter-spacing: 3px; text-transform: uppercase; color: #fff; }
.wordmark span { color: var(--orange); }

/* ════════════ Botones ════════════ */
.btn-primary {
  width: 100%; height: 48px; border: none; border-radius: var(--radius);
  background: var(--blue); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter 0.15s, transform 0.12s;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-ghost {
  height: 42px; padding: 0 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: transparent; color: var(--ink); font-weight: 500; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); }
.btn-danger {
  height: 42px; padding: 0 18px; border: none; border-radius: var(--radius);
  background: var(--red); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer;
}
.btn-danger:hover { filter: brightness(1.08); }
.link { color: var(--blue); font-weight: 500; cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }

:where(button, a, summary, [tabindex], input, select):focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ════════════ Pantallas de acceso ════════════ */
.auth {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(700px 380px at 85% 0%, rgba(79, 107, 255, 0.16), transparent 65%),
    radial-gradient(600px 340px at 0% 100%, rgba(255, 122, 26, 0.10), transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 440px; background: var(--card); border-radius: 10px;
  padding: 32px 30px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: screen-in 0.35s ease both;
}
.auth-brand { margin-bottom: 26px; }
.auth-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.auth-hero .capi-img {
  width: 76px; height: 76px; flex-shrink: 0; border-radius: 50%; object-fit: cover; object-position: 50% 28%;
  background: var(--soft-blue); border: 3px solid var(--line); animation: capi-bob 4s ease-in-out infinite;
}
.auth-title { font-size: 22px; font-weight: 600; color: var(--ink); margin: 0 0 6px; }
.auth-sub { font-size: 14px; color: var(--muted-2); line-height: 1.5; margin: 0 0 20px; }
.auth-sub strong { color: var(--ink); font-weight: 600; }
.auth-note { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 18px 0 0; }
.auth-note svg { flex-shrink: 0; margin-top: 1px; }
.auth-alt { text-align: center; margin-top: 14px; font-size: 13.5px; }
.auth-foot { margin-top: 22px; font-size: 12px; color: var(--muted); }

.flash { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-radius: var(--radius); font-size: 13.5px; font-weight: 500; margin-bottom: 18px; }
.flash svg { flex-shrink: 0; }

.steps { display: flex; align-items: center; gap: 8px; margin: 0 0 20px; }
.step { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.step.active { color: var(--ink); }
.step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; }
.step.active .step-n { background: var(--blue); border-color: var(--blue); color: #fff; }
.step-line { flex: 1; min-width: 14px; height: 1px; background: var(--line); }

.label { display: block; font-size: 13px; font-weight: 500; color: var(--muted-2); margin-bottom: 8px; }
.input-wrap {
  display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 14px;
  border-radius: var(--radius); background: var(--card-2); border: 1px solid var(--line); transition: border-color 0.15s, box-shadow 0.15s;
}
.input-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79, 107, 255, 0.18); }
.input-wrap.error { border-color: var(--red); }
.input-wrap svg { flex-shrink: 0; }
.input-wrap input { flex: 1; border: none; background: transparent; font-size: 16px; font-weight: 500; letter-spacing: 0.4px; color: var(--ink); min-width: 0; }
.input-wrap input::placeholder { color: var(--muted); font-weight: 400; }
.field-error { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--red); font-size: 13px; font-weight: 500; line-height: 1.4; }
.hint { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 14px; color: var(--muted); font-size: 12.5px; text-align: center; }

.verif-icon { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%; background: var(--soft-blue); display: flex; align-items: center; justify-content: center; }
.code-wrap { justify-content: center; }
.code-input { text-align: center; font-family: "Space Mono", monospace !important; font-size: 26px !important; letter-spacing: 12px !important; font-weight: 700; width: 100%; padding-left: 12px; }

/* Selección de servicio */
.serv-list { display: flex; flex-direction: column; gap: 10px; }
.serv-card {
  position: relative; display: flex; align-items: flex-start; gap: 13px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--card-2);
  transition: border-color 0.15s, background 0.15s;
}
.serv-card:hover { border-color: #3e4150; }
.serv-card input { position: absolute; opacity: 0; pointer-events: none; }
.serv-radio { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid #4a4e5c; 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-card input:focus-visible ~ .serv-radio { outline: 2px solid var(--blue); outline-offset: 2px; }
.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-weight: 600; font-size: 15px; color: var(--ink); }
.serv-plan { font-size: 13.5px; font-weight: 500; color: var(--blue); }
.serv-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }

/* Carga / error */
.loading { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.loading .lt { font-weight: 600; font-size: 17px; color: var(--ink); }
.loading .ls { font-size: 13.5px; color: var(--muted-2); margin-top: 6px; max-width: 300px; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
.spinner-sm { width: 17px; height: 17px; border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
.errbox { text-align: center; }
.errbox h2 { font-size: 19px; font-weight: 600; color: var(--ink); margin: 6px 0 0; }
.errbox p { font-size: 14px; color: var(--muted-2); margin: 8px 0 20px; line-height: 1.5; }

/* Capicom (mascota) */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes capi-bob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-6px) rotate(1deg); } }
@keyframes capi-pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.capi-stage { position: relative; width: 118px; height: 118px; display: grid; place-items: center; }
.capi-orbit { position: absolute; inset: 0; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--blue); border-right-color: var(--orange); animation: spin 0.9s linear infinite; }
.capi-loader { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; object-position: 50% 28%; background: var(--soft-blue); animation: capi-bob 1.8s ease-in-out infinite; }
.capi-err { position: relative; width: 100px; height: 100px; margin: 0 auto 8px; }
.capi-err img { width: 100px; height: 100px; 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: 36px; height: 36px; border-radius: 50%; background: var(--red); border: 3px solid var(--card); display: flex; align-items: center; justify-content: center; animation: capi-pop 0.4s ease both 0.2s; }

/* ════════════ Portal: estructura ════════════ */
.layout { min-height: 100vh; }
.side {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--side-w); z-index: 40;
  background: var(--card); display: flex; flex-direction: column; overflow-y: auto;
  transition: width 0.2s ease, transform 0.25s ease;
}
.side-brand { height: var(--nav-h); display: flex; align-items: center; padding: 0 22px; flex-shrink: 0; }
.side-profile { display: flex; align-items: center; gap: 12px; padding: 12px 22px 18px; }
.avatar {
  position: relative; width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px;
}
.avatar--sm { width: 34px; height: 34px; font-size: 12.5px; }
.avatar-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--card); }
.side-who { min-width: 0; }
.side-name { color: var(--ink); font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-plan { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-label { padding: 6px 22px 10px; color: var(--muted); font-size: 13px; font-weight: 500; }
.nav { display: flex; flex-direction: column; padding-right: 14px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 9px 22px;
  color: var(--muted-2); text-decoration: none; font-size: 14px; border-radius: 0 100px 100px 0;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.03); }
.nav-item.active { background: #0f1015; color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }
.nav-ic { width: 31px; height: 31px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.nav-t { white-space: nowrap; }
.side-card {
  margin: auto 16px 18px; padding: 14px; border-radius: 8px; background: var(--card-2);
  display: flex; gap: 10px; font-size: 12px; color: var(--muted); line-height: 1.45;
}
.side-card svg { flex-shrink: 0; margin-top: 1px; }
.side-card b { display: block; color: var(--ink); font-weight: 500; font-size: 13px; margin-bottom: 2px; }
.side-backdrop { display: none; }

.main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.2s ease; min-width: 0; }
.navbar {
  position: sticky; top: 0; z-index: 30; height: var(--nav-h); display: flex; align-items: center; gap: 14px;
  padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line);
}
.nb-btn {
  position: relative; width: 40px; height: 40px; flex-shrink: 0; border: none; border-radius: var(--radius);
  background: transparent; color: var(--muted-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.nb-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.nb-btn.spinning svg { animation: spin 0.8s linear infinite; }
.nb-badge {
  position: absolute; top: 5px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.nb-badge[hidden] { display: none; }
.nb-title { min-width: 0; }
.nb-title h1 { margin: 0; font-size: 17px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.nb-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nb-user {
  display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 4px; margin-left: 6px;
  border: none; background: transparent; color: var(--ink); cursor: pointer; border-radius: var(--radius); font-size: 14px;
}
.nb-user:hover { background: rgba(255, 255, 255, 0.05); }

/* Menús desplegables */
.dd { position: relative; }
.dd-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 280px; z-index: 50;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); padding: 6px 0;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.dd-menu--wide { width: 320px; }
.dd.open .dd-menu { opacity: 1; visibility: visible; transform: none; }
.dd-head { padding: 10px 16px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dd-name { color: var(--ink); font-weight: 500; font-size: 14px; }
.dd-mail { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.dd-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; border: none; background: transparent;
  color: var(--text); text-decoration: none; font-size: 14px; cursor: pointer; text-align: left;
}
.dd-item:hover { background: rgba(255, 255, 255, 0.04); color: #fff; }
.dd-item .nav-ic { width: 30px; height: 30px; }
.dd-item--out { color: var(--red); }
.dd-item--out:hover { color: var(--red); background: var(--soft-red); }
.dd-sep { height: 1px; background: var(--line); margin: 6px 0; }
.dd-aviso { display: flex; gap: 12px; padding: 10px 16px; font-size: 13px; line-height: 1.45; }
.dd-aviso b { display: block; color: var(--ink); font-weight: 500; }
.dd-aviso span { color: var(--muted-2); }
.dd-aviso .nav-ic { width: 30px; height: 30px; }
.dd-empty { display: flex; align-items: center; gap: 8px; padding: 12px 16px; color: var(--muted-2); font-size: 13px; }

.content { flex: 1; padding: 26px 24px 30px; }
.page { animation: screen-in 0.3s ease both; }
.foot { padding: 18px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; background: var(--bg); }

/* Menú plegado (escritorio): solo íconos */
.side-mini .side { width: var(--side-mini); }
.side-mini .main { margin-left: var(--side-mini); }
.side-mini .side-brand { justify-content: center; padding: 0; }
.side-mini .wordmark { font-size: 0; letter-spacing: 0; }
.side-mini .wordmark::before { content: "O"; font-size: 22px; color: #fff; }
.side-mini .side-profile { justify-content: center; padding: 12px 0 18px; }
.side-mini .side-who, .side-mini .side-label, .side-mini .nav-t, .side-mini .side-card { display: none; }
.side-mini .nav { padding-right: 0; }
.side-mini .nav-item { justify-content: center; padding: 9px 0; border-radius: 0; }

/* ════════════ Portal: contenido ════════════ */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.hello h2 { margin: 0; font-size: 22px; font-weight: 500; color: var(--ink); }
.hello p { margin: 4px 0 0; color: var(--muted-2); font-size: 14px; }
.updated { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 22px 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stat-v { color: var(--ink); font-size: 21px; font-weight: 500; line-height: 1.2; }
.stat-x { font-size: 12px; font-weight: 500; margin-left: 6px; }
.stat-l { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.stat-ic { width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; margin-bottom: 20px; }
.grid-1-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }

.widget { background: var(--card); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.grid-2 > .widget, .grid-1-2 > .widget, .grid-2-1 > .widget, .sec-grid > .widget { margin-bottom: 0; }
.card-title { color: var(--ink); font-size: 16px; font-weight: 500; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }

/* Anillo de calidad */
.donut { position: relative; width: 170px; height: 170px; margin: 6px auto 18px; }
.donut-svg { width: 100%; height: 100%; transform: none; }
.donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-v { font-size: 18px; font-weight: 500; }
.donut-l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.legend-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--card-2); font-size: 13px; color: var(--muted-2); }
.legend-row + .legend-row { margin-top: 8px; }
.legend-row b { color: var(--ink); font-weight: 400; font-size: 12.5px; }

/* Accesos rápidos */
.ql { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.ql:last-child { border-bottom: none; padding-bottom: 0; }
.ql:hover .ql-t { color: var(--blue); }
.ql-ic { width: 40px; height: 40px; flex-shrink: 0; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.ql-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ql-t { color: var(--ink); font-size: 14px; font-weight: 500; transition: color 0.15s; }
.ql-d { color: var(--muted); font-size: 12.5px; }

/* Filas clave/valor */
.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); flex-shrink: 0; }
.row .v { font-size: 13.5px; color: var(--ink); text-align: right; word-break: break-word; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }

/* Diagnóstico */
.diag { display: flex; align-items: flex-start; gap: 16px; border-radius: var(--radius); padding: 18px; border: 1px solid transparent; }
.diag .icon { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.diag h2 { font-size: 17px; font-weight: 500; color: var(--ink); margin: 2px 0 0; }
.diag p { font-size: 13.5px; color: var(--muted-2); margin: 6px 0 0; line-height: 1.5; }
.diag .consejos-lead { font-weight: 500; color: var(--text); margin: 8px 0 10px; }
.consejos-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.consejos-scroll::-webkit-scrollbar { height: 6px; }
.consejos-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.consejo-card { flex: 0 0 210px; scroll-snap-align: start; background: var(--card-2); border-radius: var(--radius); padding: 13px; display: flex; flex-direction: column; gap: 9px; }
.consejo-dot { width: 10px; height: 10px; border-radius: 50%; }
.consejo-txt { font-size: 13px; color: var(--text); line-height: 1.45; }
.advert { margin-top: 14px; border-radius: var(--radius); padding: 13px 15px; background: var(--soft-amber); display: flex; gap: 10px; font-size: 13px; color: #ffd27a; line-height: 1.45; }
.advert svg { flex-shrink: 0; }

/* Avisos de caída */
.aviso { display: flex; align-items: flex-start; gap: 11px; border: 1px solid; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; }
.aviso svg { flex-shrink: 0; margin-top: 1px; }
.aviso .aviso-t { font-weight: 500; font-size: 14.5px; }
.aviso .aviso-m { font-size: 13px; color: var(--muted-2); margin-top: 3px; line-height: 1.45; }

/* Señal */
.metric { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.metric:last-of-type { 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; flex-wrap: wrap; }
.metric .ml { font-weight: 500; font-size: 14px; color: var(--ink); }
.metric .tags { display: inline-flex; align-items: center; gap: 8px; }
.metric .tag { font-size: 12px; font-weight: 500; }
.metric .tech { font-family: "Space Mono", monospace; font-size: 11px; color: var(--muted-2); background: var(--card-2); padding: 2px 7px; border-radius: 4px; }
.sq { margin-bottom: 14px; }
.sq-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sq-label { font-weight: 500; font-size: 14px; color: var(--ink); }
.sq-bar { display: flex; gap: 6px; }
.sq-seg { flex: 1; height: 8px; border-radius: 4px; }
.sq-scale { font-size: 11.5px; color: var(--muted); margin-top: 7px; }

/* Acciones del equipo / WiFi */
.onu-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.onu-btn {
  height: 46px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card-2);
  color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 500; font-size: 14px; 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); }
.onu-btn:disabled { opacity: 0.6; cursor: default; }
.onu-btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.onu-btn.primary:hover:not(:disabled) { filter: brightness(1.1); }
.onu-msg { display: none; align-items: flex-start; gap: 9px; margin-top: 12px; padding: 11px 13px; border-radius: var(--radius); font-size: 13.5px; font-weight: 500; 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: #9aaaff; }
.onu-msg.ok { background: var(--soft-green); color: var(--green); }
.onu-msg.warn { background: var(--soft-amber); color: var(--amber); }
.onu-msg.err { background: var(--soft-red); color: #ff8a90; }
.onu-msg-note { display: block; margin-top: 4px; font-size: 12px; opacity: 0.85; }
.onu-sub { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin: 18px 0 10px; }
.onu-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card-2);
  cursor: pointer; font-weight: 500; font-size: 13px; color: var(--muted-2); display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover, .chip.active { border-color: var(--blue); color: #fff; }
.graph-box:not(:empty) { margin-top: 12px; }
.graph-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.graph-frame img { width: 100%; display: block; }
.graph-frame:has(.graph-state) { background: var(--card-2); }
.graph-state { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px 16px; color: var(--muted-2); font-size: 13.5px; text-align: center; }
.onu-clave { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.onu-input {
  height: 44px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card-2);
  padding: 0 13px; font-size: 14px; color: var(--ink); min-width: 0;
}
.onu-input::placeholder { color: var(--muted); }
.onu-input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(79, 107, 255, 0.18); }
.onu-hint { font-size: 13.5px; color: var(--muted-2); line-height: 1.55; }
.onu-hint b { color: var(--ink); font-weight: 500; }
.wifi-tabs { display: flex; gap: 6px; background: var(--card-2); border-radius: var(--radius); padding: 4px; margin-bottom: 12px; }
.wifi-tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; border: none;
  border-radius: 4px; background: transparent; cursor: pointer; font-weight: 500; font-size: 14px; color: var(--muted-2);
}
.wifi-tab.active { background: var(--blue); color: #fff; }
.band-adv { display: flex; align-items: flex-start; gap: 9px; background: var(--soft-blue); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; font-size: 13px; color: #b9c3ff; line-height: 1.5; }
.band-adv 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-weight: 500; font-size: 13px; color: var(--ink); }
.wifi-hist-w { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* Velocidad */
.speed-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.speed-row:last-child { border-bottom: none; }
.speed-row svg { flex-shrink: 0; }
.speed-t { font-weight: 500; font-size: 14px; color: var(--ink); }
.speed-d { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.lat-box { display: flex; align-items: center; gap: 9px; background: var(--soft-green); border-radius: var(--radius); padding: 11px 13px; margin-bottom: 12px; font-size: 13.5px; color: var(--green); }
.lat-box strong { color: #fff !important; }
.tip-box { display: flex; align-items: flex-start; gap: 9px; background: var(--soft-amber); border-radius: var(--radius); padding: 11px 13px; font-size: 13px; color: #ffd27a; line-height: 1.5; }
.tip-box svg { flex-shrink: 0; margin-top: 1px; }

/* Equipo */
.router-art { display: flex; align-items: center; gap: 16px; padding: 4px 0 14px; }
.router-art svg { flex-shrink: 0; }
.router-meta .router-model { font-weight: 500; font-size: 16px; color: var(--ink); }
.router-meta .router-mode { font-size: 13px; color: var(--muted-2); 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-radius: var(--radius); background: var(--card-2); }
.lan-led { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.lan-name { font-weight: 500; font-size: 12.5px; color: var(--ink); }
.lan-state { margin-left: auto; font-size: 11.5px; font-weight: 500; }
.lan-empty { grid-column: 1 / -1; color: var(--muted-2); font-size: 13px; padding: 6px 0; }
.eq-row { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 12px; }
.eq-row svg { flex-shrink: 0; margin-top: 1px; }
.eq-txt { font-size: 13.5px; color: var(--muted-2); line-height: 1.5; }
.app-row {
  display: flex; align-items: center; gap: 12px; text-decoration: none; border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 8px; background: var(--card-2); border: 1px solid transparent; transition: border-color 0.15s;
}
.app-row:last-child { margin-bottom: 0; }
.app-row:hover { border-color: var(--blue); }
.app-ic { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; 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-weight: 500; font-size: 14px; color: var(--ink); }
.app-desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* Guías y preguntas */
.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: 50%; background: var(--soft-blue); display: flex; align-items: center; justify-content: center; }
.guide-t { font-weight: 500; font-size: 14px; color: var(--ink); }
.guide-d { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.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-weight: 500; font-size: 14px; 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: var(--muted-2); line-height: 1.55; padding: 0 0 13px; }
.tech-details { margin-top: 4px; background: var(--card); border-radius: var(--radius); padding: 0 22px; border: 1px dashed var(--line); }
.tech-details summary { justify-content: flex-start; gap: 8px; font-size: 13px; color: var(--muted); }
.tech-details summary::after { margin-left: auto; }

/* Mis consultas */
.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-weight: 500; 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); }
.hist-empty { padding: 34px 20px; text-align: center; color: var(--muted-2); font-size: 14px; }

/* Ventana de confirmación */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade-in 0.15s ease both; }
.modal { width: 100%; max-width: 380px; background: var(--card); border-radius: 10px; padding: 26px 24px 22px; text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); animation: screen-in 0.2s ease both; }
.modal-ic { width: 58px; height: 58px; margin: 0 auto 12px; border-radius: 50%; background: var(--soft-red); display: flex; align-items: center; justify-content: center; }
.modal h3 { margin: 0; color: var(--ink); font-size: 18px; font-weight: 500; }
.modal p { margin: 8px 0 20px; color: var(--muted-2); font-size: 13.5px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions > * { flex: 1; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Barras de scroll discretas */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c2e33; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }

/* ════════════ Responsive ════════════ */
@media (max-width: 1199px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
  .side { transform: translateX(-100%); width: var(--side-w); box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); }
  .side-open .side { transform: none; }
  .side-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, 0.55); }
  .main, .side-mini .main { margin-left: 0; }
  .grid-2, .grid-1-2, .grid-2-1 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .navbar { padding: 0 10px; gap: 6px; }
  .nb-title p, .nb-user-name { display: none; }
  .nb-user { margin-left: 0; padding: 0 4px; }
  .content { padding: 18px 16px 24px; }
  .stat-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .stat { padding: 18px; }
  .auth-card { padding: 26px 20px; }
  .onu-clave, .onu-actions { grid-template-columns: 1fr; }
  .dd-menu, .dd-menu--wide { position: fixed; left: 12px; right: 12px; top: calc(var(--nav-h) + 6px); width: auto; }
  .diag { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* "Próximamente" (funciones en preparación) */
.soon {
  display: inline-flex; align-items: center; gap: 4px; vertical-align: middle;
  padding: 2px 8px; border-radius: 999px; background: var(--soft-amber); color: var(--amber);
  font-size: 10.5px; font-weight: 500; white-space: nowrap; letter-spacing: 0.2px;
}
.soon--dot { width: 7px; height: 7px; padding: 0; margin-left: auto; background: var(--amber); }
.side-mini .soon--dot { display: none; }
.dd-item--soon { cursor: default; opacity: 0.7; }
.dd-item--soon:hover { background: transparent; color: var(--text); }
.dd-item--soon .soon { margin-left: auto; flex-shrink: 0; }
.prox { text-align: center; padding: 30px 24px; }
.prox-ic { width: 66px; height: 66px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.prox .soon { display: flex; width: max-content; margin: 0 auto; }
.prox h3 { color: var(--ink); font-size: 18px; font-weight: 500; margin: 14px 0 8px; }
.prox p { color: var(--muted-2); font-size: 14px; line-height: 1.55; max-width: 440px; margin: 0 auto 20px; }
.prox-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.prox-actions .onu-btn { text-decoration: none; padding: 0 18px; }

/* ════════════ Capicom (variantes) ════════════ */
.auth-hero .capi-img, .capi-loader, .capi-err img { object-position: 50% 18%; }
.hello-l { display: flex; align-items: center; gap: 14px; }
.hello-capi { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; border: 2px solid var(--line); flex-shrink: 0; }
.prox-capi { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; border: 3px solid var(--line); margin-bottom: 12px; }

/* ════════════ Soporte: solicitudes + chat ════════════ */
.nav-new { width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-left: auto; box-shadow: 0 0 0 3px rgba(252, 66, 74, 0.2); }
.nav-new[hidden] { display: none; }
.side-mini .nav-new { position: absolute; top: 8px; right: 14px; margin: 0; }
.btn-sm {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: none; border-radius: var(--radius);
  background: var(--blue); color: #fff; font-weight: 500; font-size: 13px; cursor: pointer;
}
.btn-sm:hover { filter: brightness(1.1); }

.sop { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.sop > .widget { margin-bottom: 0; }
.sop-list-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
#sop-tickets { display: flex; flex-direction: column; gap: 6px; max-height: 560px; overflow-y: auto; }
.tk-row {
  display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; padding: 11px 12px; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius); background: var(--card-2); color: var(--text); font: inherit;
}
.tk-row:hover { border-color: var(--line); }
.tk-row.active { border-color: var(--blue); background: var(--soft-blue); }
.tk-top { display: flex; align-items: center; gap: 8px; }
.tk-tipo { flex: 1; min-width: 0; color: var(--ink); font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-new { flex-shrink: 0; padding: 1px 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 600; }
.tk-meta { font-size: 12px; color: var(--muted); }
.tk-est { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.tk-dot { width: 7px; height: 7px; border-radius: 50%; }

.sop-main { min-height: 480px; display: flex; flex-direction: column; }
.sop-intro { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.sop-capi { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; border: 3px solid var(--line); flex-shrink: 0; }
.sop-intro h3 { margin: 0 0 4px; color: var(--ink); font-size: 18px; font-weight: 500; }
.sop-intro p { margin: 0; color: var(--muted-2); font-size: 13.5px; line-height: 1.5; }
.sop-areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sop-area {
  height: 44px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card-2);
  color: var(--muted-2); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.sop-area:hover { color: #fff; }
.sop-area.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.sop-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sop-textarea { width: 100%; height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.5; font-family: inherit; }
.sop-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.sop-row2 .onu-input { width: 100%; }

.chat-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.chat-h-t { color: var(--ink); font-size: 16px; font-weight: 500; }
.chat-h-s { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.sop-ok { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 12px; border-radius: var(--radius); background: var(--soft-green); color: var(--green); font-size: 13.5px; font-weight: 500; }
.sop-ok img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; flex-shrink: 0; }
.chat-msgs { flex: 1; min-height: 280px; max-height: 460px; overflow-y: auto; padding: 16px 2px; display: flex; flex-direction: column; gap: 10px; }
.bub { max-width: 80%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.bub--yo { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.bub--sop { align-self: flex-start; background: var(--card-2); color: var(--text); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bub-who { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--green); margin-bottom: 3px; }
.bub-txt { white-space: pre-wrap; word-break: break-word; }
.bub-when { font-size: 11px; opacity: 0.6; margin-top: 4px; text-align: right; }
.chat-composer { display: flex; align-items: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.chat-input { flex: 1; height: auto; min-height: 44px; max-height: 140px; padding: 11px 13px; resize: none; line-height: 1.4; font-family: inherit; }
.chat-send { width: 44px; height: 44px; flex-shrink: 0; border: none; border-radius: 50%; background: var(--blue); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.chat-send:hover { filter: brightness(1.1); }
.chat-send:disabled { opacity: 0.5; cursor: default; }
.chat-note { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.chat-closed { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--soft-green); color: var(--text); font-size: 13.5px; }
.chat-closed svg { flex-shrink: 0; }

@media (max-width: 991px) {
  .sop { grid-template-columns: minmax(0, 1fr); }
  #sop-tickets { max-height: 260px; }
}
@media (max-width: 600px) {
  .sop-areas, .sop-row2 { grid-template-columns: 1fr; }
  .bub { max-width: 90%; }
  .hello-capi { width: 46px; height: 46px; }
}
