/* --- Tipografía: Avenir ------------------------------------------------------
   Avenir Next LT W02 (Regular/Medium/Demi/Bold), los mismos ficheros que sirve el
   ITSM de Pandora. Se sirven desde aquí (no del ITSM) para que no dependan de él
   y se cacheen con la app. */
@font-face {
  font-family: "Avenir"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("avenir.woff2") format("woff2"), url("avenir.woff") format("woff");
}
@font-face {
  font-family: "Avenir"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("avenir-medium.woff2") format("woff2"), url("avenir-medium.woff") format("woff");
}
@font-face {
  font-family: "Avenir"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("avenir-demi.woff2") format("woff2"), url("avenir-demi.woff") format("woff");
}
@font-face {
  font-family: "Avenir"; font-style: normal; font-weight: 700 900; font-display: swap;
  src: url("avenir-bold.woff2") format("woff2"), url("avenir-bold.woff") format("woff");
}

:root {
  /* Pandora Cloud — sistema de color (Look C: navy + cobalt + amarillo) */
  --navy: #1A1A3F;
  --brand: #F5BB00;
  --bg: #F5F7FB;
  --panel: #FFFFFF;
  --surface2: #F3F6FB;
  --field: #FFFFFF;
  --border: #D9DFEA;
  --ink: #1F2747;
  --muted: #667085;
  --accent: #3B82F6;
  --accent2: #2563EB;
  --ok: #16A34A;
  --warn: #F59E0B;
  --down: #EF4444;
  --recover: #0EA5A0;
  --on-status: #FFFFFF;
  --on-warn: #1A1A3F;
  --code-bg: #1A1A3F;
  --code-ink: #E6EAF5;
  --danger-bg: #FEF2F2;
  --danger-border: #FCA5A5;
  --danger-ink: #B42318;
  --flashok-bg: #ECFDF3;
  --flashok-border: #A6F4C5;
  --flashok-ink: #067647;
  --flasherr-bg: #FEF3F2;
  --flasherr-border: #FDA29B;
  --flasherr-ink: #B42318;
  --inc-bg: #FEF3F2;
  --inc-border: #FDA29B;
  --inc-ink: #B42318;
  --btn-bg: #FFFFFF;
  --btn-bg-hover: #F3F6FB;
  --track: #E9EEF6;
  --chart-bg: #FFFFFF;
  --inset: rgba(16,24,40,.07);
  --btn-ink: #475467;
  --border-soft: #E7EBF2;
  --shadow-1: 0 1px 2px rgba(16,24,40,.05);
  --shadow-2: 0 20px 50px rgba(16,24,40,.28), 0 2px 6px rgba(16,24,40,.10);
  --font: Avenir, "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
body.dark {
  --bg: #0F1226;
  --panel: #1A1A3F;
  --surface2: #232350;
  --field: #0F1226;
  --border: #2A2A55;
  --border-soft: #232350;
  --btn-ink: #C7CEE0;
  --shadow-1: 0 1px 2px rgba(0,0,0,.35);
  --shadow-2: 0 20px 50px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.35);
  --ink: #E6EAF5;
  --muted: #9AA3B8;
  --accent: #3B82F6;
  --accent2: #60A5FA;
  --ok: #22C55E;
  --warn: #F59E0B;
  --down: #EF4444;
  --recover: #22D3EE;
  --on-status: #FFFFFF;
  --on-warn: #1A1A3F;
  --code-bg: #0B0E20;
  --code-ink: #E6EAF5;
  --danger-bg: #3A1D1D;
  --danger-border: #6B2B2B;
  --danger-ink: #FFB3AD;
  --flashok-bg: #12261A;
  --flashok-border: #1F6F37;
  --flashok-ink: #7EE787;
  --flasherr-bg: #2B1618;
  --flasherr-border: #6B2B2B;
  --flasherr-ink: #FFB3AD;
  --inc-bg: #3A1D1D;
  --inc-border: #6B2B2B;
  --inc-ink: #FFFFFF;
  --btn-bg: #232350;
  --btn-bg-hover: #2C2C60;
  --track: #232350;
  --chart-bg: #0F1226;
  --inset: rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent2); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

header.top {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px; background: var(--navy); border-bottom: 1px solid #2A2A55;
}
header.top .brand { font-weight: 700; color: #E6EAF5; font-size: 17px; }
header.top .logo { color: var(--brand); }
header.top .tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  background: var(--brand); color: var(--navy); border-radius: 6px; padding: 2px 6px; margin-left: 6px;
}
header.top nav { display: flex; gap: 18px; }
header.top nav a { color: #CFCFE6; }
header.top nav a:hover { color: #FFFFFF; text-decoration: none; }
header.top .who { margin-left: auto; display: flex; align-items: center; gap: 12px; color: #B9B9D6; }

main { max-width: 1040px; margin: 0 auto; padding: 28px 24px 60px; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin: 28px 0 10px; color: var(--ink); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-1); }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); }
th { color: var(--ink); font-weight: 700; font-size: 13.5px; white-space: nowrap; background: var(--panel); }
tbody tr:hover { background: var(--surface2); }
tr:last-child td { border-bottom: none; }

.pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--border); color: var(--muted);
}
.pill.st-ok { color: var(--on-status); background: var(--ok); border-color: var(--ok); }
.pill.st-down { color: white; background: var(--down); border-color: var(--down); }
.pill.st-failing { color: var(--on-warn); background: var(--warn); border-color: var(--warn); }
.pill.st-recovering { color: var(--on-status); background: var(--recover); border-color: var(--recover); }

