/* ============================================================
   BlackDash — tema "Royal Charcoal"
   Paleta: Cinder #24292e · Chimney #4a5156 · Sea Lion #808a92
           Blue Dolphin #bdc7ce · Royal Charcoal #1e1f22 / #1e2023
   ============================================================ */

:root {
  /* Fondos, del más profundo al más claro */
  --bg-void: #060606;
  --bg-0: #0b0b0b;      /* Deep Black */
  --bg-1: #101011;      /* base neutra */
  --bg-2: #161617;      /* paneles */
  --bg-3: #1e1e1f;
  --bg-4: #2a2a2c;

  /* Líneas y bordes (neutras) */
  --line: #2c2c2e;
  --line-soft: #1a1a1b;

  /* Texto */
  --ink: #f8f1e7;       /* Soft Cream */
  --ink-2: #dad3c8;
  --ink-3: #8a847e;
  --ink-4: #554e49;

  /* Acentos — monocromo crema (mismo lenguaje que el login) */
  --accent: #c9c1b1;
  --accent-glow: #f2ece0;
  --crit: #d0574f;
  --high: #d6a24f;
  --med:  #cabf78;
  --low:  #7fa06a;
  --info: #9a9088;

  /* Gradientes: paneles negro neutro plano; accent en vino sólo para chips */
  --grad-panel: linear-gradient(145deg, #161617 0%, #121213 60%, #0e0e0f 100%);
  --grad-hero: linear-gradient(120deg, #161617 0%, #121213 45%, #0d0d0e 100%);
  --grad-accent: linear-gradient(135deg, #3a1218 0%, #211015 55%, #130c0e 100%);
  --grad-rail: linear-gradient(180deg, #0f0f10 0%, #090909 100%);

  /* Login: encuadre de la imagen del ojo (ya viene horizontal) */
  --eye-size: 135%;    /* zoom: sube para acercar, baja para alejar */
  --eye-pos-x: 100%;   /* horizontal: 100% deja el ojo hacia la izquierda */

  --radius: 3px;
  --radius-sm: 3px;
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.8);
  /* Fuente principal: serif elegante (estilo AURA) para toda la interfaz */
  --font: "Hoefler Text", "Baskerville", "Didot", Georgia, "Times New Roman", serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
  /* Serif con soporte griego real (Palatino en macOS) — sólo la cita */
  --serif: "Palatino Linotype", "Palatino", "Book Antiqua", "Didot", Georgia, serif;
  /* Serif Didone poderosa para el wordmark PAYDAY (sólo latino) */
  --display: "Didot", "Bodoni 72", "Playfair Display", "Times New Roman", serif;
  /* Grano fino monocromo para la textura del formulario */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)' opacity='0.06'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--grain) 0 0 / 160px 160px, var(--bg-void);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv05", "ss01";
}

a { color: inherit; text-decoration: none; }

::selection { background: rgba(248, 241, 231, 0.22); }

/* barras de scroll discretas */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #2a2a2c; border-radius: 20px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   LOGIN
   ============================================================ */
.auth {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 100vh;
  background: var(--bg-void);
}
.auth::before {   /* UNA sola imagen de fondo, a pantalla completa */
  content: "";
  position: absolute;
  inset: 0;
  background: url("/static/img/eye.jpg?v=3") var(--eye-pos-x) center / var(--eye-size) no-repeat;
  filter: grayscale(1) contrast(1.05) brightness(0.66);
  z-index: 0;
}
.auth::after {   /* degradado sutil y gradual: imagen a la izquierda, negro hacia el login */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(2,2,2,0.00) 0%,
    rgba(2,2,2,0.06) 22%,
    rgba(2,2,2,0.18) 40%,
    rgba(2,2,2,0.38) 55%,
    rgba(2,2,2,0.62) 70%,
    rgba(2,2,2,0.82) 84%,
    rgba(2,2,2,0.92) 100%);
  z-index: 1;
}
.auth__art {
  position: relative;
  z-index: 2;
}
.auth__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 46px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink);
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.9), 0 1px 3px rgba(0, 0, 0, 0.7);
}
.auth__quote {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.auth__quote .rule { width: 52px; height: 1px; background: rgba(248, 241, 231, 0.55); }
.auth__quote p {
  margin: 0;
  max-width: 18ch;
  font-family: var(--serif);
  font-size: clamp(22px, 2.1vw, 30px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.28;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.auth__index {
  display: flex;
  gap: 46px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(248, 241, 231, 0.62);
}
.auth__index b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 8px; font-size: 20px; letter-spacing: 0.06em; }

.auth__panel {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.auth__form {
  position: relative;
  width: 100%; max-width: 384px;
  padding: 36px 34px 30px;
  background:
    var(--grain) 0 0 / 140px 140px repeat,
    linear-gradient(150deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 34%),
    linear-gradient(160deg, rgba(10, 10, 11, 0.55), rgba(3, 3, 4, 0.46));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  backdrop-filter: blur(24px) saturate(0.92);
  -webkit-backdrop-filter: blur(24px) saturate(0.92);
  box-shadow:
    0 40px 80px -38px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.brand {
  display: flex;
  justify-content: center;
  margin-bottom: 34px;
}
.brand__mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: radial-gradient(120% 120% at 50% 0%, #1e1013, #0c0a0b);
  border: 1px solid rgba(158, 43, 56, 0.30);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 16px -5px rgba(158, 43, 56, 0.4);
}
.brand__mark::before {
  content: "$";
  font-family: var(--mono);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  color: var(--accent-glow);
  text-shadow: 0 0 9px rgba(158, 43, 56, 0.75);
}
.brand__mark::after {   /* cursor de terminal parpadeante */
  content: "";
  width: 5px; height: 2px; margin-left: 2px;
  background: var(--accent-glow);
  box-shadow: 0 0 8px rgba(158, 43, 56, 0.75);
  animation: blink 1.05s steps(1, end) infinite;
}
@keyframes blink { 0%, 55% { opacity: 1; } 55.01%, 100% { opacity: 0; } }
.brand__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: 0.14em;
  line-height: 1;
  color: var(--ink);
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.7);
}
.brand__name em {
  color: inherit;
  font-style: normal;
  font-weight: 400;
}

.auth__title { font-size: 22px; font-weight: 500; margin: 0 0 4px; }
.auth__sub { color: var(--ink-3); font-size: 13px; margin: 0 0 26px; }

.field { margin-bottom: 15px; }
.field label {
  display: block; font-family: var(--mono);
  font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.24em; color: var(--ink-3); margin-bottom: 8px;
}
.inp-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 0 13px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  transition: border-color .15s, box-shadow .15s;
}
.inp-wrap:focus-within {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}
.inp-wrap .prompt {
  font-family: var(--mono); font-weight: 700; font-size: 14px;
  color: var(--ink-3);
  user-select: none;
}
.inp-wrap input {
  flex: 1; min-width: 0;
  padding: 12px 0; border: 0; background: transparent; outline: none;
  color: var(--ink); caret-color: var(--ink); font-family: var(--mono); font-size: 13.5px;
  letter-spacing: 0.02em;
}
.inp-wrap input::placeholder { color: var(--ink-4); }
.btn {
  width: 100%; padding: 12px 16px; margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--grad-accent);
  color: var(--ink); font-size: 14px; font-weight: 600;
  letter-spacing: 0.02em; cursor: pointer;
  transition: transform .12s, box-shadow .2s, border-color .2s;
}
.btn:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px -10px rgba(158,43,56,0.4);
  transform: translateY(-1px);
}
.auth__form .btn {
  margin-top: 8px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 2px;
}
.auth__form .btn:hover {
  background: var(--ink);
  color: var(--bg-void);
  border-color: var(--ink);
  box-shadow: none;
  transform: none;
}
.auth__meta { margin-top: 22px; font-size: 11.5px; color: var(--ink-4); line-height: 1.6; }
.auth__error {
  background: rgba(209,108,108,0.12);
  border: 1px solid rgba(209,108,108,0.4);
  color: #e6a3a3; font-size: 12.5px;
  padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 18px;
}

