:root {
  --brand: #f1649f;
  --brand-hover: #d94e88;
  --navy: #1a1a3f;
  --bg: #fff;
  --page: #f4f5f8;
  --fg: #1f2937;
  --heading: #0f172a;
  --border: #e5e7eb;
  --muted: #6b7280;
  --muted-bg: #eef0f4;
  --font: Avenir, "Avenir Next", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { color: var(--heading); font-size: 22px; margin: 0; }

/* Shell con menú lateral */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex: none; background: var(--bg); border-right: 1px solid var(--border);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 0; align-self: flex-start; height: 100vh;
}
/* Tipografía del logotipo (Archivo Black, OFL): misma familia que PANDORA. */
@font-face {
  font-family: "Archivo Black";
  src: url("fonts/archivo-black.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
.sidebrand { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 2px 8px; width: 100%; max-width: 176px; }
.sidebrand:hover { text-decoration: none; }
.plogo { display: block; width: 100%; max-width: 160px; }
.plogo img { display: block; width: 100%; height: auto; }
.plogo .light { display: none; }
html:not(.dark) .plogo .dark { display: none; }
html:not(.dark) .plogo .light { display: block; }
.pname { align-self: flex-end; color: var(--brand); font-family: "Archivo Black", var(--font); font-size: 11.5px; line-height: 1; letter-spacing: .05em; }
.tag { background: var(--navy); color: #fff; border-radius: 5px; padding: 1px 6px; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--fg); font-weight: 500; font-size: 14px;
}
.sidenav a:hover { background: var(--muted-bg); text-decoration: none; }
.sidenav a.active { background: rgba(241, 100, 159, .16); color: var(--brand); font-weight: 600; }
.sidenav .i { width: 18px; text-align: center; }
.sidefoot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.who { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn { border: 1px solid var(--border); background: transparent; border-radius: 8px; padding: 6px 9px; cursor: pointer; color: var(--fg); }

.content { flex: 1; min-width: 0; }
main { max-width: 1024px; margin: 0 auto; padding: 28px 24px 48px; }
footer { max-width: 1024px; margin: 0 auto; padding: 0 24px 40px; color: var(--muted); font-size: 12px; }

/* Tarjetas */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 3px rgba(15,18,38,.06); padding: 16px; }
.pagebar { margin-bottom: 14px; }

/* Tablas */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--border); }
.tbl td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .c { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; color: var(--heading); }
.truncate { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.devcell { display: flex; align-items: center; gap: 10px; }
.devcell .os { font-size: 18px; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }

/* Pills de estado */
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 600; line-height: 1.4; }
.pill.ok { background: #22c55e; color: #fff; }
.pill.bad { background: #ef4444; color: #fff; }
.pill.muted { background: var(--muted-bg); color: var(--muted); }

/* Botones */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 100px; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--fg); background: transparent; cursor: pointer; }
.btn:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); color: #fff; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); font-size: 13px; }

/* Bento de resumen */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; justify-content: center; }
.bento { padding: 0; border: none; box-shadow: none; background: transparent; }
.bento .tile { box-shadow: 0 1px 3px rgba(15,18,38,.06); }
.grow2 { grid-column: span 2; }
.rowcenter { display: flex; align-items: center; gap: 10px; }
.devname { font-size: 24px; }
.big { font-size: 22px; font-weight: 700; color: var(--heading); }
.val { font-size: 14px; }
.k { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 2px; }
.emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }

/* Solapas */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border); margin: 20px 0 0; }
.tabs a { padding: 8px 14px; border: 2px solid transparent; border-radius: 8px 8px 0 0; color: var(--muted); font-size: 14px; margin-bottom: -1px; }
.tabs a:hover { color: var(--brand); text-decoration: none; }
.tabs a.active { border-color: var(--brand); border-bottom-color: var(--bg); color: var(--brand); font-weight: 600; background: var(--bg); }
.tabs + .card { margin-top: 0; border-top-left-radius: 0; }