form label { display: block; margin: 12px 0; color: var(--muted); }
input, select {
  width: 100%; margin-top: 4px; padding: 9px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--field); color: var(--ink); font-size: 14px;
}
input:focus, select:focus { outline: 1px solid var(--accent2); border-color: var(--accent2); }
/* Selector de color: cuadrado con muestra visible (el input base lo colapsaba a una raya). */
input[type="color"] { width: 48px; height: 32px; padding: 3px; margin-top: 4px; cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
input[type="color"]::-moz-color-swatch { border: 0; border-radius: 5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .actions { grid-column: 1 / -1; margin-top: 8px; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 8px; cursor: pointer; font-family: inherit;
  border: 1px solid var(--border); background: var(--btn-bg); color: var(--btn-ink);
  font-size: 14px; font-weight: 600; line-height: 1.2;
  box-shadow: var(--shadow-1);
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, color .12s ease;
}
button:hover, .button:hover { background: var(--btn-bg-hover); text-decoration: none; }
button.primary, .button.primary {
  background: linear-gradient(180deg, #5C9DFF 0%, var(--accent) 100%);
  border-color: #2F6FE4; color: #FFFFFF;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), var(--shadow-1);
}
button.primary:hover, .button.primary:hover {
  background: linear-gradient(180deg, #4C92FF 0%, var(--accent2) 100%);
  border-color: var(--accent2);
}
button:disabled, .button:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
button.danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-ink); }
button.link { background: none; border: none; box-shadow: none; color: var(--accent2); padding: 0; }
button.link.danger { color: var(--down); }

.auth { max-width: 420px; margin: 40px auto; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 28px; }
.auth.wide { max-width: 680px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.flash.ok { background: var(--flashok-bg); border: 1px solid var(--flashok-border); color: var(--flashok-ink); }
.flash.err { background: var(--flasherr-bg); border: 1px solid var(--flasherr-border); color: var(--flasherr-ink); }

.spark { display: block; background: transparent; border: 0; }
footer { max-width: 1040px; margin: 0 auto; padding: 0 24px 40px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; }

/* --- auth (login/registro) --- */
body.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(26,26,63,.14), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(59,130,246,.16), transparent 55%),
    radial-gradient(600px 400px at 50% 110%, rgba(245,187,0,.10), transparent 60%),
    var(--bg);
}
body.auth-body main { display: flex; flex-direction: column; min-height: 100vh; max-width: none; padding: 0; }
.authwrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; }
.authcard {
  width: 100%; max-width: 420px; background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
  border: 1px solid var(--border); border-radius: 16px; padding: 36px 32px 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(6px);
}
.authlogo {
  margin: 0 auto 16px; border-radius: 14px; padding: 14px 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy); border: 1px solid #2A2A55;
  box-shadow: 0 10px 30px rgba(26,26,63,.55);
  width: fit-content;
}
.authlogo img { display: block; width: 190px; max-width: 100%; height: auto; }
header.top .brandlogo { display: block; height: 26px; width: auto; max-width: 170px; }
header.top .brand { display: flex; align-items: center; gap: 8px; }
.authcard h1 { text-align: center; font-size: 24px; margin: 0 0 4px; }
.authtag { text-align: center; color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.authform label { margin: 14px 0; }
.authform input { padding: 11px 12px; }
button.block, .button.block { width: 100%; margin-top: 10px; padding: 12px; font-weight: 600; }
.authalt { text-align: center; color: var(--muted); margin: 18px 0 0; font-size: 14px; }
.authfoot { color: var(--muted); font-size: 12px; margin-top: 18px; }
.hint { color: var(--muted); font-weight: 400; font-size: 12px; }
.authperks { list-style: none; padding: 0; margin: 18px 0 0; color: var(--muted); font-size: 13px; }
.authperks li { padding: 4px 0 4px 20px; position: relative; }
.authperks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); }