/* ============================================================
   LAYOUT APP
   ============================================================ */
.app { position: relative; height: 100vh; }
.app::before {   /* billete de fondo, oscuro y sutil (estética del login) */
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url("/static/img/bill.jpg?v=1") center / cover no-repeat;
  filter: grayscale(1) contrast(1.05) brightness(0.5);
  opacity: 0.14;
}
.app::after {   /* viñeta para que el centro respire y los bordes se fundan a negro */
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 0%, rgba(6,6,6,0.75) 100%);
}
.main { position: relative; z-index: 1; }

.rail {
  background: var(--grad-rail);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0; gap: 6px;
}
.rail__logo {
  width: 34px; height: 34px; border-radius: 3px;
  background: #0e0e0f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.rail__logo::before {
  content: "$";
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  color: var(--ink);
}
.rail__logo::after {   /* cursor de terminal parpadeante */
  content: "";
  width: 4px; height: 2px; margin-left: 2px;
  background: var(--ink-3);
  animation: blink 1.05s steps(1, end) infinite;
}
.rail__btn {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; color: var(--ink-3);
  cursor: pointer; transition: background .15s, color .15s;
}
.rail__btn:hover { background: var(--bg-2); color: var(--ink-2); }
.rail__btn.is-active { background: var(--bg-2); color: var(--ink); box-shadow: inset 2px 0 0 rgba(255, 255, 255, 0.5); }
.rail__btn svg { width: 19px; height: 19px; }
.rail__spacer { flex: 1; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }
.topbar__logout {
  width: 34px; height: 34px; border-radius: 3px; flex-shrink: 0;
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--ink-3); cursor: pointer; display: grid; place-items: center;
  transition: color .15s, border-color .15s;
}
.topbar__logout:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.3); }
.topbar__logout svg { width: 17px; height: 17px; }

.topbar {
  height: 60px; flex-shrink: 0;
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(9px) saturate(0.95);
  -webkit-backdrop-filter: blur(9px) saturate(0.95);
  position: relative;
  z-index: 20;
}
.topbar__title {
  font-family: var(--display); font-weight: 700; font-size: 18px;
  letter-spacing: 0.14em; color: var(--ink);
}
.topbar__title em { color: var(--ink); font-style: normal; font-weight: 700; }
.topnav { display: flex; gap: 4px; margin-left: 12px; }
.topnav a {
  padding: 7px 14px; border-radius: 8px; font-size: 13px; color: var(--ink-3);
  transition: background .15s, color .15s;
}
.topnav a:hover { color: var(--ink-2); background: var(--bg-2); }
.topnav a.is-active { color: var(--ink); background: transparent; box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.topbar__spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 3px; padding: 8px 12px; width: 280px; color: var(--ink-4);
}
.search input {
  border: 0; background: transparent; color: var(--ink);
  font-size: 12.5px; width: 100%; outline: none; font-family: var(--mono);
  letter-spacing: 0.02em;
}
.search input::placeholder { color: var(--ink-4); }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: 20px; padding: 6px 12px; font-size: 12px; color: var(--ink-2);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--low); box-shadow: 0 0 8px var(--low); }
.avatar {
  width: 34px; height: 34px; border-radius: 3px;
  background: #141415; border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid; place-items: center; font-family: var(--mono);
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; color: var(--ink-2);
}

.content { flex: 1; overflow-y: auto; padding: 22px 24px 40px; }