/* Login */
.auth-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: var(--page); }
.auth { width: 100%; max-width: 380px; padding: 24px; }
.authform { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 3px rgba(15,18,38,.06); padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.authform h1 { font-size: 22px; }
.authform .brand { color: var(--brand); }
.authform label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.authform input { border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 14px; font-family: var(--font); color: var(--fg); background: transparent; }
.authform input:focus { outline: 2px solid rgba(31,158,147,.35); border-color: var(--brand); }

.flash { border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }
.flash.err { background: #fdecec; color: #b91c1c; }

@media (max-width: 820px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; width: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .sidenav { flex-direction: row; overflow-x: auto; }
  .bento { grid-template-columns: 1fr 1fr; }
  .grow2 { grid-column: span 2; }
}

/* Ficha: gauge, franja de actividad, avisos */
.tilecenter { align-items: center; gap: 6px; }
.gauge { position: relative; width: 96px; height: 96px; }
.gcenter { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gpct { font-size: 22px; font-weight: 700; color: var(--heading); line-height: 1; }
.gval { font-size: 11px; color: var(--muted); margin-top: 2px; }
.strip { margin-top: 12px; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 40px; border-bottom: 1px dashed var(--border); }
.bars span { flex: 1; background: var(--brand); border-radius: 1px; min-height: 2px; }
.bars.mini { height: 22px; width: 110px; border-bottom: none; }
.bars.mini span { background: #22c55e; }
.bars.mini span.risk { background: #ef4444; }
.vrow { display: flex; align-items: center; gap: 8px; }
.warn { color: #dc2626; font-size: 17px; line-height: 1; }
a.icon-link { color: #9ca3af; text-decoration: none; }
a.icon-link:hover { color: var(--brand); text-decoration: none; }

/* Informe y resumen (modales) */
.striphead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
dialog.dlg { border: 1px solid var(--border); border-radius: 12px; padding: 0; width: min(780px, 92vw); box-shadow: 0 20px 50px rgba(0,0,0,.5); color: var(--fg); background: var(--bg); }
dialog.dlg.dlg-wide { width: min(1020px, 95vw); }
dialog.dlg::backdrop { background: rgba(0,0,0,.5); }
.dlghead { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.dlghead h3 { margin: 0; font-size: 17px; color: var(--heading); }
.dlgclose { border: none; background: transparent; font-size: 16px; cursor: pointer; color: var(--muted); }
.dlgbody { padding: 18px; min-height: 120px; }
.rangechips { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 18px 0; }
.chip { border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 12px; background: transparent; color: var(--fg); cursor: pointer; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.rchart { display: flex; align-items: flex-end; gap: 2px; height: 180px; border-bottom: 1px dashed var(--border); }
.rbar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.rbar > div { width: 100%; }
.rstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.sec { color: var(--heading); font-size: 15px; margin: 22px 0 8px; }

/* Acciones y formularios */
.flash.ok { background: #e7f6ef; color: #137a52; }
.inlineform { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.inlineform label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.inlineform input, .inlineform select { border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: var(--font); background: transparent; color: var(--fg); }
.inlineform .grow { flex: 1; min-width: 200px; }
.inlineform .grow input { width: 100%; }
.actionsrow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.checkline { flex-direction: row !important; align-items: center; gap: 6px !important; }
.btn.danger { border-color: #ef4444; color: #dc2626; }
.btn.danger:hover { background: #ef4444; color: #fff; border-color: #ef4444; }
.tok { display: block; margin-top: 6px; background: var(--muted-bg); border-radius: 8px; padding: 10px 12px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; }

/* Barra de acciones y formularios en modal */
.actionsbar { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.dlgcol { display: flex; flex-direction: column; gap: 12px; }
.fcol { display: flex; flex-direction: column; gap: 10px; }
.fcol label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.fcol input, .fcol select { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 14px; font-family: var(--font); background: transparent; color: var(--fg); }
.selfstart { align-self: flex-start; }
.selfend { display: flex; justify-content: flex-end; }

/* Gráficas de resumen */
.charts { margin-top: 22px; }
.chartshead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chartshead h2 { font-size: 18px; }
.charts2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 10px; }
.charts2 > * { min-width: 0; }
.charts2 .wide { grid-column: span 2; }
.charttitle { font-size: 14px; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.insttitle { display: flex; align-items: center; gap: 8px; }
.insttitle svg { flex: none; }
.pie { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.piesvg { flex: none; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; max-height: 176px; overflow: auto; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend .sw { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.legend .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .val { color: var(--muted); font-size: 12px; white-space: nowrap; }
a.chip { text-decoration: none; }
.empty { padding: 24px 0; text-align: center; }
@media (max-width: 820px) { .charts2 { grid-template-columns: 1fr; } .charts2 .wide { grid-column: span 1; } }
.loginwrap { display: flex; justify-content: center; }

/* Tema claro/oscuro */
html { color-scheme: light; }
html.dark { color-scheme: dark; }
.dark {
  --brand: #f1649f;
  --brand-hover: #d94e88;
  --bg: #1a1a3f;
  --page: #0f1226;
  --fg: #e6eaf5;
  --heading: #f8fafc;
  --border: #2a2a55;
  --muted: #9aa3b8;
  --muted-bg: #232350;
}
.dark .sidebar { background: var(--bg); }
.dark .tag { background: #f1649f; color: #fff; }
.dark .flash.ok { background: #12331f; color: #7ee2a8; }
.dark .flash.err { background: #3a1620; color: #f3a3b0; }
.dark .tok { background: var(--muted-bg); }
.tbtn { border: 1px solid var(--border); background: transparent; border-radius: 8px; padding: 6px 9px; cursor: pointer; color: var(--fg); }
.sidefoot-actions { display: flex; align-items: center; gap: 6px; }

/* Ficha V3.1: lateral de identidad + banda donut/KPIs + actividad verde/rojo */
.devlayout { display: grid; grid-template-columns: 260px 1fr; gap: 12px; align-items: stretch; }
.devlayout .side { padding: 18px; display: flex; flex-direction: column; }
.osblock { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
.osicon { font-size: 26px; line-height: 1; }
.oslines { padding-top: 4px; }
.osname { font-size: 14px; color: var(--heading); font-weight: 600; }
.osver { font-size: 10px; color: var(--muted); }
.sidebtns { display: flex; gap: 8px; margin-top: auto; padding-top: 16px; }
.sidebtns .btn { flex: 1; justify-content: center; }
.devmain { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.band { padding: 18px; display: flex; align-items: center; gap: 26px; }
.band .gauge { width: 132px; height: 132px; }
.kpigrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 30px; flex: 1; }
.kpi-val { font-size: 15px; }
.act { padding: 16px 18px; }
.acthead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.actlegend { display: flex; gap: 14px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.actlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.sw-ok { background: #22c55e; }
.sw-bad { background: #ef4444; }
.hbars { display: flex; align-items: flex-end; gap: 2px; height: 44px; border-bottom: 1px dashed var(--border); margin-top: 10px; }
.hbars span { flex: 1; background: #22c55e; border-radius: 1px; min-height: 2px; }
.hbars span.risk { background: #ef4444; }
@media (max-width: 820px) { .devlayout { grid-template-columns: 1fr; } .band { flex-wrap: wrap; } }

/* Caja lateral v2 */
.sidtop { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.idleft { min-width: 0; }
.idright { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex: none; color: var(--muted); }
.idright svg { display: block; }
.osname { font-size: 14px; font-weight: 700; color: var(--heading); margin-top: 6px; }
.osver { font-size: 11px; color: var(--muted); }
.sidmid { margin-top: 14px; }
.sidbot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 16px; }
.icoactions { display: flex; gap: 8px; }
.icobtn { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 9px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.icobtn:hover { color: var(--text, var(--fg)); border-color: var(--muted); }

/* Informe: 4 estadísticas y dato no autorizado */
.rstats4 { grid-template-columns: repeat(4, 1fr); }
.rdark { color: #ef4444; }
@media (max-width: 820px) { .rstats4 { grid-template-columns: 1fr 1fr; } }
.rangechips { align-items: center; }

/* Icono de SO en el listado */
.os-ico { display: inline-flex; align-items: center; color: var(--muted); }

/* Diálogo Acciones: mensaje en fila + acciones juntas */
.frow { display: flex; gap: 10px; align-items: flex-end; }
.frow label { flex: 1; }
.frow input { width: 100%; }
.dlgrow { display: flex; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 14px; }

/* Aviso: permiso de Accesibilidad (macOS) */
.warnbanner { border: 1px solid #f59e0b; background: rgba(245, 158, 11, .12); border-radius: 10px; padding: 14px 16px; margin: 12px 0 0; }
.warnbanner .wb-title { color: #f59e0b; font-weight: 700; margin-bottom: 6px; }
.warnbanner ol { margin: 8px 0 0 18px; }
.warnbanner li { margin-bottom: 3px; }
.warnbanner code { background: var(--muted-bg); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.warnmark { color: #f59e0b; margin-left: 6px; }

/* Bloque de comandos (asistente de instalación) */
pre.code { background: var(--muted-bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; max-width: 100%; box-sizing: border-box; font-family: ui-monospace, Menlo, monospace; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.tbl .os-ico svg { width: 16px; height: 16px; }
.tbl .os-ico { margin-right: 6px; vertical-align: -3px; }

/* ID del tenant (instalación de agentes) */
.tenantbox { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-left: 4px solid var(--brand); }
.tenantid { font-family: ui-monospace, Menlo, monospace; font-size: 30px; font-weight: 700; letter-spacing: 3px; color: var(--brand); margin: 6px 0; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; }
.catgrid { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 8px; }
.proftitle { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.renamerow { display: flex; align-items: center; gap: 8px; }
.renamerow input { border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 15px; font-weight: 600; font-family: var(--font); background: transparent; color: var(--fg); min-width: 220px; }
.cisel, .ciinp { border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; font-size: 13px; font-family: var(--font); background: transparent; color: var(--fg); }
.fcol input:disabled { opacity: .55; }

/* Solapas + filtros de periodo en la misma línea */
.tabsbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 20px 0 0; }
.tabsbar .tabs { border-bottom: 0; margin: 0; }
.tabsbar .rangechips { padding: 0; }
.periodform { display: flex; align-items: center; gap: 8px; }
select.periodsel { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; font-family: var(--font); background: var(--bg); color: var(--fg); }
select.periodsel:focus { outline: none; border-color: var(--brand); }
.tabsbar + .card { margin-top: 0; border-top-left-radius: 0; }
.tabsbar + .charts2 { margin-top: 0; }

/* Análisis IA: modal redimensionable, gráficas + texto */
.aidlg { width: 780px; height: 640px; min-width: 520px; min-height: 320px; max-width: 95vw; max-height: 92vh; resize: both; overflow: hidden; }
.aidlg[open] { display: flex; flex-direction: column; }
.aidlg .aibody { flex: 1; overflow: auto; padding: 12px 18px 4px; }
.aidlg .aimeta { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.aicharts { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-bottom: 14px; }
.chartcard { background: var(--muted-bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.chart-h { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 10px; }
.chart-h svg { color: var(--brand); flex: none; }
.aibars { display: flex; flex-direction: column; gap: 7px; }
.aibar { display: grid; grid-template-columns: 118px 1fr 46px; align-items: center; gap: 8px; font-size: 12.5px; }
.aibar .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aibar .t { background: var(--border); border-radius: 6px; height: 14px; overflow: hidden; }
.aibar .t i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.aibar .v { text-align: right; color: var(--muted); }
.aipie { display: flex; align-items: center; gap: 12px; }
.aipie svg { flex: none; }
.ailegend { list-style: none; margin: 0; padding: 0; font-size: 12.5px; display: flex; flex-direction: column; gap: 5px; }
.ailegend li { display: flex; align-items: center; gap: 7px; }
.ailegend .sw { width: 10px; height: 10px; border-radius: 2px; }
.ailegend .p { margin-left: auto; color: var(--muted); }
.aifoot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px 16px; border-top: 1px solid var(--border); }
.md { font-size: 13px; line-height: 1.55; }
.md h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--brand); margin: 14px 0 4px; }
.md h4:first-child { margin-top: 0; }
.md p { margin: 4px 0; }
.md ul { margin: 4px 0; padding-left: 18px; }
.md li { margin: 3px 0; }
.aimatiz { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.45); border-radius: 8px; padding: 8px 11px; font-size: 12.5px; line-height: 1.5; }
@media (max-width: 640px) { .tenantid { font-size: 24px; } }

/* Catálogo de uso: categorías de apps y dominios */
.cataloglegend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chipcat { display: inline-flex; align-items: center; gap: 6px; background: var(--muted-bg); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.catpick { display: flex; align-items: center; gap: 7px; width: 240px; max-width: 100%; }
select.catsel { appearance: none; -webkit-appearance: none; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 8px; padding: 6px 26px 6px 10px; font-size: 13px; font-family: inherit; flex: 1 1 auto; width: 100%; min-width: 0; cursor: pointer; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; }
select.catsel:focus { outline: none; border-color: var(--brand); }
select.catsel.unset { border-style: dashed; border-color: #f59e0b; color: #b45309; }
.dark select.catsel.unset { color: #f4c26b; }
select.catsel.err { border-color: #ef4444; }
.catsaved { margin-left: 6px; font-size: 11.5px; color: #16a34a; }
.catpill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.catintro { margin: 0 0 8px; }
.whencell { display: inline-flex; align-items: center; gap: 6px; }
.gcount { font-size: 11px; font-weight: 700; color: var(--brand); background: rgba(241,100,159,.14); border-radius: 999px; padding: 1px 7px; flex: none; }
button.sumico { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0; line-height: 0; display: inline-flex; vertical-align: middle; }
button.sumico:hover { color: var(--brand); }
button.sumico svg { display: block; }

/* Pestaña Límites */
.limcard { margin-top: 14px; }
.limtitle h3 { margin: 0 0 2px; }
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 6px; }
.prof { display: flex; align-items: center; gap: 10px; background: var(--muted-bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.prof.on { border-color: var(--brand); }
.prof input { width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.prof .nm { font-size: 13.5px; font-weight: 600; }
.prof .ct { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.limzero { color: #ef4444; font-weight: 600; }
.addrow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.addrow label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.addrow input, .addrow select { border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: var(--font); background: transparent; color: var(--fg); }
.limtip { display: flex; gap: 9px; align-items: flex-start; background: var(--muted-bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.pill.info { background: rgba(59, 130, 246, .18); color: #3b82f6; }
.dark .pill.info { color: #7cb0f7; }

/* Pestaña Capturas */
.capactions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.capgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 8px; }
.capitem { margin: 0; background: var(--muted-bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.capitem a { display: block; }
.capitem img { display: block; width: 100%; height: 170px; object-fit: cover; background: #000; }
.capitem figcaption { display: flex; align-items: center; gap: 8px; padding: 8px 10px; flex-wrap: wrap; }
.capitem figcaption .muted { margin-right: auto; }

/* Sección Informes */
.repcard { margin-bottom: 16px; }
.rephead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.repname { font-size: 17px; font-weight: 700; color: var(--heading); display: flex; align-items: center; gap: 9px; }
.repname a { color: var(--heading); text-decoration: none; }
.repname a:hover { color: var(--brand); }
.repname svg { width: 18px; height: 18px; }
.osb { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--muted-bg); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; }
.reptotal { text-align: right; }
.reptotal b { font-size: 19px; color: var(--heading); display: block; margin-top: 2px; }
.repbars { display: flex; align-items: flex-end; gap: 4px; height: 96px; margin-top: 14px; border-bottom: 1px dashed var(--border); }
.repbars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.repbars .b i { display: block; background: linear-gradient(180deg, #f1649f, #c2477c); border-radius: 3px 3px 0 0; min-height: 2px; }
.repaxis { display: flex; gap: 4px; margin-top: 5px; }
.repaxis span { flex: 1; text-align: center; font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.repdonuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 16px; border-top: 1px solid var(--border); padding-top: 16px; }
.repd { min-width: 0; }
.repd .k { margin-bottom: 4px; }
.repd .pie { flex-direction: column; align-items: center; gap: 10px; }
.repd .piesvg { width: 140px; height: 140px; }
.repd .legend { width: 100%; max-height: none; }
@media (max-width: 1000px) { .repdonuts { grid-template-columns: 1fr; } }

/* Filtros de Sesiones WEB: todo en una línea, compacto. */
.navfilters { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 12px; }
.navfilters > label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.navfilters select { border: 1px solid var(--border); border-radius: 7px; padding: 4px 8px; font-size: 12px; font-family: var(--font); background: var(--bg); color: var(--fg); }
.navfilters select:focus { outline: none; border-color: var(--brand); }
/* Interruptor */
.navfilters label.sw { cursor: pointer; user-select: none; color: var(--fg); }
.sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw .track { width: 32px; height: 18px; border-radius: 999px; background: #8b90a8; position: relative; transition: background .15s; flex: none; }
.sw .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.sw input:checked + .track { background: var(--brand); }
.sw input:checked + .track::after { transform: translateX(14px); }
.sw input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Sesiones WEB: URL + dominio, duración en dos líneas, categoría con icono. */
.navtbl { table-layout: fixed; }
.navtbl td { overflow: hidden; }
.navtbl th:nth-child(2), .navtbl td:nth-child(2) { width: 128px; }
.navtbl th:nth-child(3), .navtbl td:nth-child(3) { width: 78px; }
.actcell .vrow { min-width: 0; }
.vurl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); font-size: 13px; }
.vurl:hover { color: var(--brand); }
.actcell .sumico { flex: none; }
.vsub { margin-top: 1px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.durcell { font-size: 12px; line-height: 1.4; white-space: nowrap; }
.durcell .muted { font-size: 11px; }
.cat-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cat-ico-wrap { display: inline-flex; }
.catpick.ico { position: relative; display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; }
.catpick.ico select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.catpick.ico:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.catsprites { position: absolute; width: 0; height: 0; overflow: hidden; }
.catcell { position: relative; }
.catcell .catsaved { position: absolute; left: calc(50% + 12px); top: 50%; transform: translateY(-50%); margin: 0; }

/* Login split (variante B): marca a la izquierda, formulario a la derecha. */
.auth-split { max-width: none; width: 100%; padding: 0; }
.login-split { display: grid; grid-template-columns: 1.12fr .88fr; min-height: 100vh; background: #f6f7fb; color: #1a1a3f; }
.login-brand { position: relative; overflow: hidden; padding: 54px 60px; display: flex; flex-direction: column; color: #e6eaf5;
  background: radial-gradient(700px 500px at 0% 0%, rgba(241,100,159,.20), transparent 60%), linear-gradient(155deg,#1a1a3f 0%,#0f1226 78%); }
.lockup.lb { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.lockup.lb .wm { display: block; width: 206px; height: auto; }
.lockup.lb .bb { display: flex; align-items: center; gap: 8px; color: #f1649f; font-family: "Archivo Black", var(--font); font-size: 15px; line-height: 1; letter-spacing: .04em; }
.lockup.lb .beta { font-family: var(--font); font-size: 9px; font-weight: 700; letter-spacing: .06em; color: #1a1a3f; background: #f1649f; border-radius: 5px; padding: 2px 6px; }
.login-copy { margin: auto 0; padding: 46px 0 34px; }
.login-brand h2 { margin: 0 0 14px; max-width: 500px; color: #fff; font-size: 37px; line-height: 1.14; letter-spacing: -.02em; }
.login-brand .lead { margin: 0 0 32px; max-width: 440px; color: #b9c0d4; font-size: 16px; line-height: 1.6; }
.login-brand .feats { display: flex; flex-direction: column; gap: 15px; max-width: 430px; }
.login-brand .feat { display: flex; gap: 13px; align-items: flex-start; }
.login-brand .feat .fic { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: rgba(241,100,159,.14); color: #f1649f; }
.login-brand .feat b { display: block; margin: 1px 0 3px; color: #fff; font-size: 14px; }
.login-brand .feat div span { color: #9aa3b8; font-size: 13px; line-height: 1.45; }
.login-brand .login-brandfoot { color: #5b6480; font-size: 11.5px; }
.login-formside { display: grid; place-items: center; padding: 48px 40px; }
.login-formbox { width: 100%; max-width: 370px; }
.login-formbox h1 { margin: 0 0 7px; color: #1a1a3f; font-size: 27px; letter-spacing: -.01em; }
.login-formbox .sub { margin: 0 0 28px; color: #5b6180; font-size: 14px; }
.loginform { display: flex; flex-direction: column; gap: 16px; }
.loginform label { display: flex; flex-direction: column; gap: 7px; color: #4b5563; font-size: 12px; }
.loginform input { padding: 12px 14px; border: 1px solid #d8dce8; border-radius: 10px; background: #fff; color: #1a1a3f; font-family: var(--font); font-size: 14px; outline: none; }
.loginform input::placeholder { color: #9aa0b0; }
.loginform input:focus { border-color: #d94e88; box-shadow: 0 0 0 3px rgba(217,78,136,.12); }
.loginform .btn.primary { justify-content: center; margin-top: 6px; padding: 13px 18px; border: 0; border-radius: 999px; background: #d94e88; color: #fff; font-size: 15px; font-weight: 700; }
.loginform .btn.primary:hover { background: #c8457c; color: #fff; }
.loginform .authalt { margin: 0; text-align: center; color: #5b6180; font-size: 13px; }
.loginform .authalt a { color: #b23a6d; font-weight: 600; }
.auth-split .flash { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 50; width: min(520px, calc(100vw - 40px)); margin: 0; box-shadow: 0 10px 30px rgba(0,0,0,.28); }
@media (max-width: 920px) {
  .login-split { grid-template-columns: 1fr; align-content: start; }
  .login-brand { padding: 34px 28px; }
  .login-brand h2 { font-size: 29px; }
  .login-brand .feats { display: none; }
  .login-copy { margin: 28px 0 6px; padding: 0; }
  .login-formside { padding: 34px 24px 44px; }
}

/* Actividad de entrada (teclas/clics) */
.inputcard { margin-bottom: 14px; }
.ihead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.ihead .charttitle { margin: 0 0 2px; }
.itot { font-size: 12px; color: var(--muted); white-space: nowrap; }
.itot b { color: var(--fg); font-size: 13px; }
.iheat { margin-top: 2px; }
.irow { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.irl { width: 42px; flex: none; font-size: 10.5px; color: var(--muted); }
.icells { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; flex: 1; }
.icells i { display: block; height: 18px; border-radius: 3px; }
.ihours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; margin-left: 50px; margin-top: 5px; }
.ihours span { font-size: 8.5px; color: var(--muted); text-align: center; }
.ilegend { display: flex; align-items: center; gap: 5px; margin-top: 8px; }
.ilegend i { width: 12px; height: 9px; border-radius: 2px; display: inline-block; }
.ipeak { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.iapps { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 4px; }
.iapps h4 { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 9px; }
.iapp { display: grid; grid-template-columns: 110px 1fr 60px; align-items: center; gap: 10px; margin-bottom: 8px; }
.iapp .an { font-size: 12.5px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iapp .abar { height: 7px; border-radius: 99px; background: var(--muted-bg); display: block; overflow: hidden; }
.iapp .abar i { display: block; height: 100%; border-radius: 99px; }
.iapp .av { font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .iapps { grid-template-columns: 1fr; } .iapp { grid-template-columns: 90px 1fr 55px; } }