/* --- consola de eventos --- */
.filters { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; margin-bottom: 12px; }
.filters label { margin: 0; display: flex; flex-direction: column; font-size: 11px; color: var(--muted); }
.filters input, .filters select { margin-top: 3px; min-width: 0; padding: 4px 7px; font-size: 12px; }
.filters input[name="q"] { width: 150px; }
.filters button { padding: 6px 12px; font-size: 13px; }
.toolbar { display: flex; align-items: center; gap: 8px; margin: 10px 0 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.toolbar .button { padding: 6px 12px; font-size: 13px; }
.toolbar form { display: inline; }
.nowrap { white-space: nowrap; }
tr.acked td { opacity: .55; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.st-ok { background: var(--ok); }
.dot.st-down { background: var(--down); }
.dot.st-failing { background: var(--warn); }
.dot.st-recovering { background: var(--recover); }
.dot.st-system { background: var(--muted); }
.pill.st-system { color: var(--muted); }
.form-grid .wide2 { grid-column: 1 / -1; }

textarea {
  width: 100%; margin-top: 4px; padding: 9px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--field); color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; resize: vertical;
}
.inlineform { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.inlineform select { max-width: 420px; }
.rowactions { display: flex; gap: 14px; }
.rowactions form { display: inline; }

pre.code { background:var(--code-bg); color:var(--code-ink); padding:12px 14px; border-radius:8px; overflow:auto; font-size:12px; border:1px solid var(--border); }
code.token { display:inline-block; background:var(--code-bg); color:var(--code-ink); border:1px solid var(--border); padding:3px 8px; border-radius:6px; word-break:break-all; }
.signals { display: block; }
.signal { margin-bottom: 16px; overflow: hidden; }
.signalhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.signal pre { margin: 6px 0; }
.signal table { border: 0; background: transparent; }
.signal > table, .signal .jsontbl { width: 100%; }
.signal .jsontbl { border-collapse: collapse; font-size: 13px; margin: 6px 0; }
.signal .jsontbl td, .signal .jsontbl th {
  border: 0; border-bottom: 1px solid var(--border); padding: 5px 10px 5px 0; vertical-align: top;
}
.signal .jsontbl th { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.signal .jsontbl .jk { color: var(--muted); white-space: nowrap; width: 1%; padding-right: 16px; }
.signal .jsontbl .jsontbl { margin: 0; }
tr:last-child .jsontbl td, .jsontbl tr:last-child td { border-bottom: 0; }

/* --- pestañas del panel, chips de estado y submenú --- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin: 26px 0 16px; }
.tab {
  padding: 9px 16px; border-radius: 9px 9px 0 0; color: var(--muted);
  text-decoration: none; font-size: 14px; border: 1px solid transparent; border-bottom: 0;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { background: var(--panel); color: var(--ink); border-color: var(--border); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-block; padding: 1px 9px;
  border-radius: 999px; font-size: 11px; border: 1px solid var(--border); background: var(--surface2); color: var(--ink);
}
.chip b { font-size: 11px; font-weight: 700; }
.chip.ok { background: var(--ok); border-color: var(--ok); color: var(--on-status); }
.chip.warn { background: var(--warn); border-color: var(--warn); color: var(--on-warn); }
.chip.down { background: var(--down); border-color: var(--down); color: #fff; }
.chip.unknown { background: var(--surface2); border-color: var(--border); color: var(--ink); }
.chip.inc { background: var(--inc-bg); border-color: var(--inc-border); color: var(--inc-ink); }
header.top nav .has-sub { position: relative; }
header.top nav .sub {
  display: none; position: absolute; top: 100%; left: 0; background: var(--panel);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px; min-width: 190px;
  box-shadow: 0 12px 30px rgba(0,0,0,.45); z-index: 20;
}
header.top nav .has-sub:hover .sub { display: block; }
header.top nav .sub a { display: block; padding: 7px 10px; border-radius: 6px; white-space: nowrap; }
header.top nav .sub a:hover { background: var(--surface2); text-decoration: none; }

/* --- tarjetas del panel (deck) --- */
.deck { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 18px; }
.deck .card { padding: 22px 24px; position: relative; background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0)), var(--panel); }
.eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.card .tenant { font-size: 24px; margin: 5px 0 0; letter-spacing: -.01em; }
.stats { display: flex; flex-wrap: wrap; gap: 26px; margin: 18px 0 2px; }
.stat b { font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.stat b small { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.stat span { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }
.groupkey { margin-top: 16px; }
.card.cta { display: flex; flex-direction: column; }
.ctaicon {
  width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; color: var(--navy); margin-bottom: 14px;
  background: linear-gradient(135deg, var(--brand), #FFD75A);
  box-shadow: 0 10px 24px rgba(245,187,0,.35);
}
.card.cta h2 { font-size: 20px; margin: 0 0 6px; }
.card.cta p { margin: 0 0 16px; }
.card.cta .button { margin-top: auto; align-self: flex-start; }
@media (max-width: 760px) { .deck { grid-template-columns: 1fr; } }

/* --- configuración: tema claro, uso de licencia --- */
.checkline { display: flex; align-items: center; gap: 9px; color: var(--ink); margin: 12px 0; cursor: pointer; }
.checkline input { width: auto; margin: 0; }
.usage { margin-top: 8px; display: grid; gap: 16px; max-width: 540px; }
.ubar { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; }
.ubar b { font-weight: 700; }
.utrack { margin-top: 6px; height: 8px; background: var(--track); border-radius: 999px; overflow: hidden; }
.ufill { height: 8px; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 999px; }

/* --- pasos de configuración --- */
.steps { margin: 6px 0 16px 18px; padding: 0; line-height: 1.6; }
.steps li { margin: 3px 0; }
.steps code { background: rgba(127,127,127,.18); padding: 1px 5px; border-radius: 5px; }

/* --- tema claro: legibilidad --- */

/* --- aviso de cuota y modal --- */
.quotaalert { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.warnbtn {
  width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--warn); color: var(--on-warn); font-weight: 800; font-size: 15px; line-height: 1;
}
.modal { position: fixed; inset: 0; background: rgba(11,15,26,.62); display: flex; align-items: flex-start;
  justify-content: center; padding: 20px; z-index: 100; overflow-y: auto; }
/* NORMA: `hidden` manda. Un `display` propio (.button, .optbtn…) gana al
   atributo por especificidad, y el elemento seguía viéndose (los botones
   "Atrás"/"Siguiente" de los asistentes, por ejemplo). */
[hidden] { display: none !important; }
.modal[hidden] { display: none; }
.modalbox {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 22px 24px;
  max-width: 520px; width: 100%; box-shadow: var(--shadow-2);
  /* NORMA UI: los modales deben caber en pantalla (tope de alto + scroll interno) */
  margin: auto; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto;
}
.modalbox h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.modalbox > .viewerhead { position: sticky; top: 0; background: var(--panel); z-index: 3;
  padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.modalbox p { color: var(--muted); }

/* --- visor de datos (modal con gráfica) --- */
.sparkwrap { display: inline-block; cursor: pointer; border-radius: 6px; }
.sparkwrap:hover { background: rgba(127,127,127,.12); }
/* Script generado por el asistente de señales: cabe en pantalla y hace scroll */
.swscript { max-height: 300px; overflow: auto; white-space: pre; }

.modalbox.viewer { max-width: 980px; }
.viewerhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.viewertitle { font-size: 18px; font-weight: 700; }
.viewertoolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.viewertoolbar .spacer { flex: 1; }
.rangebtn {
  padding: 5px 11px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--muted); cursor: pointer; font-size: 12px;
}
.rangebtn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.viewerchart { position: relative; }
.viewerchart svg { width: 100%; height: auto; display: block; background: var(--chart-bg); border: 1px solid var(--border); border-radius: 10px; cursor: crosshair; touch-action: none; }
.chartip {
  position: absolute; pointer-events: none; background: var(--navy); color: #fff; border: 1px solid #2A2A55;
  border-radius: 6px; padding: 5px 8px; font-size: 12px; white-space: nowrap; transform: translateX(-50%); z-index: 5;
}

/* --- visor: ajustes de espacio y controles --- */
.modalbox.viewer { max-width: 1080px; }
.viewerchart { overflow: hidden; }
.viewerchart svg { width: 100%; height: auto; aspect-ratio: 1200 / 336; }
/* Histograma de estados bajo la gráfica (mismo lapso; alineado con el área de dibujo). */
.viewerstates { display: flex; gap: 2px; height: 10px; margin-top: 6px; padding: 0 1.4% 0 5.2%; }
.viewerstates[hidden] { display: none; }
.viewerstates .statebar { flex: 1 1 0; min-width: 2px; border-radius: 2px; background: var(--muted); opacity: .3; }
.viewerstates .statebar.ok { background: var(--ok); opacity: .8; }
.viewerstates .statebar.warn { background: var(--warn); opacity: .9; }
.viewerstates .statebar.down { background: var(--down); opacity: .9; }
.viewerstates .statebar.recover { background: var(--recover); opacity: .85; }
.viewertoolbar label { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.viewertoolbar select { margin: 0; padding: 7px 10px; width: auto; }
.iconbtn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--btn-bg); color: var(--btn-ink); text-decoration: none;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow-1);
}
.iconbtn:hover { background: var(--btn-bg-hover); text-decoration: none; }

/* --- asistente de endpoints/satélite --- */
.modalbox.wizard { max-width: 780px; }
/* Formularios con muchos campos (alta de chequeo): anchos para no apiñarse */
.modalbox.form { max-width: 900px; }
.modalbox.form .form-grid { gap: 2px 22px; }
.modalbox.form textarea { min-height: 62px; }
.wsteps { display: flex; gap: 8px; margin: 4px 0 18px; flex-wrap: wrap; }
.wstep { font-size: 12px; color: var(--muted); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); }
.wstep.active { color: var(--ink); border-color: var(--accent); background: rgba(59,130,246,.12); font-weight: 600; }
.optcard {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; margin: 10px 0;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: rgba(127,127,127,.04);
}
.optcard:hover { border-color: var(--accent); }
.optcard input { width: auto; margin-top: 3px; }
.optcard .otitle { display: block; }
.optcard .odesc { display: block; margin-top: 4px; }
.opts { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.optbtn {
  padding: 12px 18px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--btn-bg); color: var(--ink); cursor: pointer; font-size: 14px;
}
.optbtn.active { border-color: var(--accent); background: rgba(59,130,246,.16); }
.wstatus { display: flex; align-items: center; margin-top: 14px; color: var(--muted); }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border);
  border-top-color: var(--accent2); display: inline-block; animation: spin 0.9s linear infinite; margin-right: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.wresult { margin-top: 14px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); font-size: 14px; }