/* ---- rejilla de paneles ---- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

.panel {
  background:
    var(--grain) 0 0 / 140px 140px,
    linear-gradient(150deg, rgba(255,255,255,0.02), rgba(255,255,255,0) 40%),
    linear-gradient(160deg, rgba(16,16,17,0.76), rgba(9,9,10,0.72));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  backdrop-filter: blur(9px) saturate(0.95);
  -webkit-backdrop-filter: blur(9px) saturate(0.95);
}
.panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px;
}
.panel__head h3 {
  margin: 0;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3);
}
.panel__head h3::before { content: none; }
.panel__head .meta { font-size: 11px; color: var(--ink-4); }
.panel__body { padding: 4px 18px 18px; }

/* ---- KPIs ---- */
.kpi {
  background:
    var(--grain) 0 0 / 140px 140px,
    linear-gradient(160deg, rgba(16,16,17,0.76), rgba(9,9,10,0.72));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative; overflow: hidden;
  backdrop-filter: blur(9px) saturate(0.95);
  -webkit-backdrop-filter: blur(9px) saturate(0.95);
}
.kpi::after { content: none; }
.kpi__label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-3);
}
.kpi__value {
  font-family: var(--display); font-size: 42px; font-weight: 400;
  letter-spacing: 0.01em; margin: 10px 0 2px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.kpi__delta { font-size: 12px; color: var(--low); }
.kpi__delta.up::before { content: "▲ "; font-size: 9px; }

/* ---- tabla: filas sobrias, separadas con hairline, dentro del panel de vidrio.
   Alineada con la antesala (login) y la pestaña de Perfil: marco de panel,
   tipografía mono en encabezados, sobriedad y hairlines --line. ---- */
table.tbl {
  width: 100%; font-size: 13px;
  border-collapse: separate;
  border-spacing: 0 9px;      /* gap = tarjetas flotantes, deja ver el panel/fondo */
  margin: -2px 0 2px;
}
.tbl th {
  text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-4); font-weight: 600;
  padding: 2px 14px 6px;
  background: none; border: 0;
}
.tbl tbody tr { transition: background .16s ease; }
.tbl tbody td {
  padding: 14px 16px; color: var(--ink-2); vertical-align: middle;
  /* fill claramente más claro que el panel -> la fila flota como tarjeta */
  background: rgba(255,255,255,0.045);
  border-top: 1px solid rgba(255,255,255,0.07);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.tbl tbody td:first-child {
  border-left: 1px solid rgba(255,255,255,0.07);
  border-top-left-radius: 8px; border-bottom-left-radius: 8px;
}
.tbl tbody td:last-child {
  border-right: 1px solid rgba(255,255,255,0.07);
  border-top-right-radius: 8px; border-bottom-right-radius: 8px;
}
.tbl tbody tr:hover td {
  background: rgba(255,255,255,0.075);
  border-color: rgba(255,255,255,0.14);
}
/* fila de estado vacío: no debe verse como dato */
.tbl tbody td.empty {
  background: none; border: 1px dashed var(--line); border-radius: 6px;
}
.tbl .num { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.mono { font-family: var(--mono); color: var(--ink-2); }

/* Variante plana (hairline elegante): filas finas separadas por línea, sin
   tarjeta. Para tablas sobrias como la actividad del Perfil o la auditoría.
   Nota: se usa `table.tbl--flat` para ganarle en especificidad al
   `table.tbl { border-spacing: 0 9px }` del estilo tarjeta (si no, las filas
   quedan separadas y ocupan de más). */
table.tbl--flat { border-spacing: 0; margin: 0; }
.tbl--flat tbody td {
  background: none; border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0; padding: 15px 14px;
}
.tbl--flat tbody td:first-child { border-left: 0; border-radius: 0; }
.tbl--flat tbody td:last-child  { border-right: 0; border-radius: 0; }
.tbl--flat tbody tr:last-child td { border-bottom: 0; }
.tbl--flat tbody tr:hover td { background: rgba(255,255,255,0.03); border-color: var(--line); }

/* El panel que enmarca una tabla se hace más translúcido: mantiene el marco
   (cohesión con el Perfil/antesala) pero deja asomar el billete tras las
   tarjetas flotantes, como pidió el PM ("de vidrio, deja ver el fondo"). */
.panel:has(.tbl) {
  background:
    var(--grain) 0 0 / 140px 140px,
    linear-gradient(160deg, rgba(16,16,17,0.42), rgba(9,9,10,0.34));
}

/* Medidor segmentado (estilo "CPU" de la referencia), p.ej. CVSS 0-10 */
.meter { display: inline-flex; align-items: center; gap: 8px; }
.meter__bars { display: inline-flex; gap: 2px; }
.meter__bars i {
  width: 4px; height: 13px; border-radius: 1px;
  background: rgba(255,255,255,0.12);
}
.meter__bars i.on { background: var(--ink-2); }
.meter.crit .meter__bars i.on { background: var(--crit); }
.meter.high .meter__bars i.on { background: var(--high); }
.meter.med  .meter__bars i.on { background: var(--med); }
.meter.low  .meter__bars i.on { background: var(--low); }
.meter.info .meter__bars i.on { background: var(--info); }
.meter__val { font-family: var(--mono); font-size: 11.5px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---- chips de severidad / estado ---- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 3px 9px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--ink-2); background: var(--bg-1);
  white-space: nowrap;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.tag.crit { color: #e9a9a9; border-color: rgba(209,108,108,0.4); background: rgba(209,108,108,0.10); }
.tag.crit::before { background: var(--crit); box-shadow: 0 0 8px var(--crit); }
.tag.high { color: #e6bd8e; border-color: rgba(217,154,91,0.35); background: rgba(217,154,91,0.10); }
.tag.high::before { background: var(--high); }
.tag.med  { color: #dcd49a; border-color: rgba(201,192,122,0.3); background: rgba(201,192,122,0.09); }
.tag.med::before { background: var(--med); }
.tag.low  { color: #a7c8b4; } .tag.low::before { background: var(--low); }
.tag.info { color: #a3b6c2; } .tag.info::before { background: var(--info); }
.tag.idle { color: var(--ink-4); } .tag.idle::before { background: var(--ink-4); }

/* ---- barra de severidades ---- */
.sevbar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin: 4px 0 16px; }
.sevbar span { height: 100%; }
.sevbar .crit { background: var(--crit); }
.sevbar .high { background: var(--high); }
.sevbar .med { background: var(--med); }
.sevbar .low { background: var(--low); }
.sevbar .info { background: var(--info); }
.sevlist { display: flex; flex-direction: column; gap: 10px; }
.sevrow { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.sevrow .n { font-family: var(--mono); color: var(--ink); }

/* ---- barra de progreso ---- */
.bar { height: 5px; background: var(--bg-1); border-radius: 4px; overflow: hidden; width: 90px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-glow)); }

/* ---- árbol de recon ---- */
.tree { font-size: 13px; }
.tree__dom {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0 8px; border-bottom: 1px solid var(--line-soft);
}
.tree__dom b { font-weight: 600; color: var(--ink); }
.tree__dom .mini { font-size: 11px; color: var(--ink-4); }
.tree__sub {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0 8px 20px; border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.tree__sub::before {
  content: ""; position: absolute; left: 6px; top: 50%; width: 8px; height: 1px; background: var(--line);
}
.tree__sub .name { color: var(--ink-2); font-family: var(--mono); font-size: 12.5px; }
.tree__sub .tech { color: var(--ink-4); font-size: 11.5px; }
.status { font-family: var(--mono); font-size: 11.5px; padding: 2px 6px; border-radius: 5px; background: var(--bg-1); border: 1px solid var(--line); }

/* ---- actividad ---- */
.feed { display: flex; flex-direction: column; gap: 9px; }
/* cada nota = tarjeta flotante, igual que las filas de tabla */
.feed__item {
  display: flex; gap: 12px; padding: 14px 16px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  transition: background .16s ease, border-color .16s ease;
}
.feed__item:hover { background: rgba(255,255,255,0.075); border-color: rgba(255,255,255,0.14); }
.feed__who { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; background: var(--grad-accent); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; color: var(--ink-2); font-weight: 600; }
.feed__txt { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.feed__txt b { color: var(--ink); font-weight: 600; }
.feed__when { font-size: 11px; color: var(--ink-4); margin-top: 2px; }

/* ---- vectores (chips grid) ---- */
.vecs { display: flex; flex-wrap: wrap; gap: 9px; }

.section-title {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-4); margin: 6px 0 14px; display: flex; align-items: center; gap: 12px;
}
.section-title .rule { flex: 1; height: 1px; background: var(--line-soft); }

@media (max-width: 1100px) {
  .col-3,.col-4,.col-5 { grid-column: span 6; }
  .col-6,.col-7,.col-8 { grid-column: span 12; }
}
@media (max-width: 720px) {
  .auth { grid-template-columns: 1fr; }
  .auth__art { min-height: 240px; }
  [class^="col-"] { grid-column: span 12; }
}

/* ============================================================
   CRUD — cabeceras, formularios, detalle, estados vacíos
   ============================================================ */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 20px;
}
.page-title { font-size: 22px; font-weight: 500; margin: 0; letter-spacing: -0.01em; }
.page-sub { color: var(--ink-3); font-size: 13px; margin: 4px 0 0; }
.page-actions { display: flex; gap: 10px; }

.btn--inline {
  width: auto; margin: 0; padding: 9px 16px;
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 11.5px; font-weight: 700; border-radius: 3px;
  background: transparent; color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.28);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn--inline:hover {
  background: var(--ink); color: var(--bg-void);
  border-color: var(--ink); box-shadow: none; transform: none;
}
.btn--ghost {
  width: auto; margin: 0; padding: 9px 16px;
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 11.5px; font-weight: 700; border-radius: 3px;
  background: transparent; color: var(--ink-2); border: 1px solid rgba(255, 255, 255, 0.16);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn--ghost:hover {
  color: var(--ink); border-color: rgba(255, 255, 255, 0.4);
  background: transparent; box-shadow: none; transform: none;
}
.btn--danger {
  width: auto; margin: 0; padding: 9px 16px;
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 11.5px; font-weight: 700; border-radius: 3px;
  background: transparent; border: 1px solid rgba(209,108,108,0.4);
  color: #d99a9a; display: inline-flex;
}
.btn--danger:hover { background: rgba(209,108,108,0.9); color: var(--bg-void); border-color: rgba(209,108,108,0.9); box-shadow: none; transform: none; }

.meta--link { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink-3); transition: color .15s; }
.meta--link:hover { color: var(--ink); }

.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-4); margin-bottom: 14px;
}
.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--accent-glow); }
.breadcrumb .sep { color: var(--ink-4); }

/* --- formularios --- */
.form-wrap { max-width: 820px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-field { display: flex; flex-direction: column; }
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-3); margin-bottom: 7px;
}
.inp {
  width: 100%; padding: 11px 13px;
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--ink);
  font-size: 14px; font-family: var(--font); resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
