/* Portal de SIMs — hoja de estilos.
   Marca blanca: el color de cada cuenta entra por --brand / --brand-ink (lo fija app.js). La barra lateral se tiñe
   con ese mismo color, así cada cliente ve "su" portal sin que se pierda contraste. */
:root {
  --brand: #153c7d;
  --brand-ink: #ffffff;
  --side: color-mix(in oklab, var(--brand) 20%, #0a1224);
  --bg: #f2f5f9;
  --card: #ffffff;
  --text: #101828;
  --muted: #566074;
  --line: #e4e8ef;
  --danger: #b42318;
  --ok: #067647;
  --warn: #b54708;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .06);
  --st-1: #16a34a; --st-2: #d97706; --st-0: #4f46e5; --st-4: #94a3b8;
  font-family: Inter, "Segoe UI Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
em { font-style: normal; font-weight: 600; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.hidden { display: none !important; }

/* ---------- botones y formularios ---------- */
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 600; font-size: 13.5px;
  padding: 8px 14px; border-radius: 10px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: #c5ccd8; background: #f8fafc; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); background: var(--brand); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: #fef3f2; border-color: #fecdca; }
.btn.small { padding: 4px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.small.assign { background: color-mix(in srgb, var(--brand) 10%, white); border-color: color-mix(in srgb, var(--brand) 30%, white); color: var(--brand); }
.btn.lg { padding: 12px 18px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; justify-content: center; }
.btn.link { border: 0; background: none; color: var(--brand); padding: 0; text-decoration: underline; font-weight: 600; }
.btn.link:hover { background: none; }
.btn.link.nounder { text-decoration: none; }
.btn.link.nounder:hover { text-decoration: underline; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=tel], input[type=url], textarea, select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.field { display: block; margin-bottom: 14px; font-weight: 600; font-size: 13px; }
.field > span { display: block; margin-bottom: 5px; }
.field > .hint { margin-top: 4px; margin-bottom: 0; }
.field input[type=file] { display: block; width: 100%; margin-bottom: 8px; }
.hint { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.hint.pad { padding: 8px 8px 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 auto; }
.spacer { flex: 1; }
.right { text-align: right; }
.error { color: var(--danger); margin: 8px 0; min-height: 1.2em; font-size: 13px; }
.mono { font-family: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* ---------- acceso ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); min-height: 100vh; background: #fff; }
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 40px 56px 36px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  background: radial-gradient(1100px 700px at 70% 45%, #0b2f78 0%, #051a47 45%, #030b22 100%);
  clip-path: polygon(0 0, 100% 0, 91% 100%, 0 100%); padding-right: 12%;
}
.auth-art > * { position: relative; z-index: 1; }
.auth-globe { position: absolute !important; inset: 0; width: 100%; height: 100%; z-index: 0 !important; pointer-events: none; }
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-brand img { max-height: 58px; max-width: 260px; border-radius: 12px; display: block; }
.auth-brand img.tile { background: #fff; padding: 7px 12px; }
.auth-brand .bn { font-size: 21px; font-weight: 700; }
.auth-copy { max-width: 470px; }
.auth-art h1 { font-size: clamp(34px, 3.6vw, 52px); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 18px; text-shadow: 0 2px 24px rgba(3, 11, 34, .7); }
.auth-art h1 em { font-style: normal; color: #2f9bff; display: block; }
.auth-lead { color: #cfdcf5; font-size: 15.5px; line-height: 1.55; margin: 0 0 26px; text-shadow: 0 1px 14px rgba(3, 11, 34, .8); }
.auth-feats { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; flex-wrap: wrap; }
.auth-feats li { display: grid; justify-items: center; gap: 8px; width: 82px; text-align: center; font-size: 12px; line-height: 1.25; color: #dbe6fb; }
.auth-feats .pi { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; color: #4db0ff; background: rgba(20, 70, 160, .38); border: 1px solid rgba(90, 160, 255, .38); box-shadow: 0 0 24px rgba(40, 120, 255, .25) inset; backdrop-filter: blur(4px); }
.auth-slogan { font-family: "Segoe Script", "Brush Script MT", "Snell Roundhand", cursive; font-style: italic; font-size: 30px; line-height: 1.05; transform: rotate(-6deg); transform-origin: left; width: max-content; position: relative; padding-bottom: 14px; }
.auth-slogan::after { content: ""; position: absolute; left: 6px; right: -14px; bottom: 2px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, #2f9bff 40%, #6ac1ff); transform: rotate(-3deg); }
.auth-foot { font-size: 12.5px; color: #8fa3c7; }
.auth-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.auth-form { display: grid; place-items: center; padding: 32px 40px 32px 0; background: #fff; position: relative; }
.auth-card { width: 100%; max-width: 410px; animation: authIn .7s ease both; }
@keyframes authIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.auth-logo { display: block; max-height: 64px; max-width: 280px; margin: 0 0 30px; border-radius: 12px; }
.auth-logo.tile { background: #fff; }
.auth-card h2 { font-size: 32px; letter-spacing: -.025em; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 24px; }
.ifield { position: relative; margin-bottom: 14px; }
.ifield .li { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #475467; display: grid; pointer-events: none; }
.ifield input { height: 54px; padding-left: 46px; border-radius: 12px; font-size: 15px; width: 100%; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.ifield input:focus { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); outline: 0; }
.ifield .eye { right: 10px; }
.auth-go { height: 54px; border-radius: 12px; font-size: 16px; font-weight: 600; justify-content: center; gap: 12px; margin-top: 6px; background: linear-gradient(180deg, #2f7bff, #0f55e0); border: 0; color: #fff; box-shadow: 0 10px 24px rgba(15, 85, 224, .32); transition: transform .15s, box-shadow .15s; }
.auth-go:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(15, 85, 224, .4); }
.auth-go:disabled { opacity: .7; }
.auth-secure { display: flex; gap: 12px; align-items: flex-start; margin-top: 30px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.auth-secure b { display: block; color: #344054; font-size: 13px; margin-bottom: 2px; }
.auth-secure .si { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; color: #1d4ed8; background: #eaf1ff; }
.pwwrap { position: relative; }
.pwwrap input { padding-right: 44px; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; display: grid; }
.eye:hover { color: var(--text); background: #f2f4f7; }
.mark { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: 15px; flex: none; }
.auth-art .mark { background: #fff; color: var(--side); }
@media (prefers-reduced-motion: reduce) { .auth-card { animation: none; } }

/* ---------- armazón: barra lateral + barra superior ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
.app.collapsed { grid-template-columns: 78px minmax(0, 1fr); }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px 14px;
  background: var(--side); color: #b9c4d8; z-index: 12; overflow: hidden auto;
}
.sbrand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 22px; min-height: 66px; color: #fff; }
.sbrand .bname { font-size: 17px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; }
.sbrand .mark { background: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 1px rgba(255, 255, 255, .18) inset; }
.slogo { max-height: 42px; max-width: 168px; object-fit: contain; background: #fff; border-radius: 10px; padding: 5px 9px; }
.snav { display: grid; gap: 4px; align-content: start; }
.nav-item {
  display: flex; align-items: center; gap: 13px; width: 100%; padding: 11px 13px; border: 0; border-radius: 11px; background: none;
  color: inherit; cursor: pointer; text-align: left; font-weight: 600; font-size: 14px; transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.active { background: var(--brand); color: var(--brand-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 45%, transparent); }
.nav-item:focus-visible { outline-color: #fff; }
.sfoot { margin-top: auto; display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
.tenant-chip { display: grid; padding: 6px 13px; }
.tenant-chip .tl { font-size: 11.5px; color: #8e9bb2; }
.tenant-chip .tn { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.collapse { font-weight: 500; color: #8e9bb2; }
.collapsed .lbl { display: none; }
.collapsed .sbrand { justify-content: center; padding-inline: 0; }
.slogo.plat { background: none; padding: 0; max-height: 44px; max-width: 190px; border-radius: 0; }
.collapsed .slogo { max-width: 46px; padding: 4px; object-fit: cover; object-position: left center; }
.collapsed .nav-item { justify-content: center; padding-inline: 0; }
.collapsed .tenant-chip { display: none; }
.collapsed .collapse svg { transform: scaleX(-1); }

.workspace { min-width: 0; display: flex; flex-direction: column; }
.banner { background: #fff8e6; border-bottom: 1px solid #fde4a3; color: #7a4a00; padding: 8px 28px; font-size: 13px; }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 12px 28px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.iconbtn.burger { display: none; }
.search { position: relative; flex: 1 1 auto; max-width: 560px; }
.search > .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding: 11px 14px 11px 42px; border-radius: 12px; background: #f2f5f9; border-color: transparent; }
.search input:focus { background: #fff; }
.suggest { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.sg-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; color: var(--brand); }
.sg-item:hover, .sg-item:focus-visible { background: #f2f5f9; }
.sg-main { flex: 1; min-width: 0; display: grid; color: var(--text); }
.sg-sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: inherit; }
.sg-empty { padding: 16px; text-align: center; color: var(--muted); }
.sg-all { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 10px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--brand); font-weight: 600; cursor: pointer; margin-top: 4px; }
.iconbtn { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border: 0; background: none; border-radius: 12px; color: #475467; cursor: pointer; }
.iconbtn:hover { background: #f2f5f9; color: var(--text); }
.bcount { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #e11d48; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; box-sizing: border-box; line-height: 1; }
.pop-wrap { position: relative; }
.userbtn { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 4px 8px 4px 4px; border-radius: 14px; cursor: pointer; text-align: left; }
.userbtn:hover { background: #f2f5f9; }
.userbtn .who { line-height: 1.25; }
.wn { font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.wr { color: var(--muted); font-size: 12px; }
.ava { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 15%, white); color: var(--brand); font-weight: 700; font-size: 13px; flex: none; }
.ava.lg { width: 46px; height: 46px; font-size: 15px; }
.ava.sm { width: 30px; height: 30px; font-size: 11.5px; }
.cellava { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.pop { position: absolute; top: calc(100% + 8px); left: 0; min-width: 250px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 40; animation: pop .14s ease-out; }
.pop.pop-right { left: auto; right: 0; }
.pop.wide { width: 350px; }
.pop-title { padding: 8px 10px 6px; font-weight: 700; font-size: 14px; }
.pop-user { display: flex; align-items: center; gap: 12px; padding: 10px; }
.pu-name { font-weight: 700; }
.pu-sub { color: var(--muted); font-size: 12.5px; }
.pop-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.pop-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; font-weight: 500; }
.pop-item:hover { background: #f2f5f9; }
.pop-item.danger { color: var(--danger); }
.pop-item.danger:hover { background: #fef3f2; }
.pop-empty { display: grid; justify-items: center; gap: 8px; padding: 28px 16px; color: var(--muted); }
.pop-empty .ico { color: var(--st-1); }
.note-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left; font-weight: 500; }
.note-item:hover { background: #f2f5f9; }
.note-item > span:nth-child(2) { flex: 1; }
.ni { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.t-amber .ni { background: #fff3dc; color: #b54708; }
.t-indigo .ni { background: #e8e9ff; color: #4338ca; }
.t-blue .ni { background: #e3edff; color: #1d4ed8; }
.scrim { display: none; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* ---------- vistas ---------- */
.content { flex: 1; min-width: 0; }
.view { max-width: 1360px; width: 100%; margin: 0 auto; padding: 28px; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.pagehead h1 { font-size: 28px; letter-spacing: -.025em; margin-bottom: 4px; }
.pagehead .sub { margin: 0; color: var(--muted); max-width: 72ch; }
.pagehead .row { align-self: center; gap: 12px; }
.asof { color: var(--muted); font-size: 12.5px; }
.card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card { padding: 18px; margin-bottom: 16px; }
.panel { padding: 20px; min-width: 0; }
.panel.error { color: var(--danger); }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-h h3 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 15.5px; }
.panel-h h3 .ico { color: var(--brand); }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat .n { font-size: 32px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* tarjetas KPI */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.kpi {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 16px; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s; animation: rise .5s ease-out both;
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--tone) 40%, var(--line)); }
.kicon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--tone-bg); color: var(--tone); }
.kbody { display: grid; min-width: 0; gap: 1px; }
.kl2 { font-size: 13px; font-weight: 600; color: #475467; white-space: nowrap; padding-right: 14px; }
.kn { font-size: 27px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; white-space: nowrap; }
.ks { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kgo { position: absolute; top: 14px; right: 14px; color: #c3cad6; transition: transform .18s, color .18s; }
.kpi:hover .kgo { color: var(--tone); transform: translateX(3px); }
.tone-blue { --tone: #2563eb; --tone-bg: #e6eeff; }
.tone-green { --tone: #16a34a; --tone-bg: #e0f6e8; }
.tone-amber { --tone: #d97706; --tone-bg: #fff0d6; }
.tone-indigo { --tone: #4f46e5; --tone-bg: #e8e8ff; }
.tone-purple { --tone: #7c3aed; --tone-bg: #efe6ff; }
.tone-red { --tone: #dc2626; --tone-bg: #fee4e2; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* cuadrícula del dashboard */
.dgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.span3 { grid-column: span 3; } .span4 { grid-column: span 4; } .span5 { grid-column: span 5; }
.span7 { grid-column: span 7; } .span8 { grid-column: span 8; } .span12 { grid-column: span 12; }

/* dona de estado */
.donut-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px 24px; }
.donut-box { position: relative; width: 168px; height: 168px; flex: none; }
.donut { width: 100%; height: 100%; overflow: visible; }
.donut .track { stroke: #edf0f5; }
.seg.c-s0 { stroke: var(--st-0); } .seg.c-s1 { stroke: var(--st-1); } .seg.c-s2 { stroke: var(--st-2); } .seg.c-s4 { stroke: var(--st-4); }
.donut .seg { cursor: pointer; transition: stroke-dasharray .9s cubic-bezier(.2, .8, .2, 1), opacity .2s, stroke-width .2s; outline: none; }
.donut.hov .seg:not(.on) { opacity: .3; }
.donut .seg.on, .donut .seg:focus-visible { stroke-width: 29; }
.dcenter { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; padding: 0 26px; }
.dn { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.dc { font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.legend2 { display: grid; gap: 2px; min-width: 150px; flex: 1; }
.lrow { display: grid; grid-template-columns: 10px 1fr auto 46px; align-items: center; gap: 9px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; }
.lrow:hover, .lrow.on { background: #f2f5f9; }
.ldot { width: 10px; height: 10px; border-radius: 50%; }
.ldot.c-s0 { background: var(--st-0); } .ldot.c-s1 { background: var(--st-1); } .ldot.c-s2 { background: var(--st-2); } .ldot.c-s4 { background: var(--st-4); }
.lv { font-weight: 700; }
.lp { color: var(--muted); font-size: 12px; text-align: right; }

/* barras horizontales (SIMs por cuenta, consumo) */
.bars { display: grid; gap: 2px; }
.brow { display: grid; grid-template-columns: minmax(70px, 32%) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; }
.brow:hover { background: #f2f5f9; }
.brow .bn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.btrack { height: 10px; border-radius: 6px; background: #edf0f5; overflow: hidden; }
.bfill { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--brand); transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.brow:hover .bfill { filter: brightness(1.12); }
.bv { font-weight: 700; text-align: right; min-width: 34px; }
.bv.wide { min-width: 76px; }

/* consumo */
.bignum { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin: 2px 0 14px; }
.bn1 { font-size: 34px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; }
.bignum .delta { font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #f0f2f6; color: #475467; }
.usage-load { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 54px 12px; color: var(--muted); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #d7dde8; border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.seg.small { padding: 2px; margin: 0; }
.seg.small button { padding: 5px 11px; font-size: 12.5px; white-space: nowrap; }
.partial { font-size: 12px; }

/* acciones rápidas */
.qas { display: grid; gap: 10px; }
.qa { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; text-align: left; font-weight: 600; transition: border-color .15s, background .15s, transform .15s; }
.qa > span { flex: 1; }
.qa > .ico:last-child { opacity: .45; transition: transform .15s, opacity .15s; }
.qa:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, white); }
.qa:hover > .ico:last-child { transform: translateX(3px); opacity: 1; }
.qa.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.qa.primary:hover { background: var(--brand); filter: brightness(1.1); }
.qa.accent { background: #fff4e5; border-color: #ffd8a8; color: #9a4a06; }
.qa.accent:hover { background: #ffe9cc; border-color: #f5b66b; }
.allgood { display: grid; justify-items: center; gap: 4px; padding: 30px 16px; color: var(--muted); }
.allgood .ico { color: var(--st-1); margin-bottom: 4px; }
.allgood strong { color: var(--text); }

/* ---------- tablas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: #f8fafc; white-space: nowrap; }
thead th:first-child { border-top-left-radius: 10px; } thead th:last-child { border-top-right-radius: 10px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td.num { font-weight: 700; font-size: 15px; }
td .row.end { flex-wrap: nowrap; }
td:not(.num) em { white-space: nowrap; }
tr.sel, tr.sel:hover { background: color-mix(in srgb, var(--brand) 8%, white); }
.btn.iccid { display: inline-flex; align-items: center; gap: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; text-decoration: none; }
.btn.iccid:hover { text-decoration: underline; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef1f5; color: #475467; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.s1 { background: #dcfae6; color: #067647; }
.badge.s2 { background: #fef0c7; color: #b54708; }
.badge.s0 { background: #e5e7ff; color: #3730a3; }
.badge.s4 { background: #e0f2fe; color: #075985; } /* Prueba de fábrica */
.badge.susp { background: #fee4e2; color: var(--danger); }
.indent { display: inline-block; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar select { width: auto; min-width: 190px; }
.searchbox2 { position: relative; flex: 0 1 300px; min-width: 200px; }
.searchbox2 > .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.searchbox2 input { padding-left: 38px; }
.chipsf { display: flex; gap: 6px; flex-wrap: wrap; }
.chipf { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #475467; font-weight: 600; font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s; }
.chipf:hover { border-color: #c5ccd8; }
.chipf.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.cn { min-width: 24px; padding: 1px 7px; border-radius: 999px; background: #eef1f5; color: #475467; font-size: 12px; text-align: center; }
.chipf.active .cn { background: rgba(255, 255, 255, .24); color: inherit; }
.actionbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; border-radius: 12px; background: color-mix(in srgb, var(--brand) 9%, white); border: 1px solid color-mix(in srgb, var(--brand) 30%, white); animation: pop .15s ease-out; }
.actionbar select { width: auto; min-width: 180px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; color: var(--muted); }

/* ---------- ventanas, avisos, carga ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 18, 36, .55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s ease-out; }
.modal { background: var(--card); border-radius: 20px; width: 100%; max-width: 480px; max-height: 92vh; overflow: auto; padding: 26px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal h2 { font-size: 21px; }
.modal.wide { max-width: 680px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 60; }
.toast { background: #0f172a; color: #fff; padding: 12px 16px; border-radius: 12px; max-width: 380px; box-shadow: var(--shadow-lg); animation: rise .25s ease-out; }
.toast.err { background: var(--danger); }
.skeleton-page { display: grid; gap: 16px; }
.sk { border-radius: 12px; background: linear-gradient(100deg, #e8ecf2 30%, #f4f6fa 50%, #e8ecf2 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.sk-title { height: 38px; width: min(320px, 60%); }
.sk-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.sk-card { height: 88px; }
.sk-block { height: 300px; }
@keyframes shimmer { to { background-position: -300% 0; } }

/* ---------- marca ---------- */
.brand-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.preview { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.preview .bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.preview .bar img { height: 32px; max-width: 130px; object-fit: contain; background: rgba(255, 255, 255, .95); border-radius: 8px; padding: 3px 8px; }
.preview .bar .name { font-weight: 700; }
.preview .body { padding: 16px; color: var(--muted); }
.logo-box { width: 100%; min-height: 90px; border: 1.5px dashed #c5ccd8; border-radius: var(--radius); display: grid; place-items: center; background: #f8fafc; margin-bottom: 10px; padding: 12px; text-align: center; }
.logo-box img { max-height: 72px; max-width: 100%; object-fit: contain; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.timeline .when { color: var(--muted); font-size: 12px; }

/* ---------- adaptación ---------- */
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1180px) {
  .span3, .span4, .span5 { grid-column: span 6; }
  .span7, .span8 { grid-column: span 12; }
}
@media (max-width: 960px) {
  .app, .app.collapsed { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 272px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .app.nav-open .side { transform: none; }
  .app.collapsed .lbl { display: initial; }
  .app.collapsed .nav-item { justify-content: flex-start; padding-inline: 13px; }
  .app.collapsed .sbrand { justify-content: flex-start; }
  .nav-item.collapse { display: none; }
  .scrim { position: fixed; inset: 0; background: rgba(10, 18, 36, .5); z-index: 11; }
  .app.nav-open .scrim { display: block; }
  .iconbtn.burger { display: grid; }
  .topbar { padding: 10px 14px; }
  .banner { padding: 8px 14px; }
  .view { padding: 18px 14px; }
  .userbtn .who, .userbtn > .ico { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 26px 24px 22px; gap: 16px; clip-path: none; min-height: 360px; }
  .auth-art h1 { font-size: 28px; margin-bottom: 8px; }
  .auth-lead, .auth-feats, .auth-foot, .auth-slogan { display: none; }
  .auth-form { padding: 28px 22px 36px; }
  .auth-logo { display: none; }
  .brand-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span3, .span4, .span5, .span7, .span8 { grid-column: span 12; }
  .cards.three { grid-template-columns: 1fr; }
  .pagehead h1 { font-size: 24px; }
  .pop.wide { width: min(350px, calc(100vw - 28px)); }
  .pop.pop-right { right: -48px; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .kpi .kgo { display: none; }
  .searchbox2 { flex-basis: 100%; }
  .toolbar select { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* =====================================================================
   Panel de una SIM: detalle, ubicación, conectividad, estadísticas,
   operadores bloqueados y SMS (public/sim-detail.js)
   ===================================================================== */
:root { --series-1: #2563eb; --series-2: #ea580c; --series-3: #0d9488; --soft: #f8fafc; }
.hidden { display: none !important; }
.ico { flex: none; }
.btn { display: inline-flex; align-items: center; gap: 7px; }
a.btn { text-decoration: none; color: var(--text); }
a.btn.disabled { opacity: .5; pointer-events: none; }
textarea { font: inherit; }
.row.tight { gap: 6px; }
.mono.small, .kvv.small { font-size: 12.5px; }
.modal.panel { max-width: 540px; }
.modal.panel.wide { max-width: 800px; }

/* cabecera del panel */
.phead { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.phead h2 { margin: 0; font-size: 20px; color: var(--brand); }
.phead h2 > .mono { font-weight: 500; font-size: 15px; color: var(--muted); }
.phead h2 > .mono::before { content: ' – '; }
.psub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.picon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); flex: none; }
.picon.big { width: 58px; height: 58px; border-radius: 16px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: #fff; background: #16a34a; white-space: nowrap; }
.status-pill.s0 { background: #4f46e5; }
.status-pill.s2 { background: #d97706; }
.status-pill.s4 { background: #0284c7; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.actions-row .btn { flex: 1 1 130px; justify-content: center; padding: 10px 12px; }

/* tarjetas y datos */
.card2 { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; background: var(--card); }
.sec { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--brand); margin: 20px 0 10px; }
.sec.flat { margin: 0; padding: 12px 18px; background: var(--soft); border-bottom: 1px solid var(--line); }
.kvgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; padding: 18px; }
.kl { color: var(--muted); font-size: 12.5px; margin-bottom: 3px; }
.kvv { font-size: 14px; font-weight: 500; word-break: break-all; }
.kvv.strong { font-weight: 700; font-size: 15px; }
.kv.wide2 { grid-column: 1 / -1; }
.kvv.path { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; word-break: normal; }
.kvv.path .sep { color: var(--muted); }
.kvv.path .cur { font-weight: 700; color: var(--brand); }
.banner2 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 500; }
.banner2.ok { background: #ecfdf3; color: #067647; border: 1px solid #abefc6; }
.banner2.warn { background: #fffaeb; color: #93370d; border: 1px solid #fedf89; }
.banner2.err { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }
.banner2.off { background: #f2f4f7; color: #475467; border: 1px solid var(--line); }
.tiles { display: grid; gap: 12px; }
.tiles.two { grid-template-columns: 1fr 1fr; }
.tiles.three { grid-template-columns: repeat(3, 1fr); }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--card); min-width: 0; }
.tl { color: var(--muted); font-size: 12.5px; }
.tv { font-size: 16px; font-weight: 700; margin-top: 4px; word-break: break-word; }
.tv.mono { font-weight: 600; font-size: 14px; }
.ts { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tiles.flat { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; gap: 16px 24px; margin: 12px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 2px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 12px; }
.chip.blue { background: #eff4ff; border-color: #c7d7fe; color: #3538cd; font-weight: 600; }
.pfoot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.btn.plainbtn { border-color: transparent; background: transparent; }
.btn.warnbtn { background: #f04e0c; border-color: #f04e0c; color: #fff; }
.btn.warnbtn:hover { filter: brightness(.94); }
.note { background: var(--soft); border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; color: #475467; margin: 10px 0; }
.note.err { background: #fef3f2; border-color: #fecdca; color: var(--danger); }
.seg { display: flex; background: #eef1f4; border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(16,24,40,.12); }

/* ubicación */
.map { height: 380px; border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; isolation: isolate; background: #e8ecf0; }
.foot-note { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin-top: 10px; text-align: center; }

/* estadísticas */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.card3 { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; background: var(--card); }
.grid2 .card3 { margin-bottom: 0; }
.ct { font-weight: 600; margin-bottom: 12px; }
.big-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; color: var(--muted); }
.big { font-size: 28px; font-weight: 800; color: var(--text); }
.line { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); font-size: 13px; }
.line span:last-child { color: var(--text); font-weight: 600; }
.delta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin-top: 10px; }
.delta.up { color: #d92d20; }
.delta.down { color: #067647; }
.hint.pad { padding: 14px 0; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 10px; font-size: 13px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.sw[data-c="rx"] { background: var(--series-1); }
.sw[data-c="tx"] { background: var(--series-2); }
.chartwrap { position: relative; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis, .uc-svg .axis { fill: var(--muted); font-size: 11px; }
.uc-svg .grid { stroke: var(--line); stroke-width: 1; }
.chart .dlabel { font-size: 12px; font-weight: 600; }
.chart .cross { stroke: #98a2b3; stroke-dasharray: 3 3; }
.tip { position: absolute; background: #17202a; color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; pointer-events: none; min-width: 130px; }
.tip .tr { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.table-wrap.tall { max-height: 380px; overflow: auto; }

/* operadores bloqueados */
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; color: var(--text); }
.pill.active { background: #101828; color: #fff; border-color: #101828; }
.searchbox { position: relative; margin-bottom: 14px; }
.searchbox .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.searchbox input { padding-left: 38px; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.stat2 { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--line); }
.stat2 .sl { font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.stat2 .sn { font-size: 28px; font-weight: 800; }
.stat2.red { background: #fef3f2; border-color: #fecdca; color: #b42318; }
.stat2.blue { background: #eff4ff; border-color: #c7d7fe; color: #3538cd; }
.stat2.gray { background: var(--soft); color: #475467; }
.iconcell { display: inline-flex; align-items: center; gap: 8px; }
.badge2 { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; border: 1px solid transparent; font-family: inherit; }
.badge2.green { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.badge2.red { background: #fef3f2; color: #b42318; border-color: #fecdca; }
button.badge2.clickable { cursor: pointer; }
button.badge2.clickable:hover { filter: brightness(.95); }

/* SMS (pantalla completa) */
.overlay.fullpage-wrap { display: block; padding: 0; background: linear-gradient(160deg, #eef3ff, #f7f9fc 60%); overflow: hidden; }
.fullpage { height: 100%; }
.fullinner { max-width: 1040px; margin: 0 auto; padding: 18px; height: 100%; display: flex; flex-direction: column; }
.ftop { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ftop h1 { font-size: 30px; margin: 0; color: var(--brand); }
.chatcard { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--card); border-radius: 18px; box-shadow: 0 10px 40px rgba(16,24,40,.10); overflow: hidden; border: 1px solid var(--line); }
.chead { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.avatar { position: relative; width: 42px; height: 42px; border-radius: 50%; background: #dcfce7; color: #16a34a; display: grid; place-items: center; flex: none; }
.avatar .dot { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: #98a2b3; border: 2px solid #fff; }
.avatar .dot.on { background: #22c55e; }
td.num { font-weight: 700; font-size: 17px; }
.btn.pausebtn { background: #eef3ff; border-color: transparent; color: #1d4ed8; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; display: inline-block; }
.live.off i { background: #98a2b3; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 20px; background: var(--soft); display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; flex-direction: column; max-width: 78%; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.msg.in { align-self: flex-start; align-items: flex-start; }
.bubble { padding: 10px 14px; border-radius: 14px; word-break: break-word; white-space: pre-wrap; }
.msg.out .bubble { background: #dcfce7; border: 1px solid #bbf7d0; }
.msg.in .bubble { background: #fff; border: 1px solid var(--line); }
.meta { display: flex; gap: 8px; align-items: center; justify-content: flex-end; font-size: 11.5px; color: var(--muted); margin-top: 6px; white-space: normal; }
.meta .ok { color: #067647; display: inline-flex; gap: 4px; align-items: center; }
.meta .bad { color: #b42318; }
.from { font-size: 11.5px; color: var(--muted); margin: 3px 4px 0; }
.compose { padding: 12px 16px 14px; border-top: 1px solid var(--line); background: var(--card); }
.cinput { display: flex; gap: 10px; align-items: flex-end; }
.cinput textarea { flex: 1; resize: none; border-radius: 22px; padding: 11px 16px; }
.sendbtn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.sendbtn:disabled { background: #d0d5dd; color: #fff; cursor: not-allowed; }
.cmeta { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
kbd { background: #eef1f4; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: 11.5px; font-family: inherit; }

/* subasignación (panel Subcuentas) */
.btn.assign { background: color-mix(in srgb, var(--brand) 10%, white); border-color: color-mix(in srgb, var(--brand) 35%, white); color: var(--text); }

@media (max-width: 640px) {
  .kvgrid, .tiles.two, .grid2, .stats3 { grid-template-columns: 1fr; }
  .tiles.three { grid-template-columns: 1fr 1fr; }
  .actions-row .btn { flex-basis: 45%; }
  .msg { max-width: 92%; }
  .ftop h1 { font-size: 22px; }
  .phead { flex-wrap: wrap; }
  .map { height: 300px; }
}

/* ---------- gráfico de consumo diario ---------- */
.trend-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 6px; }
.trend-top .bignum { margin-bottom: 0; }
.uc { margin-top: 6px; }
.uc-svg { width: 100%; height: 270px; display: block; touch-action: pan-y; cursor: crosshair; border-radius: 8px; }
.uc-svg:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.uc-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.uc-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px 4px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text); transition: background .15s, border-color .15s, opacity .15s; }
.uc-chip[aria-pressed="false"] { opacity: .5; background: var(--soft, #f8fafc); text-decoration: line-through; }
.uc-chip:hover { border-color: #c5ccd8; }
.sw[data-k="mb"] { background: var(--series-1); } .sw[data-k="rx"] { background: var(--series-3); } .sw[data-k="tx"] { background: var(--series-2); }
.uc .sw, .uc-chip .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.uc-tip { position: absolute; z-index: 5; min-width: 168px; pointer-events: none; background: #101828; color: #fff; border-radius: 10px; padding: 9px 12px; box-shadow: var(--shadow-lg); font-size: 12.5px; }
.uc-tip .tt-d { font-weight: 600; margin-bottom: 5px; text-transform: capitalize; }
.uc-tip .tt-r { display: flex; align-items: center; gap: 8px; padding: 1px 0; }
.uc-tip .tt-l { flex: 1; color: #cbd5e1; }
.uc-tip .tt-r.muted { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.14); }
.chart .cross, .uc-svg .cross { stroke: #98a2b3; stroke-dasharray: 3 3; }

/* tabla de alertas: operador y estado de conexión */
.clickrow { cursor: pointer; }
.clickrow:hover td { background: #f8fafc; }
.opchip { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.opav { width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 10.5px; font-weight: 700; display: inline-grid; place-items: center; flex: none; }
.dotstate { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: #98a2b3; }
.dotstate.online { background: #16a34a; } .dotstate.attached { background: #d97706; } .dotstate.blocked { background: #b42318; }
.sk-line { display: inline-block; width: 84px; height: 11px; border-radius: 6px; background: linear-gradient(90deg, #eef1f5, #f8fafc, #eef1f5); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk-line { animation: none; } }

/* menú por fila, selector de logo */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
label.btn { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.visually-hidden:focus-visible + label.btn, label.btn:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.iconbtn.sm { width: 32px; height: 32px; border-radius: 9px; }
td.rowmenu { width: 48px; text-align: right; }
td.rowmenu .pop-wrap { position: relative; display: inline-block; }
@media (max-width: 480px) { .kpis .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.donut-wrap { margin-block: auto; }

/* ---------- facturación ---------- */
.badge.bl { border-radius: 999px; }
.badge.bl-pending { background: #fef0c7; color: #b54708; }
.badge.bl-overdue { background: #fee4e2; color: #b42318; }
.badge.bl-review { background: #e5e7ff; color: #3730a3; }
.badge.bl-paid { background: #dcfae6; color: #067647; }
.badge.bl-void { background: #eef1f5; color: #667085; text-decoration: line-through; }
.tabsx { display: inline-flex; gap: 4px; padding: 4px; background: #e8ecf3; border-radius: 12px; margin-bottom: 16px; }
.tabsx button { border: 0; background: none; padding: 8px 18px; border-radius: 9px; font: inherit; font-weight: 600; color: #475467; cursor: pointer; }
.tabsx button.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.bl-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.bl-kn { font-size: 20px; line-height: 1.25; word-break: break-word; }
td.num2, th.num2 { text-align: right; font-variant-numeric: tabular-nums; }
.bl-money { font-weight: 700; }
.bl-num { font-weight: 600; }
.bl-form .row2, .bl-detail .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bl-sub { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 14px; }
.bl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.bl-amount { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.bl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 14px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
.bl-pay { border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); background: color-mix(in srgb, var(--brand) 6%, #fff); border-radius: 12px; padding: 14px; margin: 12px 0; display: grid; gap: 10px; }
.bl-pay-h { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.row.between { justify-content: space-between; align-items: center; gap: 10px; }
.kvv.big { font-size: 18px; font-weight: 700; letter-spacing: .02em; }
.bl-doc, .bl-actions { margin: 10px 0; flex-wrap: wrap; }
.bl-upload { border: 1px dashed #b9c2d0; border-radius: 12px; padding: 4px 14px 14px; margin: 14px 0; background: #fcfdff; }
.bl-proofs { display: grid; gap: 10px; }
.bl-proof { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.bl-proof-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.bl-proof-name { font-weight: 600; word-break: break-all; }
.bl-note { background: #f8fafc; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; color: #475467; }
.bl-reject { display: flex; gap: 8px; align-items: center; background: #fef3f2; color: #b42318; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; }
.bl-preview { border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #f8fafc; }
.bl-preview img { max-width: 100%; max-height: 360px; display: block; margin: 0 auto; border-radius: 6px; }
.bl-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.bl-events .when { color: var(--muted); margin-right: 10px; }
.filepick { align-items: center; gap: 12px; }
@media (max-width: 1280px) { .bl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .bl-form .row2, .bl-detail .row2 { grid-template-columns: 1fr; } .bl-amount { font-size: 26px; } }
.badge.bl { white-space: nowrap; }
.bl-form input[type=month], .bl-form input[type=date], .bl-detail input[type=date] { width: 100%; }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; padding: 10px 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.check input { margin-top: 3px; width: 16px; height: 16px; flex: none; }

/* ---------- consumo del mes: Top 10 y columna en la lista de SIMs ---------- */
td.cons { min-width: 170px; }
.cons-cell { display: flex; align-items: center; gap: 10px; }
.cons-track { flex: 1; min-width: 70px; max-width: 150px; height: 8px; }
.cons-v { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.rank { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #eef1f5; color: #475467; font-weight: 700; font-size: 12.5px; }
.rank.r1 { background: #fef0c7; color: #93370d; } .rank.r2 { background: #e8ecf3; color: #344054; } .rank.r3 { background: #fde6d3; color: #8a3b12; }
.topsims .table-wrap { margin-top: 4px; }
.row.between.pad { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 4px 0; }
.page-use { font-weight: 600; color: var(--text); }
.topsims .delta { margin-top: 0; display: inline-flex; padding: 2px 8px; border-radius: 999px; background: #f6f7f9; }

/* Dominio propio */
.domain-box { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.domain-box .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.domain-box .row input { flex: 1 1 200px; min-width: 0; }
.dns-steps { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.dns-rec { display: grid; grid-template-columns: 64px 1fr auto; gap: 4px 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.dns-rec .badge::before { display: none; }
.dns-kv { grid-column: 2; display: flex; flex-direction: column; min-width: 0; word-break: break-all; }
.dns-rec > .btn { grid-column: 3; grid-row: 1 / span 2; }

/* Solicitudes */
.navcount { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #e11d48; color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.collapsed .navcount { position: absolute; top: 4px; right: 6px; margin: 0; min-width: 16px; height: 16px; font-size: 10px; }
.nav-item { position: relative; }
.reason { max-width: 280px; white-space: normal; }
.modal textarea { width: 100%; resize: vertical; }

/* Notificaciones */
.note-item.unread { background: color-mix(in srgb, var(--brand) 7%, #fff); }
.note-item .nt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; }
.note-item .ntitle, .ntitle { font-weight: 600; }
.note-item:not(.unread) .ntitle { font-weight: 500; }
.nbody { white-space: normal; }
.notelist .note-item { border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 16px; }
.notelist .note-item:last-child { border-bottom: 0; }
.row.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.card.pad { padding: 18px; margin-bottom: 16px; }
.center { text-align: center; }
.banner2.warn { background: #fef0c7; color: #93370d; padding: 10px 14px; border-radius: 10px; margin: 10px 0; }
.errlist { margin: 8px 0; padding-left: 18px; color: #b42318; font-size: 12.5px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch .slider { position: absolute; inset: 0; border-radius: 999px; background: #d0d5dd; transition: background .15s; }
.switch .slider::before { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Comandos SMS guardados: chat flotante sobre la conversación */
.cmdwrap { position: absolute; right: 18px; top: 70px; bottom: 138px; z-index: 6; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end; gap: 12px; pointer-events: none; }
.cmdwrap > * { pointer-events: auto; }
.cmdfab { flex: none; position: relative; width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 24px rgba(16,24,40,.28); transition: transform .15s; }
.cmdfab:hover { transform: scale(1.06); }
.cmdfab.open { background: #fff; color: var(--brand); border: 2px solid var(--brand); }
.cmdcount { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #e11d48; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; box-sizing: border-box; line-height: 1; }
.cmdcard { width: min(350px, calc(100vw - 48px)); flex: 0 1 auto; min-height: 0; max-height: 470px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgba(16,24,40,.28); overflow: hidden; animation: cmdin .16s ease-out; transform-origin: bottom right; }
@keyframes cmdin { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cmdcard { animation: none; } }
.cmdhead { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--brand); color: var(--brand-ink); }
.cmdhead .hint { color: inherit; opacity: .8; }
.cmdhead .iconbtn { color: inherit; }
.cmdbody { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.cmdlist { flex: 1 1 auto; min-height: 90px; overflow-y: auto; display: flex; flex-direction: column; }
.cmdform { flex: none; }
.cmdrow { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--line); }
.cmdrow:hover { background: var(--soft); }
.cmduse { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: none; border: 0; padding: 4px 0; cursor: pointer; text-align: left; }
.cmdlabel { font-size: 12px; font-weight: 700; color: var(--brand); }
.cmdtext { max-width: 100%; white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cmdact { display: flex; gap: 0; flex: none; opacity: .55; }
.cmdrow:hover .cmdact, .cmdrow:focus-within .cmdact { opacity: 1; }
.cmdact .iconbtn:disabled { opacity: .3; cursor: default; }
.cmdempty { padding: 18px 16px 6px; color: var(--muted); font-size: 13px; text-align: center; }
.cmdform { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; background: var(--soft); }
.cmdform textarea { resize: none; }
.row.tight { display: flex; gap: 6px; align-items: center; }
.pad { padding: 12px 14px; }

/* SMS como ventana emergente (igual que el detalle de la SIM) */
.modal.panel.sms { max-width: 720px; height: min(780px, 92vh); padding: 20px 22px 22px; display: flex; flex-direction: column; overflow: hidden; }
.smsinner { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.smsinner .phead { margin-bottom: 12px; }
.smsinner .chatcard { box-shadow: none; }
@media (max-width: 640px) { .modal.panel.sms { height: 96vh; padding: 14px; } }
.modal .cinput textarea { resize: none; width: auto; }
.cmdadd { flex: none; padding: 10px 14px 12px; background: var(--soft); }

/* Respaldo: ubicación y SMS archivados */
.note.warn { background: #fffaeb; border-color: #fedf89; color: #93370d; }
.hist { margin-top: 8px; }
.hist .table-wrap.tall { max-height: 260px; }
.clickrow { cursor: pointer; }
.clickrow:hover td { background: #f2f5f9; }
.olderbtn { align-self: center; flex: none; }
.retention { display: flex; align-items: center; gap: 6px; }
.chead .btn.small { flex: none; }

/* App Android (WebView de Capacitor) */
body.native-app { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain; }
body.native-app .toast, body.native-app #toasts { padding-bottom: env(safe-area-inset-bottom); }

/* Claves de API */
.chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 320px; }
.chip { font: 600 11.5px ui-monospace, monospace; padding: 2px 8px; border-radius: 999px; background: #eef2f6; color: #344054; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.pill.ok { background: #ecfdf3; color: #067647; } .pill.warn { background: #fffaeb; color: #93370d; } .pill.bad { background: #fef3f2; color: #b42318; }
tr.dim td { opacity: .6; }
.scopelist { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.scoperow { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.scoperow input { margin-top: 3px; }
.keybox { padding: 14px; border: 1px dashed var(--brand); border-radius: 10px; background: var(--soft); word-break: break-all; font-size: 14px; margin: 12px 0; user-select: all; }
.keycurl { padding: 12px; background: #0f172a; color: #e2e8f0; border-radius: 10px; overflow: auto; font-size: 12.5px; }

.imp-banner { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 9px 28px; background: #3b2a8f; color: #fff; font-size: 13.5px; }
.imp-banner span { flex: 1; min-width: 220px; }
.imp-banner .btn { background: #fff; color: #3b2a8f; border: 0; font-weight: 600; }
@media (max-width: 980px) { .imp-banner { padding: 9px 14px; } }
.imp-log { margin-top: 16px; }
.imp-log-h { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 18px 4px; }
.imp-log-h h3 { margin: 0; font-size: 15px; }

/* ---- Plan, consumo contra el plan y pool de datos ---- */
.bfill.warn { background: #f59e0b; }
.bfill.danger { background: #dc2626; }
.cons-of { font-weight: 500; color: var(--muted, #667085); }
.cons-v { min-width: 0; white-space: nowrap; }
.pool { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: start; padding: 4px 0 8px; }
.pool-track { display: block; height: 16px; border-radius: 10px; margin: 8px 0 14px; }
.pool-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.pool-stat { background: #f5f7fb; border-radius: 12px; padding: 10px 16px; min-width: 120px; }
.pool-stat .ps-l { font-size: 12px; color: var(--muted, #667085); }
.pool-stat .ps-v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pool-stat.muted .ps-v { color: var(--muted, #667085); }
.pool-stat.bad .ps-v { color: #dc2626; }
@media (max-width: 760px) { .pool { grid-template-columns: 1fr; gap: 14px; } }
.cons-cell .cons-track { min-width: 44px; max-width: 90px; }
.cons-cell .cons-v { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; min-width: 70px; }
.cons-of { font-size: 11px; }
.permlist { display: grid; gap: 6px; margin: 10px 0; }
.permrow { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: #f5f7fb; cursor: pointer; }
.permrow input { margin-top: 3px; }
.lchips { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.lchips.edit { display: flex; margin: 10px 0 6px; min-height: 30px; }
.lchip { display: inline-flex; align-items: center; gap: 4px; background: #e8eefb; color: #153c7d; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lchip.more { background: #eef0f4; color: #52607a; }
.lchip .lx { border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1; color: inherit; padding: 0 0 0 2px; }
.lchips:not(.edit) { flex-wrap: nowrap; }
.lchips:not(.edit) .lchip { max-width: 110px; }
td .btn.link.nounder { white-space: nowrap; }

/* Configuración del sistema */
.panel > .banner2 { margin-bottom: 14px; }
.panel > .tiles.flat { margin-bottom: 14px; }
.panel > .field { margin-bottom: 12px; }

/* Alertas de la SIM y personalización */
.alertrow { display: grid; gap: 8px; margin: 12px 0; }
.alertrow .banner2 { margin: 0; }
.setnav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.setnav .chipf { padding: 7px 14px; }
.setgrid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }
.setgrid .field { margin: 0; }
@media (max-width: 760px) { .setgrid { grid-template-columns: 1fr; } }
.tenant-flag { font-size: 12px; }
.btn.small.on { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.auth-help { margin: 14px 0 0; font-size: 13px; color: #667085; text-align: center; }
.auth-help a { color: var(--brand); font-weight: 600; }
.alertrow .banner2 { flex-wrap: nowrap; align-items: flex-start; } .alertrow .banner2 .grow { flex: 1; min-width: 0; }

/* Mensajes personalizados */
.nimg { display: block; max-width: 100%; max-height: 180px; border-radius: 10px; margin: 6px 0 2px; object-fit: cover; align-self: flex-start; }
.bc-grid { display: grid; gap: 22px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
@media (max-width: 900px) { .bc-grid { grid-template-columns: 1fr; } }
.bc-grid textarea { width: 100%; resize: vertical; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.bc-prev .note-item { cursor: default; }
.logo-box.dark { background: #0b1a33; border-color: #3b4f73; }
.logo-box.dark .hint { color: #9fb2d3; }

/* Botón flotante de soporte (WhatsApp) */
.support-fab { position: fixed; right: 20px; bottom: 20px; z-index: 55; display: flex; align-items: center; gap: 10px; height: 56px; min-width: 56px; padding: 0 15px; border-radius: 28px; background: #25d366; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.28); text-decoration: none; font-weight: 600; font-size: 14px; transition: transform .15s, box-shadow .15s; }
.support-fab:hover, .support-fab:focus-visible { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.34); }
.support-fab svg { flex: none; }
.support-fab .sf-tip { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; transition: max-width .25s, opacity .2s; }
.support-fab:hover .sf-tip, .support-fab:focus-visible .sf-tip { max-width: 180px; opacity: 1; }
#toasts { bottom: 90px; }
@media (max-width: 760px) { .support-fab { right: 14px; bottom: 14px; height: 52px; min-width: 52px; } .support-fab .sf-tip { display: none; } }
@media (max-width: 760px) { .auth-form { padding-bottom: 88px; } }

/* Comprobación de dominio */
.check-out { margin-top: 12px; }
.checks { display: grid; gap: 10px; }
.chk { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.chk .ck { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.chk .ck.ok { background: #ecfdf3; color: #067647; }
.chk .ck.bad { background: #fef3f2; color: #b42318; }
.chk .ck.wait { background: #fffaeb; color: #93370d; }
.chk .fixit { margin-top: 4px; font-size: 13px; color: #344054; background: #f8fafc; border-left: 3px solid var(--brand); padding: 6px 10px; border-radius: 4px; }

/* Seguridad: 2FA, códigos de recuperación, copias */
.qrbox { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin: 8px 0 14px; }
.qr { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.secretkey { font-size: 15px; letter-spacing: .06em; margin: 4px 0 8px; word-break: break-all; }
.steps { margin: 6px 0 6px 20px; padding: 0; }
.steps li { margin: 4px 0; }
.rc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 12px 0; }
.rc { padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; text-align: center; background: #f8fafc; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 8px 0; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.badge.info { background: #eef4ff; color: #1d4ed8; }
.bulk-errs { margin: 10px 0 0 18px; font-size: 13px; color: #b42318; }

/* ---------- modo oscuro ----------
   Se activa con html[data-theme="dark"] (solo dentro del portal; el inicio de sesión conserva su diseño).
   Las variables cubren lo principal; las reglas generadas debajo reemplazan los colores fijos de cada componente. */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220; --card: #111a2c; --text: #e6eaf2; --muted: #93a0b8; --line: #243049;
  --danger: #f97066; --ok: #47cd89; --warn: #fdb022;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
}
[data-theme="dark"] a { color: color-mix(in oklab, var(--brand) 45%, #ffffff); }
[data-theme="dark"] .btn:hover { border-color: #3a4866; background: #1a2338; }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { background: #0e1626; border-color: #2b3750; color: var(--text); }
[data-theme="dark"] img.logo-on-light { background: #fff; border-radius: 8px; }
[data-theme="dark"] .btn:hover { border-color: #2b3750; background: #1a2338; }
[data-theme="dark"] .btn.danger:hover { background: #3a1a1d; border-color: #6b2a2a; }
[data-theme="dark"] input[type=text], [data-theme="dark"] input[type=email], [data-theme="dark"] input[type=password], [data-theme="dark"] input[type=search], [data-theme="dark"] input[type=number], [data-theme="dark"] textarea, [data-theme="dark"] select { background: var(--card); }
[data-theme="dark"] input[type=color] { background: var(--card); }
[data-theme="dark"] .ifield .li { color: #d5dbe8; }
[data-theme="dark"] .eye:hover { background: #1a2338; }
[data-theme="dark"] .slogo { background: var(--card); }
[data-theme="dark"] .tenant-chip .tl { color: #93a0b8; }
[data-theme="dark"] .nav-item.collapse { color: #93a0b8; }
[data-theme="dark"] .search input { background: #1a2338; }
[data-theme="dark"] .search input:focus { background: var(--card); }
[data-theme="dark"] .suggest { background: var(--card); }
[data-theme="dark"] .sg-item:hover, [data-theme="dark"] .sg-item:focus-visible { background: #1a2338; }
[data-theme="dark"] .iconbtn { color: #d5dbe8; }
[data-theme="dark"] .iconbtn:hover { background: #1a2338; }
[data-theme="dark"] .userbtn:hover { background: #1a2338; }
[data-theme="dark"] .pop { background: var(--card); }
[data-theme="dark"] .pop-item:hover { background: #1a2338; }
[data-theme="dark"] .pop-item.danger:hover { background: #3a1a1d; }
[data-theme="dark"] .note-item:hover { background: #1a2338; }
[data-theme="dark"] .t-amber .ni { color: #fdb022; }
[data-theme="dark"] .t-blue .ni { color: #8ab4ff; }
[data-theme="dark"] .kl2 { color: #d5dbe8; }
[data-theme="dark"] .lrow:hover, [data-theme="dark"] .lrow.on { background: #1a2338; }
[data-theme="dark"] .brow:hover { background: #1a2338; }
[data-theme="dark"] .btrack { background: #1a2338; }
[data-theme="dark"] .bignum .delta { color: #d5dbe8; }
[data-theme="dark"] .qa { background: var(--card); }
[data-theme="dark"] th { background: #1a2338; }
[data-theme="dark"] tbody tr:hover { background: #1a2338; }
[data-theme="dark"] .badge { background: #1a2338; color: #d5dbe8; }
[data-theme="dark"] .badge.s1 { background: #12301f; color: #47cd89; }
[data-theme="dark"] .badge.s2 { background: #33280f; color: #fdb022; }
[data-theme="dark"] .badge.s0 { background: #1b2a4d; color: #a5b4fc; }
[data-theme="dark"] .badge.s4 { background: #0c2d44; color: #7dd3fc; }
[data-theme="dark"] .badge.susp { background: #3a1a1d; }
[data-theme="dark"] .chipf { background: var(--card); color: #d5dbe8; }
[data-theme="dark"] .chipf:hover { border-color: #2b3750; }
[data-theme="dark"] .cn { background: #1a2338; color: #d5dbe8; }
[data-theme="dark"] .logo-box { border: 1.5px dashed #2b3750; background: #1a2338; }
[data-theme="dark"] .banner2.ok { background: #12301f; color: #47cd89; border: 1px solid #1f5a3a; }
[data-theme="dark"] .banner2.warn { background: #33280f; color: #fdb022; border: 1px solid #6b531a; }
[data-theme="dark"] .banner2.err { background: #3a1a1d; color: #f97066; border: 1px solid #6b2a2a; }
[data-theme="dark"] .banner2.off { background: #1a2338; color: #d5dbe8; }
[data-theme="dark"] .chip { background: var(--card); }
[data-theme="dark"] .chip.blue { background: #1b2a4d; border-color: #2d4377; }
[data-theme="dark"] .note { color: #d5dbe8; }
[data-theme="dark"] .note.err { background: #3a1a1d; border-color: #6b2a2a; }
[data-theme="dark"] .seg { background: #1a2338; }
[data-theme="dark"] .seg button.active { background: var(--card); }
[data-theme="dark"] .delta.down { color: #47cd89; }
[data-theme="dark"] .stat2.red { background: #3a1a1d; border-color: #6b2a2a; color: #f97066; }
[data-theme="dark"] .stat2.blue { background: #1b2a4d; border-color: #2d4377; }
[data-theme="dark"] .stat2.gray { color: #d5dbe8; }
[data-theme="dark"] .badge2.green { background: #12301f; color: #47cd89; border-color: #1f5a3a; }
[data-theme="dark"] .badge2.red { background: #3a1a1d; color: #f97066; border-color: #6b2a2a; }
[data-theme="dark"] .avatar { background: #12301f; }
[data-theme="dark"] .btn.pausebtn { background: #1b2a4d; color: #8ab4ff; }
[data-theme="dark"] .msg.out .bubble { background: #12301f; }
[data-theme="dark"] .msg.in .bubble { background: var(--card); }
[data-theme="dark"] .meta .ok { color: #47cd89; }
[data-theme="dark"] .meta .bad { color: #f97066; }
[data-theme="dark"] kbd { background: #1a2338; }
[data-theme="dark"] .uc-chip { background: var(--card); }
[data-theme="dark"] .uc-chip:hover { border-color: #2b3750; }
[data-theme="dark"] .clickrow:hover td { background: #1a2338; }
[data-theme="dark"] .badge.bl-pending { background: #33280f; color: #fdb022; }
[data-theme="dark"] .badge.bl-overdue { background: #3a1a1d; color: #f97066; }
[data-theme="dark"] .badge.bl-review { background: #1b2a4d; }
[data-theme="dark"] .badge.bl-paid { background: #12301f; color: #47cd89; }
[data-theme="dark"] .badge.bl-void { background: #1a2338; color: #93a0b8; }
[data-theme="dark"] .tabsx { background: #1a2338; }
[data-theme="dark"] .tabsx button { color: #d5dbe8; }
[data-theme="dark"] .tabsx button.active { background: var(--card); }
[data-theme="dark"] .bl-grid { background: #1a2338; }
[data-theme="dark"] .bl-note { background: #1a2338; color: #d5dbe8; }
[data-theme="dark"] .bl-reject { background: #3a1a1d; color: #f97066; }
[data-theme="dark"] .bl-preview { background: #1a2338; }
[data-theme="dark"] .check { background: #1a2338; }
[data-theme="dark"] .rank { background: #1a2338; color: #d5dbe8; }
[data-theme="dark"] .rank.r1 { background: #33280f; color: #fdb022; }
[data-theme="dark"] .rank.r2 { background: #1a2338; color: #d5dbe8; }
[data-theme="dark"] .dns-steps { background: #1a2338; }
[data-theme="dark"] .banner2.warn { background: #33280f; color: #fdb022; }
[data-theme="dark"] .errlist { color: #f97066; }
[data-theme="dark"] .switch .slider::before { background: var(--card); }
[data-theme="dark"] .cmdfab.open { background: var(--card); }
[data-theme="dark"] .cmdcard { background: var(--card); }
[data-theme="dark"] .note.warn { background: #33280f; border-color: #6b531a; color: #fdb022; }
[data-theme="dark"] .clickrow:hover td { background: #1a2338; }
[data-theme="dark"] .chip { color: #d5dbe8; }
[data-theme="dark"] .pill.ok { background: #12301f; color: #47cd89; }
[data-theme="dark"] .pill.warn { background: #33280f; color: #fdb022; }
[data-theme="dark"] .pill.bad { background: #3a1a1d; color: #f97066; }
[data-theme="dark"] .imp-banner .btn { background: var(--card); }
[data-theme="dark"] .pool-stat { background: #1a2338; }
[data-theme="dark"] .permrow { background: #1a2338; }
[data-theme="dark"] .btn.small.on { background: #12301f; border-color: #1f5a3a; color: #47cd89; }
[data-theme="dark"] .chk .ck.ok { background: #12301f; color: #47cd89; }
[data-theme="dark"] .chk .ck.bad { background: #3a1a1d; color: #f97066; }
[data-theme="dark"] .chk .ck.wait { background: #33280f; color: #fdb022; }
[data-theme="dark"] .chk .fixit { color: #d5dbe8; background: #1a2338; }
[data-theme="dark"] .qr { background: var(--card); }
[data-theme="dark"] .rc { background: #1a2338; }
[data-theme="dark"] .badge.info { color: #8ab4ff; }
[data-theme="dark"] .bulk-errs { color: #f97066; }
[data-theme="dark"] .qr, [data-theme="dark"] .qr canvas { background: #fff; }

/* ---------- mapa de SIMs ---------- */
.simmap { height: min(62vh, 560px); min-height: 320px; border-radius: 12px; border: 1px solid var(--line); margin: 12px 0 8px; overflow: hidden; z-index: 0; }
.maplegend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); }
.maplegend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.row.filters { gap: 10px; align-items: center; flex-wrap: wrap; }
.row.filters input[type=search] { flex: 1 1 240px; min-width: 0; }

/* ---------- primeros pasos ---------- */
.onboard { margin-bottom: 16px; }
.onb-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 4px 0 6px; }
.onb-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; }
.onb-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.onb-list li { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-top: 1px solid var(--line); }
.onb-list li:first-child { border-top: 0; }
.onb-ck { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: #fff; }
.onb-list li.done .onb-ck { background: var(--ok); border-color: var(--ok); }
.onb-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.onb-t span { color: var(--muted); font-size: 12.5px; }
.onb-list li.done .onb-t b { text-decoration: line-through; color: var(--muted); font-weight: 600; }
.row.filters { display: flex; }
.row.filters input[type=search] { width: auto; }
.row.filters select { width: auto; flex: none; }

/* modo oscuro: ajustes finos */
[data-theme="dark"] { --link: color-mix(in oklab, var(--brand) 38%, #ffffff); }
[data-theme="dark"] .topbar { background: rgba(11, 18, 32, .92); }
[data-theme="dark"] .userbtn:hover { background: #1a2338; }
[data-theme="dark"] .btn.link, [data-theme="dark"] .ava { color: var(--link); }
[data-theme="dark"] .ava { background: color-mix(in srgb, var(--brand) 35%, #0b1220); }
[data-theme="dark"] .sbrand .mark { background: #fff; }
[data-theme="dark"] .topbar .search, [data-theme="dark"] .topbar input { background: #0e1626; }
[data-theme="dark"] .slogo { background: #fff; }

/* ---------- centro de ayuda ---------- */
.help-list { margin-top: 12px; display: grid; gap: 8px; }
.help-item { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.help-item[open] { padding-bottom: 6px; }
.help-item summary { cursor: pointer; font-weight: 600; padding: 12px 0; }
.help-item p { margin: 0 0 10px; color: var(--muted); line-height: 1.6; }
.help-contact { margin-top: 16px; }
.imp-table { max-height: 280px; overflow: auto; margin-top: 10px; }

/* ---------- línea de tiempo de la SIM ---------- */
.tl { list-style: none; margin: 14px 0 8px; padding: 0 0 0 4px; position: relative; }
.tl::before { content: ""; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { display: flex; gap: 12px; padding: 0 0 14px; position: relative; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #eef1f5; color: #475467; border: 2px solid var(--card); z-index: 1; }
.tl-dot.s1 { background: #dcfae6; color: #067647; } .tl-dot.s2 { background: #fef0c7; color: #93370d; } .tl-dot.susp { background: #fee4e2; color: #b42318; } .tl-dot.s0 { background: #e5e7ff; color: #4f46e5; }
.tl-top { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.tl-top time { color: var(--muted); font-size: 12.5px; }
.tl-detail { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.tl-who { font-size: 12px; color: var(--muted); }
[data-theme="dark"] .tl-dot { background: #1a2338; color: #cbd3e1; }
[data-theme="dark"] .tl-dot.s1 { background: #12301f; color: #47cd89; } [data-theme="dark"] .tl-dot.s2 { background: #33280f; color: #fdb022; } [data-theme="dark"] .tl-dot.susp { background: #3a1a1d; color: #f97066; } [data-theme="dark"] .tl-dot.s0 { background: #1b2a4d; color: #8ab4ff; }

/* ---------- proyección del mes ---------- */
.fmsg { font-size: 15px; font-weight: 600; margin: 4px 0 10px; }
.fbar { position: relative; height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 12px; }
.fbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.fbar .fproj { background: repeating-linear-gradient(45deg, #94a3b8 0 6px, #cbd5e1 6px 12px); opacity: .7; }
.fbar .fused { background: var(--ok); }
.fbar.high .fused { background: var(--danger); } .fbar.medium .fused { background: var(--warn); }
[data-theme="dark"] .fbar .fproj { background: repeating-linear-gradient(45deg, #475569 0 6px, #334155 6px 12px); }

/* ---------- rentabilidad ---------- */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.neg { color: var(--danger); } .pos .tv { color: var(--ok); } .neg .tv { color: var(--danger); }
.prof-tot h4 { margin: 0 0 8px; }

/* modo oscuro: pasada automática de colores claros restantes */
[data-theme="dark"] { --soft: #1a2338; --series-1: #5b8cff; }
[data-theme="dark"] .btn.small.assign { background: color-mix(in srgb, var(--brand) 10%, var(--card)); }
[data-theme="dark"] input[type=text], [data-theme="dark"] input[type=email], [data-theme="dark"] input[type=password], [data-theme="dark"] input[type=search], [data-theme="dark"] input[type=number], [data-theme="dark"] textarea, [data-theme="dark"] select { background: #1a2338; }
[data-theme="dark"] .banner { background: #1a2338; color: #d5dbe8; }
[data-theme="dark"] .sg-item:hover, [data-theme="dark"] .sg-item:focus-visible { background: #1a2338; }
[data-theme="dark"] .t-indigo .ni { background: #1a2338; color: #d5dbe8; }
[data-theme="dark"] .lrow:hover, [data-theme="dark"] .lrow.on { background: #1a2338; }
[data-theme="dark"] .qa:hover { background: color-mix(in srgb, var(--brand) 6%, var(--card)); }
[data-theme="dark"] .qa.accent { background: #1a2338; color: #d5dbe8; }
[data-theme="dark"] .qa.accent:hover { background: #1a2338; }
[data-theme="dark"] tr.sel, [data-theme="dark"] tr.sel:hover { background: color-mix(in srgb, var(--brand) 8%, var(--card)); }
[data-theme="dark"] .actionbar { background: color-mix(in srgb, var(--brand) 9%, var(--card)); }
[data-theme="dark"] .map { background: #1a2338; }
[data-theme="dark"] .sendbtn:disabled { background: #1a2338; }
[data-theme="dark"] .btn.assign { background: color-mix(in srgb, var(--brand) 10%, var(--card)); }
[data-theme="dark"] .bl-pay { background: color-mix(in srgb, var(--brand) 6%, var(--card)); }
[data-theme="dark"] .bl-upload { background: #1a2338; }
[data-theme="dark"] .rank.r3 { background: #1a2338; color: #d5dbe8; }
[data-theme="dark"] .topsims .delta { background: #1a2338; }
[data-theme="dark"] .note-item.unread { background: color-mix(in srgb, var(--brand) 7%, var(--card)); }
[data-theme="dark"] .switch .slider { background: #1a2338; }
[data-theme="dark"] .lchip { background: #1a2338; color: #d5dbe8; }
[data-theme="dark"] .lchip.more { background: #1a2338; color: #d5dbe8; }
[data-theme="dark"] .bignum .delta, [data-theme="dark"] .topsims .delta { background: #1a2338; }
[data-theme="dark"] .btn.small.assign, [data-theme="dark"] .btn.assign { color: var(--link); background: color-mix(in srgb, var(--brand) 25%, var(--card)); border-color: color-mix(in srgb, var(--brand) 45%, var(--card)); }

/* ---------- accesibilidad ---------- */
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 1000; background: var(--brand); color: var(--brand-ink); padding: 10px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; transition: top .15s; }
.skip-link:focus { top: 12px; }
main:focus { outline: none; }
tr[tabindex]:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
.offline-page{max-width:420px;margin:20vh auto 0;padding:0 16px;text-align:center}
.lang-link{display:inline-flex;align-items:center;gap:6px;margin:14px auto 0;background:none;border:0;color:var(--link,var(--brand));font:inherit;font-size:13px;cursor:pointer;text-decoration:underline}
.auth-card{text-align:left}.auth-card .lang-link{display:flex;margin-inline:0}
a.skip-link, :root[data-theme="dark"] a.skip-link { color: var(--brand-ink); }

/* Aviso de cuenta suspendida (acceso y sesiones abiertas) */
.susp-box { background: #fef3f2; border: 1px solid #fecdca; color: #7a271a; border-radius: 12px; padding: 16px 18px; margin: 10px 0; text-align: left; }
.susp-box h2 { margin: 0 0 6px; font-size: 16px; color: #b42318; }
.susp-box p { margin: 6px 0; font-size: 13.5px; line-height: 1.45; }
.susp-box .susp-contact { font-weight: 600; margin-top: 10px; }
.susp-box .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.susp-page { max-width: 520px; margin: 12vh auto 0; padding: 0 16px; display: grid; gap: 14px; justify-items: start; }
:root[data-theme="dark"] .susp-box { background: #2a1210; border-color: #7a271a; color: #fecdca; }
:root[data-theme="dark"] .susp-box h2 { color: #fda29b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .susp-box { background: #2a1210; border-color: #7a271a; color: #fecdca; } :root:not([data-theme="light"]) .susp-box h2 { color: #fda29b; } }

/* ===== Movimiento: transición entre paneles y botón de soporte flotante =====
   Todo se apaga solo con «reducir movimiento» (regla global de prefers-reduced-motion más abajo y al final de este bloque). */
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.view { animation: viewIn .34s cubic-bezier(.22, .8, .3, 1) both; }
.snav .nav-item { transition: background-color .2s, color .2s, transform .2s; }
.snav .nav-item:hover { transform: translateX(2px); }

@keyframes fabIn { from { opacity: 0; transform: scale(.4) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes fabFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@keyframes fabRing { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .55); } 70%, 100% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); } }
.support-fab { animation: fabIn .6s cubic-bezier(.34, 1.56, .64, 1) .8s both, fabFloat 3.4s ease-in-out 1.6s infinite; }
.support-fab::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: fabRing 2.8s ease-out 2s infinite; }
.support-fab:hover, .support-fab:focus-visible { animation-play-state: running, paused; }
@media (prefers-reduced-motion: reduce) {
  .view, .support-fab, .support-fab::after { animation: none !important; }
  .snav .nav-item:hover { transform: none; }
}
.fiscal-line { margin: 2px 0 0; font-size: 12px; }
.forgot { margin: 14px 0 0; text-align: center; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand, #153c7d); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; }
.linkbtn:hover { opacity: .8; }
.ok-note { margin: 4px 0 12px; padding: 10px 12px; border-radius: 10px; background: #e8f7ee; color: #14633a; font-size: 14px; line-height: 1.4; }
.check-out .ok { color: #067647; }
.check-out .bad { color: #b42318; }

/* ---------- asistente de ayuda ---------- */
button.support-fab { border: 0; cursor: pointer; font-family: inherit; }
.asx { position: fixed; right: 20px; bottom: 92px; z-index: 60; width: min(390px, calc(100vw - 24px)); height: min(580px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: asxIn .22s ease-out; }
@keyframes asxIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.asx-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--brand); color: var(--brand-ink); }
.asx-head .hint { color: inherit; opacity: .8; margin: 0; font-size: 12px; }
.asx-x { background: none; border: 0; color: inherit; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.asx-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.asx-msg { max-width: 92%; padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.asx-msg.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.asx-msg.me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 4px; }
.asx-msg ol, .asx-msg ul { margin: 6px 0 4px; padding-left: 20px; } .asx-msg li { margin: 3px 0; } .asx-msg p { margin: 4px 0; }
.asx-title { font-weight: 700; margin-bottom: 2px; }
.asx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.asx-chip { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.asx-chip:hover, .asx-chip:focus-visible { border-color: var(--brand); }
.asx-in { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--card); }
.asx-in input { flex: 1; min-width: 0; }
.asx-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; } .asx-out { font-size: 13px; } .asx-out .ok { color: var(--ok); } .asx-out .bad, .asx .bad { color: var(--danger); }
.asx-fb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } .asx-wa { margin-top: 4px; }
.asx-apn { display: flex; align-items: center; gap: 10px; margin: 6px 0; } .asx-apn code { font-size: 26px; font-weight: 700; letter-spacing: .04em; padding: 2px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.asx-ops { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; } .asx-oplist { display: flex; flex-direction: column; gap: 6px; max-height: 230px; overflow-y: auto; }
.asx-op { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); } .asx-opn { display: flex; flex-direction: column; min-width: 0; }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
@media (max-width: 520px) { .asx { right: 8px; left: 8px; width: auto; bottom: 84px; } }
@media (prefers-reduced-motion: reduce) { .asx { animation: none; } }

.asx-diag { display: flex; flex-direction: column; gap: 4px; } .asx-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; border-bottom: 1px solid var(--line); } .asx-kv .k { color: var(--muted); } .asx-kv .v { text-align: right; font-weight: 600; overflow-wrap: anywhere; } .asx-kv .v.ok { color: var(--ok, #15803d); } .asx-kv .v.warn { color: #b45309; } .asx-kv .v.bad { color: var(--bad, #b91c1c); } .asx-diag .banner2 { margin-top: 4px; font-size: 13px; }
.asx-diag .banner2 { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 8px; } .asx-diag .banner2 svg { flex: none; margin-top: 2px; }
.asx-chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); } .asx-msg textarea { width: 100%; margin-top: 8px; resize: vertical; }

/* Salud de la flota */
.fh-body { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.fh-ring { --p: 0%; width: 120px; height: 120px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(closest-side, var(--card) 72%, transparent 73% 100%), conic-gradient(var(--c, #98a2b3) var(--p), var(--line) 0); }
.fh-ring b { font-size: 26px; line-height: 1; } .fh-ring span { font-size: 11px; color: var(--muted); }
.fh-ring.good { --c: #12b76a; } .fh-ring.mid { --c: #f79009; } .fh-ring.bad { --c: #f04438; }
.fh-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fh-tile { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; }
button.fh-tile { cursor: pointer; } button.fh-tile:hover, button.fh-tile:focus-visible { border-color: var(--brand); }
.fh-tile b { font-size: 22px; line-height: 1.1; } .fh-tile span { font-size: 12.5px; color: var(--muted); } .fh-tile small { font-size: 11px; color: var(--muted); }
.fh-tile.ok b { color: #067647; } .fh-tile.bad b { color: #b42318; } .fh-tile.warn b { color: #b54708; } .fh-tile.na b { color: var(--muted); }
.fh-list { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 10px; } .fh-list h4 { margin: 0 0 6px; font-size: 13px; }
.fh-row { display: flex; gap: 12px; align-items: center; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 7px 4px; cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.fh-row:hover, .fh-row:focus-visible { background: var(--bg, #f2f4f7); } .fh-since { margin-left: auto; font-size: 12.5px; color: #b42318; font-weight: 600; }
.fh-ok { grid-column: 1 / -1; padding: 8px 0 0; }
@media (max-width: 760px) { .fh-body { grid-template-columns: 1fr; justify-items: center; } .fh-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; } }

/* Instalar la app y avisos */
.pwa-slot:empty { display: none; }
.pwa-card .pwa-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.pwa-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.pwa-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .pwa-t span { font-size: 13px; color: var(--muted); }
.pwa-btns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) { .pwa-card .pwa-row { flex-wrap: wrap; } }

/* Paneles plegables del dashboard */
.panel-h.foldable { cursor: pointer; }
.pcol { margin-left: auto; flex: none; width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; }
.pcol:hover, .pcol:focus-visible { color: var(--text); border-color: var(--brand); }
.pcol svg { transition: transform .15s ease; }
.panel.collapsed .pcol svg { transform: rotate(-90deg); }
.panel.collapsed > :not(.panel-h) { display: none !important; }
.panel.collapsed > .panel-h { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .pcol svg { transition: none; } }

/* Editor de perfiles: nivel por función */
.lvlist { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.lvrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.lvt { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .lvt .hint { font-size: 12.5px; }
.lvgroup { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lvopt { position: relative; padding: 7px 12px; font-size: 13px; cursor: pointer; background: var(--card); color: var(--text); border-left: 1px solid var(--line); white-space: nowrap; }
.lvopt:first-child { border-left: 0; } .lvopt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.lvopt.on { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.lvopt:focus-within { outline: 2px solid var(--brand); outline-offset: -2px; }

/* Tickets de soporte */
.tk-table tr.clickable { cursor: pointer; }
.tk-table tr.clickable:hover td, .tk-table tr.clickable:focus-visible td { background: color-mix(in srgb, var(--brand) 6%, white); }
.tk-urgent { margin-left: 8px; }
.tk-thread { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; max-width: 820px; }
.tk-msg { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.tk-msg.staff { background: color-mix(in srgb, var(--brand) 7%, white); border-color: color-mix(in srgb, var(--brand) 25%, white); }
.tk-msg.internal { background: #fffaeb; border: 1px dashed #fedf89; }
.tk-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.tk-who .hint { margin-left: auto; }
.tk-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.tk-reply { max-width: 820px; display: flex; flex-direction: column; gap: 10px; }
.tk-reply textarea { width: 100%; }
.tk-ctx { max-width: 820px; margin-top: 12px; font-size: 13px; }
.tk-ctx pre { white-space: pre-wrap; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 6px 0 0; }
.checkline { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; cursor: pointer; }
.asx-handoff { margin-top: 6px; }
.tk-note { flex-wrap: nowrap; align-items: flex-start; background: color-mix(in srgb, var(--brand) 8%, white); margin-bottom: 12px; } .tk-note svg { flex: none; margin-top: 2px; }
.tk-attach { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.tk-file-input { display: none; }
.tk-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tk-thumb { position: relative; width: 72px; height: 72px; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; background: #f2f4f7; padding: 0; }
.tk-thumb.big { width: 140px; height: 100px; cursor: zoom-in; }
.tk-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tk-thumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(16, 24, 40, .75); color: #fff; cursor: pointer; line-height: 1; }
.tk-quick { gap: 8px; }
.tk-quick select { width: auto; min-width: 200px; }

/* Red y cobertura */
.netbars { display: flex; align-items: flex-end; gap: 8px; height: 82px; padding: 6px 2px 0; }
.netbar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; flex: 1; max-width: 44px; }
.netbar i { display: block; width: 100%; background: var(--primary, #4f46e5); border-radius: 4px 4px 0 0; opacity: .85; }
.netbar span { font-size: 11px; color: var(--muted); }
.cov-table td, .cov-table th { vertical-align: top; }
.cov-country td { font-weight: 600; background: var(--panel-alt, rgba(100,116,139,.06)); }
.cov-op td { font-weight: 400; font-size: 13.5px; }
.cov-indent { padding-left: 22px; }
.cov-country .status-pill { margin-left: 8px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; text-align: left; }
.linkbtn:hover { text-decoration: underline; }
.upper { text-transform: uppercase; }
.status-pill.bad { background: #dc2626; }
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis.four { grid-template-columns: 1fr; } }

/* MapLibre: buscador, puntos de cobertura y ajustes */
.simmap.maplibregl-map, .maplibregl-map { font-family: inherit; }
.map-search { position: absolute; top: 10px; left: 10px; z-index: 3; width: min(340px, calc(100% - 140px)); }
.map-search input { width: 100%; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel, #fff); color: inherit; box-shadow: 0 2px 10px rgba(15, 23, 42, .18); font-size: 14px; }
.map-search-list { list-style: none; margin: 6px 0 0; padding: 4px; border-radius: 10px; background: var(--panel, #fff); border: 1px solid var(--line); box-shadow: 0 6px 22px rgba(15, 23, 42, .22); max-height: 280px; overflow: auto; }
.map-search-list button { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: inherit; font: inherit; }
.map-search-list button:hover, .map-search-list button:focus-visible { background: rgba(79, 70, 229, .1); outline: none; }
.map-search-list button span { font-size: 12.5px; color: var(--muted); }
.map-search-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.cov-dot { border-radius: 50%; border: 2px solid #fff; color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; display: grid; place-items: center; padding: 0; box-shadow: 0 1px 6px rgba(15, 23, 42, .35); }
.maplibregl-popup-content { font-size: 13px; line-height: 1.5; border-radius: 10px; padding: 12px 14px; }
.maplibregl-popup-content .btn { margin-top: 8px; }
.maplibregl-popup-close-button { font-size: 18px; padding: 2px 8px; }

/* Crear dispositivo en emnify */
.devform { display: grid; gap: 14px; }
.devform .setgrid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.devform select, .devform input[type=text] { width: 100%; min-width: 0; }
.devopts { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.devopts legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.devopt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line, #e4e7ec); border-radius: 12px; cursor: pointer; }
.devopt input { margin-top: 3px; }
.devopt .grow { display: grid; gap: 4px; min-width: 0; }
.devopt:has(input:checked) { border-color: var(--brand, #153c7d); box-shadow: 0 0 0 1px var(--brand, #153c7d) inset; }
.devopt .badge { justify-self: start; }
/* Títulos de las ventanas: el azul de la marca no se lee sobre el fondo oscuro */
[data-theme="dark"] .phead h2 { color: var(--text); }

/* El logo de la plataforma (texto blanco, fondo transparente) se ve igual en modo claro y oscuro. */
[data-theme="dark"] .slogo.plat { background: none; padding: 0; }
