/* Estilos de MapRed: portada, inicio de sesión y panel (usa las variables de tema.css). */

/* ============ Base ============ */
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--plum-700);
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
code, .mono { font-family: var(--mono); }
h1, h2, h3 { text-wrap: balance; }
.red { color: var(--pink); }
.gutter { padding-left: 16px; padding-right: 16px; }
.muted { color: var(--muted-ink); font-size: 13px; font-weight: 400; }

/* Marca (logo + nombre) */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand b { font-size: 30px; font-weight: 600; letter-spacing: -.5px; }
.brand b span { color: var(--pink); }

/* ============ PORTADA (antes de iniciar sesión) ============ */
#loginScreen { min-height: 100vh; background: var(--grad-landing); }
.land-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; padding-block: 16px; background: rgba(74, 11, 58, .55); color: #fff;
}
.land-top nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 26px; }
.land-top nav a { color: #fff; text-decoration: none; font-size: 17px; font-weight: 500; padding: 10px 2px; }
.land-top nav a:hover { color: #ffd1e3; }
.land-top nav a.cta { background: var(--plum-800); padding: 11px 20px; border-radius: 12px; font-weight: 600; }

.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 22px; padding-block: 110px 100px; color: #fff; }
.hero h1 { margin: 0; font-size: clamp(64px, 11vw, 132px); font-weight: 600; line-height: 1; letter-spacing: -2px; }
.hero .tri { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; font-size: clamp(26px, 4vw, 42px); font-weight: 500; }
.hero p { margin: 0; max-width: 680px; font-size: 19px; line-height: 1.55; }
.hero .acts { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }
.btn-hero {
  display: inline-flex; align-items: center; gap: 10px; background: var(--violet); color: #ffe0ec;
  font-size: 19px; font-weight: 600; text-decoration: none; padding: 15px 46px; border-radius: 999px; min-height: 54px;
}
.btn-hero:hover { background: var(--violet-ink); }
.btn-hero.o { background: rgba(255, 255, 255, .14); color: #fff; border: 2px solid rgba(255, 255, 255, .55); padding: 13px 32px; }

.wrap { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { background: rgba(74, 11, 58, .8); border-radius: 22px; padding: 22px 24px; display: flex; flex-direction: column; gap: 4px; color: #f3dbe8; font-size: 15px; }
.stat b { font-size: 34px; color: #ff5c98; font-weight: 700; }

.frame-card {
  border: 6px solid transparent; border-radius: var(--radius-card);
  background: linear-gradient(#fff, #fff) padding-box, var(--grad-frame) border-box;
  padding: 40px 32px; display: flex; flex-direction: column; gap: 24px;
}
.center { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.center h2 { margin: 0; font-size: 28px; font-weight: 600; color: var(--rose); border-bottom: 2px solid var(--magenta); padding-bottom: 4px; }
.center h1 { margin: 0; font-size: 22px; font-weight: 600; color: var(--rose); }
.center p { margin: 0; }
.sub { font-size: 15px; color: var(--rose-ink); }

.feat { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.feat article { border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 10px; background: var(--soft); border: 2px solid var(--line); }
.feat h3 { margin: 0; font-size: 18px; color: var(--wine); }
.feat p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.fi { width: 52px; height: 52px; border-radius: 14px; color: #fff; font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.step { display: flex; gap: 16px; align-items: flex-start; padding: 22px; border-radius: 20px; background: var(--grad-soft); }
.step i { width: 50px; height: 50px; flex: 0 0 50px; border-radius: 50%; background: var(--magenta); color: #fff; font-style: normal; font-size: 21px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step h3 { margin: 0 0 4px; font-size: 17px; color: var(--wine); }
.step p { margin: 0; font-size: 15px; color: var(--ink-2); }

.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.role { border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 10px; border: 2px solid; }
.role h3 { margin: 0; }
.role p { margin: 0; font-size: 14px; color: var(--ink-2); }
.role .tag { align-self: flex-start; color: #fff; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.role.admin { background: #fdf0f6; border-color: #f4c2d8; }
.role.admin h3 { color: var(--wine); }
.role.admin .tag { background: var(--magenta); }
.role.viewer { background: #f4effc; border-color: #d9ccf5; }
.role.viewer h3 { color: var(--violet-ink); }
.role.viewer .tag { background: var(--violet); }

.cta-band { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 46px 24px; border-radius: 28px; background: rgba(74, 11, 58, .85); color: #fff; }
.cta-band h2 { margin: 0; font-size: 30px; }
.cta-band p { margin: 0; color: #f3dbe8; }
.foot { background: var(--plum-800); padding-block: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 14px; color: #e7c9dc; }
.foot strong { color: #fff; }

/* Botón principal tipo "enlace" (portada) */
a.btn { background: var(--hot); color: #fff; text-decoration: none; font-size: 17px; font-weight: 600; padding: 13px 34px; border-radius: 10px; min-height: 50px; display: inline-flex; align-items: center; gap: 8px; }
a.btn:hover { background: var(--magenta); }

/* Portada / acceso: solo se ve una de las dos vistas */
#loginScreen .view-access { display: none; }
#loginScreen.show-access .view-landing { display: none; }
#loginScreen.show-access .view-access { display: block; }

/* ============ INICIO DE SESIÓN ============ */
.auth-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; background: var(--plum-700); color: #fff; }
.auth-top a.back { color: #fff; text-decoration: none; font-size: 16px; font-weight: 500; padding: 10px 4px; }
.auth { display: flex; justify-content: center; padding-block: 48px 64px; }
.auth .login-card {
  width: 100%; max-width: 540px; border: 6px solid transparent; border-radius: 32px;
  background: linear-gradient(#fff, #fff) padding-box, var(--grad-frame) border-box;
  padding: 38px; display: flex; flex-direction: column; gap: 22px;
}
.auth .center p { font-size: 16px; color: #8a7a86; }
.lock { width: 60px; height: 60px; border-radius: 50%; background: var(--chip); display: flex; align-items: center; justify-content: center; }
#loginForm { gap: 18px; }
#loginForm label { font-size: 16px; color: #8a7a86; font-weight: 500; }
#loginForm input { background: #e6e3e3; }
#loginForm button.primary { width: 100%; font-size: 17px; min-height: 50px; }
.note { margin: 0; font-size: 14px; color: var(--muted-ink); text-align: center; }

/* ============ RECUPERAR CONTRASEÑA ============ */
#loginScreen .view-recover { display: none; }
#loginScreen.show-recover .view-landing { display: none; }
#loginScreen.show-recover .view-recover { display: block; }
.rec-body { display: flex; flex-direction: column; gap: 18px; }
.rec-body form { gap: 16px; }
.rec-body label { font-size: 16px; color: #8a7a86; font-weight: 500; }
.rec-body input { background: #e6e3e3; }
.rec-body button.primary, a.btn.block { width: 100%; justify-content: center; font-size: 17px; min-height: 50px; }
.rec-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font-size: 14px; color: #8a7a86; }
.rec-row.right { justify-content: flex-end; margin-top: -8px; }
.link { background: none; border: 0; padding: 8px 0; min-height: 40px; font-size: 14px; font-weight: 600; color: var(--rose); text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; cursor: pointer; }
.link:hover { color: var(--magenta); background: none; }
.center-link { align-self: center; }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; gap: 6px; }
.stepper li { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: #8a7a86; text-align: center; }
.stepper li i { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 700; background: #f3eef2; border: 2px solid #e3d6df; }
.stepper li.on { color: var(--rose); font-weight: 700; }
.stepper li.on i { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.stepper li.done { color: var(--ok); }
.stepper li.done i { background: var(--ok); border-color: var(--ok); color: #fff; }
.code-set { border: 0; margin: 0; padding: 0; }
.code-set legend { padding: 0; margin-bottom: 12px; font-size: 16px; color: #8a7a86; font-weight: 500; }
.code { display: flex; justify-content: center; gap: 9px; }
.code input { width: 50px; height: 58px; padding: 0; text-align: center; background: #e6e3e3; border-radius: 12px; font-size: 24px; font-weight: 600; color: var(--ink); }
.banner { border-radius: 16px; padding: 14px 18px; font-size: 15px; line-height: 1.5; border: 2px solid; }
.banner b { display: block; font-size: 16px; margin-bottom: 2px; }
.banner b.inline { display: inline; font-size: inherit; }
.banner.ok { background: var(--ok-bg); border-color: var(--ok-line); color: #17502a; }
.banner.err { background: #fdf2f4; border-color: var(--err-line); color: #7d0f22; }
.banner.v { background: #f4effc; border-color: #d9ccf5; color: #3d2a73; }
.inrow { display: flex; gap: 8px; }
.inrow input { flex: 1; }
.rules { text-align: left; margin: 0; padding-left: 18px; }
.lock.ok { background: var(--ok); }
.done-box { gap: 14px; }
.done-box p { color: #6b5566; font-size: 15px; }
.ok-title { color: var(--ok) !important; }
.warn-text { color: var(--warn); font-weight: 600; }

/* Primer inicio de sesión: crear contraseña propia */
#loginScreen .view-change { display: none; }
#loginScreen.show-change .view-landing,
#loginScreen.show-change .view-access,
#loginScreen.show-change .view-recover { display: none !important; }
#loginScreen.show-change .view-change { display: block; }
.back.as-button { color: #fff; cursor: pointer; font: inherit; font-size: 16px; font-weight: 500; background: none; border: 0; min-height: 44px; }

/* Contraseña temporal mostrada una vez (cuando el correo no salió) */
.temp-pass { display: flex; flex-direction: column; gap: 14px; }
.temp-pass .code-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-radius: 14px; background: #fdf0f6; border: 2px dashed #f4c2d8; }
.temp-pass .code-box span { font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: 2px; color: var(--plum-700); }

/* "Mi cuenta" (ventana modal) */
.account { display: flex; flex-direction: column; gap: 22px; }
.account-block { border: 2px solid var(--line); background: var(--soft); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.account-block h3 { margin: 0; font-size: 17px; color: var(--wine); }
.account-block p { margin: 0; }

@media (max-width: 420px) { .code input { width: 42px; height: 52px; } .code { gap: 6px; } }

/* ============ PANEL (después de iniciar sesión) ============ */
#mainPanel { min-height: 100vh; background: var(--grad-app); padding-bottom: 64px; }

/* Encabezado */
/* Encabezado en rejilla: logo | título | cuenta, y abajo las pestañas.
   .drawer no ocupa lugar en escritorio (display: contents); en celular es el menú plegable. */
header.top {
  background: var(--plum-700); color: #fff;
  display: grid; grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "brand mid session" "tabs tabs tabs";
  align-items: center; gap: 6px 16px; padding-block: 14px 0; margin-bottom: 18px;
}
header.top > .brand { grid-area: brand; }
header.top > .top-mid { grid-area: mid; }
header.top .drawer { display: contents; }
header.top #sessionBox { grid-area: session; justify-self: end; }
header.top .tabs-bar { grid-area: tabs; margin-bottom: 0; }
.top-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.top-mid strong { font-size: 19px; font-weight: 500; }
.top-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.top-chips .badge { background: #c2177a; color: #fff; font-size: 13px; font-weight: 500; padding: 5px 12px; border-radius: 999px; text-transform: capitalize; }
#sessionBox { display: none; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-dark {
  background: var(--wine); color: #fff; border: 0; text-decoration: none;
  font-size: 14px; font-weight: 600; padding: 10px 14px; border-radius: 9px;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer;
}
.btn-dark:hover { background: var(--magenta); }
#mapSelect { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .35); min-height: 44px; }
#mapSelect option { color: var(--ink); }
.avatar { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-left: 6px; }
.avatar i {
  width: 46px; height: 46px; border-radius: 50%; background: #b79cf0; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 700; color: var(--violet-ink); font-size: 18px;
}
.avatar small { background: var(--violet); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 6px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Menú de cuenta (avatar → Mi cuenta / Cerrar sesión) */
.acct { position: relative; }
button.avatar { background: none; border: 0; padding: 4px; min-height: 0; cursor: pointer; border-radius: 12px; }
button.avatar:hover i, .acct.open button.avatar i { box-shadow: 0 0 0 3px var(--pink); }
button.avatar:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
button.avatar:hover { background: none; }
.acct-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 190px;
  flex-direction: column; gap: 4px; padding: 8px; border-radius: 14px;
  background: var(--plum-800); box-shadow: 0 10px 28px rgba(42, 6, 32, .4); border: 1px solid rgba(255, 255, 255, .15);
  animation: drop-in .15s ease;
}
.acct.open .acct-menu { display: flex; }
.acct-menu button {
  background: none; border: 0; color: #fff; text-align: left; font-size: 15px; font-weight: 500;
  padding: 10px 12px; border-radius: 10px; min-height: 0; cursor: pointer;
}
.acct-menu button:hover, .acct-menu button:focus-visible { background: rgba(255, 255, 255, .12); }
.acct-menu .acct-exit { color: #ffc2d4; }
.acct-menu .acct-exit:hover { background: var(--magenta); color: #fff; }

/* Aviso de modo demostración */
.demo-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px;
  padding-block: 10px; margin-bottom: 22px; background: #f4effc; color: #3d2a73; border-bottom: 2px solid #d9ccf5; font-size: 14px;
}
.demo-acts { display: inline-flex; gap: 10px; align-items: center; }
.demo-acts a, .demo-acts button {
  font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 9px; min-height: 0; cursor: pointer;
  text-decoration: none; border: 2px solid #c9b6f2; background: #fff; color: #3d2a73;
}
.demo-acts button { background: var(--violet); border-color: var(--violet); color: #fff; }
/* Escanear PCs conectadas (ventana) */
.scan-table input[type="text"] { min-width: 130px; padding: 6px 8px; min-height: 0; font-size: 13px; }
.scan-table select { padding: 6px 8px; min-height: 0; font-size: 13px; }
.scan-table td { vertical-align: top; }

/* Bitácora */
.audit-filters { margin-bottom: 16px; }
.audit-table td { vertical-align: top; }
.audit-table .when { white-space: nowrap; font-size: 13px; }
.audit-table .who b { display: block; }
.audit-more { justify-content: center; margin-top: 14px; }
[data-demo].busy { opacity: .6; pointer-events: none; cursor: progress; }

/* Pestañas */
/* Pestañas centradas; "Cerrar sesión" queda a la derecha */
.tabs-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding-block: 10px; margin-bottom: 18px; }
nav.tabs { grid-column: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 22px; }
nav.tabs button {
  background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0;
  color: #ffd1e3; font-size: 16px; font-weight: 500; padding: 9px 2px; min-height: 0;
}
nav.tabs button:hover { color: #fff; background: none; }
nav.tabs button.active { color: var(--pink); font-weight: 700; border-bottom-color: var(--pink); }
.tab { display: none; }
.tab.active { display: flex; flex-direction: column; gap: 28px; }
.panel-body { max-width: 1180px; margin: 0 auto; }

/* ============ Tarjetas ============ */
.card {
  border: 6px solid transparent; border-radius: var(--radius-card);
  background: linear-gradient(#fff, #fff) padding-box, var(--grad-frame) border-box;
  padding: 28px 30px; min-width: 0;
}
/* Título subrayado; el texto secundario (.muted) va a un lado sin subrayar */
.card h2 {
  margin: 0 0 20px; font-size: 20px; font-weight: 600; color: var(--rose);
  text-decoration: underline; text-decoration-color: var(--magenta);
  text-decoration-thickness: 2px; text-underline-offset: 8px; line-height: 1.6;
}
.card h2 .muted { display: inline-block; margin-left: 10px; font-size: 15px; color: var(--rose-ink); font-weight: 400; }
.card h3 { font-size: 17px; margin: 22px 0 12px; color: var(--wine); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.card-head h2 { margin: 0; }
.card > .muted { font-size: 14px; color: var(--muted-ink); }

/* ============ Formularios ============ */
form { display: flex; flex-direction: column; gap: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px 28px; }
label { display: flex; flex-direction: column; gap: 8px; font-size: 15px; font-weight: 600; color: var(--rose); min-width: 0; }
label .muted { color: var(--rose-ink); font-size: 13px; }
input, select, textarea {
  font-size: 15px; padding: 10px 14px; min-height: 46px;
  border: 2px solid transparent; border-radius: 10px; background: var(--field); color: var(--ink);
  min-width: 0; font-weight: 400;
}
input::placeholder, textarea::placeholder { color: #7d6f79; }
textarea { font-family: var(--mono); font-size: 13px; min-height: 140px; border-radius: 16px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pink); background: #fff; }
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 20px; height: 20px; accent-color: var(--hot); margin: 0; }
details summary { cursor: pointer; font-size: 15px; font-weight: 600; color: var(--wine); padding: 8px 0; }

/* ============ Botones ============ */
button { font-family: inherit; font-size: 15px; font-weight: 600; padding: 11px 22px; border-radius: 10px; border: 0; cursor: pointer; min-height: 46px; }
button.primary { background: var(--hot); color: #fff; padding: 12px 30px; }
button.primary:hover { background: var(--magenta); }
button.secondary { background: #f3eef2; color: #3a1530; border: 1px solid #e3d6df; font-weight: 500; }
button.secondary:hover { background: #ebe3e9; }
button.danger { background: #fdecef; color: #c0102e; border: 1px solid var(--err-line); }
button.danger:hover { background: #fbdde3; }
button.small { padding: 8px 14px; font-size: 13px; min-height: 38px; }
.card-head button.secondary.small { background: var(--hot); color: #fff; border-color: transparent; }
.card-head button.secondary.small:hover { background: var(--magenta); }
button:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ============ Mensajes ============ */
.msg { padding: 12px 16px; border-radius: 14px; font-size: 14px; margin-top: 4px; border: 2px solid; }
.msg.error { background: #fdf2f4; border-color: var(--err-line); color: #7d0f22; }
.msg.success { background: var(--ok-bg); border-color: var(--ok-line); color: #17502a; }
.msg.info { background: #f4effc; border-color: #d9ccf5; color: #3d2a73; }

/* ============ Listas ============ */
.list { display: flex; flex-direction: column; gap: 12px; }
.item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 18px; border-radius: 18px; background: var(--soft); border: 2px solid var(--line);
}
.item-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.item-name { font-weight: 600; font-size: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--ink); }
.item-meta { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }

/* Mover equipos de piso (pestaña Dispositivos) */
.move-box { padding: 16px 18px; margin-bottom: 16px; border-radius: 18px; background: #f4effc; border: 2px solid #d9ccf5; display: flex; flex-direction: column; gap: 12px; }
.move-box .muted { margin: 0; }
.move-preview { margin: 0; font-size: 14px; color: #3d2a73; font-weight: 600; }
.move-preview.warn { color: #7d0f22; }
.item.move-on { cursor: pointer; }
.item.move-selected { border-color: var(--hot); background: #fff4f9; }
.move-check { margin-right: 4px !important; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; background: #f3eef2; color: var(--muted-ink); white-space: nowrap; }
.pill.ok, .status-online, .pill.permit { background: var(--ok-bg); color: var(--ok); }
.pill.error, .status-offline, .pill.deny { background: var(--err-bg); color: var(--err); }
.pill.warning { background: var(--warn-bg); color: var(--warn); }
.pill.accent { background: var(--chip); color: var(--chip-ink); }
.empty-state { text-align: center; color: var(--rose-ink); padding: 24px; font-size: 15px; border: 2px dashed #e8c9d8; border-radius: 16px; }
td.empty-state { border: 0; border-radius: 0; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }

/* ============ Tablas ============ */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 2px solid var(--line); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; vertical-align: middle; }
td { border-top: 1px solid var(--line); }
th { background: var(--plum-700); color: #fff; font-size: 13px; font-weight: 600; }
tbody tr:nth-child(even) td { background: #fcf8fb; }
td.mono, .mono { font-family: var(--mono); font-size: 13px; }
tr.matched td { background: #fdf0f6 !important; }
table input, table select { padding: 6px 10px; font-size: 13px; width: 100%; min-height: 38px; }

/* ============ VLANs ============ */
.vlan-card { border: 2px solid var(--line); background: var(--soft); border-radius: 18px; padding: 16px 18px; margin-bottom: 12px; }
.vlan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.vlan-num { font-family: var(--mono); font-weight: 700; color: var(--magenta); }

/* ============ Diagnóstico ============ */
.report { border: 2px solid var(--line); background: var(--soft); border-radius: 16px; padding: 16px; margin-top: 12px; }
.check { display: grid; grid-template-columns: 90px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.check:last-child { border-bottom: none; }
.hint { color: var(--warn); font-size: 13px; margin-top: 3px; }
.verdict { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.verdict.allowed { color: var(--ok); }
.verdict.denied { color: var(--err); }

/* ============ Topología ============ */
.topo-row-off td { opacity: .55; }
td.check-cell { width: 36px; }
td.check-cell input { width: 20px; }
.link-arrow { color: var(--magenta); padding: 0 6px; font-weight: 700; }

/* ============ Despliegue rápido ============ */
.progress { height: 10px; background: #f3eef2; border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--magenta), var(--violet)); width: 0; transition: width .3s; }
.log { background: var(--plum-900); color: #f3dbe8; border-radius: 14px; padding: 12px 14px; font-family: var(--mono); font-size: 12px; max-height: 220px; overflow-y: auto; white-space: pre-wrap; margin-top: 12px; }
.cred-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
#discTable select { min-width: 115px; }
.checks { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.checks label { flex-direction: row; align-items: center; gap: 10px; color: #c2177a; font-weight: 500; }

/* ============ Pestaña Topología ============ */
.topo-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tstat { background: var(--plum-700); color: #f3dbe8; border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.tstat b { font-size: 26px; color: #ff5c98; font-weight: 700; line-height: 1.1; }
.topo-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.topo-tools input { flex: 0 1 260px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.fbtn { min-height: 40px; padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; border: 2px solid #ecd9e4; background: #fff; color: var(--wine); }
.fbtn:hover { border-color: var(--magenta); }
.fbtn.on { border-color: var(--magenta); background: var(--magenta); color: #fff; }
.topo { overflow-x: auto; border-radius: 18px; background: var(--grad-soft); border: 2px solid var(--line); }
.topo svg { display: block; margin: 0 auto; font-family: var(--font); }
.node { cursor: pointer; transition: opacity .15s; }
.node:hover circle { filter: brightness(1.12); }
.node:focus { outline: none; }
.node:focus-visible circle { stroke: var(--pink); stroke-width: 5; }
.node.dim { opacity: .22; }
/* Contorno claro alrededor del texto para que las líneas no lo tapen */
.node .lbl { paint-order: stroke; stroke: #fbf2f8; stroke-width: 4px; stroke-linejoin: round; }
.topo-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.topo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.topo-legend i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.topo-legend .ln { width: 22px; height: 0; border-top: 3px solid #c2177a; display: inline-block; }
.topo-legend .ln.off { border-top: 3px dashed #a89aa5; }

.topo-ficha { margin-top: 16px; background: var(--plum-700); color: #fff; border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.ficha-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ficha-id { display: flex; gap: 14px; align-items: center; min-width: 0; }
.topo-badge { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 14px; border: 3px solid #fff; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ficha-name { font-size: 18px; font-weight: 600; }
.ficha-name span { font-weight: 400; color: #ffc2da; }
.ficha-meta { font-size: 13px; color: #f3dbe8; overflow-wrap: anywhere; }
.ficha-sub { font-size: 14px; font-weight: 600; color: #ffc2da; margin-bottom: 6px; }
.ficha-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.ficha-links li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: rgba(255, 255, 255, .08); border-radius: 10px; padding: 6px 10px; }
.ficha-links .link-arrow { color: #ff5c98; }
.ficha-src { font-size: 12px; color: #e7c9dc; margin-left: auto; }
.linklike { background: none; border: 0; padding: 0; min-height: 0; color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn-dark.light { background: rgba(255, 255, 255, .14); }
.btn-dark.light:hover { background: var(--magenta); }

.plan { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; background: var(--plum-900); padding: 14px; border-radius: 18px; }
.room { min-height: 140px; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: #3d0a30; border: 2px solid #6d2a5c; color: #e7c9dc; font-size: 13px; font-weight: 600; }
.room.comm { background: #7a1a5e; border-color: #ff5c98; color: #fff; }
.room-title { font-size: 15px; display: flex; justify-content: space-between; gap: 8px; }
.room-title span, .room-sub { font-weight: 400; color: #e7c9dc; font-size: 12px; }
.room .devs { display: flex; flex-wrap: wrap; gap: 12px; }
.rdev { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0; min-height: 0; color: #f3dbe8; font-size: 11px; font-weight: 500; max-width: 96px; text-align: center; }
.rdev span { color: #d7b3c8; font-family: var(--mono); font-size: 10px; }
.rdev i { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 700; font-size: 14px; color: #fff; border: 3px solid #fff; }
.rdev i.off { border-style: dashed; }
.rdev:hover i { box-shadow: 0 0 0 3px var(--pink); }
.host { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #f3dbe8; }
.host.bad { background: var(--err-bg); color: var(--err); }
.room-none { font-weight: 400; }

/* ============ Ventana modal ============ */
#modal { display: none; position: fixed; inset: 0; background: rgba(42, 6, 32, .6); z-index: 10; padding: 24px 12px; overflow-y: auto; }
#modal .modal-box {
  max-width: 960px; margin: 0 auto; border: 6px solid transparent; border-radius: var(--radius-card);
  background: linear-gradient(#fff, #fff) padding-box, var(--grad-frame) border-box; padding: 24px 26px;
}
#modal .modal-box h2 { color: var(--rose); margin: 0; }
#modal pre { background: var(--soft); border: 2px solid var(--line); padding: 12px; border-radius: 12px; overflow: auto; max-height: 360px; font-size: 12px; }

/* ============ Pantallas chicas ============ */
@media (max-width: 680px) {
  .row, .row3, .cred-row { grid-template-columns: 1fr; }
  .card { padding: 22px 18px; }
  .top-mid { order: 3; width: 100%; }
  .tabs-bar { grid-template-columns: 1fr; justify-items: center; }
  nav.tabs { grid-column: 1; justify-self: center; }
  .auth .login-card { padding: 26px 20px; }
  .frame-card { padding: 28px 18px; }
  .hero { padding-block: 70px 60px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ============ Menús hamburguesa (celular) ============ */
.burger {
  display: none; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px;
  background: var(--wine); color: #fff; border: 0; border-radius: 10px; font-size: 15px; font-weight: 600;
}
.burger:hover { background: var(--magenta); }
.burger-icon { width: 20px; height: 14px; display: flex; flex-direction: column; justify-content: space-between; flex: 0 0 20px; }
.burger-icon i { display: block; height: 2px; border-radius: 2px; background: #fff; transition: transform .2s, opacity .2s; }
.open > .burger { background: var(--magenta); }
.open > .burger .burger-icon i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.open > .burger .burger-icon i:nth-child(2) { opacity: 0; }
.open > .burger .burger-icon i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.burger-label { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Panel */
@media (max-width: 900px) {
  header.top { grid-template-columns: 1fr auto; grid-template-areas: "brand burger" "mid mid"; padding-block: 10px; gap: 8px 12px; }
  header.top .brand b { font-size: 26px; }
  header.top .brand svg { width: 44px; height: 38px; }
  header.top > .top-mid { flex-direction: row; justify-content: flex-start; }
  header.top > .top-mid strong { display: none; }
  header.top > .burger { display: inline-flex; grid-area: burger; }
  header.top .drawer { display: none; grid-column: 1 / -1; }
  header.top.open .drawer {
    display: flex; flex-direction: column; gap: 14px; padding: 14px 0 16px;
    border-top: 1px solid rgba(255, 255, 255, .18); animation: drop-in .2s ease;
  }
  header.top .drawer .tabs-bar { order: 1; display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 0; }
  header.top .drawer nav.tabs { flex-direction: column; flex-wrap: nowrap; gap: 4px; }
  header.top .drawer nav.tabs button {
    text-align: left; padding: 12px 14px; border: 0; border-radius: 12px;
    background: rgba(255, 255, 255, .07); color: #ffd1e3; font-size: 16px;
  }
  header.top .drawer nav.tabs button.active { background: var(--magenta); color: #fff; }
  header.top .drawer #sessionBox { order: 0; flex-direction: column; align-items: stretch; gap: 8px; }
  header.top .drawer #sessionBox > .btn-dark, header.top .drawer #mapSelect { width: 100%; justify-content: center; }
  header.top .drawer .acct { order: -1; display: flex; flex-direction: column; gap: 8px; }
  header.top .drawer .avatar { flex-direction: row; gap: 12px; margin: 0 0 4px; pointer-events: none; justify-content: flex-start; }
  header.top .drawer .avatar small { max-width: none; font-size: 13px; padding: 3px 10px; }
  /* En el celular el menú de cuenta va abierto dentro del menú hamburguesa */
  header.top .drawer .acct-menu { display: flex; position: static; box-shadow: none; border: 0; padding: 0; background: none; animation: none; }
  header.top .drawer .acct-menu button { background: rgba(255, 255, 255, .07); text-align: center; }
}

/* Portada */
@media (max-width: 760px) {
  .land-top { padding-block: 10px; }
  .land-top .brand b { font-size: 26px; }
  .land-top .brand svg { width: 44px; height: 38px; }
  .land-top > .burger { display: inline-flex; background: rgba(255, 255, 255, .14); }
  .land-top > nav { display: none; }
  .land-top.open > nav {
    display: flex; flex-direction: column; align-items: stretch; gap: 4px; flex-basis: 100%;
    padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .18); animation: drop-in .2s ease;
  }
  .land-top.open > nav a { padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .07); }
  .land-top.open > nav a.cta { text-align: center; background: var(--magenta); }
}

/* ============ Aviso de tiempo real ============ */
/* Cascada de notificaciones (panelToast en api.js): se apilan hacia arriba sin encimarse */
.toast-stack {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  width: min(92vw, 460px); pointer-events: none;
}
.rt-toast {
  transform: translateY(16px); width: 100%; box-sizing: border-box; cursor: pointer;
  max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 14px;
  background: var(--plum-800); color: #fff; font-size: 14px; box-shadow: 0 8px 24px rgba(42, 6, 32, .35);
  border-left: 4px solid var(--pink); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.rt-toast.on { opacity: 1; transform: none; pointer-events: auto; }
.rt-toast.leaving { opacity: 0; transform: translateY(8px); }
/* En PC van abajo a la derecha para no tapar las tablas */
@media (min-width: 901px) {
  .toast-stack { left: auto; right: 22px; transform: none; align-items: flex-end; width: 420px; }
}
/* Notificaciones del panel (panelToast en api.js) */
.rt-toast.ok { border-left-color: #4ade80; }
.rt-toast.error { border-left-color: #ff6b81; background: #5a0c22; }