textarea.inp { font-family: var(--mono); font-size: 13px; line-height: 1.5; }
.inp:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(158,43,56,0.12);
}
select.inp { appearance: none; cursor: pointer;
  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='%23808a92' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
.form-actions {
  display: flex; gap: 10px; margin-top: 22px;
  padding-top: 18px; border-top: 1px solid var(--line-soft);
}
.help { font-size: 11.5px; color: var(--ink-4); margin-top: 5px; }
.errlist { list-style: none; padding: 0; margin: 6px 0 0; }
.errlist li { color: #e6a3a3; font-size: 12px; }

/* --- detalle --- */
.detail-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 18px;
}
.detail-title { font-size: 24px; font-weight: 500; margin: 6px 0 8px; letter-spacing: -0.01em; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); }

/* Perfil: llena la pantalla exacta — cabecera arriba, paneles al centro
   ocupando el espacio libre, y el calendario fijo abajo (siempre visible).
   La actividad scrollea DENTRO de su panel sólo si no cabe. */
.content:has(.profile-page) { overflow: hidden; }
.profile-page { height: 100%; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.profile-page > .page-head { flex: 0 0 auto; margin: 0; }
.profile-grid {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: 1fr 2fr; gap: 16px;
}
.profile-grid > .panel { height: 100%; min-height: 0; }
.profile-id-panel { overflow: auto; }
.profile-act { display: flex; flex-direction: column; }
.profile-act__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.profile-cal { flex: 0 0 auto; }

/* Panel de identidad del Perfil: centrado, compacto y centrado verticalmente
   para que quepa todo (4 datos) sin barra y sin hueco, en cualquier pantalla. */
.profile-id { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.profile-id .avatar--xl { width: 132px; height: 132px; font-size: 44px; }
.profile-id__head { display: flex; flex-direction: column; align-items: center; text-align: center; }
.profile-id__name { font-family: var(--display); font-size: 24px; color: var(--ink); margin-top: 12px; letter-spacing: 0.01em; }
.profile-id__head .help { margin-top: 5px; }
.profile-id__kv {
  margin: 0; width: 100%;
  display: flex; flex-direction: column; align-items: center;
  gap: 15px; text-align: center;
}
.profile-id__kv > div { display: flex; flex-direction: column; gap: 5px; }
.profile-id__kv dt {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-4);
}
.profile-id__kv dd { margin: 0; color: var(--ink); font-size: 15px; }
.prose { font-size: 14px; line-height: 1.65; color: var(--ink-2); white-space: pre-wrap; }
.prose:empty::after { content: "—"; color: var(--ink-4); }
.block-label {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-4); margin: 20px 0 8px;
}
.block-label:first-child { margin-top: 0; }

