/* =====================================================================
   DISEÑO "CRISTAL + CENTRO DE CONTROL" (se carga después de app.css y lo sobrescribe)
   ===================================================================== */
:root {
  --glass: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  --glass-line: rgba(255,255,255,.11);
}
body { background: #121217; }
body::before, body::after { content: ""; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(90px); opacity: .55; }
body::before { width: 46vw; height: 46vw; right: -12vw; top: -16vw; background: radial-gradient(circle, rgba(229,72,77,.55), transparent 65%); animation: drift 22s ease-in-out infinite alternate; }
body::after { width: 52vw; height: 52vw; left: -16vw; bottom: -20vw; background: radial-gradient(circle, rgba(59,130,246,.40), rgba(168,85,247,.18) 55%, transparent 70%); animation: drift 28s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate(0,0) scale(1); } to { transform: translate(4vw, 3vw) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { body::before, body::after, .pill.online .dot { animation: none; } }

.card, .glass, .stat, .cmdlist, .terminal, .modal, .login-card {
  background: var(--glass), rgba(30,30,38,.55);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 10px 30px rgba(0,0,0,.28);
}
.terminal { background: rgba(10,11,15,.72); }
.sidebar { background: rgba(22,22,27,.6); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); }
.nav a.active { background: linear-gradient(90deg, rgba(59,130,246,.22), rgba(59,130,246,.04)); box-shadow: inset 3px 0 0 var(--accent); }

input, select, textarea { background: rgba(10,10,14,.55); border: 1px solid var(--glass-line); }
textarea { display: block; width: 100%; margin-top: 6px; padding: 9px 12px; font: inherit; color: var(--text); border-radius: 8px; outline: none; resize: vertical; }
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-primary { background: linear-gradient(180deg, #4b8ff8, #2f6fe0); box-shadow: 0 6px 18px rgba(59,130,246,.35); }
.btn-primary:hover { background: linear-gradient(180deg, #5b9bfa, #3a7af0); }

/* Resumen de equipos */
.stat { overflow: hidden; position: relative; }
.stat::after { content: ""; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, var(--c), transparent 70%); opacity: .18; }
.stat.sel { border-color: rgba(59,130,246,.7); box-shadow: 0 0 0 1px rgba(59,130,246,.4), 0 10px 30px rgba(59,130,246,.18); }
.stat-n { font-size: 32px; text-shadow: 0 0 24px color-mix(in srgb, var(--c) 45%, transparent); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar input { flex: 1 1 260px; }
.toolbar select { flex: 0 1 220px; margin: 0; width: auto; }

/* Grupos por cliente */
.group-head { display: flex; align-items: baseline; gap: 10px; margin: 22px 2px 10px; }
.group-head:first-child { margin-top: 4px; }
.group-head b { font-size: 15px; letter-spacing: .01em; }
.group-head span { color: var(--muted); font-size: 12.5px; }
.group-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--glass-line), transparent); }

/* Tarjeta de equipo */
.device { padding: 16px 16px 14px; gap: 12px; }
.device::before { width: 0; }
.device:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.24); box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 16px 40px rgba(0,0,0,.42); }
.device[data-state="online"] { box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 10px 30px rgba(0,0,0,.28), 0 0 0 1px rgba(48,164,108,.18); }
.device.alarm { border-color: rgba(229,72,77,.6); box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 0 0 1px rgba(229,72,77,.3), 0 12px 36px rgba(229,72,77,.2); }
.d-head { display: flex; align-items: center; gap: 12px; }
.d-title { flex: 1; min-width: 0; }
.d-customer { color: var(--muted); font-size: 12.5px; margin-bottom: 1px; }      /* el cliente tal como se escribió, sin forzar mayúsculas */
.device .name { font-size: 16.5px; font-weight: 650; line-height: 1.2; }