.wresult.ok { background: var(--flashok-bg); border-color: var(--flashok-border); color: var(--flashok-ink); }
.wfooter { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.wfooter .spacer { flex: 1; }

/* --- botones de SO con icono --- */
.optbtn { display: inline-flex; align-items: center; gap: 9px; }
.osico { width: 20px; height: 20px; flex: none; }

/* --- submenú de navegación: legible en ambos temas --- */
header.top nav .sub a { color: var(--ink); font-weight: 500; }
header.top nav .sub a:hover { background: var(--bg); color: var(--ink); text-decoration: none; }

/* --- dashboards, métricas y página de estado --- */
.dashgrid { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 70px; gap: 14px; }
.dashwidget { min-height: 120px; }
.dashwtitle { font-weight: 700; margin-bottom: 8px; }
.dashwhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dashwhead .dashwtitle { margin-bottom: 0; }
.minitable { width: 100%; border-collapse: collapse; font-size: 12px; background: transparent; border: 0; }
.minitable td { border: 0; padding: 2px 6px 2px 0; }
.boardhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }
.dashwidget { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.dashwidget .dashwhead { cursor: grab; border-radius: 8px; transition: background .12s, box-shadow .12s; }
.dashwtitle::before { content: "⠿"; color: var(--muted); opacity: .4; margin-right: 6px; font-size: 13px; }
.dashwidget:hover .dashwhead { background: var(--surface2); box-shadow: inset 0 0 0 1px var(--border); }
.dashwidget:hover .dashwtitle::before { opacity: 1; color: var(--accent2); }
.dashwidget:hover .dash-resize { opacity: 1; }
.dashwidget.dragging { opacity: .85; outline: 2px dashed var(--accent2); outline-offset: 2px; z-index: 5; }
.dash-resize { position: absolute; right: 3px; bottom: 3px; width: 16px; height: 16px; cursor: se-resize; z-index: 4;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); border-radius: 0 0 4px 0; opacity: .55; }
.dash-resize:hover { opacity: 1; border-color: var(--accent2); }
.fab { position: fixed; right: 24px; bottom: 24px; z-index: 25;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); border-radius: 999px; padding: 12px 18px; }
.dashchart { flex: 1 1 auto; min-height: 72px; display: flex; margin-top: 6px; }
.dashchart .sparkwrap { flex: 1 1 auto; display: flex; min-width: 0; }
.dashchart .sparkfill { width: 100%; height: 100%; display: block; }
.dashvalue { font-size: 30px; font-weight: 700; }
.dashevlist { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.dashev { display: flex; align-items: center; gap: 8px; padding: 4px 7px; border-radius: 7px; font-size: 12.5px; min-width: 0; }
.dashev.st-ok { background: rgba(22,163,74,.08); }
.dashev.st-failing { background: rgba(245,158,11,.13); }
.dashev.st-down { background: rgba(239,68,68,.12); }
.dashev.st-recovering { background: rgba(14,165,160,.11); }
.dashev.st-system { background: rgba(102,112,133,.08); }
.dashevbar { flex: none; width: 5px; align-self: stretch; border-radius: 3px; background: #9aa7b4; }
.dashev.st-ok .dashevbar { background: var(--ok); }
.dashev.st-failing .dashevbar { background: var(--warn); }
.dashev.st-down .dashevbar { background: var(--down); }
.dashev.st-recovering .dashevbar { background: var(--recover); }
.dashevtext { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashevago { flex: none; }
.dashwacts { display: flex; gap: 4px; align-items: center; }
.dashcheck { display: flex; flex-direction: column; flex: 1 1 auto; margin-top: 10px; }
.dashcheckhead { display: flex; align-items: center; gap: 8px; }
.dashchecktitle { font-weight: 600; }
.dashval { margin-left: auto; font-weight: 800; font-size: 18px; }
.dashval.val-down { color: var(--down); }
.dashval.val-warn { color: var(--warn); }
.dashval.val-ok { color: var(--ink); }
.dashval.val-unknown { color: var(--muted); }
.dashcheck .dashchart { flex: 1 1 auto; min-height: 64px; }
/* Solo el dato: la cifra llena el widget (autoajuste por JS) */
.dashcheck.value-only { flex: 1 1 auto; }
.dashval.fill { flex: 1 1 auto; display: flex; align-items: center; justify-content: center;
  margin: 0; line-height: 1; overflow: hidden; }
.dashinclist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dashinc { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.dashinctitle { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
.dashinctitle:hover { text-decoration: underline; }
.dashincago { flex: none; }
.worldmap .wmpin.pin-down { background: var(--down); box-shadow: 0 0 0 3px rgba(239,68,68,.30), 0 1px 3px rgba(0,0,0,.55); }
.worldmap .wmpin.pin-warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(224,161,58,.30), 0 1px 3px rgba(0,0,0,.55); }
.worldmap .wmpin.pin-ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(34,197,94,.30), 0 1px 3px rgba(0,0,0,.55); }
.worldmap .wmpin.pin-unknown { background: #9aa7b4; box-shadow: 0 0 0 3px rgba(154,167,180,.28), 0 1px 3px rgba(0,0,0,.55); }
body.auth-body main { align-items: center; }
.statuspage { width: 100%; max-width: 900px; margin: 0 auto; padding: 28px 20px 60px; }
.statushead { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }

/* Ficha de host/agente (endpoint) */
.hostcard { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin: 6px 0 18px; }
.hosthead { display: flex; align-items: center; gap: 12px; }
.hosthead h1 { margin: 0; font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Espacio RESERVADO para alias + descripción: así lo de detrás (tipo, histograma,
   filtros) cae siempre en el mismo sitio y no baila según el largo del nombre. */
.hosthead-main { display: flex; flex-direction: column; flex: 0 0 300px; min-width: 0; }
.hostdesc { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .hosthead-main { flex: 1 1 auto; } }
.osbadge { font-size: 26px; line-height: 1; }
.osbadge.small { font-size: 15px; }
.typechip { border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 132px; text-align: center; }
.kv2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 28px; margin: 14px 0 0; }
.kv2 > div { display: flex; gap: 10px; }
.kv2 dt { color: var(--muted); min-width: 150px; }
.kv2 dd { margin: 0; }
@media (max-width: 720px) { .kv2 { grid-template-columns: 1fr; } }

/* Tabla de hosts/agentes del panel */
table.hosts td.agentname a { white-space: nowrap; }
table.hosts td.agentname { min-width: 190px; }
table.hosts th.iconcol, table.hosts td.iconcol { width: 44px; text-align: center; }
.hosticon { font-size: 20px; line-height: 1; }

/* Editor de umbrales por módulo */
.thred { margin-top: 4px; }
.thred summary { cursor: pointer; }
.thrform { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end; margin: 6px 0 2px; }
.thrform label { display: block; font-size: 12px; color: var(--muted); }
.thrform input, .thrform select { font-size: 12px; padding: 2px 4px; }

/* Logs */
.logfilters { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; margin: 10px 0; }
.logfilters label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.logfilters input, .logfilters select { font-size: 13px; }
table.logtable td, table.logtable th { vertical-align: top; }
.logmsg { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-word; }

/* Modal de umbrales (compacto) */
.thrbox { max-width: 470px; }
/* Configurar chequeo: modal más ancho y en dos columnas (más ancho que alto). */
.modalbox.probebox { max-width: 860px; }
.modalbox.probebox .probeform { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; align-items: end; }
.modalbox.probebox .probeform > label,
.modalbox.probebox .probeform > div { min-width: 0; }
.modalbox.probebox .probeform .wide2 { grid-column: 1 / -1; }
.modalbox.probebox .probeform [data-when-thr] { grid-column: 1 / -1; }
.modalbox.probebox .probeform .actions { grid-column: 1 / -1; }
.thrlink { display: inline-block; text-align: left; margin-top: 6px; }
.thrform { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; align-items: stretch; }
/* NORMA de interfaz: la etiqueta va ENCIMA del control, a ancho completo, y el texto
   fluye en una sola línea (nunca se parte por elementos inline sueltos). Por eso las
   labels son `display:block` y no `flex-direction:column`. */
.thrform > label { display: block; font-size: 13px; color: var(--muted); }
.thrgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.thrgrid label { display: block; font-size: 13px; color: var(--muted); }
.thrform input, .thrform select { font-size: 14px; padding: 6px 8px; }

/* Sub-pestañas de Notificaciones */
.tabs.nsub { margin: 10px 0 16px; }
.tabs.nsub .tab { font-size: 13px; padding: 6px 12px; }

/* Etiqueta de logs en el panel */
.chip.logs { background: var(--accent); color: #fff; text-decoration: none; }
.chip.logs:hover { opacity: .9; }
/* Burbuja de señales del agente: gris muy claro, es información, no un estado */
.chip.sig { background: var(--surface2); border-color: var(--border-soft); color: var(--muted); text-decoration: none; }
.chip.sig:hover { color: var(--ink); border-color: var(--border); }

/* Rueda de configuración (métricas / módulos) */
.gear { font-size: 32px; line-height: 1; }

/* Ayuda contextual (?) */
.hint { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px;
  border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font-size: 11px; font-weight: 700;
  cursor: help; position: relative; margin-left: 6px; vertical-align: middle; }
.hint::after { content: attr(data-tip); position: absolute; left: 0; top: 140%;
  background: var(--panel); color: var(--ink); border: 1px solid var(--border); padding: 9px 11px; border-radius: 8px;
  width: 320px; max-width: 72vw; font-size: 12px; font-weight: 400; line-height: 1.45; text-align: left;
  opacity: 0; visibility: hidden; transition: opacity .12s; z-index: 60; box-shadow: 0 10px 28px rgba(0,0,0,.45); white-space: normal; }
.hint:hover::after { opacity: 1; visibility: visible; }

/* Consola de eventos: fondo por estado + barra lateral (borde izquierdo, ancho fijo) */
tr.evrow.st-ok td { background: rgba(22,163,74,.08); }
tr.evrow.st-failing td { background: rgba(245,158,11,.13); }
tr.evrow.st-down td { background: rgba(239,68,68,.12); }
tr.evrow.st-recovering td { background: rgba(14,165,160,.11); }
tr.evrow.st-system td { background: rgba(102,112,133,.08); }
tr.evrow.acked td { opacity: .6; }
tr.evrow td:first-child { border-left: 5px solid transparent; }
tr.evrow.st-ok td:first-child { border-left-color: var(--ok); }
tr.evrow.st-failing td:first-child { border-left-color: var(--warn); }
tr.evrow.st-down td:first-child { border-left-color: var(--down); }
tr.evrow.st-recovering td:first-child { border-left-color: var(--recover); }
tr.evrow.st-system td:first-child { border-left-color: var(--muted); }
td.evactions { white-space: nowrap; }
td.evactions form { display: inline; }
td.evactions .link { padding: 2px 4px; vertical-align: middle; }

/* Barra de título compacta + migas de pan */
.pagebar { background: var(--bg); border-bottom: 1px solid var(--border); }
.pb-inner { max-width: 1040px; margin: 0 auto; padding: 14px 24px 12px; display: flex; align-items: center; gap: 14px; }
.pagebar h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0; display: flex; align-items: center; }
.pagebar .spacer { flex: 1; }
.crumbs { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent2); text-decoration: none; }
.crumbs .sep { opacity: .5; }
.iconbtn { background: none; border: 1px solid transparent; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; }
.iconbtn:hover { color: var(--ink); background: rgba(127,127,127,.15); }
.modalclose, .viewerclose { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 8px; padding: 4px 9px; cursor: pointer; font-size: 13px; line-height: 1.2; }
.modalclose:hover, .viewerclose:hover { color: var(--ink); border-color: var(--muted); }
main { padding-top: 18px; }

/* Iconos de acción de eventos */
td.evactions svg { width: 22px; height: 22px; }
td.evactions .ev-ok { color: var(--ok); }
td.evactions .ev-ok:hover { opacity: .75; }
td.evactions .ev-del { color: var(--muted); }
td.evactions .ev-del:hover { color: var(--down); }

/* Sección activa en el menú */
header.top nav a.active { color: #FFFFFF; border-bottom: 2px solid var(--brand); padding-bottom: 2px; }

/* Filtros de logs compactos a todo el ancho */
.logfilters { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; width: 100%; margin: 0 0 8px; }
.logfilters label { margin: 0; display: flex; flex-direction: column; font-size: 11px; color: var(--muted); white-space: nowrap; }
.logfilters input, .logfilters select { margin-top: 3px; min-width: 0; padding: 4px 7px; font-size: 12px; }
.logfilters .grow { flex: 1 1 260px; }
.logfilters .grow input { width: 100%; }
.logfilters .actions { display: flex; align-items: center; gap: 10px; }
.logfilters button { padding: 6px 12px; font-size: 13px; }
main { padding-top: 12px; }

/* Enlace "volver" dentro de la tarjeta del host (esquina superior derecha) */
.hostcard { position: relative; }
.hosttools { position: absolute; top: 12px; right: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; z-index: 2; }
.htrow { display: flex; align-items: center; gap: 12px; }
.backlink { color: var(--accent2); font-size: 13px; white-space: nowrap; }
.backlink:hover { text-decoration: none; opacity: .85; }

/* Etiquetas de estado: mayúsculas, negrita, algo más pequeñas; verde en blanco */
.pill, .chip { text-transform: uppercase; font-weight: 400; font-size: 11px; }
.pill b, .chip b { font-weight: 700; }
.pill.st-ok, .chip.ok { color: #fff; }

/* Email del header: acceso rápido a Configuración → Cuenta */
header.top .whoemail { color: #B9B9D6; text-decoration: none; }
header.top .whoemail:hover { color: #FFFFFF; text-decoration: none; }

/* Disponibilidad */
.av-ok { color: var(--ok); }
.av-warn { color: var(--warn); }
.av-down { color: var(--down); }

/* Informe: timeline de disponibilidad */
.tlgrid { display: flex; flex-direction: column; gap: 3px; }
.tlrow { display: grid; grid-template-columns: 280px 1fr 64px; align-items: center; gap: 10px; }
.tllabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.tl { display: flex; width: 100%; height: 16px; border-radius: 3px; overflow: hidden; background: var(--ok); }
.tl-seg { flex: 1 1 0; background: var(--ok); }
.tl-seg.down { background: var(--down); }
.tlpct { text-align: right; font-size: 13px; }
.tl-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.tl-key.ok { background: var(--ok); }
.tl-key.down { background: var(--down); }
@media (max-width: 720px) { .tlrow { grid-template-columns: 1fr; } }

/* Informe: gráfica en la tabla de chequeos */
.tlcell { width: 220px; }
.tlcell .tl { height: 12px; }
tr.grouprow td { background: rgba(127,127,127,.10); font-size: 13px; }

/* Mapa de calor (cada celda = un chequeo) */
.heatmap { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.heatrow { display: flex; align-items: center; gap: 10px; }
.heatlabel { width: 190px; flex: 0 0 auto; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heatcells { display: flex; flex-wrap: wrap; gap: 3px; }
.heatcell { width: 16px; height: 16px; border-radius: 3px; display: inline-block; background: var(--muted); }
.heatcell.st-ok { background: var(--ok); }
.heatcell.st-down { background: var(--down); }
.heatcell.st-failing { background: var(--warn); }
.heatcell.st-recovering { background: var(--recover); }
.heatcell.st-system { background: var(--muted); }
.heatlegend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.heatlegend .heatcell { margin-left: 10px; }

/* Filtro del panel */
.tabsrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabsrow .tabs { margin: 0; }
.tabsrow .spacer { flex: 1; }
.tabsrow .dashq { min-width: 220px; padding: 6px 10px; font-size: 13px; }
button.chip { cursor: pointer; font-family: inherit; }
.chips .chip.active { outline: 2px solid var(--accent2); }
.chips .chip.active::after { content: " ✕"; font-weight: 700; }

/* Filtros de estado en la tarjeta del host */
.hostfilters { display: flex; gap: 8px; margin: 0 auto; }
.hostfilters .chip.active { outline: 2px solid var(--accent2); }
.hostfilters .chip.active::after { content: " ✕"; font-weight: 700; }

/* Globo de incidencias del panel como enlace */
a.chip { text-decoration: none; }
.chip.inc:hover { opacity: .85; }

/* Histograma de eventos del agente (cabecera de la ficha) */
a.evhist { display: inline-flex; align-items: center; padding: 2px 5px; border-radius: 6px; line-height: 0; }
a.evhist:hover { background: var(--surface2, #F2F4F7); }
a.evhist svg { display: block; }

/* Filtro de estado de los chequeos del host */
.hostfilters .chip { cursor: pointer; }

/* Cabecera de tabla con acción a la derecha */
.tablehead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tableaction { color: var(--accent2); font-size: 14px; white-space: nowrap; }
.htrow.tools { gap: 16px; }

/* Columna "Recibido": hace cuánto, con la frecuencia en fuente menor */
.freq { font-size: 11px; opacity: .85; }

/* Botón pequeño para acciones en tablas */
.btn-sm { padding: 4px 10px; font-size: 12px; line-height: 1.2; }

/* Filtro de incidencias (abiertas / cerradas / todas) */
.incfilters { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.incfilters .chip { cursor: pointer; }
.incfilters .chip.active { outline: 2px solid var(--accent2); }
.incfilters .chip.active::after { content: " ✕"; font-weight: 700; }

/* Opciones del asistente que se ocultan por tipo (p. ej. macOS en satélite) */
.optbtn[hidden] { display: none; }

/* Selector con buscador y chips (reutilizable) */
.pick { position: relative; }
.pickbox {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  border: 1px solid var(--border); background: var(--field); border-radius: 8px;
  padding: 6px 8px; box-shadow: inset 0 1px 2px var(--inset);
}
.pickbox:focus-within { outline: 1px solid var(--accent2); border-color: var(--accent2); }
.pick .pickq {
  width: auto; flex: 1 1 140px; min-width: 140px; margin: 0; padding: 0; line-height: 21px;
  border: 0; background: transparent; box-shadow: none;
}
/* El foco lo marca la caja entera (.pickbox:focus-within), no el input */
.pick .pickq:focus { outline: none; border-color: transparent; box-shadow: none; }
.pickchips { display: flex; flex-wrap: wrap; gap: 4px; }
.pickchip {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(59,130,246,.14);
  border: 1px solid rgba(59,130,246,.35); color: var(--ink); border-radius: 4px;
  padding: 4px 6px 4px 12px; font-size: 12px; line-height: 1.2;
}
.pickx {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  padding: 0; margin: 0; width: 16px; height: 16px; border-radius: 4px; font-size: 11px; line-height: 1;
}
.pickx:hover { color: var(--ink); background: rgba(127,127,127,.18); }
.pickx:hover { color: var(--ink); }
.pickmenu {
  position: absolute; z-index: 70; left: 0; right: 0; top: 100%; margin-top: 4px; max-height: 220px; overflow: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 12px 30px rgba(16,24,40,.18);
}
.pickopt { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; cursor: pointer; color: var(--ink); font-size: 13px; }
.pickopt:hover { background: var(--surface2); }
/* Variante "fichas": el menú se pinta como chips de colores (p. ej. etiquetas). */
.pickmenu.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; }
.pickopt.chip { display: inline-block; width: auto; border-radius: 6px; padding: 5px 12px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.pickopt.chip:hover { filter: brightness(.94); }
.pickchip.chipc { border-color: transparent; }
/* Opción ya seleccionada (se puede quitar volviendo a clicarla). */
.pickopt.on { color: var(--muted); }
.pickopt.on::after { content: "✓"; float: right; font-weight: 700; }
.pickopt.chip.on { color: inherit; opacity: .6; box-shadow: 0 0 0 2px var(--accent2); }
.pickopt.chip.on::after { content: ""; float: none; }
.pickempty { padding: 8px 10px; color: var(--muted); font-size: 12px; }
.wkdays { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 6px 0; }
.wkdays .checkline { margin: 0; }

/* Modo silencioso: bolita junto a la burbuja de estado */
.silentdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 6px; vertical-align: middle; border: 1px solid rgba(0,0,0,.12); }
.silentdot.sd-none { background: #98A2B3; }
.silentdot.sd-events { background: #60A5FA; }
.silentdot.sd-incidents { background: #A16207; }
.silentdot.sd-alerts { background: #F5BB00; }
.silentdot.sd-data { background: #16A34A; }
.silentdot.sd-off { background: #667085; }
.pill.st-disabled { color: var(--muted); background: var(--surface2); border-color: var(--border); }

/* Icono de ayuda con cajita al pasar el ratón (contenido con saltos de línea). */
.infotip { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px;
  border-radius: 50%; border: 1px solid var(--border); color: var(--muted); background: var(--surface2);
  font-size: 11px; font-weight: 700; font-style: normal; line-height: 1; cursor: help;
  margin-left: 6px; vertical-align: middle; user-select: none; }
.infotip:hover, .infotip:focus { color: var(--ink); border-color: var(--accent); outline: none; }
.tipbox { position: fixed; z-index: 300; max-width: 360px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow-2);
  font-size: 12.5px; line-height: 1.55; color: var(--ink); }
.tipbox b { color: var(--ink); font-weight: 700; }

/* Logs en la ficha del agente: burbujas por módulo */
.hlogchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.hlogchips .chip { cursor: pointer; }
.hlogchips .chip.active { outline: 2px solid var(--accent2); }
.hlogchips .chip.active::after { content: " ✕"; font-weight: 700; }

/* Logs del agente: buscador + filas + botones en la misma fila */
.hlogform { margin: 0 0 10px; }
.hlogform .hlogrow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.hlogform label { display: flex; flex-direction: column; margin: 0; font-size: 11px; color: var(--muted); white-space: nowrap; }
.hlogform .grow { flex: 1 1 320px; min-width: 180px; }
.hlogform .grow input { width: 100%; margin-top: 3px; }
.hlogform select { margin-top: 3px; }

/* Métricas: acciones alineadas a la derecha y semáforo (umbrales) a la izquierda de la rueda */
.metricactions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.thrlight { display: inline-flex; align-items: center; line-height: 0; opacity: .95; }

/* Métricas: columnas de ancho fijo para que todos los grupos cuadren */
table.metrics { table-layout: fixed; }
table.metrics th:first-child { width: 30%; }
table.metrics th:nth-child(5) { width: 20%; }
table.metrics th.actcol { width: 52px; }
table.metrics td:first-child code { white-space: normal; word-break: break-all; }

/* --- Paginación numerada (estilo ITSM) ------------------------------------- */
.pager {
  display: inline-flex; align-items: stretch; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-1);
}
.pager .pg {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  min-width: 44px; height: 40px; padding: 0 13px;
  font-size: 14px; font-weight: 600; color: var(--btn-ink);
  border-right: 1px solid var(--border); text-decoration: none;
}
.pager .pg:last-child { border-right: none; }
.pager a.pg:hover { background: var(--btn-bg-hover); text-decoration: none; color: var(--ink); }
.pager .pg.on { background: var(--navy); color: #FFFFFF; font-weight: 800; }
.pager .pg.off { color: var(--muted); opacity: .55; cursor: default; }
.pager .pg.dots { min-width: 34px; padding: 0; color: var(--muted); letter-spacing: 2px; }
.pager .pg.num { min-width: 44px; padding: 0; font-variant-numeric: tabular-nums; }
.toolbar.bottom { margin: 14px 0 0; }

/* --- Acciones de diálogo (con la acción peligrosa a la derecha) --- */
.actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.actions .push { margin-left: auto; }
.confirmchk {
  display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 11px 13px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface2);
  font-size: 14px; color: var(--ink); cursor: pointer;
}
.confirmchk input { width: auto; margin: 2px 0 0; }
button.danger:disabled { opacity: .5; cursor: not-allowed; }

/* --- Señales: catálogo de vistas (spec pandora.signal/v1) --- */
.sigr { display: block; margin: 6px 0 2px; }
.sigr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 26px; align-items: start; }
.sigr-grid .sigp.w1 { grid-column: span 1; }
.sigr-grid .sigp.w2 { grid-column: span 2; }
.sigr-grid .sigp.w3 { grid-column: span 3; }
.sigr-grid .sigp.w4 { grid-column: span 4; }
@media (max-width: 720px) { .sigr-grid { grid-template-columns: 1fr; } .sigr-grid .sigp { grid-column: span 1; } }
.sigptitle { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 3px; }
/* Los datos de una señal se leen EN COLUMNA: una pareja por línea, la etiqueta a
   la izquierda y el valor (o el estado) alineados a su derecha, como una tabla.
   `display: contents` hace que dt y dd caigan directamente en la rejilla. */
.sigkv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; margin: 0; font-size: 13.5px; }
.sigkv > div { display: contents; }
.sigkv dt { color: var(--muted); }
.sigkv dd { margin: 0; font-weight: 500; }
.sigtable { width: 100%; border-collapse: collapse; font-size: 12.5px; background: transparent; box-shadow: none; }
.sigtable th, .sigtable td { padding: 7px 10px; border-bottom: 1px solid var(--border-soft); }
.sigtable th { font-size: 12px; color: var(--muted); }
.sigstatus { gap: 2px 14px; }
.siglog { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; max-height: 260px; overflow: auto; }
.siglog > div { padding: 3px 0; border-bottom: 1px solid var(--border-soft); }
.sigstat { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.sigstat .u { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 5px; }
.sigstat.st-down { color: var(--down); }
.sigstat.st-failing { color: var(--warn); }
.siggauge .barbg { height: 10px; background: var(--track); border-radius: 999px; overflow: hidden; }
.siggauge .barfill { height: 100%; background: var(--accent); }
.siggauge .barfill.st-down { background: var(--down); }
.siggauge .barfill.st-failing { background: var(--warn); }
.sigts svg.sigsvg { width: 100%; height: 90px; color: var(--accent); }
.siglinks { display: flex; flex-wrap: wrap; gap: 12px; font-size: 14px; }
.sigtext { font-size: 14px; line-height: 1.5; }

/* Fila señalada al llegar por ancla: /hosts/{id}#chk-{chequeo} */
tr:target { background: var(--surface2); box-shadow: inset 3px 0 0 var(--accent); }

/* --- Barra superior: búsqueda global y conmutador de tema --- */
header.top .topsearch {
  position: relative; margin-left: auto; flex: 0 1 300px; min-width: 120px;
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px;
  /* Mismo aspecto que un control de formulario normal (ver `input, select`). */
  background: var(--field); border: 1px solid var(--border); border-radius: 8px;
}
header.top .topsearch .tsicon { display: inline-flex; align-items: center; color: var(--muted); font-size: 14px; line-height: 1; }
header.top .topsearch input {
  flex: 1; min-width: 0; margin: 0; padding: 0; height: auto;
  background: transparent; border: 0; outline: 0;
  color: var(--ink); font: inherit; font-size: 14px; line-height: 1;
}
header.top .topsearch input::placeholder { color: var(--muted); }
header.top .topsearch input::-webkit-search-cancel-button { opacity: .5; }
header.top .who { margin-left: 0; }

.tsdrop {
  position: absolute; top: calc(100% + 6px); right: 0; width: 440px; max-width: 82vw;
  max-height: 62vh; overflow: auto; z-index: 60; padding: 6px;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-2);
}
.tsdrop[hidden] { display: none; }
.tsgroup {
  padding: 7px 10px 3px; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.tsrow {
  display: flex; flex-direction: column; gap: 1px; padding: 7px 10px;
  border-radius: 7px; color: var(--ink);
}
.tsrow:hover, .tsrow.sel { background: var(--surface2); text-decoration: none; }
.tsrow .tstitle { font-size: 14px; font-weight: 600; }
.tsrow .tssub { font-size: 12px; color: var(--muted); }
.tsempty { padding: 10px; font-size: 13px; color: var(--muted); }
.tsall { display: block; padding: 8px 10px; font-size: 13px; color: var(--accent2); font-weight: 600; }

/* El icono del conmutador muestra a qué modo se cambia (sol en oscuro). */
.themebtn .tsun { display: none; }
body.dark .themebtn .tsun { display: inline-flex; }
body.dark .themebtn .tmoon { display: none; }
.themebtn { padding: 8px; }

/* --- Página de resultados de la búsqueda --- */
.searchpage { display: flex; gap: 10px; align-items: center; margin: 6px 0 4px; }
.searchpage input { flex: 1; }
.gsresults { display: flex; flex-direction: column; gap: 20px; margin-top: 18px; }
.gsgtitle {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 7px;
}
.gslist {
  list-style: none; margin: 0; padding: 0; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow-1);
}
.gslist li + li { border-top: 1px solid var(--border); }
.gslist a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 12px 16px; color: var(--ink);
}
.gslist a:hover { background: var(--surface2); text-decoration: none; }
.gssub { font-size: 13px; color: var(--muted); text-align: right; }

/* La cabecera ya iba justa: al añadir la búsqueda hay que ceder espacio por
   tramos, quitando primero el correo (redundante: está en Configuración). */
/* El icono de usuario solo aparece cuando se oculta el correo (pantallas reducidas).
   Previsualiza la cuenta (title con el email) y enlaza a Configuración → Cuenta. */
header.top .userbtn { display: none; }
@media (max-width: 1500px) {
  header.top .whoemail { display: none; }
  header.top .userbtn { display: inline-flex; }
}
@media (max-width: 1280px) {
  header.top { gap: 14px; padding: 12px 16px; }
  header.top nav { gap: 12px; }
}
@media (max-width: 1100px) {
  header.top nav { gap: 9px; font-size: 13.5px; }
  header.top .brandlogo { height: 22px; }
  header.top .topsearch { flex-basis: 220px; }
}


/* Iconos de SO como SVG inline (currentColor): tamaño en cada contenedor */
.hosticon svg { width: 20px; height: 20px; display: inline-block; vertical-align: middle; }
.osbadge svg { width: 26px; height: 26px; display: block; }
.osbadge.small svg { width: 15px; height: 15px; }
.hosttitle .osbadge svg { width: 28px; height: 28px; }
.ai-avatar svg { width: 30px; height: 30px; }