/* --- estados vacíos --- */
.empty { text-align: center; padding: 46px 24px; }
.empty__icon { font-size: 34px; color: var(--ink-4); margin-bottom: 8px; }
.empty h3 { margin: 0 0 6px; font-weight: 500; color: var(--ink); }
.empty p { color: var(--ink-3); font-size: 13.5px; margin: 0 0 18px; }
.empty--sm { padding: 26px; color: var(--ink-4); font-size: 13px; }

.chip-cvss {
  font-family: var(--mono); font-size: 22px; font-weight: 300;
  color: var(--ink); font-variant-numeric: tabular-nums;
}

/* ============================================================
   Objetivo — pestañas y alta rápida en línea
   ============================================================ */
.tabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); margin-bottom: 20px;
}
.tab {
  padding: 10px 15px; font-size: 13px; color: var(--ink-3);
  cursor: pointer; background: none; border: 0; border-bottom: 2px solid transparent;
  font-family: var(--font); letter-spacing: 0.01em;
}
.tab:hover { color: var(--ink-2); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent-glow); }
.tab .n {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-4);
  margin-left: 7px; padding: 1px 6px; border-radius: 10px; background: var(--bg-1);
}
.tab.is-active .n { color: var(--accent-glow); }
.tabpane { display: none; }
.tabpane.is-active { display: block; }

.subhead {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-4); margin: 4px 0 10px;
}
.addrow {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-top: 14px; padding: 12px 14px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 4px;
}
.addrow .inp {
  width: auto; height: 36px; padding: 7px 11px; font-size: 13px;
}
.addrow select.inp { min-width: 130px; }
.addrow textarea.inp { width: auto; height: auto; }
.addrow .btn--inline { height: 36px; }
.addrow .check {
  display: inline-flex; align-items: center; gap: 6px; height: 36px;
  font-size: 11.5px; color: var(--ink-3); font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.icon-del {
  background: none; border: 0; color: var(--ink-4); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 2px 7px; border-radius: 4px;
}
.icon-del:hover { color: #e6a3a3; background: rgba(209, 108, 108, 0.12); }
.tbl td .del-form { display: inline; }
.overview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .overview-grid { grid-template-columns: repeat(2, 1fr); } }

/* mensajes flash */
.msgs { margin-bottom: 16px; }
.msg {
  padding: 10px 14px; border-radius: 3px; font-size: 13px;
  color: var(--ink); background: rgba(127,160,106,0.12);
  border: 1px solid rgba(127,160,106,0.35); margin-bottom: 8px;
}

/* icono editar (junto al borrar) */
.icon-edit {
  display: inline-block; color: var(--ink-4); font-size: 13px;
  padding: 2px 7px; border-radius: 4px; margin-right: 2px;
}
.icon-edit:hover { color: var(--accent-glow); background: rgba(158,43,56,0.12); }

/* ============================================================
   Menú de usuario (estilo GitHub) + panel de administración
   ============================================================ */
.usermenu { position: relative; }
.usermenu > .avatar { cursor: pointer; }
.usermenu__pop {
  position: absolute; right: 0; top: 44px; z-index: 50;
  min-width: 220px; padding: 6px;
  background: var(--grain) 0 0 / 140px 140px, #0d0d0e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.9);
  display: none;
}
.usermenu.open .usermenu__pop { display: block; }
.usermenu__head {
  padding: 10px 12px; font-size: 12px; color: var(--ink-3);
  border-bottom: 1px solid var(--line-soft); margin-bottom: 6px;
}
.usermenu__head b { display: block; color: var(--ink); font-size: 14px; margin-top: 2px; }
.usermenu__head span {
  display: block; font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--ink-4); margin-top: 3px;
}
.usermenu__label {
  padding: 6px 12px 2px; font-family: var(--mono); font-size: 9.5px;
  text-transform: uppercase; letter-spacing: 0.18em; color: var(--ink-4);
}
.usermenu__pop a, .usermenu__pop button {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; border-radius: 3px; font-size: 13px; color: var(--ink-2);
  background: none; border: 0; cursor: pointer; font-family: var(--font);
}
.usermenu__pop a:hover, .usermenu__pop button:hover { background: var(--bg-2); color: var(--ink); }
.usermenu__sep { height: 1px; background: var(--line-soft); margin: 6px 0; }