.ring { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.05); border: 2px solid #555b64; color: #9aa0aa; }
.ring svg { width: 21px; height: 21px; }
.ring.online { border-color: var(--green); color: #6fe0a8; box-shadow: 0 0 0 4px rgba(48,164,108,.12), 0 0 22px rgba(48,164,108,.35); }
.ring.offline { border-color: var(--red); color: #ff9a9d; box-shadow: 0 0 0 4px rgba(229,72,77,.10); }
.ring.pending { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 0 4px rgba(245,165,36,.10); }
.ring.big { width: 62px; height: 62px; } .ring.big svg { width: 28px; height: 28px; }
/* Aviso amarillo sobre el icono del equipo, arriba a la derecha (programa cargado casi vacío) */
.ring { position: relative; }
.ring .rbadge { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--amber); color: #1a1204; border: 2px solid #1b1b22; box-shadow: 0 0 10px rgba(245,165,36,.45); }
.ring .rbadge svg { width: 12px; height: 12px; }
/* Tarjeta de una función que la versión de la app del equipo aún no tiene: en rojo suave */
.card.vlocked { border-color: rgba(229,72,77,.3); }
.card.vlocked h3, .card.vlocked .muted { color: #d9898c; }
/* Acciones: tarjetas iguales, con el botón siempre abajo y todos del mismo tamaño */
.actgrid .card { display: flex; flex-direction: column; }
.actgrid .card select { width: 100%; margin: 0 0 12px; }
.actgrid .copyrow { margin-top: auto; flex-wrap: wrap; }
.actgrid .copyrow .btn { flex: 0 0 200px; width: 200px; justify-content: center; padding-left: 0; padding-right: 0; }
@media (max-width: 820px) { .actgrid .copyrow .btn { flex: 1 1 100%; width: 100%; } }
.card.vlocked select:disabled { color: #d9898c; border-color: rgba(229,72,77,.3); opacity: 1; }
.card.vlocked .btn:disabled { color: #d9898c; border-color: rgba(229,72,77,.3); background: rgba(229,72,77,.075); background-image: none; box-shadow: none; opacity: 1; cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: rgba(255,255,255,.07); border: 1px solid var(--glass-line); color: #d6d6dc; }
.chip.of { background: rgba(59,130,246,.16); border-color: rgba(59,130,246,.35); color: #b8d3ff; font-weight: 600; }
.chip.loc { background: rgba(245,165,36,.14); border-color: rgba(245,165,36,.35); color: #ffc873; }
.chip.rid { color: var(--muted); }
.chips:empty { display: none; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); min-width: 0; }
.kpi svg { width: 20px; height: 20px; flex: none; }
.kpi b { display: block; font-size: 12.5px; font-weight: 600; }
.kpi small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi > div { min-width: 0; }
.kpi.ok { background: rgba(48,164,108,.10); border-color: rgba(48,164,108,.28); } .kpi.ok svg { color: #5fd39b; }
.kpi.good { background: rgba(168,85,247,.10); border-color: rgba(168,85,247,.28); } .kpi.good svg { color: #c58bff; }
.kpi.bad { background: rgba(229,72,77,.10); border-color: rgba(229,72,77,.30); } .kpi.bad svg { color: #ff8a8e; }
.kpi.na svg { color: var(--muted); }
.pending-note { color: var(--amber); background: rgba(245,165,36,.08); border: 1px dashed rgba(245,165,36,.35); border-radius: 10px; padding: 10px 12px; font-size: 13px; }

/* Cabecera de la ficha */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border-radius: 16px; margin-bottom: 18px; }
.hero-main { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1 1 380px; }
.hero-text { min-width: 0; flex: 1; }
.hero-text h1 { font-size: 24px; line-height: 1.15; margin: 1px 0 8px; word-break: break-word; }
.hero .actions { flex: none; }

/* Pestañas como cápsulas */
.tabs { gap: 6px; border-bottom: 0; padding-bottom: 2px; }
.tabs button { border: 1px solid transparent; border-radius: 999px; padding: 8px 15px; }
.tabs button.active { background: rgba(255,255,255,.09); border-color: var(--glass-line); color: var(--text); }
.kv { grid-template-columns: 130px 1fr; }

/* Acceso */
.login-card { border-radius: 20px; padding: 36px 30px; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 30px 80px rgba(0,0,0,.55), 0 0 80px rgba(229,72,77,.10); }
.login-body { background: transparent; }

@media (max-width: 820px) {
  .sidebar { background: rgba(22,22,27,.82); }
  .topbar { background: rgba(18,18,23,.8); }
  .hero { padding: 14px; gap: 12px; }
  .hero-main { flex-basis: 100%; gap: 12px; }
  .hero-text h1 { font-size: 20px; }
  .ring.big { width: 52px; height: 52px; }
  .hero .actions { width: 100%; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .toolbar select { flex: 1 1 100%; width: 100%; }
  .stat-n { font-size: 26px; }
  .kv { grid-template-columns: 1fr; }
}

/* Actividad: lista desplegable, sin scroll horizontal */
#actHost { overflow: visible; padding: 6px 14px; }
.act { border-bottom: 1px solid rgba(255,255,255,.07); }
.act:last-child { border-bottom: 0; }
.act summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto auto 1fr; gap: 4px 12px; align-items: baseline; padding: 11px 22px 11px 0; position: relative; }
.act summary::-webkit-details-marker { display: none; }
.act summary::after { content: "›"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%) rotate(90deg); color: var(--muted); font-size: 18px; transition: transform .15s; }
.act[open] summary::after { transform: translateY(-50%) rotate(-90deg); }
.act-date { color: var(--muted); font-size: 13px; white-space: nowrap; }
.act-action { color: var(--muted); font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.act-body { padding: 0 0 12px; font-size: 13.5px; overflow-wrap: anywhere; display: grid; gap: 4px; }
@media (max-width: 820px) {
  .act summary { grid-template-columns: 1fr auto; }
  .act-date { grid-column: 1; grid-row: 1; }
  .act-user { grid-column: 2; grid-row: 1; }
  .act-action { grid-column: 1 / -1; grid-row: 2; }
}

/* Las tarjetas de Usuarios, Actividad y Ajustes llegan hasta abajo */
.main:has(#usersHost, #actHost, #setHost) { display: flex; flex-direction: column; min-height: calc(100vh - 0px); }
#usersHost, #actHost, #setHost { flex: 1 1 auto; align-self: stretch; }
@media (max-width: 820px) {
  .main:has(#usersHost, #actHost, #setHost) { min-height: calc(100vh - 56px); }
  #usersHost, #actHost, #setHost { margin-bottom: 0; }
}
#usersHost { overflow: visible; padding: 6px 14px; }
.act-body .actions { display: flex; gap: 8px; margin-top: 4px; }
@media (max-width: 820px) { .table-wrap { overflow-x: hidden; } .table th, .table td { padding-left: 8px; padding-right: 8px; } }
#usersHost { overflow: visible; padding: 6px 14px; }
.act-body .actions { display: flex; gap: 8px; margin-top: 4px; }
@media (max-width: 820px) { .table-wrap { overflow-x: hidden; } .table th, .table td { padding-left: 8px; padding-right: 8px; } }

/* Tabla en pantallas anchas, desplegables solo cuando no cabe */
.only-narrow { display: none; }
@media (max-width: 820px) { .only-wide { display: none; } .only-narrow { display: block; } }
@media (min-width: 821px) { #usersHost, #actHost { padding: 0; overflow-x: auto; } }

/* Resumen de equipos: tira discreta, sin colorines grandes */
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.stat { display: inline-flex; flex-direction: row-reverse; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.04); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.stat::after { display: none; }
.stat:hover { transform: none; background: rgba(255,255,255,.08); }
.stat.sel { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.28); box-shadow: none; }
.stat-n { font-size: 13px; font-weight: 600; color: var(--text); text-shadow: none; line-height: 1; }
.stat-l { font-size: 13px; line-height: 1; }
.stat-l .dot { width: 6px; height: 6px; }
@media (max-width: 820px) {
  .stats { display: flex; grid-template-columns: none; gap: 6px; }
  .stat { padding: 6px 10px; } .stat-n, .stat-l { font-size: 12.5px; }
}
.toolbar select { flex: 1 1 150px; max-width: 220px; }
@media (max-width: 820px) { .toolbar select { flex: 1 1 calc(50% - 5px); max-width: none; width: auto; } }
select { color-scheme: dark; }
select option { background: #1b1b22; color: #e8e8ee; }
.chip { max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device .name, .d-customer { overflow-wrap: anywhere; }
/* Tarjeta: una sola línea; la ubicación se estira y, si no cabe, termina en puntos suspensivos */
.device .chips { flex-wrap: nowrap; }
.device .chip { flex: 0 0 auto; }
.device .chip.loc { flex: 1 1 0; min-width: 40px; }
.device .chip.loc { justify-content: center; text-align: center; }
/* Las tres píldoras con el mismo color que la de la OF */
.chip.loc, .chip.rid { background: rgba(59,130,246,.16); border-color: rgba(59,130,246,.35); color: #b8d3ff; }
.chip.rid { font-weight: 600; }
/* Móvil: la tarjeta llega justo hasta la barra inferior */
@media (max-width: 820px) {
  .main:has(#usersHost, #actHost, #setHost) { box-sizing: border-box; min-height: 100vh; min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* ===== Sobrio: todo neutro; el color solo indica estado, con un punto pequeño ===== */
.chip, .chip.of, .chip.loc, .chip.rid { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.10); color: #c9c9d1; font: inherit; font-size: 12.5px; font-weight: 500; height: 26px; box-sizing: border-box; padding: 0 11px; align-items: center; letter-spacing: 0; }
.chip.of { color: var(--text); }
.chip.rid { font-family: inherit; color: var(--muted); font-variant-numeric: tabular-nums; }

.stat { height: 30px; box-sizing: border-box; padding: 0 12px; background: transparent; border-color: rgba(255,255,255,.10); }
.stat-n, .stat-l { font-size: 12.5px; font-weight: 500; }
.stat-n { color: var(--muted); }
.stat-l { color: var(--text); }
.stat.sel { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.28); }
.stat-l .dot { background: #6b7079 !important; box-shadow: none; }
.stat[data-filter="online"] .dot { background: var(--green) !important; }
.stat[data-filter="offline"] .dot { background: var(--red) !important; }
.stat[data-filter="alarm"] .dot { background: var(--amber) !important; }

/* Indicadores de la tarjeta: fondo neutro y un punto de estado */
.kpi, .kpi.ok, .kpi.good, .kpi.bad, .kpi.na { background: rgba(255,255,255,.035); border-color: rgba(255,255,255,.07); position: relative; }
.kpi svg, .kpi.ok svg, .kpi.good svg, .kpi.bad svg, .kpi.na svg { color: var(--muted); }
.kpi::after { content: ""; position: absolute; right: 9px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: #6b7079; }
.kpi.ok::after, .kpi.good::after { background: var(--green); }
.kpi.bad::after { background: var(--red); }
.device.alarm { box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 0 0 1px rgba(229,72,77,.35), 0 10px 30px rgba(0,0,0,.28); }
.device[data-state="online"] { box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 10px 30px rgba(0,0,0,.28); }
/* Fondo sin manchas de colores */
body::before { opacity: .22; } body::after { opacity: .18; }

/* ===== Simetría: elementos hermanos del mismo ancho y alto ===== */
/* Filtros de estado: llenan la fila a partes iguales */
.stats { gap: 8px; }
.stat { flex: 1 1 0; justify-content: center; min-width: max-content; }
/* Buscador en su propia fila y los dos desplegables a partes iguales debajo */
.toolbar { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.toolbar input { grid-column: 1 / -1; flex: none; }
.toolbar select { width: 100%; max-width: none; flex: none; margin: 0; }
.toolbar #devClear { height: 100%; min-width: 40px; justify-content: center; }
.toolbar #devClear[hidden] { display: none; }
.toolbar:not(:has(#devClear:not([hidden]))) { grid-template-columns: 1fr 1fr; }
/* Píldoras de la tarjeta: tres iguales, texto centrado */
.device .chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.device .chips:has(.chip:nth-child(2):last-child) { grid-template-columns: repeat(2, 1fr); }
.device .chips:has(.chip:only-child) { grid-template-columns: 1fr; }
.device .chip, .device .chip.loc { flex: none; min-width: 0; justify-content: center; text-align: center; }
@media (max-width: 820px) {
  .toolbar select { flex: none; width: 100%; }
  .stat { min-width: 0; padding: 0 8px; }
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); }
  .stats .stat:nth-child(n+4) { grid-column: span 1; }
}
@media (max-width: 820px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:first-child { grid-column: 1 / -1; }
}

/* Barra inferior (móvil): el botón activo se marca con una línea bajo el icono, simétrica, sin degradado lateral */
@media (max-width: 820px) {
  .nav a.active { background: rgba(255,255,255,.06); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 10px; }
}

/* Dentro de cada píldora de estado: punto + nombre a la izquierda, número a la derecha, siempre alineados */
.stat { flex-direction: row; justify-content: space-between; gap: 12px; padding: 0 14px; }
.stat-l { order: 1; display: inline-flex; align-items: center; gap: 8px; }
.stat-n { order: 2; min-width: 1.5ch; text-align: right; font-variant-numeric: tabular-nums; }

/* Móvil: «Equipos» muestra el total y despliega los filtros */
@media (max-width: 820px) {
  .stats:not(.open) .stat:not(:first-child) { display: none; }
  .toolbar:not(.open) select, .toolbar:not(.open) #devClear { display: none; }
  .stats .stat:first-child::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translateY(-2px); order: 3; transition: transform .15s; }
  .stats.open .stat:first-child::after { transform: rotate(-135deg); }
  .stats .stat:first-child .stat-n { order: 2; margin-left: auto; }
  .toolbar:not(.open) { grid-template-columns: 1fr; }
}

/* Móvil (versión final): una tarjeta «Equipos  N  ⌄»; al abrir, las píldoras salen dentro de la misma tarjeta */
@media (max-width: 820px) {
  .stats { background: var(--glass), rgba(30,30,38,.55); border: 1px solid var(--glass-line); border-radius: 14px; padding: 6px; gap: 8px; }
  .stats .stat:first-child { height: 38px; border: 0; background: transparent; justify-content: flex-start; gap: 12px; padding: 0 8px; }
  .stats .stat:first-child.sel { background: transparent; }
  .stats .stat:first-child .stat-l { font-size: 14px; font-weight: 600; }
  .stats .stat:first-child .stat-n { margin-left: 0; font-size: 14px; text-align: left; }
  .stats .stat:first-child::after { margin-left: auto; margin-right: 4px; }
  .stats.open .stat:first-child { border-bottom: 0; }
}
@media (max-width: 820px) {
  .stats .stat:first-child::after { display: block; position: static; right: auto; top: auto; background: none; opacity: 1; border-radius: 0; flex: none; width: 8px; height: 8px; margin: 0 6px 3px auto; }
  .stats.open .stat:first-child::after { margin-bottom: 0; margin-top: 4px; }
  .stats { padding: 2px 6px; gap: 6px; }
  .stats.open { padding-bottom: 8px; }
  .stats .stat:first-child { height: 36px; min-height: 0; }
}
@media (max-width: 820px) {
  .stats .stat:first-child::after { transform: rotate(45deg); margin: 0 8px 4px auto; }
  .stats.open .stat:first-child::after { transform: rotate(225deg); margin: 4px 8px 0 auto; }
}
.toolbar input, .toolbar select { font-size: 14px; height: 40px; box-sizing: border-box; }
select option:disabled { color: #6b7079; }
select[disabled] { opacity: .6; cursor: not-allowed; }

/* Usuarios, Actividad y Ajustes: la tarjeta llega hasta la barra inferior y el scroll va dentro de ella */
.main:has(#usersHost, #actHost, #setHost) { height: 100vh; height: 100dvh; box-sizing: border-box; overflow: hidden; }
#usersHost, #actHost, #setHost { flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; }
@media (max-width: 820px) { .main:has(#usersHost, #actHost, #setHost) { min-height: 0; } }

/* Ficha del equipo en móvil: botones y pestañas en cuadrícula de columnas iguales, sin scroll lateral */
@media (max-width: 820px) {
  .hero .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero .actions .btn { width: 100%; justify-content: center; text-align: center; margin: 0; }
  .hero .actions > :nth-child(odd):last-child { grid-column: 1 / -1; }
  .tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; overflow: visible; }
  .tabs button { width: 100%; padding: 9px 4px; text-align: center; white-space: normal; line-height: 1.2; min-height: 40px; display: flex; align-items: center; justify-content: center; }
}
@media (max-width: 820px) { .tabs button { font-size: 12.5px; background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); } .tabs button.active { background: rgba(255,255,255,.12); } }

/* Las cuadrículas de tarjetas (.grid.stats) no son la tira de filtros: columnas iguales y sin la caja de la tira */
.grid.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
@media (max-width: 820px) { .grid.stats { grid-template-columns: 1fr; gap: 10px; padding: 0; } .grid.stats.fit2 { grid-template-columns: 1fr 1fr; } }
/* Resumen del equipo: 10 tarjetas = 5 columnas × 2 filas (o 2 columnas en pantallas medias) */
@media (min-width: 821px) { .grid.stats.sum { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1180px) { .grid.stats.sum { grid-template-columns: repeat(5, 1fr); } }
.backlink { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; margin: 0 2px 10px; text-decoration: none; }
.backlink:hover { color: var(--text); }
@media (max-width: 820px) { .hero .actions { grid-template-columns: repeat(3, 1fr); } .hero .actions > :nth-child(odd):last-child { grid-column: auto; } .hero .actions:empty { display: none; } }
@media (max-width: 820px) {
  .hero .actions { grid-template-columns: 1fr 1fr; }
  .hero .actions > .btn-danger { grid-column: 1 / -1; height: 44px; }
}
@media (max-width: 820px) {
  .hero .actions { grid-template-columns: repeat(3, 1fr); }
  .hero .actions > .btn-danger { grid-column: auto; height: auto; }
}

/* Interruptor «Equipo habilitado» y pestañas no disponibles */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; height: 38px; box-sizing: border-box; border: 1px solid rgba(255,255,255,.10); border-radius: 10px; background: rgba(255,255,255,.04); font-size: 13.5px; cursor: pointer; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #3a3d45; transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #d8d8de; transition: transform .15s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(16px); background: #fff; }
.switch input:disabled { cursor: not-allowed; }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabs button:disabled { opacity: .35; cursor: not-allowed; }
@media (max-width: 820px) { .hero .actions .switch-row { grid-column: 1 / -1; } }

/* Ficha: ID y estado en la misma fila, a partes iguales */
.hero-text .chips { margin-bottom: 6px; }
.hero-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 340px; }
.hero-row .chip, .hero-row .pill { height: 26px; box-sizing: border-box; justify-content: center; text-align: center; margin: 0; width: 100%; }
.hero-row .pill { display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; font-size: 12.5px; line-height: 1; }
.hero-text h1 { margin-bottom: 6px; }
@media (min-width: 821px) { .grid.stats.tri { grid-template-columns: repeat(3, 1fr); } }

/* Datos del equipo: campos de solo lectura como los del formulario de editar */
.fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { color: var(--muted); font-size: 13px; }
.field .box { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 9px 12px; box-sizing: border-box; border: 1px solid var(--glass-line); border-radius: 8px; background: rgba(10,10,14,.55); font-size: 14px; overflow-wrap: anywhere; }
.field .box small { color: var(--muted); font-size: 12.5px; }
@media (max-width: 1100px) { .fields { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .fields { grid-template-columns: 1fr; } }

/* Pestañas de la ficha: cuadradas, como los botones (Editar, Desvincular…) */
.tabs button { border-radius: 10px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.04); }
.tabs button.active { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.28); }

/* ===== Píldoras de OF / ubicación / ID / estado: un único estilo =====
   Mismo alto, letra, color y forma; siempre cuatro, repartidas a partes iguales. */
.meta { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
.meta > .chip, .meta > .pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-width: 0;
  height: 28px; padding: 0 10px; box-sizing: border-box; margin: 0;
  border-radius: 8px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.05); color: #d0d0d8;
  font: inherit; font-size: 12.5px; font-weight: 500; line-height: 1; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.meta > .chip.empty { color: var(--muted); opacity: .75; }
.meta > .pill .dot { flex: none; }
.hero-text .meta { max-width: 600px; }
@media (min-width: 821px) { .hero-text .meta { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Ficha: interruptor y botones con la misma altura; pestañas del mismo ancho */
.hero .actions { align-items: stretch; }
.hero .actions .btn, .hero .actions .switch-row { height: 38px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; padding-top: 0; padding-bottom: 0; margin: 0; }
.hero .actions .switch-row { justify-content: space-between; }
@media (min-width: 821px) {
  .hero .actions { display: flex; gap: 8px; flex-wrap: nowrap; }
  .hero .actions .btn { min-width: 112px; }
  .tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; max-width: 900px; }
  .tabs button { width: 100%; height: 38px; padding: 0 8px; white-space: nowrap; }
}
@media (min-width: 821px) {
  .hero-main { flex: 1 1 auto; }
  .hero-text .meta { max-width: 640px; }
}
@media (min-width: 821px) {
  .toolbar, .toolbar:not(:has(#devClear:not([hidden]))) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toolbar:has(#devClear:not([hidden])) { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
  .toolbar input { grid-column: auto; }
}

/* Ficha en PC: píldoras y botones en la misma línea y con la misma altura */
@media (min-width: 821px) {
  .hero { align-items: flex-end; }
  .hero-text .meta > .chip, .hero-text .meta > .pill { height: 38px; font-size: 13px; }
  .hero .actions { align-self: flex-end; }
}

/* ===== Cabecera de la ficha, versión final: arriba identidad + acciones; debajo, la información en una banda ===== */
.hero { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "main actions" "meta meta"; align-items: center; gap: 16px 20px; flex-wrap: unset; }
.hero-main { grid-area: main; min-width: 0; }
.hero .actions { grid-area: actions; align-self: center; display: flex; gap: 8px; width: auto; }
.hero > .meta { grid-area: meta; margin: 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); max-width: none; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hero > .meta > .chip, .hero > .meta > .pill { height: 38px; font-size: 13px; }
.hero-text h1 { margin-bottom: 0; }
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; grid-template-areas: "main" "meta" "actions"; gap: 12px; }
  .hero > .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 12px; }
  .hero > .meta > .chip, .hero > .meta > .pill { height: 32px; }
  .hero .actions { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .hero .actions .switch-row { grid-column: 1 / -1; }
}

/* ===== Cabecera de la ficha (definitiva): identidad e información arriba, acciones abajo, en la misma cuadrícula de 4 columnas ===== */
.hero { grid-template-columns: 1fr; grid-template-areas: "main" "meta" "actions"; gap: 14px; }
.hero > .meta { padding-top: 0; border-top: 0; }
.hero .actions { grid-area: actions; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; width: 100%; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); align-self: stretch; }
.hero .actions .btn, .hero .actions .switch-row { width: 100%; min-width: 0; height: 38px; }
@media (max-width: 820px) {
  .hero .actions { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 12px; }
  .hero .actions .switch-row { grid-column: 1 / -1; }
}

/* Marca más grande (menú lateral y barra superior del móvil) */
.brand { gap: 12px; }
.brand img { width: 42px; height: 42px; }
.brand b { font-size: 17px; }
.brand small { font-size: 12.5px; letter-spacing: .02em; white-space: nowrap; }
@media (max-width: 820px) {
  .topbar .brand img { width: 38px; height: 38px; }
  .topbar .brand b { font-size: 16px; }
  .topbar .brand small { font-size: 12px; }
  .topbar .brand { min-width: 0; }
}

/* Contraseña con ver / generar / copiar */
.pwrow { display: flex; gap: 8px; align-items: stretch; margin-top: 6px; }
.pwrow input { flex: 1 1 auto; min-width: 0; margin-top: 0; }
.pw-btn { flex: none; height: 40px; padding: 0 12px; font-size: 13px; }
@media (max-width: 520px) { .pwrow { flex-wrap: wrap; } .pwrow input { flex: 1 1 100%; } .pw-btn { flex: 1 1 0; } }
.pw-btn { width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pw-btn svg { width: 19px; height: 19px; }
@media (max-width: 520px) { .pwrow { flex-wrap: nowrap; } .pwrow input { flex: 1 1 auto; } .pw-btn { flex: none; } }

/* Pestañas del robot con el robot no disponible: se puede entrar, pero el contenido sale sombreado y sin interacción */
#lockNote:empty { display: none; }
#lockNote { margin-bottom: 14px; }
#tabBody.tab-locked { opacity: .38; filter: grayscale(.5); pointer-events: none; user-select: none; }
/* Bloqueado = sombreado y sin pulsar botones o campos, pero se puede hacer scroll y leer */
#tabBody.tab-locked { pointer-events: auto; user-select: text; }
#tabBody.tab-locked button, #tabBody.tab-locked input, #tabBody.tab-locked select, #tabBody.tab-locked textarea, #tabBody.tab-locked a { pointer-events: none; }

/* Acceso: ojo para ver la contraseña */
.pwfield { position: relative; display: block; margin-top: 6px; }
.pwfield input { margin-top: 0; padding-right: 44px; }
.pwfield .eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; }
.pwfield .eye:hover { color: var(--text); background: rgba(255,255,255,.06); }
.pwfield .eye svg { width: 19px; height: 19px; }
.pwfield .eye .i-hide, .pwfield .eye.on .i-show { display: none; }
.pwfield .eye.on .i-hide { display: block; }
#tabBody.tab-stale .grid { opacity: .45; filter: grayscale(.5); }

/* Móvil: la clave ocupa todo el ancho y los tres botones van debajo, iguales */
@media (max-width: 820px) {
  #setHost .copyrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  #setHost #keyRow { display: contents; }
  #setHost #keyField { grid-column: 1 / -1; width: 100%; }
  #setHost .pw-btn, #setHost #regenKey { width: 100%; height: 40px; margin: 0; padding: 0; justify-content: center; }
}
@media (max-width: 820px) { #setHost #keyField { font-size: 10.5px; letter-spacing: 0; padding-left: 10px; padding-right: 10px; } }
.brand { color: inherit; text-decoration: none; cursor: pointer; }

/* Clientes en Ajustes */
.sep { height: 1px; background: rgba(255,255,255,.08); margin: 22px 0 16px; }
.custadd { display: flex; gap: 8px; margin: 8px 0 6px; }
.custadd input { flex: 1 1 auto; min-width: 0; margin: 0; height: 40px; box-sizing: border-box; }
.custadd .btn { height: 40px; flex: none; }
.custrow { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.custrow:last-child { border-bottom: 0; }
.custrow .cname { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custrow .ccount { flex: none; font-size: 13px; margin-right: 4px; }
#setHost .custrow .pw-btn { width: 40px; flex: none; }
@media (max-width: 820px) { #setHost .custrow .pw-btn { width: 40px; } }

/* Ajustes: lo de arriba (clave, alta de cliente) queda fijo y solo la lista de clientes hace scroll */
#setHost { display: flex; flex-direction: column; overflow: hidden; }
#setHost > * { flex: none; }
#setHost #custList { flex: 1 1 0; min-height: 140px; overflow-y: auto; overflow-x: hidden; }
@media (max-height: 560px) { #setHost { overflow-y: auto; } #setHost #custList { flex: none; overflow: visible; } }

/* Root: el único con un aspecto propio (dorado discreto) */
:root { --gold: #ff6b70; }
.role-root { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-weight: 600; }
.role-root svg { width: 14px; height: 14px; flex: none; }
tr.root-row { background: linear-gradient(90deg, rgba(229,72,77,.12), rgba(229,72,77,.02)); }
tr.root-row td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
tr.root-row td:first-child b { color: var(--gold); }
.act.root-row { background: linear-gradient(90deg, rgba(229,72,77,.10), rgba(229,72,77,.02)); box-shadow: inset 3px 0 0 var(--gold); border-radius: 8px; padding-left: 10px; margin: 2px 0; }
.act.root-row .act-date { color: var(--gold) !important; }
.act.root-row .act-user { color: var(--gold); }

/* Root: mismo estilo que el botón activo del menú (redondeado, degradado y franja a la izquierda), en rojo */
tr.root-row { background: linear-gradient(90deg, rgba(229,72,77,.22), rgba(229,72,77,.04)); clip-path: inset(0 round 10px); }
.act.root-row { background: linear-gradient(90deg, rgba(229,72,77,.22), rgba(229,72,77,.04)); border-radius: 10px; }
@media (min-width: 821px) { #usersHost { padding: 8px; } }
/* Móvil: la fila del Root se ensancha hacia fuera para que su texto quede alineado con el de los demás */
.act.root-row { padding-left: 10px; padding-right: 10px; margin-left: -10px; margin-right: -10px; }
/* Ajustes: si no cabe todo, scroll del conjunto como último recurso (la lista de clientes mantiene su alto mínimo) */
#setHost { overflow-y: auto; }
@media (max-width: 820px) { #setHost #appPwSave { width: 100%; height: 40px; padding: 0; } }
@media (max-width: 820px) {
  #setHost #appPwRow { display: contents; }
  #setHost #appPwField { grid-column: 1 / -1; width: 100%; }
  #setHost #appPwSave { margin: 0; justify-content: center; }
}
/* Ajustes más compacto para que la lista de clientes tenga sitio y sea lo único que hace scroll */
.sep { margin: 14px 0 10px; }
#setHost h3 { margin-bottom: 6px; }
#setHost p.muted { margin-top: 0; margin-bottom: 8px; }
#setHost #custList { min-height: 84px; }
#setHost .custadd { margin: 4px 0 4px; }

/* Ajustes en PC: los tres botones de la derecha (Regenerar, Guardar, Añadir) del mismo ancho y los iconos de cada fila en las mismas columnas */
@media (min-width: 821px) {
  #setHost #regenKey, #setHost #appPwSave, #setHost #swDown, #setHost #dbDown, #setHost .custadd .btn { width: 120px; flex: none; padding: 0; justify-content: center; text-align: center; }
}
@media (min-width: 821px) { #setHost #regenKey, #setHost #appPwSave, #setHost #swDown, #setHost #dbDown, #setHost .custadd .btn { height: 40px; } }

/* Tablas con scroll (Actividad, Usuarios): la fila de títulos se queda fija arriba */
#actHost thead th, #usersHost thead th { position: sticky; top: 0; z-index: 2; background: #26262d; box-shadow: 0 1px 0 rgba(255,255,255,.08); }

/* Actividad: filtros y «Cargar más» */
.acttools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.acttools select { margin: 0; width: 100%; height: 40px; box-sizing: border-box; font-size: 14px; }
.loadmore { display: flex; justify-content: center; padding: 14px 0 6px; }
.loadmore .btn { min-width: 200px; height: 40px; justify-content: center; }
.main:has(#actHost) { display: flex; flex-direction: column; }
.main:has(#actHost) .acttools { flex: none; }

/* Backups guardados en el equipo: carpeta, tamaño y descargar, en columnas alineadas */
.backup-list { display: grid; }
.backup-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 120px minmax(0, 190px); align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.backup-row:last-child { border-bottom: 0; }
.backup-row .bname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backup-row .bsize { text-align: right; font-variant-numeric: tabular-nums; }
.backup-row .bdl { width: 100%; height: 36px; justify-content: center; }
.backup-row .bstat { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-locked { opacity: .45; filter: grayscale(.5); }
.card-locked button { pointer-events: none; }
@media (max-width: 820px) {
  .backup-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n s" "d d" "t t"; gap: 6px 10px; }
  .backup-row .bname { grid-area: n; } .backup-row .bsize { grid-area: s; } .backup-row .bdl { grid-area: d; } .backup-row .bstat { grid-area: t; }
  .backup-row .bstat:empty { display: none; }
}
/* Backups: el botón Descargar siempre pegado a la derecha; la columna del estado queda entre el tamaño y el botón */
.backup-row { grid-template-columns: minmax(0, 1fr) 80px minmax(0, 200px) 120px; }
.backup-row .bstat { text-align: right; }
#bBackupsRefresh { flex: none; }
@media (max-width: 820px) {
  .backup-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n s" "t t" "d d"; }
}

/* Tarjetas de equipo que se abren y se cierran. Cerrada: icono, cliente, nombre, OF y estado. Abierta: todo. */
.device .d-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) 32px; gap: 12px; align-items: center; }
.device .d-chev { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid rgba(255,255,255,.10); border-radius: 8px; background: rgba(255,255,255,.04); color: var(--muted); cursor: pointer; }
.device .d-chev:hover { color: var(--text); background: rgba(255,255,255,.08); }
.device .d-chev svg { width: 18px; height: 18px; transition: transform .15s; }
.device.open .d-chev svg { transform: rotate(180deg); }
.device .meta { margin-top: 0; }
.device .d-more { display: none; flex-direction: column; gap: 12px; }
.device.open .d-more { display: flex; }

/* Tabla de articulaciones: en pantallas estrechas, títulos cortos y menos relleno para que quepan las cinco columnas */
.table th .sh { display: none; }
@media (max-width: 520px) {
  .table th .lg { display: none; }
  .table th .sh { display: inline; }
  #robotLive .table { table-layout: fixed; width: 100%; }
  #robotLive .table th, #robotLive .table td { padding: 9px 4px; font-size: 13px; white-space: nowrap; }
  #robotLive .table th:first-child, #robotLive .table td:first-child { width: 22%; padding-left: 8px; }
  #robotLive .table th:last-child, #robotLive .table td:last-child { padding-right: 8px; }
}

/* Pestañas de la ficha con icono; el de la pestaña activa, en azul */
.tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.tabs button svg { width: 17px; height: 17px; flex: none; color: var(--muted); }
.tabs button.active svg { color: var(--accent); }
@media (max-width: 520px) {
  .tabs button { flex-direction: column; gap: 3px; padding: 7px 2px; min-height: 52px; font-size: 12px; }
  .tabs button svg { width: 18px; height: 18px; }
}

/* Iconos de los botones con texto */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn svg.bi { width: 16px; height: 16px; flex: none; }
.btn-sm svg.bi { width: 15px; height: 15px; }

/* Iconos de los botones con texto */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn svg.bi { width: 16px; height: 16px; flex: none; }
.btn-sm svg.bi { width: 15px; height: 15px; }

/* «Cargando datos…» */
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 40px 16px; color: var(--muted); font-size: 14px; }
.loading.small { justify-content: flex-start; padding: 10px 0; font-size: 13.5px; }
.loading .spin { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid rgba(255,255,255,.14); border-top-color: var(--accent); animation: po2spin .8s linear infinite; }
.loading.small .spin { width: 16px; height: 16px; }
@keyframes po2spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading .spin { animation-duration: 2.4s; } }

/* Ajustes: pestañas de carpeta (la activa es más alta y se une a la tarjeta) */
.tabs2 { display: flex; gap: 4px; align-items: flex-end; overflow: visible; margin: 0 0 -1px; padding: 0 12px; border: 0; position: relative; z-index: 1; }
.tabs2 button { flex: 1 1 0; width: auto; min-height: 0; height: 36px; padding: 0 10px; border-radius: 10px 10px 0 0; border: 1px solid var(--glass-line); border-bottom-color: transparent; background: rgba(255,255,255,.03); color: var(--muted); font-size: 13.5px; }
.tabs2 button.active { height: 44px; background: #23242c; border-color: var(--glass-line); border-bottom-color: #23242c; color: var(--text); font-weight: 600; }
.tabs2 + .card { border-top-left-radius: 14px; border-top-right-radius: 14px; }
@media (max-width: 820px) { .tabs2 button, .tabs2 button.active { font-size: 13.5px; } .tabs2 { margin-left: 0; margin-right: 0; padding: 0 12px; } }
/* Fila de la descarga: texto a la izquierda y el botón a la derecha, del mismo tamaño que Regenerar / Guardar */
.swrow .swtxt { flex: 1 1 auto; }
@media (max-width: 820px) { #setHost .swrow .swtxt { grid-column: 1 / 3; } #setHost .swrow .btn { grid-column: 3; width: 100%; height: 40px; padding: 0; justify-content: center; } }
/* Separadores entre los bloques de Ajustes: más visibles y con el mismo aire arriba y abajo */
#setHost .sep { height: 1px; background: rgba(255,255,255,.16); margin: 18px 0; }

/* Mensaje al operario */
#msgText { width: 100%; box-sizing: border-box; resize: vertical; min-height: 78px; }
.msg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.msg-icons { display: flex; gap: 6px; }
.msg-ic { width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.msg-ic svg { width: 19px; height: 19px; }
.msg-ic.on { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.4); }
.msg-row #bMsgSend { width: 120px; height: 40px; padding: 0; justify-content: center; }
.msg-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 12.5px; min-height: 16px; }
@media (max-width: 820px) {
  .msg-row { flex-direction: column; align-items: stretch; }
  .msg-icons { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .msg-ic { width: 100%; }
  .msg-row #bMsgSend { width: 100%; }
}
/* Backups: desplegable como los demás (flecha a la derecha del todo) y botón de actualizar dentro */
.bkcard .act summary { display: block; padding: 2px 22px 2px 0; }
.bkcard #backupsTitle { font-size: 12.5px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
/* Iconos del mensaje: mismos colores que en la ventana de Power Off 2 */
.msg-ic[data-ic="info"] { color: #4C9AFF; }
.msg-ic[data-ic="warning"] { color: #F5A623; }
.msg-ic[data-ic="alarm"] { color: #E5484D; }
.msg-ic[data-ic="help"] { color: #4C9AFF; }
.msg-ic[data-ic="ok"] { color: #3FB950; }
.bkcard .act summary { outline: 0; }
.bkcard .act summary:focus-visible #backupsTitle { color: var(--text); }
.bkcard #backupsHost { margin-top: 6px; }

/* Pestaña BBDD: herramientas, tabla sin scroll horizontal (celdas con puntos suspensivos) y paginación */
.dbtools { display: flex; gap: 8px; margin-bottom: 10px; }
.dbtools select { flex: 1 1 0; min-width: 0; height: 40px; }
.dbtools input { flex: 1 1 0; min-width: 0; height: 40px; margin: 0; }
.dbtable { table-layout: fixed; width: 100%; }
.dbtable th, .dbtable td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbtable td.num { text-align: right; font-variant-numeric: tabular-nums; }
.dbpager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 13px; }
.dbbtns { display: flex; gap: 8px; }
.dbbtns .btn { width: 110px; height: 36px; padding: 0; justify-content: center; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.kv span:last-child { text-align: right; overflow-wrap: anywhere; }
@media (max-width: 820px) { .dbtools { flex-direction: column; } .dbbtns .btn { width: 96px; } .tabs:not(.tabs2) button:last-child:nth-child(3n+1) { grid-column: 1 / -1; } }
.dbtable th.num { text-align: right; }

/* Pestañas de la ficha en PC: una sola fila, todas del mismo ancho y ocupando todo el ancho */
@media (min-width: 821px) {
  .tabs:not(.tabs2) { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; overflow: visible; }
  .tabs:not(.tabs2) button { width: 100%; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 7px; padding-left: 6px; padding-right: 6px; }
  .tabs:not(.tabs2) button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (min-width: 821px) { .tabs:not(.tabs2) { max-width: none; } }
.dbtable th.num, .dbtable td.num { padding-right: 22px; }
.dbtools { align-items: stretch; }
.dbtools select, .dbtools input { margin: 0; height: 40px; box-sizing: border-box; align-self: stretch; }

/* Filas de la BBDD en móvil: una sola línea (id · dato principal · tercer dato) con puntos suspensivos, sin marco blanco al pulsar */
.act summary { outline: 0; }
.act summary:focus-visible { background: rgba(255,255,255,.05); border-radius: 8px; }
.dbrow summary { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.dbrow summary > span, .dbrow summary > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbrow .act-date { flex: none; max-width: 28%; }
.dbrow .act-user { flex: 1 1 auto; text-align: left; }
.dbrow .act-action { flex: 0 1 34%; text-align: right; }
.dbtools select { line-height: 1.2; padding-top: 0; padding-bottom: 0; }.dbrow .act-date { min-width: 2.6em; }
@media (max-width: 820px) { .dbtools select, .dbtools input { flex: none; width: 100%; height: 44px; } }

/* Desplegables (select) de toda la web: flecha propia con margen a la derecha (antes quedaba pegada al borde) */
select:not([multiple]) {
  appearance: none; -webkit-appearance: none; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9aa6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; padding-right: 42px;
}
select:not([multiple]):hover { background-color: rgba(18,18,24,.7); }
/* =====================================================================
   CRISTAL v2: pestañas de carpeta en la ficha (PC) y efectos acristalados más modernos en toda la web
   ===================================================================== */
@media (min-width: 821px) {
  /* El contenido de cada pestaña vive dentro de un panel de cristal casi transparente, unido a la pestaña activa */
  .tabpanel { position: relative; padding: 20px; border: 1px solid rgba(255,255,255,.13); border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.02)), rgba(28,29,38,.30);
    backdrop-filter: blur(26px) saturate(170%); -webkit-backdrop-filter: blur(26px) saturate(170%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 24px 60px rgba(0,0,0,.32); }
  #dTabs { align-items: end; gap: 4px; margin: 0 0 -1px; padding: 0 16px; position: relative; z-index: 2; border: 0; }
  #dTabs button { height: 40px; border-radius: 13px 13px 0 0; border: 1px solid rgba(255,255,255,.10); border-bottom-color: transparent;
    background: rgba(255,255,255,.03); color: var(--muted); font-size: 14px;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: background .18s, color .18s, height .18s; }
  #dTabs button:hover:not(.active) { background: rgba(255,255,255,.07); color: var(--text); }
  #dTabs button.active { height: 50px; font-weight: 600; color: var(--text); border-color: rgba(255,255,255,.17); border-bottom-color: transparent;
    background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05)), rgba(34,35,46,.55); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
  /* Las tarjetas de dentro, todavía más ligeras que el panel */
  .tabpanel .card, .tabpanel .stat { background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)), rgba(24,25,33,.28); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 6px 18px rgba(0,0,0,.18); }
  #lockNote:empty { display: none; }
}

/* Efectos generales: vidrio con reflejo, ventanas y avisos más suaves */
.modal-back { background: rgba(8,8,12,.5) !important; backdrop-filter: blur(8px) saturate(120%); -webkit-backdrop-filter: blur(8px) saturate(120%); }
.modal { box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 30px 80px rgba(0,0,0,.55); }
#toasts > *, .toast { backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%); }
.btn { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .18s, border-color .18s, transform .18s, box-shadow .18s, color .18s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: none; }
.card, .glass, .stat { transition: border-color .2s, box-shadow .2s, transform .2s; }
.card:hover:not(.card-locked), .stat:hover { border-color: rgba(255,255,255,.2); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(59,130,246,.22), 0 0 24px rgba(59,130,246,.12); }
.table thead th { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.28); background-clip: content-box; border: 2px solid transparent; }
/* =====================================================================
   CRISTAL v3 (punto medio): tarjetas acristaladas, ni tan opacas como antes ni tan transparentes
   ===================================================================== */
body::before { opacity: .65; }
body::after { opacity: .62; }
.card, .glass, .stat, .cmdlist, .modal, .login-card {
  background:
    linear-gradient(135deg, rgba(255,255,255,.11) 0%, rgba(255,255,255,.04) 36%, rgba(255,255,255,.02) 64%, rgba(255,255,255,.06) 100%),
    rgba(27,28,37,.42);
  backdrop-filter: blur(24px) saturate(170%) brightness(1.05); -webkit-backdrop-filter: blur(24px) saturate(170%) brightness(1.05);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.17), inset 1px 0 0 rgba(255,255,255,.05), 0 12px 34px rgba(0,0,0,.29);
}
.terminal { background: rgba(9,10,14,.68); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); }
.tabpanel { background: linear-gradient(135deg, rgba(255,255,255,.075) 0%, rgba(255,255,255,.028) 42%, rgba(255,255,255,.012) 70%, rgba(255,255,255,.04) 100%), rgba(24,25,33,.26) !important;
  backdrop-filter: blur(28px) saturate(180%) brightness(1.05) !important; -webkit-backdrop-filter: blur(28px) saturate(180%) brightness(1.05) !important; border-color: rgba(255,255,255,.15) !important; }
.tabpanel .card, .tabpanel .stat { background: linear-gradient(135deg, rgba(255,255,255,.09) 0%, rgba(255,255,255,.03) 45%, rgba(255,255,255,.055) 100%), rgba(22,23,31,.30); }
.card-locked { filter: grayscale(.5); }

/* Sin el marco blanco del navegador al enfocar botones y pestañas: solo un brillo suave */
button:focus, .btn:focus, a.btn:focus, [role="tab"]:focus { outline: 0; }
.btn:focus-visible, button:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
.btn-primary:focus-visible { box-shadow: 0 0 0 3px rgba(59,130,246,.28), 0 6px 18px rgba(59,130,246,.35); }
.btn-danger:focus-visible { box-shadow: 0 0 0 3px rgba(229,72,77,.25); }

/* Pestañas de Ajustes con icono (azul al estar seleccionada, como las de la ficha) */
.tabs2 button { display: flex; align-items: center; justify-content: center; gap: 8px; }
.tabs2 button svg { width: 17px; height: 17px; flex: none; color: var(--muted); }
.tabs2 button.active svg { color: var(--accent); }
.dbbtns .btn { gap: 6px; }

/* Pantallas grandes: el contenido se estira con la ventana (antes se quedaba en 1280 px). En móvil no cambia nada. */
@media (min-width: 821px) {
  .main { max-width: none; }
}

/* Filtros de estado de Equipos (PC): cuadrados como el resto de botones y la opción elegida bien resaltada */
@media (min-width: 821px) {
  #devStats .stat { border-radius: 8px; height: 34px; transition: background .18s, border-color .18s, box-shadow .18s; }
  #devStats .stat:hover { background: rgba(255,255,255,.07); }
  #devStats .stat.sel { background: linear-gradient(180deg, rgba(59,130,246,.24), rgba(59,130,246,.10)); border-color: rgba(59,130,246,.7);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 0 0 1px rgba(59,130,246,.22), 0 6px 18px rgba(59,130,246,.2); }
  #devStats .stat.sel .stat-l { font-weight: 700; color: #fff; }
  #devStats .stat.sel .stat-n { font-weight: 700; color: #fff; }
}

/* PC: el hueco de la barra de scroll vertical se reserva siempre, así la web no se mueve unos píxeles al aparecer o desaparecer el scroll */
@media (min-width: 821px) {
  html { scrollbar-gutter: stable; }
}

/* Filtros de Equipos (PC): el buscador y los dos desplegables se reparten todo el ancho por igual, sin huecos */
@media (min-width: 821px) {
  .toolbar input, .toolbar select { flex: 1 1 0; max-width: none; min-width: 0; width: auto; }
}

/* Tarjeta de equipo: borde superior de cristal (franja de grosor por encima del canto y línea de luz arriba). Solo eso. */
.device { position: relative; border-top-color: rgba(255,255,255,.34); }
.device::before, .device[data-state]::before {
  content: ""; position: absolute; left: 9px; right: 9px; top: -5px; bottom: auto; width: auto; height: 6px; border-radius: 16px 16px 4px 4px; pointer-events: none; z-index: 3;
  background: linear-gradient(to bottom, rgba(255,255,255,.34) 0%, rgba(180,195,255,.18) 40%, rgba(75,90,150,.10) 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34), 0 -1px 4px rgba(160,180,255,.10);
}

/* Recetas: lista, editor de campos, tabla de paquetes y dibujo de la capa */
.recrows tbody tr { cursor: pointer; }
.recrows tbody tr:hover { background: rgba(255,255,255,.05); }
.recrows tbody tr:focus-visible { background: rgba(59,130,246,.12); outline: 0; }
.recrow { display: flex; flex-direction: column; gap: 2px; padding: 12px 4px; border-bottom: 1px solid rgba(255,255,255,.07); cursor: pointer; }
.recrow:focus-visible { background: rgba(255,255,255,.05); outline: 0; border-radius: 8px; }
.recrow b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rechead { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.rechead .btn { height: 38px; min-width: 110px; padding: 0 14px; justify-content: center; }
.recname { flex: 1 1 auto; min-width: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recchg { font-size: 13px; }
.recsec .act-body { padding: 4px 0 14px; }
.recgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 12px; }
.rf { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rf span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf input, .recpk input.pk { margin: 0; height: 38px; box-sizing: border-box; width: 100%; font-variant-numeric: tabular-nums; }
.rf input.chg, .recpk input.chg { border-color: rgba(59,130,246,.8); background: rgba(59,130,246,.10); }
.rf input.bad, .recpk input.bad { border-color: rgba(229,72,77,.9); background: rgba(229,72,77,.10); }
.recsplit { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.recdraw svg { width: 100%; height: auto; display: block; border-radius: 10px; background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.10); }
.recpk { max-height: 460px; overflow-y: auto; }
.recpk table { width: 100%; table-layout: fixed; }
.recpk input.pk { height: 32px; padding: 0 8px; font-size: 13px; }
.reclist { margin: 8px 0 0; padding-left: 18px; font-size: 13px; max-height: 240px; overflow-y: auto; }
@media (max-width: 820px) { .recsplit { grid-template-columns: 1fr; } .recgrid { grid-template-columns: 1fr 1fr; } .rechead .btn { min-width: 0; flex: 1 1 40%; } }.recpk .table th, .recpk .table td { padding: 4px 3px; }
.recpk .table th:first-child, .recpk .table td:first-child { width: 30px; text-align: center; }
.recpk input.pk { padding: 0 4px; font-size: 12.5px; text-align: right; }
.recpk .table th { text-align: right; }
.recpk .table th:first-child { text-align: center; }

.recdraw { display: flex; justify-content: center; }
.recdraw svg { width: auto; max-width: 100%; max-height: 560px; }

/* Interruptor Usados / Todos de la tabla de paquetes */
.seg { display: flex; padding: 3px; gap: 3px; margin: 0 0 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(0,0,0,.20); }
.seg button { flex: 1 1 0; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; transition: background .18s, color .18s; }
.seg button:hover:not(.on) { color: var(--text); background: rgba(255,255,255,.06); }
.seg button.on { background: linear-gradient(180deg, rgba(59,130,246,.34), rgba(59,130,246,.18)); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(59,130,246,.55); }
/* Interruptor Usados / Todos (con deslizador) */
.tgrow { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.10); border-radius: 12px; background: rgba(0,0,0,.18); }
.tgl { font-size: 13px; color: var(--muted); transition: color .18s; }
.tgl.on { color: #fff; font-weight: 600; }
.tg { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; cursor: pointer; }
.tg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.tg i { position: absolute; inset: 0; border-radius: 999px; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.20); transition: background .2s, border-color .2s; }
.tg i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); transition: transform .2s; }
.tg input:checked + i { background: rgba(59,130,246,.55); border-color: rgba(59,130,246,.9); }
.tg input:checked + i::after { transform: translateX(20px); }
.tg input:focus-visible + i { box-shadow: 0 0 0 3px rgba(59,130,246,.3); }
/* Interruptor a la derecha y sin recuadro; tabla de paquetes de altura fija y con hueco de scroll reservado (no se mueve nada al pasar a «Todos») */
.tgrow { border: 0; background: none; padding: 0; justify-content: flex-end; margin: 0 0 8px; }
.recpk { max-height: none; overflow: visible; }
.recpkbox { height: 500px; overflow-y: scroll; scrollbar-gutter: stable; }
.recpkbox thead th { position: sticky; top: 0; z-index: 1; background: rgba(30,31,40,.92); }
@media (max-width: 820px) { .recpkbox { height: 380px; } }
/* Aviso al pasar el ratón por un paquete del dibujo */
.rectip { position: fixed; z-index: 300; pointer-events: none; padding: 8px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5; min-width: 92px;
  background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.05)), rgba(22,23,31,.78); border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); box-shadow: 0 10px 28px rgba(0,0,0,.45); }
.rectip[hidden] { display: none; }
.rectip div { display: flex; justify-content: space-between; gap: 18px; font-variant-numeric: tabular-nums; }
.rectip span { color: var(--muted); }
.rectip span::after { content: ":"; }
.recdraw .pk { cursor: default; }
.recdraw .pk:hover rect:first-child { stroke: #fff; fill: rgba(59,130,246,.42); }
@media (hover: none), (max-width: 820px) { .rectip { display: none !important; } }.rectip { min-width: 0; }
.rectip div { justify-content: flex-start; gap: 6px; }

/* Usuarios conectados (barra lateral, encima de tu usuario) */
.presence { margin: 0 12px 10px; }
.pres-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.04); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-align: left; position: relative; padding-right: 34px; }
.pres-head:hover { background: rgba(255,255,255,.07); }
.pres-head::after { content: "›"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%) rotate(90deg); color: var(--muted); font-size: 18px; transition: transform .15s; }
.pres-head.open::after { transform: translateY(-50%) rotate(-90deg); }
.pres-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pres-n { flex: none; min-width: 20px; padding: 1px 7px; border-radius: 8px; background: rgba(48,164,108,.18); color: #7fe0ae; font-size: 12px; font-weight: 600; text-align: center; }
.pres-n:empty { display: none; }
.pres-list { margin-top: 6px; padding: 4px 4px; border-radius: 10px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); max-height: 220px; overflow-y: auto; }
.pres-list[hidden] { display: none; }
.pres-u { display: flex; align-items: center; gap: 9px; padding: 7px 8px; font-size: 13px; }
.pres-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pres-name small, .pres-u > small { color: var(--muted); font-size: 11.5px; }
.pres-empty { padding: 8px; color: var(--muted); font-size: 12.5px; }
.dot.blink { animation: pulse 2s infinite; }
@media (prefers-reduced-motion: reduce) { .dot.blink { animation: none; } }
@media (max-width: 820px) { .presence { display: none; } }/* Usuarios conectados: abajo, justo encima de tu usuario, y con el título entero */
.presence { margin: auto 10px 8px; }
.presence + .side-foot { margin-top: 0; }
.pres-head { font-size: 12.5px; gap: 6px; padding: 9px 28px 9px 10px; }
.pres-head::after { right: 10px; }

/* Usuarios conectados con el mismo estilo que los filtros de Equipos y los demás desplegables */
.pres-head { height: 34px; box-sizing: border-box; padding: 0 30px 0 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.10); background: transparent;
  font-size: 12.5px; font-weight: 500; color: var(--text); gap: 10px; }
.pres-head:hover { background: rgba(255,255,255,.08); }
.pres-head.open { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.28); }
.pres-n { background: none; padding: 0; min-width: 0; color: var(--muted); font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.pres-head::after { right: 12px; font-size: 18px; color: var(--muted); }
.pres-list { border-radius: 8px; background: transparent; border-color: rgba(255,255,255,.10); padding: 2px 4px; }
.pres-u { font-size: 12.5px; padding: 8px 8px; border-bottom: 1px solid rgba(255,255,255,.06); }
.pres-u:last-child { border-bottom: 0; }
.pres-name { color: var(--text); font-weight: 500; }
.pres-u > small, .pres-name small { font-size: 12px; }

/* Usuarios conectados sin recuadro y con la misma letra que el menú y que tu usuario de abajo */
.presence { margin: auto 0 4px; }
.pres-head { border: 0; background: transparent; height: auto; padding: 10px 12px; gap: 10px; font-size: 14px; font-weight: 400; color: var(--text); border-radius: 8px; }
.pres-head:hover { background: rgba(255,255,255,.06); }
.pres-head.open { background: transparent; border: 0; }
.pres-head svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.pres-head::after { right: 14px; }
.pres-n { font-size: 12px; }
.pres-list { border: 0; background: transparent; border-radius: 0; padding: 0 12px 4px 40px; max-height: 240px; }
.pres-u { padding: 6px 0; gap: 10px; border: 0; font-size: 14px; }
.pres-u:last-child { border: 0; }
.pres-name { font-size: 14px; font-weight: 700; color: var(--text); }
.pres-name small, .pres-u > small { font-size: 12px; font-weight: 400; color: var(--muted); }
.pres-empty { padding: 6px 0; font-size: 12px; }.pres-head svg { color: inherit; opacity: .85; }
.pres-head { gap: 12px; }

/* Usuarios conectados: nombre corto, sin negrita, y el número separado de la flecha */
.pres-name { font-weight: 400; }
.pres-n { margin-right: 22px; }
/* La flecha va dentro de la fila (no pegada al borde) para que quepa el título entero y el número no la toque */
.pres-head { padding: 10px 12px; }
.pres-head::after { position: static; transform: rotate(90deg); margin-left: 4px; line-height: 1; flex: none; }
.pres-head.open::after { transform: rotate(-90deg); }
.pres-n { margin-right: 0; }
.pres-t { font-size: 13.5px; }
.pres-head { gap: 8px; }
.pres-head svg { margin-right: 4px; }
.pres-head::after { margin-left: 0; }

/* Enlace de descarga sin sesión (Ajustes): mismo diseño que la clave de empresa */
.dllabel { margin: 14px 0 6px; font-size: 12.5px; }
#setHost #dlField { font-family: var(--mono); font-size: 12.5px; text-overflow: ellipsis; }
@media (min-width: 821px) { #setHost #regenDl { width: 120px; flex: none; padding: 0; justify-content: center; height: 40px; } }
@media (max-width: 820px) {
  #setHost .dlrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  #setHost #dlRow { display: contents; }
  #setHost #dlField { grid-column: 1 / -1; width: 100%; font-size: 10.5px; }
  #setHost #dlCopy { grid-column: 1 / 3; width: 100%; height: 40px; margin: 0; padding: 0; justify-content: center; }
  #setHost #regenDl { grid-column: 3; width: 100%; height: 40px; margin: 0; padding: 0; justify-content: center; }
}
/* Ajustes: el scroll vertical es el de la página, no el del cuadrado */
.main:has(#setHost) { height: auto; min-height: 100vh; overflow: visible; }
#setHost { flex: none; min-height: 0; overflow: visible; }
#setHost #custList { flex: none; max-height: none; overflow: visible; }
@media (max-width: 820px) { .main:has(#setHost) { min-height: 0; } }

/* Ajustes: el cuadrado ocupa siempre hasta abajo (y crece con el contenido si hace falta; entonces desplaza la página) */
.main:has(#setHost) { display: flex; flex-direction: column; box-sizing: border-box; min-height: 100vh; min-height: 100dvh; }
#setHost { flex: 1 0 auto; }
@media (max-width: 820px) { .main:has(#setHost) { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(84px + env(safe-area-inset-bottom)); } }

/* Pestañas de Ajustes en móvil: icono y texto en la misma línea y centrados, con aire por debajo (antes el texto quedaba pegado al cuadrado) */
@media (max-width: 820px) {
  .tabs2 button { flex-direction: row; align-items: center; justify-content: center; gap: 8px; padding: 0 10px 4px; line-height: 1.2; }
  .tabs2 button, .tabs2 button.active { min-height: 0; }
  .tabs2 button { height: 40px; }
  .tabs2 button.active { height: 48px; padding-bottom: 6px; }
}
/* Pestañas de Ajustes en móvil: idénticas a las de PC (mismas alturas, icono y texto en una línea, sin relleno extra) */
@media (max-width: 820px) {
  .tabs2 button { flex-direction: row; align-items: center; justify-content: center; gap: 8px; padding: 0 10px; height: 36px; min-height: 0; line-height: 1.2; font-size: 13.5px; }
  .tabs2 button.active { height: 44px; padding: 0 10px; }
}

.rechead #recToggle { min-width: 150px; }
@media (max-width: 820px) { .rechead #recToggle { min-width: 0; } }

/* Receta: pestañas Planta / 3D del dibujo del palé */
.recview { min-width: 0; }
.recdraw[hidden], .rec3dnote[hidden] { display: none; }
#rec3d svg { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
#rec3d svg:active { cursor: grabbing; }
.rec3dnote { text-align: center; font-size: 12.5px; margin-top: 8px; }
.recpanel { border: 1px solid var(--glass-line); border-radius: 14px; background: #23242c; padding: 10px; position: relative; }
.recpanel .recdraw svg { background: none; border: 0; border-radius: 0; }
.rectabs { padding: 0 12px; }

/* Lista de recetas en PC: ningún texto se corta; el nombre ocupa lo que sobra y, si no caben todas las columnas, se ocultan las menos importantes por orden */
#recList { container-type: inline-size; }
.recrows { table-layout: auto; width: 100%; }
.recrows th, .recrows td { overflow: visible; text-overflow: clip; white-space: nowrap; }
.recrows th:first-child, .recrows td:first-child { width: 99%; min-width: 210px; white-space: normal; overflow-wrap: anywhere; }
.recrows th.num, .recrows td.num { padding-left: 10px; padding-right: 16px; }
@container (max-width: 1180px) { .recrows th:nth-child(11), .recrows td:nth-child(11) { display: none; } }
@container (max-width: 1090px) { .recrows th:nth-child(10), .recrows td:nth-child(10) { display: none; } }
@container (max-width: 1000px) { .recrows th:nth-child(9), .recrows td:nth-child(9) { display: none; } }
@container (max-width: 910px) { .recrows th:nth-child(4), .recrows td:nth-child(4) { display: none; } }
@container (max-width: 820px) { .recrows th:nth-child(2), .recrows td:nth-child(2), .recrows th:nth-child(3), .recrows td:nth-child(3) { display: none; } }

/* Marca de la barra lateral y de la cabecera: sin negrita */
.brand, .brand b { font-weight: 400; }

/* PC: la tabla de paquetes mide lo mismo que el dibujo de la izquierda (en vez de una altura fija) y hace scroll dentro */
@media (min-width: 821px) {
  .recsplit { align-items: stretch; }
  .recpk { height: 0; min-height: 100%; display: flex; flex-direction: column; }
  .recpkbox { flex: 1 1 0; height: auto; min-height: 0; }
}

/* Planta y 3D dentro del mismo recuadro, con la misma altura (el dibujo se ajusta sin deformarse) */
.recpanel .recdraw { height: 540px; align-items: center; }
.recpanel .recdraw svg { width: 100%; height: 100%; max-width: none; max-height: none; }
@media (max-width: 820px) { .recpanel .recdraw { height: 420px; } }
.recpanel .rec3dnote { min-height: 2.8em; display: flex; align-items: center; justify-content: center; }

/* Equipos: vista de mapa */
.mapbox { padding: 0; overflow: hidden; }
.mapview { position: relative; height: clamp(360px, 64vh, 760px); background: rgba(0,0,0,.22); }
.mapview svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.mapview svg:active { cursor: grabbing; }
.worldland { fill: rgba(255,255,255,.09); stroke: rgba(255,255,255,.22); stroke-width: .8px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.mp { cursor: pointer; --c: var(--green); }
.mp-offline { --c: var(--red); } .mp-alarm { --c: var(--amber); } .mp-pending { --c: var(--purple); }
/* Marcadores: círculo de color del estado, con un brillo suave arriba, aro fino y sombra; icono de pantalla con línea de pulso */
.mp { filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.mp circle.mb { fill: var(--c); stroke: rgba(255,255,255,.85); stroke-width: 1.5; transition: stroke-width .15s; }
.mp:hover circle.mb { stroke: #fff; stroke-width: 2.2; }
.mp circle.hl { fill: rgba(255,255,255,.16); pointer-events: none; }
.mp .ic * { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.mp text { fill: #fff; font: 600 13px "Segoe UI", system-ui, sans-serif; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.mp:hover circle { stroke-width: 3; }
.mapctl { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; }
.mapctl .btn { width: 38px; min-width: 0; height: 38px; padding: 0; justify-content: center; }
.mapctl .btn svg { margin: 0; }
.maptip { display: block !important; min-width: 0; }
.maptip[hidden] { display: none !important; }
.maptip b { display: block; margin-bottom: 2px; }
@media (min-width: 821px) { .mapview { height: auto; aspect-ratio: 1440 / 568; max-height: 78vh; } }
@media (max-width: 820px) { .mapview { height: 62vh; } }
/* Equipos: Abrir/Cerrar todos y Mapa/Lista siempre del mismo tamaño y en el mismo sitio */
#toggleAll { min-width: 140px; justify-content: center; }
@media (max-width: 820px) { #mapIn, #mapOut { display: none; } }      /* en el móvil se hace zoom con los dedos */
/* Equipos: botones Lista y Mapa sueltos (el elegido, con el icono azul); sin recuadro que los envuelva */
.vseg { display: contents; }
.vb svg { color: var(--muted); }
.vb.on { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.28); }
.vb.on svg { color: var(--accent); }
@media (max-width: 820px) {
  .page-head .actions:has(#viewSeg) { display: flex; gap: 6px; width: 100%; }
  .page-head .actions:has(#toggleAll) > #toggleAll, .page-head .actions:has(#viewSeg) > #addDevice { flex: 1 1 auto; min-width: 0; padding: 0 8px; font-size: 12.5px; gap: 6px; }
  .vb { flex: 0 0 44px; width: 44px; min-width: 0; padding: 0; justify-content: center; }
  .vb span { display: none; }
  .vb svg { width: 20px; height: 20px; margin: 0; }
}
@media (max-width: 820px) { .page-head .actions .vb { flex: 0 0 44px; width: 44px; } }
/* Móvil: el mapa no ocupa toda la pantalla, así queda hueco fuera de él para poder hacer scroll de la página con un dedo (encima del mapa el dedo lo mueve a él) */
@media (max-width: 820px) { .mapview { height: clamp(280px, 46vh, 400px); } }
/* Equipos sin localizar: la lista se despliega entera (sin scroll propio, la página crece) y sin borde de enfoque */
/* «Equipos sin localizar» va encima del mapa, en su propia tarjeta */
/* «Equipos sin localizar»: tarjeta encima del mapa con un desplegable; la lista se abre entera (sin scroll propio) y sin borde de enfoque */
.card.mapnote { margin-bottom: 12px; padding: 0; font-size: 13.5px; }
.card.mapnote[hidden] { display: none; }
.mapdet summary { cursor: pointer; padding: 10px 16px; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.mapdet summary::-webkit-details-marker { display: none; }
.mapdet summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .18s; margin-right: 4px; }
.mapdet[open] summary::after { transform: rotate(-135deg); }
.mapdet summary, .mapdet summary:focus, .mapdet summary:focus-visible { outline: 0; box-shadow: none; }
.maplost { display: flex; flex-direction: column; padding: 0 8px 8px; }
.maplost a { padding: 7px 8px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13px; }
.maplost a:hover, .maplost a:focus, .maplost a:focus-visible { outline: 0; background: rgba(255,255,255,.06); }/* Barra de filtros de Equipos (buscador, clientes, OF): mismo gris de cristal que las tarjetas; misma posición y tamaño */
.toolbar input, .toolbar select {
  background-color: rgba(30,30,38,.55); border: 1px solid var(--glass-line); border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 10px 30px rgba(0,0,0,.28);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
}
.toolbar input { background-image: var(--glass); }
.toolbar select:not([multiple]) {
  background-image: var(--glass), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9aa6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat; background-position: 0 0, right 14px center; background-size: 100% 100%, 16px;
}
.toolbar select:not([multiple]):hover { background-color: rgba(38,38,48,.6); }

/* Lista desplegable de los select con el mismo diseño de cristal que el campo (Chrome / Edge modernos; en otros navegadores sigue la lista normal) */
@supports (appearance: base-select) {
  select:not([multiple]), select:not([multiple])::picker(select) { appearance: base-select; }
  select:not([multiple])::picker-icon { display: none; }
  select:not([multiple])::picker(select) {
    margin-top: 4px; padding: 4px; border: 1px solid var(--glass-line); border-radius: 10px;
    background: var(--glass), rgba(26,27,35,.96); box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 16px 40px rgba(0,0,0,.5);
    color: var(--text); max-height: 320px;
  }
  select:not([multiple]) option { padding: 9px 12px; border-radius: 7px; background: transparent; color: var(--text); font-size: 14px; cursor: pointer; }
  select:not([multiple]) option::checkmark { display: none; }
  select:not([multiple]) option:hover, select:not([multiple]) option:focus-visible { background: rgba(255,255,255,.08); outline: 0; }
  select:not([multiple]) option:checked { background: rgba(59,130,246,.18); }
  select:not([multiple]) option:disabled { color: #6b7079; cursor: not-allowed; }
}

/* «Equipos sin localizar»: la lista se abre flotando sobre el mapa (como los desplegables de clientes y OF) y no lo empuja */
.card.mapnote { position: relative; z-index: 5; overflow: visible; }
.mapdet .maplost {
  position: absolute; left: -1px; right: -1px; top: calc(100% + 4px); z-index: 30; padding: 4px; max-height: min(60vh, 420px); overflow-y: auto;
  border: 1px solid var(--glass-line); border-radius: 10px; background: var(--glass), rgba(26,27,35,.96);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 16px 40px rgba(0,0,0,.5);
}
.mapdet .maplost a { padding: 9px 12px; border-radius: 7px; font-size: 14px; }

/* Flecha de los select: la misma que la de «sin localizar» y gira al abrir (en Chrome / Edge modernos; en otros navegadores queda la flecha fija de siempre) */
@supports (appearance: base-select) {
  select:not([multiple]) { display: flex; align-items: center; gap: 8px; background-image: none; padding-right: 14px; }
  .toolbar select:not([multiple]) { background-image: var(--glass); background-repeat: no-repeat; background-position: 0 0; background-size: 100% 100%; }
  select:not([multiple])::picker-icon {
    display: block; content: ""; flex: none; margin-left: auto; margin-right: 4px; width: 7px; height: 7px; color: #9a9aa6;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .18s;
  }
  select:not([multiple]):open::picker-icon { transform: rotate(-135deg) translateY(-2px); }
}

/* Móvil: «Equipos» es un único desplegable que lleva dentro los estados, el buscador y los filtros */
@media (min-width: 821px) { .filterbox { display: contents; } }
@media (max-width: 820px) {
  .filterbox { background: var(--glass), rgba(30,30,38,.55); border: 1px solid var(--glass-line); border-radius: 14px; padding: 2px 6px; margin-bottom: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 10px 30px rgba(0,0,0,.28); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%); }
  .filterbox:has(.toolbar.open) { padding-bottom: 8px; }
  .filterbox .stats { background: none; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; margin: 0; }
  .filterbox .toolbar { margin: 8px 0 0; }
  .filterbox .toolbar:not(.open) { display: none; }
}
@media (max-width: 820px) { .mapview { height: var(--mapH, clamp(280px, 60vh, 560px)); } }      /* móvil: el mapa llega hasta la barra de abajo */

/* Lista para elegir entre varios equipos que están en el mismo punto del mapa */
.mappick { position: fixed; z-index: 300; min-width: 220px; max-width: min(320px, calc(100vw - 16px)); max-height: min(60vh, 420px); overflow-y: auto; padding: 4px;
  border: 1px solid var(--glass-line); border-radius: 10px; background: var(--glass), rgba(26,27,35,.96); box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 16px 40px rgba(0,0,0,.5); }
.mappick .mp-head { padding: 8px 12px 6px; font-size: 12px; color: var(--muted); }
.mappick a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 14px; }
.mappick a:hover, .mappick a:focus-visible { background: rgba(255,255,255,.08); outline: 0; }
.mappick small { display: block; color: var(--muted); font-size: 12px; }

/* «Demostración» en el desplegable de clientes: en amarillo suave, para que se vea que es especial */
select option[value="__demo"] { color: var(--amber); }
@supports (appearance: base-select) {
  select:not([multiple]) option[value="__demo"] { color: var(--amber); background: rgba(245,165,36,.08); }
  select:not([multiple]) option[value="__demo"]:hover, select:not([multiple]) option[value="__demo"]:focus-visible { background: rgba(245,165,36,.16); }
  select:not([multiple]) option[value="__demo"]:checked { background: rgba(245,165,36,.18); }
}
select:has(option[value="__demo"]:checked) { color: var(--amber); border-color: rgba(245,165,36,.45); }

/* Con «Demostración» elegida los contadores (Online, Offline…) no aplican: en PC desaparece la tira; en móvil queda solo la cabecera «Equipos», sin número ni estados */
@media (min-width: 821px) { .stats.demo-off { display: none; } }
@media (max-width: 820px) {
  .stats.demo-off .stat:not(:first-child) { display: none !important; }
  .stats.demo-off .stat:first-child .stat-n { display: none; }
}

/* Los filtros (buscador y desplegables) van ENCIMA de los contadores: al desaparecer estos con «Demostración», nada se mueve */
@media (max-width: 820px) {
  .filterbox { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .filterbox .stats { display: contents; }
  .filterbox .stats .stat:first-child { order: 0; grid-column: 1 / -1; }
  .filterbox .toolbar { order: 1; grid-column: 1 / -1; margin: 2px 0 0; }
  .filterbox .stats .stat:not(:first-child) { order: 2; grid-column: auto; }
}

/* Actividad: columnas ordenables (clic en la cabecera; la flecha azul marca la columna y el sentido) */
.actsort th[data-sort] { cursor: pointer; user-select: none; -webkit-user-select: none; white-space: nowrap; }
.actsort th[data-sort]:hover { color: var(--text); }
.actsort th[data-sort]:focus-visible { outline: 0; color: var(--text); }
.actsort th[data-sort]::after { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 0 3px 9px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); opacity: 0; transition: opacity .15s, transform .18s; }
.actsort th[data-sort]:hover::after { opacity: .45; }
.actsort th[aria-sort]::after { opacity: 1; color: var(--accent); }
.actsort th[aria-sort="ascending"]::after { transform: rotate(-135deg); margin-bottom: 0; margin-top: 3px; }

/* Los select ocultos (atributo hidden) o solo de móvil siguen sin verse aunque lleven el estilo nuevo */
@supports (appearance: base-select) {
  select:not([multiple])[hidden], select.only-narrow:not([multiple]), select.only-wide:not([multiple]) { display: none; }
  @media (max-width: 820px) { select.only-narrow:not([multiple]) { display: flex; } }
  @media (min-width: 821px) { select.only-wide:not([multiple]) { display: flex; } }
}

/* Actividad: cada tipo de evento lleva su propio color, muy suave (fondo casi transparente, franja fina a la izquierda y el nombre de la acción en tono pastel) */
[data-act] { --c: 150,150,165; }
[data-act="login"] { --c: 100,165,250; }
[data-act="logout"] { --c: 140,150,175; }
[data-act="login_fail"] { --c: 235,110,115; }
[data-act="user_create"] { --c: 150,130,245; }
[data-act="user_update"] { --c: 185,150,240; }
[data-act="user_delete"] { --c: 225,120,170; }
[data-act="device_create"] { --c: 80,200,150; }
[data-act="device_update"] { --c: 110,200,190; }
[data-act="device_delete"] { --c: 235,130,100; }
[data-act="device_linked"] { --c: 120,210,120; }
[data-act="device_unlink"] { --c: 200,190,90; }
[data-act="device_enable"] { --c: 90,210,170; }
[data-act="device_disable"] { --c: 170,160,150; }
[data-act="customer_create"] { --c: 230,180,80; }
[data-act="customer_rename"] { --c: 215,195,110; }
[data-act="customer_delete"] { --c: 235,150,90; }
[data-act="enroll_key_regenerate"] { --c: 220,160,60; }
[data-act="download_key_regenerate"] { --c: 225,170,80; }
[data-act="app_admin_password_change"] { --c: 235,120,150; }
[data-act="command"] { --c: 100,190,230; }
[data-act="recipe_edit"] { --c: 240,160,110; }
[data-act="download"] { --c: 90,200,220; }
[data-act="audit_clear"] { --c: 225,100,100; }
.actsort tbody tr[data-act] { background: rgba(var(--c), .055); }
.actsort tbody tr[data-act]:hover { background: rgba(var(--c), .10); }
.actsort tbody tr[data-act] td:first-child { box-shadow: inset 3px 0 0 rgba(var(--c), .5); }
.actsort tbody tr[data-act] td.actname { color: rgb(var(--c)); }
.act-list details.act[data-act] { background: rgba(var(--c), .055); box-shadow: inset 3px 0 0 rgba(var(--c), .5); }
.act-list details.act[data-act] .act-action { color: rgb(var(--c)); }
/* El desplegable de acciones usa los mismos colores suaves */
@supports (appearance: base-select) {
  select:not([multiple]) option[data-act] { color: rgb(var(--c)); background: rgba(var(--c), .06); }
  select:not([multiple]) option[data-act]:hover, select:not([multiple]) option[data-act]:focus-visible { background: rgba(var(--c), .14); }
  select:not([multiple]) option[data-act]:checked { background: rgba(var(--c), .20); }
}
select option[data-act] { color: rgb(var(--c)); }
.act-list details.act[data-act] > summary { padding-left: 16px; }
.act-list details.act[data-act] > .act-body { padding-left: 16px; }
/* Ajustes: la fila del archivo de licencias (DB) justo debajo de la del instalador, igual de alta y alineada */
.swrow + .swrow { margin-top: 8px; }

/* Botón de info junto a «Descargar» de la DB (cuadrado, como los de más abajo) y su ventana */
#setHost .swrow #dbInfo { width: 40px; }
@media (max-width: 820px) {
  #setHost .swrow.dbrow { grid-template-columns: minmax(0, 1fr) 40px calc((100% - 16px) / 3); }
  #setHost .swrow.dbrow .swtxt { grid-column: 1; }
  #setHost .swrow.dbrow #dbInfo { grid-column: 2; width: 100%; }
  #setHost .swrow.dbrow #dbDown { grid-column: 3; }
}
.dbinfo { display: flex; flex-direction: column; gap: 4px; max-height: 58vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.dbv { padding: 9px 12px; border-radius: 8px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); }
.dbv b { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; }
.dbv b small { font-weight: 400; font-size: 12px; color: var(--muted); white-space: nowrap; }
.dbv span { display: block; margin-top: 3px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.dbv .dbl { margin-top: 8px; }
.dbv .dbl em { display: block; font-style: normal; color: var(--text); font-size: 13px; }
.dbv .dbl i { display: block; font-style: normal; margin-top: 2px; }
/* Estados de cada variable: una fila por estado, con la viñeta en su propia columna (sangría francesa) */
.dbv .dbl { margin-top: 8px; display: block; }
.dbv .dbl em { display: block; margin-bottom: 3px; }
.dbv .dbs { display: grid; grid-template-columns: 14px minmax(0, 1fr); margin-top: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.dbv .dbs i { font-style: normal; text-align: center; }
.dbv .dbs span { margin-top: 0; }

/* Pestaña Power Off 2 → PLC */
.plchead { margin: 0 0 10px; font-size: 13px; }
.plctable td { padding-top: 10px; padding-bottom: 10px; }
.plcval { white-space: nowrap; font-variant-numeric: tabular-nums; }
.plcval .dot { margin-right: 8px; }
.act-list .plcval .dot { margin-right: 6px; }
/* Con 8 pestañas en PC: menos aire entre el icono y el texto para que ninguna se corte */
@media (min-width: 821px) { .tabs:not(.tabs2) button { gap: 6px; padding-left: 6px; padding-right: 6px; font-size: 13px; } }
@media (min-width: 821px) { #dTabs button { font-size: 13px; } }
/* Pestaña PLC en móvil: una fila por variable (nombre y posición a la izquierda, valor y estado a la derecha) */
.plclist { display: flex; flex-direction: column; }
.plcrow { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.plcrow:last-child { border-bottom: 0; }
.plcl b, .plcr .plcval { display: block; font-size: 14px; }
.plcl small, .plcr small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.plcr { text-align: right; min-width: 0; }
.plcr .plcval { font-weight: 600; }
.plcval .dot:last-child { margin-right: 0; }
.plclist.only-narrow { display: none; }
@media (max-width: 820px) { .plclist.only-narrow { display: flex; } }
/* PC con poco ancho: sin iconos en las pestañas de la ficha, para que ningún nombre se corte */
@media (min-width: 821px) and (max-width: 1279px) { #dTabs button svg { display: none; } }
.plcval { display: flex; align-items: center; }
.plcled { display: inline-flex; align-items: center; justify-content: flex-start; width: 30px; flex: none; }
.plcval .dot { margin: 0; }
.plctable td.plcval { display: table-cell; }
.plctable td.plcval > * { vertical-align: middle; }
.plcr .plcval { justify-content: flex-end; }
.plcr .plcled { width: 24px; justify-content: center; }
/* Latidos del DB (Largoiko Server y App): el bit cambia entre 1 y 0 en cada escritura de la app, que es cada 5 s; el led hace lo mismo (en la web, más rápido para que se vea: medio segundo encendido y medio apagado) */
@keyframes ledblink { 0%, 49% { background: var(--green); box-shadow: 0 0 8px rgba(48,164,108,.55); } 50%, 99% { background: rgba(255,255,255,.2); box-shadow: none; } 100% { background: var(--green); box-shadow: 0 0 8px rgba(48,164,108,.55); } }
.dot.ledblink { animation: ledblink 1s steps(1, end) infinite; }
@media (prefers-reduced-motion: reduce) { .dot.ledblink { animation: none; } }

/* Consola: la leyenda de colores y su aviso quedan fijos arriba de la lista de comandos y solo hacen scroll los comandos (PC y móvil). Como la leyenda está fuera de la parte que se mueve, comparte el fondo de la lista. */
.cmdlist { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.cmdhead { flex: none; padding: 14px 14px 8px; border-bottom: 1px solid rgba(255,255,255,.06); }
.cmdhead .legend { margin-bottom: 6px; }
.cmdbody { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 10px 14px 14px; }
@media (max-width: 820px) {
  .cmdlist { max-height: 52vh; }      /* móvil: la lista crece y el terminal se reduce */
  .terminal { height: 38vh; min-height: 240px; }
}

/* Mensaje al operario: en móvil es un desplegable cerrado por defecto (como Backups); en PC sigue siendo la tarjeta de siempre, siempre abierta */
#msgDet > summary h3 { font-size: inherit; }
@media (min-width: 821px) {
  #msgDet > summary { pointer-events: none; cursor: default; padding: 0 0 10px; }
  #msgDet > summary::after, #msgDet > summary::before { display: none !important; }
  #msgDet > .act-body { padding: 0; margin: 0; border: 0; }
}

/* Ficha del equipo en móvil: cabecera compacta (nombre, estado y el interruptor del robot; lo demás en «Datos y acciones», cerrado) y pestañas en una sola fila de iconos */
.herotog { display: none; }
@media (max-width: 820px) {
  #dHero { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: none !important; gap: 8px !important; padding: 12px 14px !important; margin-bottom: 12px; position: relative; align-items: stretch; }
  #dHero > .hero-main { grid-column: 1 / -1; order: 0; padding-right: 84px; flex: none; gap: 10px; align-items: center; }
  #dHero .ring.big { width: 40px; height: 40px; flex: none; }
  #dHero .ring.big svg { width: 20px; height: 20px; }
  #dHero .hero-text h1 { font-size: 18px; margin: 0; }
  #dHero .hero-text .d-customer { font-size: 11.5px; }
  #dHero > .actions { display: contents !important; }
  #dHero .actions .switch-row { grid-column: 1 / -1; order: 1; }
  #dHero > .herotog { display: flex; grid-column: 1 / -1; order: 2; align-items: center; justify-content: space-between; height: 38px; padding: 0 12px; border: 1px solid rgba(255,255,255,.10); border-radius: 10px; background: rgba(255,255,255,.04); color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; }
  #dHero > .herotog::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .18s; margin-right: 4px; }
  #dHero.open > .herotog::after { transform: rotate(-135deg) translateY(-2px); }
  #dHero .actions .btn { order: 3; }
  #dHero > .meta { order: 4; grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; border: 0; max-width: none; }
  /* el estado (Online / Offline) se queda siempre arriba a la derecha */
  #dHero > .meta > .pill { position: absolute; top: 18px; right: 14px; width: auto; height: 28px; padding: 0 11px; }
  #dHero:not(.open) .actions .btn, #dHero:not(.open) > .meta > .chip { display: none !important; }
  #dHero:not(.open) > .meta { display: block; height: 0; }

  #dTabs { display: grid !important; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: minmax(0, 1fr); gap: 4px !important; align-items: end; margin-bottom: 12px; }
  #dTabs button { width: 100%; min-width: 0; min-height: 0; height: 42px; padding: 0 !important; flex-direction: row; justify-content: center; }
  #dTabs button span { display: none !important; }
  #dTabs button svg { width: 20px; height: 20px; }
  #dTabs button.active { height: 50px; }
  #dTabs::after { content: attr(data-cap); grid-column: 1 / -1; grid-row: 2; text-align: center; font-size: 12.5px; color: var(--muted); padding-top: 6px; }
}
@media (max-width: 820px) {
  #dHero > .hero-main { grid-area: auto !important; }
  #dTabs button { grid-row: 1; }
}
@media (max-width: 820px) { #dHero > .hero-main { grid-column: 1 / -1 !important; } }
@media (max-width: 820px) { #dTabs::after { justify-self: center; } }

/* Pestañas de la ficha en móvil: el nombre de la elegida va en una barra de ancho completo encima de los iconos y el botón elegido se une a ella, como una pestaña de carpeta */
@media (max-width: 820px) {
  #dTabs { row-gap: 0 !important; column-gap: 4px !important; margin-bottom: 12px; align-items: stretch !important; }
  #dTabs::after { display: none !important; }
  #dTabs::before { content: attr(data-cap); grid-column: 1 / -1; grid-row: 1; height: 34px; display: flex; align-items: center; justify-content: center;
    background: #2b2d37; border: 1px solid rgba(255,255,255,.18); border-radius: 12px 12px 0 0; color: var(--text); font-size: 13.5px; font-weight: 600; }
  #dTabs button { grid-row: 2; height: 42px !important; margin-top: 6px; border-radius: 10px; }
  #dTabs button.active { height: 49px !important; margin-top: -1px; position: relative; z-index: 1; background: #2b2d37 !important; border-color: rgba(255,255,255,.18) !important; border-top-color: #2b2d37 !important; border-radius: 0 0 12px 12px; }
}
@media (max-width: 820px) { #dTabs { grid-template-columns: repeat(var(--n, 8), minmax(0, 1fr)) !important; grid-auto-flow: row !important; } }

/* Ficha en móvil: el mismo diseño que la tarjeta de la lista. Icono, nombre y una flecha cuadrada a la derecha; debajo, solo el interruptor «Robot activo». Al abrir con la flecha salen los datos y luego los botones */
@media (max-width: 820px) {
  #dHero > .herotog { display: inline-flex !important; position: absolute; top: 14px; right: 14px; width: 32px !important; height: 32px !important; padding: 0 !important; justify-content: center; align-items: center;
    border: 1px solid rgba(255,255,255,.10); border-radius: 8px; background: rgba(255,255,255,.04); color: var(--muted); }
  #dHero > .herotog::after { content: none !important; }
  #dHero > .herotog svg { width: 18px; height: 18px; transition: transform .15s; }
  #dHero.open > .herotog svg { transform: rotate(180deg); }
  #dHero > .hero-main { padding-right: 44px !important; }
  #dHero > .meta > .pill { position: static !important; top: auto; right: auto; width: auto; height: auto; }
  #dHero:not(.open) > .meta { display: none !important; }
  #dHero.open > .meta { order: 2; display: grid; }
  #dHero .actions .btn { order: 3; }
}
@media (max-width: 820px) { #dHero > .meta { grid-row: auto !important; grid-area: auto !important; grid-column: 1 / -1 !important; } }

/* Ficha en móvil, abierta: arriba el ID y el estado; luego el interruptor del robot; debajo la OF y la ubicación; y al final los botones. Más aire entre las filas */
@media (max-width: 820px) {
  #dHero { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; row-gap: 10px !important; }
  #dHero > .hero-main { margin-bottom: 6px; }
  #dHero .actions .btn { grid-column: span 2 !important; order: 4; }
  #dHero .actions .switch-row { order: 2; }
  #dHero.open > .meta { display: contents !important; }
  #dHero.open > .meta > * { grid-column: span 3; margin: 0; }
  #dHero.open > .meta > :nth-child(3), #dHero.open > .meta > :nth-child(4) { order: 1; }
  #dHero.open > .meta > :nth-child(1), #dHero.open > .meta > :nth-child(2) { order: 3; }
}
/* Ficha en móvil: «Robot activo» siempre arriba, justo debajo del nombre; después el ID y el estado, la OF y la ubicación, y los botones */
@media (max-width: 820px) {
  #dHero .actions .switch-row { order: 1 !important; }
  #dHero.open > .meta > :nth-child(3), #dHero.open > .meta > :nth-child(4) { order: 2 !important; }
}
@media (max-width: 820px) { #dTabs::before { height: 26px; font-size: 13px; } }
@media (max-width: 820px) { #dTabs button { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } }

/* Pestañas de la ficha en móvil: 4 + 4, con el icono arriba y el nombre debajo (sin la barra ni la pulsación larga) */
@media (max-width: 820px) {
  #dTabs { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; grid-auto-flow: row !important; gap: 6px !important; margin-bottom: 12px; align-items: stretch !important; }
  #dTabs::before, #dTabs::after { content: none !important; display: none !important; }
  #dTabs button { grid-row: auto !important; height: auto !important; min-height: 56px; margin: 0 !important; padding: 7px 4px !important; flex-direction: column !important; gap: 3px !important; border-radius: 10px !important;
    font-size: 12px !important; line-height: 1.15; text-align: center; background: rgba(255,255,255,.04) !important; border: 1px solid rgba(255,255,255,.10) !important; position: static; z-index: auto; }
  #dTabs button span { display: block !important; white-space: normal !important; overflow: visible !important; }
  #dTabs button.active { background: rgba(255,255,255,.12) !important; border-color: rgba(255,255,255,.28) !important; color: var(--text); }
}

/* Nombre corto de una pestaña (solo en móvil): «Robot en vivo» pasa a «Robot live» para que ocupe una sola línea */
#dTabs button .ts { display: none !important; }
@media (max-width: 820px) { #dTabs button:has(.ts) .tl { display: none !important; } #dTabs button:has(.ts) .ts { display: block !important; } }

/* Ajustes: base de datos (expander con barra apilada y una barra por tipo) */
.dbx > summary { display: block; padding: 2px 22px 2px 0; outline: 0; }
.dbx > summary h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.dbtot { font-weight: 400; font-size: 13px; }
.dbbar { display: flex; gap: 2px; height: 14px; margin: 14px 0 16px; border-radius: 7px; overflow: hidden; }
.dbbar i { min-width: 3px; background: rgb(var(--c)); opacity: .85; }
.dblist { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.dbtop { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.dbname { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.dbdot { width: 9px; height: 9px; border-radius: 50%; background: rgb(var(--c)); flex: none; }
.dbval { white-space: nowrap; }
.dbval small { color: var(--muted); font-size: 12px; margin-left: 4px; }
.dbmeter { height: 6px; margin: 6px 0 4px; border-radius: 3px; background: rgba(255,255,255,.06); overflow: hidden; }
.dbmeter b { display: block; height: 100%; border-radius: 3px; background: rgb(var(--c)); opacity: .85; }
.dbsub { font-size: 12px; }
.dbtables { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.dbtables > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 14px; }
.dbtables .muted { white-space: nowrap; }
@media (max-width: 560px) { .dbtables { grid-template-columns: 1fr; } }.dbinfo2 { margin-top: 12px; }
.dbpie { display: block; width: 100%; max-width: 430px; margin: 8px auto 20px; }
.dbpie .top { fill: rgb(var(--c)); stroke: rgba(0,0,0,.35); stroke-width: 1; }
.dbpie .side { fill: rgb(var(--c)); filter: brightness(.5); }
.dbpie g:hover .top { filter: brightness(1.12); }
.tabs2 { max-width: none; width: 100%; }
.dbpie .side { fill: rgb(var(--c)); filter: brightness(.62); stroke: rgba(0,0,0,.25); stroke-width: .6; }
.dbpie .cut { fill: rgb(var(--c)); filter: brightness(.45); stroke: rgba(0,0,0,.25); stroke-width: .6; }

/* Receta: pestañas de capa en la planta (bicapa / cuatricapa); la pestaña recoge el dibujo y el texto */
.laytabs { padding: 0 8px; }
.laytabs button.active { background: #2b2c36; border-bottom-color: #2b2c36; }
.laypanel { border: 1px solid var(--glass-line); border-radius: 12px; background: #2b2c36; padding: 10px; position: relative; z-index: 0; }
.laypanel.solo { border-color: transparent; background: none; padding: 0; }

/* Ajustes → Clientes: tabla de equipos */
.eqdet > summary { display: block; padding: 2px 22px 2px 0; outline: 0; }
.eqbar { display: flex; gap: 10px; margin: 6px 0 12px; }
.eqbar input { flex: 1 1 auto; min-width: 0; }
.eqwrap { max-height: 60vh; overflow: auto; }
.eqtable th.eqh { cursor: pointer; white-space: nowrap; user-select: none; position: sticky; top: 0; background: #23242c; z-index: 1; }
.eqtable td { white-space: nowrap; }
@media (max-width: 820px) { .eqopt { display: none; } .eqbar { flex-direction: column; } }
.eqbar .btn { white-space: nowrap; flex: none; }
.eqbar { align-items: center; }
.eqbar input, .eqbar .btn { height: 40px; min-height: 0; box-sizing: border-box; }
.eqbar .btn { padding: 0 18px; }
.eqbar .btn { width: 120px; flex: none; padding: 0; justify-content: center; gap: 6px; }
.eqbar .btn svg { width: 16px; height: 16px; flex: none; }
@media (max-width: 820px) { .eqbar .btn { width: 100%; } }
#bkCard.card-locked summary { pointer-events: none; cursor: default; }

/* Usuarios: avatar con iniciales e indicador de presencia */
.ucell { display: flex; align-items: center; gap: 12px; }
.uav { position: relative; display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.05)); border: 1px solid rgba(255,255,255,.12); }
.uav-i { font-size: 11px; font-weight: 600; letter-spacing: .03em; color: var(--text); }
.uav-st { position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; background: #4a4f59; border: 2px solid #1f2027; box-sizing: border-box; }
.uav.on .uav-st { background: var(--green); box-shadow: 0 0 8px rgba(52,211,153,.6); }
.act-list .ucell { gap: 10px; }
.act-list .uav { width: 26px; height: 26px; }
.act-list .uav-i { font-size: 10px; }
.act-list .uav-st { width: 10px; height: 10px; }

/* Avatar del usuario (menú y barra superior): iniciales, mismo estilo que en la página Usuarios */
.avatar, .topbar .avatar { font-size: 12px; letter-spacing: .03em; background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.05)); border: 1px solid rgba(255,255,255,.12); box-sizing: border-box; }
.eqtable tr.eq-ur td { background: rgba(96,140,226,.07); }

/* Usuarios: el indicador de conectado parpadea; la fila de Root, en un rojo suave */
.uav.on .uav-st { animation: pulse 2s infinite; }
@media (prefers-reduced-motion: reduce) { .uav.on .uav-st { animation: none; } }
tr.root-row { background: linear-gradient(90deg, rgba(229,72,77,.075), rgba(229,72,77,.012)); }
tr.root-row td:first-child { box-shadow: inset 3px 0 0 rgba(229,72,77,.45); }
tr.root-row td:first-child b, tr.root-row .role-root { color: #d9898c; }
.act.root-row { background: linear-gradient(90deg, rgba(229,72,77,.075), rgba(229,72,77,.012)); box-shadow: inset 3px 0 0 rgba(229,72,77,.45); }
.act.root-row .act-date, .act.root-row .act-user, .act.root-row .role-root { color: #d9898c !important; }

/* LED «Online» de las tarjetas: el mismo punto verde que el de «usuario conectado» */
.pill.online .dot { width: 11px; height: 11px; box-sizing: border-box; background: var(--green); border: 2px solid #1f2027; animation: pulse 2s infinite; }
@media (prefers-reduced-motion: reduce) { .pill.online .dot { animation: none; } }

/* Ficha → Datos: contraseña de RustDesk del equipo */
.rdrow { display: flex; gap: 8px; align-items: center; }
.rdrow input { flex: 1 1 auto; min-width: 0; height: 40px; box-sizing: border-box; }
.rdrow .btn { height: 40px; flex: none; }
.rdrow .btn-primary { width: 120px; padding: 0; justify-content: center; }
.rdnote { font-size: 12.5px; margin-top: 6px; }
@media (max-width: 820px) { .rdrow { flex-wrap: wrap; } .rdrow input { flex: 1 1 100%; } .rdrow .btn-primary { flex: 1 1 auto; } }
.rdrow .btn:disabled { opacity: .4; cursor: not-allowed; }
.rdrow input:disabled { opacity: .55; cursor: not-allowed; }

/* Actividad (Root): casillas para elegir y borrar registros */
.actsort th.selc, .actsort td.selc { width: 38px; padding-left: 14px; padding-right: 0; }
.actsort input[type=checkbox], .selm input[type=checkbox] { width: 16px; height: 16px; accent-color: #5b8def; cursor: pointer; vertical-align: middle; }
.actsort tr.sel td { background: rgba(91,141,239,.09); }
.selm { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.sectitle { margin: 2px 0 6px; }
.sectitle .dbtot, .eqdet summary h3 .dbtot { margin-left: 8px; }

/* Ajustes → Equipos de Largoiko en móvil: Cliente · OF · Equipo y, al desplegar, el resto (ID y contraseña de RustDesk primero) */
.eqlist { display: flex; flex-direction: column; }
.eqrow { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1.3fr); gap: 8px 10px; align-items: baseline; overflow-wrap: anywhere; }
.eqhead { padding: 8px 22px 8px 0; font-size: 12px; color: var(--muted); border-bottom: 1px solid rgba(255,255,255,.08); }
.eqd > summary.eqrow { padding: 11px 22px 11px 0; }
.eqbody { padding: 2px 0 8px; }
.eqf { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 14px; }
.eqf:last-child { border-bottom: 0; }
.eqf > span:first-child { color: var(--muted); flex: none; }
.eqv { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; text-align: right; overflow-wrap: anywhere; }
.eqcp { width: 28px; height: 28px; min-height: 0; padding: 0; flex: none; }
.eqcp svg { width: 14px; height: 14px; }
.eqd.eq-ur { background: rgba(96,140,226,.07); border-radius: 8px; }
.eqd > summary.eqrow { grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1.3fr); }
.eqd > summary.eqrow > * { grid-column: auto !important; grid-row: auto !important; }
.eqd > summary.eqrow b { color: var(--text); }
.eqf .eqcp { width: 30px !important; height: 30px !important; min-width: 0 !important; min-height: 0 !important; padding: 0 !important; flex: none; }
.eqf .eqcp svg { width: 15px; height: 15px; }
.eqf .eqv { white-space: normal; }
.eqf .eqcp:disabled { opacity: .35; cursor: not-allowed; }
@media (max-width: 820px) { .eqwrap { max-height: none; overflow: visible; } .eqf > span:first-child { max-width: 45%; } .eqv { flex: 1 1 auto; } }
@media (max-width: 820px) { .eqwrap, .eqlist { overflow-x: clip; max-width: 100%; } }
.eqlist.only-narrow { display: none; }
@media (max-width: 820px) { .eqlist.only-narrow { display: flex; } }
.eqcell { display: inline-flex; align-items: center; gap: 8px; }
.eqtable .eqcp { width: 26px !important; height: 26px !important; min-width: 0 !important; min-height: 0 !important; padding: 0 !important; flex: none; }
.eqtable .eqcp svg { width: 14px; height: 14px; }
.eqtable .eqcp:disabled { opacity: .3; cursor: not-allowed; }


/* Función no disponible por la versión de la app del equipo: título, botones y aviso en el rojo suave de la fila de Root */
.vlocked > span, .vlocked .rdnote { color: #d9898c; }
.vlocked input:disabled { color: #d9898c; border-color: rgba(229,72,77,.3); opacity: 1; }
.vlocked .rdrow .btn[data-rd=gen]:disabled, .vlocked .rdrow .btn[data-rd=apply]:disabled, .vlocked .rdrow .btn[data-rd=eye] { color: #d9898c; border-color: rgba(229,72,77,.3); background: rgba(229,72,77,.075); opacity: 1; }
.vlocked .rdrow .btn[data-rd=eye]:disabled { opacity: .6; cursor: not-allowed; }

/* LED de conexión en la lista de equipos (PC y móvil): verde = conectado, el mismo de «online»; gris = sin conexión */
.eqled { width: 11px; height: 11px; box-sizing: border-box; border-radius: 50%; background: #5d616c; border: 2px solid #1f2027; align-self: center; justify-self: center; flex: none; }
.eqled.on { background: var(--green); animation: pulse 2s infinite; }
.eqtable td .eqled { display: inline-block; vertical-align: middle; margin-right: 10px; }
@media (max-width: 820px) { .eqlist .eqrow, .eqd > summary.eqrow { grid-template-columns: 14px minmax(0, 1fr) 64px minmax(0, 1.3fr); } }
@media (prefers-reduced-motion: reduce) { .eqled.on { animation: none; } }

/* Aviso de un grupo en el mapa: el estado de cada equipo, con su punto de color */
.maptip .tipdev { display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
.maptip .tipdev .dot { flex: none; }

/* ---- Becario de Lucas (chat): la pantalla no se mueve, solo se desplaza el chat ---- */
.chatcard { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.chatlog { display: flex; flex-direction: column; gap: 10px; min-height: 280px; overflow-y: auto; overflow-x: hidden; padding: 2px 2px 6px; }
.chmsg { max-width: 82%; padding: 9px 13px; border-radius: 12px; line-height: 1.45; overflow-wrap: anywhere; word-break: break-word; border: 1px solid var(--glass-line); }
.chmsg.me { align-self: flex-end; background: rgba(59,130,246,.14); }
.chmsg.bot { align-self: flex-start; background: rgba(255,255,255,.04); }
.chempty { margin: auto; text-align: center; padding: 30px 10px; }
.chatform { display: flex; gap: 10px; align-items: flex-end; }
.chatform { align-items: stretch; }
.chatform textarea { margin-top: 0; flex: 1 1 auto; height: 44px; min-height: 44px; max-height: 44px; box-sizing: border-box; resize: none; line-height: 22px; padding-top: 10px; padding-bottom: 10px; }
.chatform .btn { flex: 0 0 auto; height: 44px; box-sizing: border-box; }
@media (max-width: 820px) { .chmsg { max-width: 94%; } }
.main:has(#chLog) { display: flex; flex-direction: column; height: 100vh; height: 100dvh; box-sizing: border-box; overflow: hidden; }
.main:has(#chLog) .page-head { flex: none; }
.main:has(#chLog) .chatcard { flex: 1 1 auto; min-height: 0; }
.main:has(#chLog) .chatlog { flex: 1 1 auto; min-height: 0; }
.main:has(#chLog) .chatform { flex: none; }

.chatcard .chstat { flex: none; margin-top: 0; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); }
.chstat .chip b { font-weight: 500; color: var(--muted); }

/* Becario: documentación, historial, herramientas usadas y selector de modelo */
.chatform .pw-btn { height: 44px; width: 44px; flex: none; padding: 0; justify-content: center; }
.chtools { font-size: 12px; margin-top: 6px; }
.doclist { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; margin: 10px 0; }
.docrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--glass-line); border-radius: 10px; }
.docrow .dt { grid-column: 1; font-weight: 600; overflow-wrap: anywhere; }
.docrow .ds { grid-column: 1; font-size: 12.5px; }
.docrow .pw-btn { grid-column: 2; grid-row: 1 / 3; }
.histrow { cursor: pointer; }
.histrow:hover, .histrow:focus-visible { background: rgba(255,255,255,.05); outline: 0; }
.docbtns { display: flex; gap: 10px; flex-wrap: wrap; }
.docbtns .btn { flex: 1 1 auto; justify-content: center; }
.mdlist { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.mdopt { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 2px 10px; padding: 10px 12px; border: 1px solid var(--glass-line); border-radius: 10px; cursor: pointer; }
.mdopt input { grid-row: 1 / 4; align-self: center; margin: 0; }
.mdopt.on { border-color: var(--accent); background: rgba(59,130,246,.08); }
.mdopt .mdn { font-weight: 600; }
.mdopt .mdp, .mdopt .mdd { font-size: 12.5px; }@media (max-width: 820px) {
  .main:has(#chLog) .page-head { display: block; }
  .main:has(#chLog) .page-head .actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; margin-top: 10px; }
  .main:has(#chLog) .page-head .actions .btn { width: 100%; min-width: 0; justify-content: center; padding-left: 6px; padding-right: 6px; }
}

/* Fila del Becario en Ajustes: estado en un campo y los botones; en móvil, el campo arriba y los botones en columnas iguales */
.gmrow { display: flex; gap: 10px; align-items: center; }
.gmrow .pwrow { flex: 1 1 auto; min-width: 0; margin-top: 0; }
.gmrow input { text-overflow: ellipsis; }
.gmbtns { display: flex; gap: 10px; flex: none; }
.gmbtns .btn { white-space: nowrap; }
@media (max-width: 820px) {
  .gmrow { flex-direction: column; align-items: stretch; }
  .gmbtns { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .gmbtns .btn { width: 100%; justify-content: center; padding-left: 6px; padding-right: 6px; }
}
/* Selector de modelo dentro del chat: tres botones iguales con icono, nombre y precio aproximado por pregunta */
.mdseg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; flex: none; }
.mdseg:empty { display: none; }
.mdb { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 0 8px; align-items: center; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--glass-line); background: rgba(255,255,255,.04); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.mdb svg { width: 18px; height: 18px; grid-row: 1 / 3; color: var(--muted); }
.mdb .mdbn { font-weight: 600; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdb .mdbp { font-size: 11.5px; color: var(--muted); line-height: 1.2; white-space: nowrap; }
.mdb:hover { background: rgba(255,255,255,.07); }
.mdb.on { border-color: var(--accent); background: rgba(59,130,246,.10); }
.mdb.on svg { color: var(--accent); }
@media (max-width: 820px) { .mdb { padding: 7px 8px; gap: 0 6px; } .mdb .mdbn { font-size: 12.5px; } }
/* Lo que consultó el Becario, desplegable bajo cada respuesta */
details.chtools summary { cursor: pointer; list-style: none; }
details.chtools summary::-webkit-details-marker { display: none; }
details.chtools summary::after { content: ' ▾'; }
details.chtools[open] summary::after { content: ' ▴'; }
.chtr { margin-top: 8px; }
.chtr b { font-weight: 600; color: var(--text); font-size: 12px; }
.chtr pre { margin: 4px 0 0; padding: 8px 10px; max-height: 180px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 11.5px/1.45 ui-monospace, Menlo, Consolas, monospace; background: rgba(0,0,0,.25); border-radius: 8px; color: #c9ccd4; }
/* Móvil: barra de abajo con iconos y texto un poco más grandes */
@media (max-width: 820px) {
  .nav a { font-size: 12px; gap: 4px; }
  .nav a svg { width: 25px; height: 25px; }
}
@media (max-width: 380px) { .nav a { font-size: 11.5px; } }

/* Contraseña de RustDesk con app antigua: el botón de copiar, igual que el ojo (rojo suave y deshabilitado) */
.vlocked .rdrow .btn[data-rd=copy] { color: #d9898c; border-color: rgba(229,72,77,.3); background: rgba(229,72,77,.075); opacity: 1; }
.vlocked .rdrow .btn[data-rd=copy]:disabled, .vlocked .rdrow .btn[data-rd=eye]:disabled { opacity: .6; cursor: not-allowed; }

/* Iko: el robot delante del nombre, flotando casi sin notarse */
.ikoh { display: flex; align-items: center; gap: 6px; }
.ikobox { display: inline-flex; width: 44px; height: 30px; flex: none; align-items: center; justify-content: center; margin-top: -2px; }
.ikofl { display: block; width: 44px; height: 44px; margin: -7px 0; }
.ikoimg { display: block; width: 44px; height: 44px; pointer-events: none; user-select: none; -webkit-user-drag: none;
  --ix: 0px; --iy: 0px; --ir: 0deg; --is: 1;
  transform: translate(var(--ix), var(--iy)) rotate(var(--ir)) scale(var(--is));
  filter: drop-shadow(0 2px 5px rgba(124, 108, 255, .35)); }
.ikobox.ikolive { cursor: grab; }
.ikobox.ikolive .ikofl { animation: ikofloat 4.6s ease-in-out infinite; }
.ikobox.ikolive.ikohov .ikofl { animation-duration: 2.4s; }
.ikobox.ikolive .ikoimg { transition: transform .55s cubic-bezier(.34, 1.56, .64, 1); }
.ikobox.ikolive.ikohov .ikoimg { transition: transform .22s ease-out; }
@keyframes ikofloat { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-2.5px) rotate(.9deg); } }
@media (prefers-reduced-motion: reduce) { .ikobox .ikofl { animation: none !important; } .ikobox .ikoimg { transition: none !important; } }

.vlocked .rdrow .btn[data-rd=connect] { color: #d9898c; border-color: rgba(229,72,77,.3); background: rgba(229,72,77,.075); opacity: 1; }
.vlocked .rdrow .btn[data-rd=connect]:disabled { opacity: .6; cursor: not-allowed; }
.rdrow .btn[data-rd=connect]:not(:disabled) { color: var(--accent, #7c6cff); }
/* icono de RustDesk: azul cuando se puede usar, apagado o rojo si no */
.rdrow .btn[data-rd=connect] .rdlogo { width: 22px; height: 22px; }
.rdlbg { fill: #2f6bff; }
.rdrow .btn[data-rd=connect]:disabled .rdlbg { fill: currentColor; opacity: .45; }
.rdrow .btn[data-rd=connect]:not(:disabled) { color: inherit; }
.vlocked .rdrow .btn[data-rd=connect] .rdlbg { fill: #d9898c; opacity: .75; }
.rdrow .btn[data-rd=connect] img.rdlogo { width: 22px; height: 22px; display: block; pointer-events: none; }
.rdrow .btn[data-rd=connect]:disabled img.rdlogo { filter: grayscale(1); }
.vlocked .rdrow .btn[data-rd=connect] img.rdlogo { filter: grayscale(1) sepia(1) saturate(2.2) hue-rotate(-30deg); opacity: .8; }
/* RustDesk en la tabla de equipos: a la izquierda de copiar, solo en los conectados */
.eqrd { flex: none; }
.eqrd img.rdlogo { width: 18px; height: 18px; display: block; pointer-events: none; }
.eqrd-gap { display: inline-block; width: 26px; height: 26px; }
.eqf .eqrd-gap { width: 30px; height: 30px; }
.eqrd:disabled img.rdlogo { filter: grayscale(1); }
.eqrd.vlocked { color: #d9898c; border-color: rgba(229,72,77,.3); background: rgba(229,72,77,.075); }
.eqrd.vlocked img.rdlogo { filter: grayscale(1) sepia(1) saturate(2.2) hue-rotate(-30deg); opacity: .8; }
.eqrd.vlocked:disabled { opacity: .6; }

/* Menú al tocar un bocadillo del chat: Copiar y Eliminar */
.chmsg[data-mi] { cursor: pointer; }
.chmsg.chsel { box-shadow: 0 0 0 2px rgba(91,141,239,.55); }
.chmenu { position: fixed; z-index: 60; display: flex; flex-direction: column; min-width: 150px; padding: 5px; border-radius: 12px; background: #23242c; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.chmenu button { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.chmenu button:hover { background: rgba(255,255,255,.07); }
.chmenu button svg { width: 17px; height: 17px; flex: none; }
.chmenu button.danger { color: #e5484d; }

/* Voz en el chat de Iko: micrófono (dictar) y altavoz (leer en voz alta) */
.chatform #chMic.rec { color: #fff; background: #e5484d; border-color: #e5484d; animation: chmicpulse 1.2s ease-in-out infinite; }
.chatform #chSpk.on { color: var(--accent, #7c6cff); border-color: rgba(124,108,255,.5); background: rgba(124,108,255,.12); }
@keyframes chmicpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(229,72,77,.5); } 50% { box-shadow: 0 0 0 6px rgba(229,72,77,0); } }
@media (prefers-reduced-motion: reduce) { .chatform #chMic.rec { animation: none; } }
/* Móvil: la caja de la pregunta ocupa toda la fila y los botones van debajo, repartidos */
@media (max-width: 820px) {
  .chatform { flex-wrap: wrap; }
  .chatform textarea { flex: 1 1 100%; width: 100%; }
  .chatform #chGo { flex: 1 1 auto; justify-content: center; }
}

/* Documentos de Iko: descargar y borrar a la derecha de cada fila */
.docrow .docbt { grid-column: 2; grid-row: 1 / 3; display: flex; gap: 8px; }
.docrow .docbt .pw-btn { grid-column: auto; grid-row: auto; }

/* Iko: modelo en un combo y saldo con moneda (una sola fila) */
.chbar { display: flex; gap: 10px; flex: none; align-items: stretch; }
.chcombo { position: relative; flex: 1 1 auto; min-width: 0; }
.chcoin { position: relative; flex: none; }
.cbtn, .coinb { height: 44px; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--glass-line); background: rgba(255,255,255,.04); color: var(--text); font: inherit; cursor: pointer; }
.cbtn { width: 100%; text-align: left; }
.cbtn:hover, .coinb:hover { background: rgba(255,255,255,.07); }
.cbtn > svg:first-child { width: 18px; height: 18px; flex: none; color: var(--accent); }
.cbn { font-weight: 600; font-size: 14px; white-space: nowrap; }
.cbp { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cbtn > svg:last-child { width: 16px; height: 16px; flex: none; color: var(--muted); }
.coinb { font-weight: 600; font-size: 14px; white-space: nowrap; }
.coinb svg { width: 20px; height: 20px; flex: none; color: #e0a526; }
.coinb.low { border-color: rgba(229,72,77,.5); background: rgba(229,72,77,.1); }
.coinb.low svg, .coinb.low span { color: #e5484d; }
.clist, .coinpop { position: absolute; z-index: 55; top: calc(100% + 6px); padding: 5px; border-radius: 12px; background: #23242c; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.clist { left: 0; right: 0; }
.coinpop { right: 0; min-width: 240px; }
.clist[hidden], .coinpop[hidden] { display: none; }
.copt { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.copt:hover { background: rgba(255,255,255,.07); }
.copt.on { background: rgba(59,130,246,.12); }
.copt svg { width: 18px; height: 18px; color: var(--muted); }
.copt.on svg { color: var(--accent); }
.cot b { display: block; font-size: 14px; font-weight: 600; }
.cot small { display: block; font-size: 12px; color: var(--muted); }
.cop { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.cprow { display: flex; justify-content: space-between; gap: 16px; padding: 7px 9px; font-size: 13.5px; }
.cprow span { color: var(--muted); }
.chtok { margin-top: 5px; font-size: 11.5px; color: var(--muted); text-align: right; }
@media (max-width: 820px) { .cbp { font-size: 12px; } .cbtn, .coinb { padding: 0 10px; gap: 8px; } }
@media (max-width: 420px) { .cbp { display: none; } .cbtn > svg:last-child { margin-left: auto; } }

/* El robot y el nombre, algo más separados */
.ikoh { gap: 14px; }

/* Tarjetas de equipos: al expandir una solo crece esa; las demás de su fila mantienen su altura */
.grid.cards { align-items: start; }

/* Iko en Ajustes: crédito y quitar, cuadrados con solo icono; «Poner clave» en azul a la derecha */
.gmbtns { align-items: stretch; }
.gmbtns .pw-btn { width: 44px; height: 44px; padding: 0; justify-content: center; flex: none; }
.gmbtns .pw-btn svg { width: 18px; height: 18px; }
.gmbtns .btn-primary { height: 44px; }
.gmbtns [hidden] { display: none; }
@media (max-width: 820px) {
  .gmbtns { display: flex; }
  .gmbtns .btn-primary { flex: 1 1 auto; width: auto; }
}
/* Los tres botones de Iko, iguales: cuadrados de 44 con solo icono; la clave, en azul y a la derecha */
.gmbtns .btn, .gmbtns .btn-primary { width: 44px; height: 44px; padding: 0; justify-content: center; flex: none; }
@media (max-width: 820px) {
  .gmbtns { display: flex; justify-content: flex-end; }
  .gmbtns .btn-primary { flex: none; width: 44px; }
}
/* Final: crédito y quitar, cuadrados iguales; «Poner clave», azul, a la derecha y más largo */
.gmbtns .btn-primary { width: auto; min-width: 150px; padding: 0 22px; height: 44px; flex: none; }
.gmbtns .pw-btn { width: 44px; height: 44px; padding: 0; flex: none; }
@media (max-width: 820px) {
  .gmbtns { display: flex; justify-content: stretch; }
  .gmbtns .btn-primary { flex: 1 1 auto; min-width: 0; }
}
/* Iko en Ajustes: exactamente como las filas de arriba (cuadrados de 40 y botón de 120) */
.gmbtns { gap: 8px; align-items: center; }
.gmbtns .pw-btn { width: 40px; height: 40px; padding: 0; flex: none; justify-content: center; }
.gmbtns .pw-btn svg { width: 17px; height: 17px; }
.gmbtns .btn-primary { width: 120px; min-width: 0; height: 40px; padding: 0; flex: none; justify-content: center; }
@media (max-width: 820px) {
  .gmbtns { display: flex; justify-content: flex-end; }
  .gmbtns .btn-primary { flex: none; width: 120px; }
}
/* Iconos de Iko del mismo tamaño que los de arriba (19 px); el de quitar, deshabilitado pero legible */
.gmbtns .pw-btn svg { width: 19px; height: 19px; }
.gmbtns .pw-btn:disabled { opacity: .7; }
/* La papelera dibuja menos área que el ojo o copiar: se agranda para que el trazo se vea igual */
.gmbtns #gmDel svg { width: 25px; height: 25px; }
.gmbtns #gmCr svg { width: 22px; height: 22px; }
/* La papelera de Iko, igual que las del resto de la web: botón de 40 y icono de 19 */
.gmbtns #gmDel svg, .gmbtns #gmCr svg { width: 19px; height: 19px; }

/* Estado del robot en la tarjeta: gris en marcha; ámbar en reposo o transición; rojo apagado o sin robot */
.kpi small.kt-warn { color: #e5a43b; }
.kpi small.kt-bad { color: #ff6b6f; }
/* Panel del saldo: cada dato en una sola fila, con la etiqueta a la izquierda y el valor a la derecha */
.coinpop { width: max-content; min-width: 280px; max-width: calc(100vw - 32px); }
.cprow { white-space: nowrap; align-items: baseline; }
.cprow span { flex: 1 1 auto; text-align: left; }
.cprow b { flex: none; text-align: right; font-weight: 600; }
/* Móvil: los tres botones de Iko reparten la fila a partes iguales, como las filas de arriba */
@media (max-width: 820px) {
  .gmbtns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; justify-content: stretch; }
  .gmbtns .btn, .gmbtns .btn-primary, .gmbtns .pw-btn { width: 100%; min-width: 0; height: 40px; }
}
/* Móvil, pantalla de Iko: en la barra de arriba van el robot y «IKO» en lugar de la marca, y se quita el título de la página para ganar sitio */
.topbar .ikobrand { display: flex; align-items: center; gap: 12px; }
.topbar .ikobrand .ikotb { width: 40px; height: 40px; display: block; }
.topbar .ikobrand b { font-size: 21px; letter-spacing: .04em; font-weight: 700; }
@media (max-width: 820px) {
  .page-head > div:first-child:has(.ikoh) { display: none; }
  .page-head:has(.ikoh) { margin-top: 0; }
}
.topbar .ikobrand b { letter-spacing: 0; text-transform: none; }
/* Móvil: la barra de arriba en el mismo sitio en todas las pantallas, y logo, avatar y salir de la misma altura */
@media (max-width: 820px) {
  .main:has(#chLog), .main:has(#usersHost, #actHost, #setHost) { padding-top: 0; }      /* en estas pantallas el contenedor recorta y la barra se quedaba 14 px más abajo */
  .topbar { padding-top: 8px; padding-bottom: 8px; align-items: center; }
  .topbar .brand, .topbar .ikobrand { height: 40px; align-items: center; }
  .topbar .brand img, .topbar .ikobrand .ikotb { width: 40px; height: 40px; }
  .topbar-user { height: 40px; align-items: center; gap: 8px; }
  .topbar .avatar { width: 40px; height: 40px; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
  .topbar [data-logout] { width: 40px; height: 40px; padding: 0; justify-content: center; }
}