/* pestañas del panel admin */
.adm-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.adm-tabs a {
  padding: 10px 16px; font-size: 13px; color: var(--ink-3);
  border-bottom: 2px solid transparent;
}
.adm-tabs a:hover { color: var(--ink-2); }
.adm-tabs a.is-active { color: var(--ink); border-bottom-color: var(--ink); }

/* zona de peligro (borrar cuenta) */
.danger-zone {
  border: 1px solid rgba(209,108,108,0.35); border-radius: var(--radius);
  padding: 18px 20px; margin-top: 22px;
}
.danger-zone h3 { margin: 0 0 6px; color: #e0a0a0; font-size: 14px; }
.danger-zone p { color: var(--ink-3); font-size: 13px; margin: 0 0 14px; }

.settings-card { max-width: 640px; margin-bottom: 18px; }

/* ============================================================
   Calendario de contribuciones (estilo GitHub)
   ============================================================ */
.heat { display: flex; gap: 8px; align-items: flex-start; }
.heat__side { display: flex; flex-direction: column; flex-shrink: 0; width: 32px; }
.heat__mo-spacer { height: 18px; }
.heat__days { display: flex; flex-direction: column; gap: 4px; }
.heat__days span {
  height: 15px; line-height: 15px; font-size: 9.5px; color: var(--ink-4);
  font-family: var(--mono); text-align: right; padding-right: 4px;
}
.heat__main { flex: 1; min-width: 0; }
.heat__months { display: flex; height: 18px; }
.heat__mo {
  flex: 1; font-size: 10px; color: var(--ink-4); font-family: var(--mono);
  white-space: nowrap;
}
/* altura fija del heatmap (7 filas × 15px + 6 gaps × 4px = 129px); align-items
   flex-start evita que las columnas se estiren a una altura heredada del flex. */
.heat__grid { display: flex; gap: 4px; align-items: flex-start; height: 129px; }
.heat__wk { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; height: 129px; }
.heat__c {
  width: 100%; height: 15px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
}
.heat__c.empty { background: transparent; }
.heat__c.l0 { background: rgba(255, 255, 255, 0.05); }
.heat__c.l1 { background: rgba(248, 241, 231, 0.18); }
.heat__c.l2 { background: rgba(248, 241, 231, 0.38); }
.heat__c.l3 { background: rgba(248, 241, 231, 0.62); }
.heat__c.l4 { background: rgba(248, 241, 231, 0.92); }
.heat__legend {
  display: flex; align-items: center; gap: 4px; justify-content: flex-end;
  margin-top: 10px; font-size: 10.5px; color: var(--ink-4); font-family: var(--mono);
}
.heat__legend .heat__c { width: 10px; height: 10px; }

/* ============================================================
   Tema claro (primera versión, ligera)
   ============================================================ */
:root[data-theme="light"] {
  --bg-void: #ece8df;
  --bg-0: #f2efe7;
  --bg-1: #ffffff;
  --bg-2: #faf7f1;
  --bg-3: #eee9df;
  --bg-4: #e0d9cc;
  --line: #d8d0c2;
  --line-soft: #e7e1d5;
  --ink: #201d18;
  --ink-2: #3d382f;
  --ink-3: #7c7568;
  --ink-4: #a69d8e;
  --accent: #6a6255;
  --accent-glow: #2a251d;
  --grad-panel: linear-gradient(145deg, #ffffff 0%, #faf7f1 100%);
  --grad-hero: linear-gradient(120deg, #ffffff 0%, #f4f0e8 100%);
  --grad-rail: linear-gradient(180deg, #f2efe7 0%, #ece8df 100%);
  --grain: none;
}
:root[data-theme="light"] .panel,
:root[data-theme="light"] .kpi { border-color: rgba(0,0,0,0.10); box-shadow: 0 12px 30px -22px rgba(0,0,0,0.3); }
:root[data-theme="light"] .btn--inline { color: var(--ink); border-color: rgba(0,0,0,0.35); }
:root[data-theme="light"] .btn--inline:hover { background: var(--ink); color: var(--bg-0); }
:root[data-theme="light"] .btn--ghost { color: var(--ink-2); border-color: rgba(0,0,0,0.2); }
:root[data-theme="light"] .avatar,
:root[data-theme="light"] .rail__logo { background: #fff; border-color: rgba(0,0,0,0.12); }
:root[data-theme="light"] .usermenu__pop { background: #fff; border-color: rgba(0,0,0,0.12); }
:root[data-theme="light"] .search { background: #fff; border-color: rgba(0,0,0,0.12); }
:root[data-theme="light"] .tbl tr:hover td { background: rgba(0,0,0,0.03); }
:root[data-theme="light"] .topnav a.is-active { box-shadow: inset 0 -2px 0 var(--ink); }
:root[data-theme="light"] .rail__btn.is-active { box-shadow: inset 2px 0 0 rgba(0,0,0,0.5); }
/* heatmap en claro: celdas oscuras */
:root[data-theme="light"] .heat__c { background: rgba(0,0,0,0.05); }
:root[data-theme="light"] .heat__c.l0 { background: rgba(0,0,0,0.06); }
:root[data-theme="light"] .heat__c.l1 { background: rgba(32,29,24,0.22); }
:root[data-theme="light"] .heat__c.l2 { background: rgba(32,29,24,0.42); }
:root[data-theme="light"] .heat__c.l3 { background: rgba(32,29,24,0.66); }
:root[data-theme="light"] .heat__c.l4 { background: rgba(32,29,24,0.9); }

/* avatar con foto + tamaño grande en el perfil */
.avatar { overflow: hidden; padding: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar--xl {
  width: 168px; height: 168px; border-radius: 6px; font-size: 54px;
  font-weight: 400; font-family: var(--display); color: var(--ink-2);
}

/* tema claro: sin billete de fondo y paneles opacos */
:root[data-theme="light"] .app::before,
:root[data-theme="light"] .app::after { display: none; }
:root[data-theme="light"] .panel,
:root[data-theme="light"] .kpi {
  background: var(--grad-panel); backdrop-filter: none; -webkit-backdrop-filter: none;
}
:root[data-theme="light"] .topbar {
  background: var(--bg-0); backdrop-filter: none; -webkit-backdrop-filter: none;
}

/* checkboxes en la paleta (no el azul del navegador) */
input[type="checkbox"] {
  accent-color: #cbc3b2;
  width: 15px; height: 15px; cursor: pointer;
}

/* ============================================================
   Pulido: transiciones y micro-interacciones (smooth)
   ============================================================ */
a, button, .tag, .tab, .btn, .btn--inline, .btn--ghost, .btn--danger,
.icon-edit, .icon-del, .topbar__logout, .rail__btn, .meta--link,
.topnav a, .adm-tabs a, .usermenu__pop a, .usermenu__pop button,
.avatar, .inp, .inp-wrap, .search, summary {
  transition: color .16s ease, background-color .16s ease, border-color .16s ease,
              box-shadow .16s ease, transform .12s ease, opacity .16s ease;
}

/* filas clicables: hover suave */
.tbl td { transition: background-color .14s ease; }
.tbl tr[onclick] { cursor: pointer; }
.tbl tr[onclick]:hover td { background: rgba(255, 255, 255, 0.035); }

/* botones: leve hundido al presionar */
.btn:active, .btn--inline:active, .btn--ghost:active, .btn--danger:active { transform: translateY(1px); }
.icon-edit:active, .icon-del:active { transform: translateY(1px); }

/* avatar: leve realce al pasar */
.avatar { cursor: pointer; }
.usermenu:hover .avatar, .usermenu.open .avatar { border-color: rgba(255, 255, 255, 0.28); }

/* menú de usuario: aparición suave */
.usermenu__pop { transform-origin: top right; animation: menuIn .15s cubic-bezier(.2,.7,.3,1); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

/* paneles de pestaña: fundido al cambiar */
.tabpane.is-active { animation: paneIn .22s ease; }
@keyframes paneIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* mensajes flash: entran suave */
.msg { animation: msgIn .25s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* scroll suave y anclas */
html { scroll-behavior: smooth; }

/* respeto a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* foco por teclado: aro suave (accesibilidad) sin ensuciar el mouse */
a:focus-visible, button:focus-visible, .btn:focus-visible, .btn--inline:focus-visible,
.btn--ghost:focus-visible, .btn--danger:focus-visible, .tab:focus-visible,
.rail__btn:focus-visible, .topnav a:focus-visible, .adm-tabs a:focus-visible,
summary:focus-visible, .icon-edit:focus-visible, .icon-del:focus-visible {
  outline: 2px solid rgba(248, 241, 231, 0.4);
  outline-offset: 2px;
  border-radius: 2px;
}
a, button { -webkit-tap-highlight-color: transparent; }

/* summary (cajas de importar): cursor y hover suave */
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
details[open] > summary { color: var(--ink); }

/* KPIs: leve realce del borde al pasar (sutil, sin mover) */
.kpi { transition: border-color .2s ease; }
.kpi:hover { border-color: rgba(255, 255, 255, 0.14); }

/* ============================================================
   Transición de entrada al loguear (fade a negro -> revelar dashboard)
   ============================================================ */
#enter-overlay {
  position: fixed; inset: 0; background: #000; z-index: 9999;
  pointer-events: none; opacity: 0; display: none;
  align-items: center; justify-content: center;
}
html.entering #enter-overlay {
  display: flex;
  animation: enterFade 2.4s ease forwards;
}
@keyframes enterFade { 0%, 76% { opacity: 1; } 100% { opacity: 0; } }
.enter-brand {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(46px, 7.5vw, 104px); letter-spacing: 0.2em;
  color: var(--ink); opacity: 0;
  will-change: opacity, filter, letter-spacing, transform;
  animation: enterBrand 2s cubic-bezier(.2, .6, .3, 1) forwards;
}
.enter-brand em { color: inherit; font-style: normal; font-weight: 700; }
@keyframes enterBrand {
  0%   { opacity: 0; filter: blur(22px); letter-spacing: 0.52em; transform: scale(1.06);
         text-shadow: 0 0 0 rgba(248, 241, 231, 0); }
  30%  { opacity: 1; filter: blur(0);    letter-spacing: 0.2em;  transform: scale(1);
         text-shadow: 0 0 48px rgba(248, 241, 231, 0.18); }
  64%  { opacity: 1; filter: blur(0);    letter-spacing: 0.21em;
         text-shadow: 0 0 30px rgba(248, 241, 231, 0.10); }
  100% { opacity: 0; filter: blur(10px); letter-spacing: 0.27em; transform: scale(1.02);
         text-shadow: 0 0 0 rgba(248, 241, 231, 0); }
}
html.entering .content { animation: enterRise 1s 1.9s ease both; }
@keyframes enterRise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  #enter-overlay { display: none !important; }
  html.entering .content { animation: none !important; }
}

/* ============================================================
   Transición entre páginas (fade-out al navegar, fade-in al cargar)
   La barra superior queda fija; sólo el contenido transiciona.
   ============================================================ */
.content { animation: pageIn .32s ease; transition: opacity .2s ease, transform .2s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
body.leaving .content { opacity: 0; transform: translateY(-6px); }
@media (prefers-reduced-motion: reduce) {
  .content { animation: none !important; }
  body.leaving .content { opacity: 1 !important; transform: none !important; }
}

/* Equipo asignado (need-to-know) */
.team-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.team-chip{display:inline-flex;align-items:center;gap:8px;padding:5px 12px 5px 5px;
  border:1px solid var(--line);border-radius:999px;background:rgba(255,255,255,.03);
  font-family:var(--font);font-size:13px}
.team-chip__av{width:24px;height:24px;border-radius:50%;overflow:hidden;flex:none;
  display:inline-flex;align-items:center;justify-content:center;
  background:rgba(203,195,178,.12);color:var(--ink);font-size:10px;font-weight:600;
  text-transform:uppercase;letter-spacing:.02em}
.team-chip__av img{width:100%;height:100%;object-fit:cover}

/* Selector de miembros (CheckboxSelectMultiple) en formularios */
.form-field ul:not(.errlist){list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.form-field ul:not(.errlist) li label{display:inline-flex;align-items:center;gap:8px;margin:0;
  padding:8px 14px;border:1px solid var(--line);border-radius:999px;cursor:pointer;
  font-family:var(--font);font-size:13px;background:rgba(255,255,255,.02);
  transition:border-color .18s ease,background .18s ease}
.form-field ul:not(.errlist) li label:hover{border-color:rgba(203,195,178,.45)}
.form-field ul:not(.errlist) li input[type=checkbox]{margin:0;accent-color:#cbc3b2}

/* ---- Objetivos: grilla de tarjetas (idea de RedDoor: card + mini-stats,
   menos monótono que una tabla). Usa los tokens/paleta actuales. ---- */
.obj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.obj-card {
  display: block; text-decoration: none; color: inherit;
  background:
    var(--grain) 0 0 / 140px 140px,
    linear-gradient(150deg, rgba(255,255,255,0.02), rgba(255,255,255,0) 40%),
    linear-gradient(160deg, rgba(16,16,17,0.76), rgba(9,9,10,0.72));
  border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius);
  padding: 18px 18px 16px;
  backdrop-filter: blur(9px) saturate(0.95); -webkit-backdrop-filter: blur(9px) saturate(0.95);
  transition: transform .18s ease, border-color .18s ease, box-shadow .2s ease;
}
.obj-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.16); box-shadow: 0 24px 50px -30px rgba(0,0,0,0.9); }
.obj-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.obj-card__name { font-family: var(--display); font-size: 20px; color: var(--ink); line-height: 1.15; }
.obj-card__co { font-size: 12px; color: var(--ink-3); margin-top: 4px; font-family: var(--font); }
.obj-card__flag { margin-top: 11px; }
.obj-stats {
  margin-top: 16px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden;
}
.obj-stat { background: rgba(10,10,11,0.55); padding: 12px 8px; text-align: center; }
.obj-stat b {
  display: block; font-family: var(--display); font-size: 24px; font-weight: 400;
  color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1;
}
.obj-stat span {
  display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-4); margin-top: 5px;
}

/* ---- Overview: KPIs enriquecidos (acento + subtítulo, estilo RedDoor) ---- */
.kpi__accent { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--line); }
.kpi__accent.crit { background: var(--crit); box-shadow: 0 0 12px -2px var(--crit); }
.kpi__accent.high { background: var(--high); }
.kpi__accent.med  { background: var(--med); }
.kpi__accent.low  { background: var(--low); }
.kpi__accent.info { background: var(--info); }
.kpi__sub {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em;
  color: var(--ink-3); margin-top: 2px;
}

/* ---- Overview: variante compacta de las tarjetas de objetivo ---- */
.obj-grid--compact { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.obj-grid--compact .obj-card { padding: 14px 14px 12px; }
.obj-grid--compact .obj-card__name { font-size: 16px; }
.obj-grid--compact .obj-card__co { font-size: 11px; }
.obj-grid--compact .obj-stats { margin-top: 12px; }
.obj-grid--compact .obj-stat { padding: 9px 6px; }
.obj-grid--compact .obj-stat b { font-size: 20px; }

/* ---- Overview: dona/anillo de severidad (conic-gradient, CSS puro) ---- */
.sevwrap { display: flex; gap: 22px; align-items: center; }
.sevwrap .sevlist { flex: 1; }
.donut {
  width: 148px; height: 148px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
}
.donut__hole {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--bg-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}
.donut__hole b {
  font-family: var(--display); font-size: 30px; font-weight: 400; color: var(--ink);
  line-height: 1; font-variant-numeric: tabular-nums;
}
.donut__hole span {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-4); margin-top: 4px;
}

/* Acciones de una nota (editar/borrar) agrupadas a la derecha */
.feed__actions { display: inline-flex; align-items: center; gap: 8px; flex: none; }

/* ---- Timeline de la operación (ActivityLog) ---- */
.timeline { display: flex; flex-direction: column; gap: 2px; position: relative; }
.tl-item { display: flex; gap: 14px; padding: 10px 4px 14px; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 6px; top: 20px; bottom: -2px; width: 1px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 13px; height: 13px; border-radius: 50%; flex: none; margin-top: 3px; z-index: 1;
  background: var(--info); box-shadow: 0 0 0 3px var(--bg-void); }
.tl-dot.crit { background: var(--crit); box-shadow: 0 0 0 3px var(--bg-void), 0 0 10px -1px var(--crit); }
.tl-dot.high { background: var(--high); }
.tl-dot.med  { background: var(--med); }
.tl-dot.low  { background: var(--low); }
.tl-dot.info { background: var(--info); }
.tl-body { flex: 1; min-width: 0; }
.tl-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-action { color: var(--ink); font-size: 14px; }
.tl-when { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.tl-actions { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; }
