
:root {
  /* === DESIGN SYSTEM VILLAMEDIC v2 · PALETA FENIX === */
  --vm-primary: #FF2C33;          /* Rojo Fenix primario (CTAs, headers, links) */
  --vm-primary-light: #FF4D52;    /* Rojo medio (hover) */
  --vm-primary-lighter: #FF7680;  /* Rojo claro (acentos suaves) */
  --vm-secondary: #FE6225;        /* Naranja secundario */
  --vm-secondary-light: #FFAA6F;  /* Naranja claro (highlights) */
  --vm-bg-rojo-suave: #fff8f7;    /* Background rojo muy claro */
  --vm-bg-naranja-suave: #fff4f0; /* Background naranja muy claro */
  --vm-gradient-h: linear-gradient(90deg, #FF2C33 0%, #FE6225 100%);
  --vm-gradient-d: linear-gradient(135deg, #FF2C33 0%, #FE6225 100%);

  /* Compatibilidad con clases existentes (alias a Fenix) */
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-side: #0f172a;
  --bg-side-hover: #1e293b;
  --bg-side-active: #FF2C33;
  --text: #0f1419;
  --text-muted: #6b7280;
  --text-side: #cbd5e1;
  --text-side-active: #ffffff;
  --primary: #FF2C33;
  --primary-soft: #fff8f7;
  --green: #10B981;
  --green-soft: #ECFDF5;
  --orange: #FE6225;
  --orange-soft: #fff4f0;
  --red: #EF4444;
  --red-soft: #FEF2F2;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --shadow: 0 1px 3px rgba(255, 44, 51, .06);
  --shadow-lg: 0 8px 24px rgba(255, 44, 51, .12);
  --radius: 8px;
  --sidebar-w: 300px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
:root { --rightpanel-w: 420px; }

/* Panel derecho · preguntas ENCAPS */
.right-panel {
  width: var(--rightpanel-w);
  flex-shrink: 0;
  background: white;
  border-left: 1px solid var(--border);
  position: fixed; top: 0; right: 0; bottom: 0;
  overflow-y: auto;
  padding: 24px 22px 40px;
  z-index: 5;
}
.layout.has-right-panel .main { margin-right: var(--rightpanel-w); }

.rp-header {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 14px; border-bottom: 2px solid var(--vm-primary);
  margin-bottom: 8px;
}
.rp-icon { font-size: 22px; }
.rp-title { font-size: 17px; font-weight: 800; color: var(--vm-primary); flex: 1; line-height: 1.2; }
.rp-count {
  font-size: 11px; font-weight: 700;
  background: var(--vm-gradient-d); color: white;
  padding: 4px 10px; border-radius: 12px;
}
.rp-info { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.rp-questions { display: flex; flex-direction: column; gap: 14px; }

.encaps-toggle-btn {
  display: none;
  position: fixed; top: 14px; right: 14px; z-index: 50;
  width: 44px; height: 44px;
  border: none; border-radius: 10px;
  background: var(--vm-gradient-d); color: white;
  font-size: 20px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(255,44,51,.3);
  align-items: center; justify-content: center;
}
.encaps-toggle-btn:active { transform: scale(.95); }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-side);
  color: var(--text-side);
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  display: flex; flex-direction: column;
  border-right: 1px solid #1e293b;
}
.brand {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: var(--vm-gradient-d);
  box-shadow: 0 4px 12px rgba(255, 44, 51, .25);
  text-align: center;
}
.brand-logo {
  max-width: 130px; height: auto;
  display: block;
  filter: brightness(0) invert(1);
}
.brand .logo {
  width: 50px; height: 50px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 18px;
  letter-spacing: -.5px;
  border: 1px solid rgba(255,255,255,.25);
}
.brand-text { color: white; line-height: 1.15; }
.brand-title {
  font-weight: 900; font-size: 17px;
  letter-spacing: -.3px;
  color: white;
}
.brand-sub {
  font-weight: 700; font-size: 11px;
  letter-spacing: 3px;
  color: #FFAA6F;
  margin-top: 4px;
  text-transform: uppercase;
}

.search-wrap { padding: 12px 14px; border-bottom: 1px solid #1e293b; }
.search-wrap input {
  width: 100%; padding: 9px 12px;
  background: #1e293b; color: var(--text-side-active);
  border: 1px solid #334155; border-radius: 6px;
  font-size: 13px; outline: none;
}
.search-wrap input:focus { border-color: var(--primary); }

/* Sidebar · enlace impugnaciones */
.impug-link {
  display: flex; align-items: center; gap: 10px;
  margin: 8px 12px; padding: 10px 12px;
  background: linear-gradient(90deg, rgba(254,98,37,.18), rgba(255,44,51,.18));
  border: 1px solid rgba(254,98,37,.3);
  border-radius: 8px;
  color: white; font-size: 12.5px; font-weight: 600;
  text-decoration: none;
  transition: all .15s;
}
.impug-link:hover { background: linear-gradient(90deg, var(--vm-secondary), var(--vm-primary)); border-color: var(--vm-secondary); color: white; text-decoration: none; }
.impug-link .il-icon { font-size: 16px; flex-shrink: 0; }
.impug-link .il-text { flex: 1; line-height: 1.2; }
.impug-link .il-count {
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px;
  background: rgba(255,255,255,.22); color: white;
}
.search-wrap input::placeholder { color: #64748b; }

.tree-drill {
  padding: 6px 0 14px; flex: 1;
  font-size: 13px;
}
.tree-drill details { margin: 0; }
.tree-drill summary { list-style: none; cursor: pointer; user-select: none; }
.tree-drill summary::-webkit-details-marker { display: none; }

/* NIVEL 1: AREA */
.tree-drill .lvl-area > summary {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  color: white;
  font-weight: 700; font-size: 13px;
  border-bottom: 1px solid #1e293b;
  background: linear-gradient(90deg, transparent, transparent);
  transition: background .15s;
  position: relative;
}
.tree-drill .lvl-area > summary::after {
  content: '⌃'; transform: rotate(180deg);
  display: inline-block; margin-left: auto;
  font-size: 11px; color: #64748b;
  transition: transform .2s;
}
.tree-drill .lvl-area[open] > summary::after { transform: rotate(0deg); color: var(--primary); }
.tree-drill .lvl-area > summary:hover { background: rgba(255,44,51,0.10); }
.tree-drill .lvl-area[open] > summary {
  background: rgba(255,44,51,0.10);
  border-bottom-color: rgba(255,44,51,0.3);
}
.tree-drill .lvl-area > summary .lbl { flex: 1; line-height: 1.25; }
.tree-drill .lvl-area > summary .cnt {
  font-size: 11px; padding: 1px 7px; border-radius: 10px;
  background: rgba(255,255,255,.08); color: #94a3b8;
  flex-shrink: 0; font-weight: 600;
}
.tree-drill .lvl-area[open] > summary .cnt { background: rgba(255,44,51,.25); color: white; }
.tree-drill .lvl-area-body {
  background: rgba(0,0,0,.18);
  padding: 6px 0;
  border-bottom: 1px solid #1e293b;
}

/* NIVEL 2: SUB-AREA */
.tree-drill .lvl-sub > summary {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 32px;
  color: #cbd5e1;
  font-weight: 600; font-size: 12px;
  border-radius: 0;
  transition: background .12s, color .12s;
  position: relative;
}
.tree-drill .lvl-sub > summary::before {
  content: '▸'; display: inline-block;
  width: 12px; font-size: 10px;
  color: #64748b; transition: transform .15s;
  flex-shrink: 0;
}
.tree-drill .lvl-sub[open] > summary::before { transform: rotate(90deg); color: var(--primary); }
.tree-drill .lvl-sub > summary:hover { color: white; background: rgba(255,255,255,.04); }
.tree-drill .lvl-sub[open] > summary { color: white; }
.tree-drill .lvl-sub > summary .lbl { flex: 1; line-height: 1.3; word-wrap: break-word; overflow-wrap: break-word; }
.tree-drill .lvl-sub > summary .cnt {
  font-size: 10px; padding: 1px 6px; border-radius: 8px;
  background: #1e293b; color: #64748b;
  flex-shrink: 0;
}
.tree-drill .lvl-sub-body { padding: 4px 0 6px; }

/* NIVEL 3: BLOQUE / TOPICO */
.tree-drill a.lvl-bloque {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 14px 8px 50px;
  color: #94a3b8;
  font-size: 12.5px;
  border-left: 2px solid transparent;
  transition: all .1s;
}
.tree-drill a.lvl-bloque:hover { background: rgba(255,255,255,.04); color: white; text-decoration: none; }
.tree-drill a.lvl-bloque.active {
  background: rgba(255,44,51,.18);
  color: white;
  border-left-color: var(--primary);
  font-weight: 600;
}
.tree-drill a.lvl-bloque .bid {
  display: inline-block;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 10.5px; font-weight: 700;
  padding: 2px 6px; border-radius: 3px;
  background: #334155; color: #cbd5e1;
  flex-shrink: 0;
  margin-top: 1px;
}
.tree-drill a.lvl-bloque.active .bid { background: var(--primary); color: white; }
.tree-drill a.lvl-bloque.empty .bid { opacity: .55; }
.tree-drill a.lvl-bloque.empty .lbl { opacity: .65; }
.tree-drill a.lvl-bloque .lbl {
  flex: 1;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  white-space: normal;
}
.tree-drill a.lvl-bloque .docs-count {
  font-size: 10px; padding: 2px 6px; border-radius: 8px;
  background: #1e293b; color: #94a3b8; flex-shrink: 0;
  margin-top: 1px;
}
.tree-drill a.lvl-bloque .docs-count.empty { background: transparent; color: #475569; opacity: .6; }

.quicklinks {
  display: flex; padding: 8px;
  border-bottom: 1px solid #1e293b;
  gap: 4px;
}
.quicklinks a {
  flex: 1;
  padding: 7px 4px;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-side);
  border-radius: 5px;
  transition: all .12s;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.quicklinks a span { font-size: 13px; }
.quicklinks a:hover { background: var(--bg-side-hover); color: white; text-decoration: none; }
.tree a {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 42px;
  color: var(--text-side);
  font-size: 13px;
  border-left: 2px solid transparent;
  transition: all .12s;
}
.tree a:hover { background: var(--bg-side-hover); color: white; text-decoration: none; }
.tree a.active {
  background: rgba(37, 99, 235, .15);
  color: white;
  border-left-color: var(--primary);
  font-weight: 600;
}
.tree a .bid {
  display: inline-block;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 11px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px;
  background: #334155; color: var(--text-side-active);
  flex-shrink: 0;
}
.tree a.active .bid { background: var(--primary); color: white; }
.tree a.brecha .bid { background: #7f1d1d; color: white; }
.tree a .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.tree a .docs-count {
  font-size: 10px; padding: 1px 5px; border-radius: 8px;
  background: #1e293b; color: #94a3b8; flex-shrink: 0;
}
.tree a.brecha .docs-count { background: #450a0a; color: #fca5a5; }

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid #1e293b;
  font-size: 11px; color: #64748b;
}
.sidebar-footer a { color: #94a3b8; }

/* Main */
.main {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
.topbar {
  background: white; border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,.92);
}
.topbar .breadcrumb {
  font-size: 15px;
  color: #1f2937;
  font-weight: 600;
  letter-spacing: -.1px;
}
.topbar .breadcrumb a {
  color: var(--vm-primary);
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  transition: all .12s;
}
.topbar .breadcrumb a:hover {
  background: var(--vm-bg-rojo-suave);
  color: var(--vm-primary-light);
  text-decoration: none;
}
.topbar .breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
}
.topbar .breadcrumb::part(separator) { color: var(--vm-secondary); }
.topbar .actions {
  display: flex; gap: 8px;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  border-radius: 6px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border-strong);
  background: white; color: var(--text);
  cursor: pointer; transition: all .12s;
}
.btn:hover { background: var(--bg-soft); text-decoration: none; }
.btn-primary { background: var(--vm-primary); color: white; border-color: var(--vm-primary); }
.btn-primary:hover { background: var(--vm-primary-light); color: white; box-shadow: 0 4px 12px rgba(255,44,51,.25); }

.content { padding: 32px 40px 80px; max-width: 1100px; }

.bloque-header {
  margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border);
}
.bloque-header .bid-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 12px; font-weight: 800;
  background: var(--vm-bg-rojo-suave); color: var(--vm-primary);
  padding: 4px 10px; border-radius: 5px;
  margin-bottom: 10px;
  border: 1px solid var(--vm-primary-lighter);
}
.bloque-header .bid-tag.brecha { background: #FEE2E2; color: #B91C1C; border-color: #FCA5A5; }
.bloque-header h1 { font-size: 28px; line-height: 1.25; letter-spacing: -.4px; margin-bottom: 8px; }
.bloque-header .meta {
  font-size: 14px; color: var(--text-muted);
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 8px;
}
.bloque-header .meta span::before { content: '·'; margin-right: 8px; color: #cbd5e1; }
.bloque-header .meta span:first-child::before { content: ''; margin: 0; }

.callout {
  padding: 16px 20px; border-radius: 8px;
  margin: 20px 0; border-left: 3px solid;
}
.callout.green { background: var(--green-soft); border-color: var(--green); color: #14532d; }
.callout.orange { background: var(--orange-soft); border-color: var(--orange); color: #7c2d12; }
.callout.red { background: var(--red-soft); border-color: var(--red); color: #7f1d1d; }
.callout.blue { background: var(--vm-bg-naranja-suave); border-color: var(--vm-secondary); color: #7c2d12; }
.callout-title { font-weight: 700; margin-bottom: 4px; }

section { margin-bottom: 40px; }
section h2 {
  font-size: 19px; letter-spacing: -.2px;
  margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
section h2 .icon { font-size: 22px; }

/* Cards de docs · Fenix */
.docs-grid { display: grid; gap: 14px; }
.doc-card {
  border: 1px solid var(--border); border-radius: 10px;
  border-top: 3px solid var(--vm-primary);
  padding: 16px 18px;
  background: white;
  transition: all .15s;
}
.doc-card:hover { border-top-color: var(--vm-secondary); box-shadow: 0 6px 16px rgba(255, 44, 51, .10); }
.doc-card .doc-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 8px;
}
.doc-card .doc-title { font-size: 15px; font-weight: 700; line-height: 1.35; flex: 1; }
.doc-card .doc-meta {
  font-size: 12px; color: var(--text-muted);
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px;
}
.doc-card .doc-desc {
  font-size: 13.5px; color: #334155;
  margin: 8px 0 12px;
}
.doc-card .doc-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .2px;
}
.badge-nts { background: #ddd6fe; color: #5b21b6; }
.badge-rm  { background: #fff8f7; color: #B91C1C; }
.badge-ds  { background: #fce7f3; color: #9f1239; }
.badge-ley { background: #fef3c7; color: #854d0e; }
.badge-manual { background: #d1fae5; color: #065f46; }
.badge-otro { background: #e2e8f0; color: #334155; }
.badge-status-nat { background: var(--green-soft); color: #14532d; }
.badge-status-scan { background: var(--orange-soft); color: #7c2d12; }

/* Resumen content (rendered markdown) */
.resumen-block {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0;
  margin-bottom: 16px; overflow: hidden;
}
.resumen-block summary {
  list-style: none; cursor: pointer;
  padding: 14px 18px;
  background: var(--bg-soft);
  font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid transparent;
}
.resumen-block summary::-webkit-details-marker { display:none; }
.resumen-block summary::before {
  content:'▸'; font-size: 11px; color: var(--text-muted); transition: transform .15s;
}
.resumen-block[open] summary { border-bottom-color: var(--border); }
.resumen-block[open] summary::before { transform: rotate(90deg); }

.resumen-content {
  padding: 20px 24px;
  font-size: 14px; line-height: 1.65;
}
.resumen-content h1 { font-size: 22px; margin: 20px 0 12px; }
.resumen-content h2 { font-size: 17px; margin: 24px 0 10px; padding-bottom:4px; border-bottom:1px solid var(--border); }
.resumen-content h3 { font-size: 15px; margin: 18px 0 8px; color: var(--primary); }
.resumen-content p { margin-bottom: 12px; }
.resumen-content blockquote {
  border-left: 3px solid var(--vm-secondary);
  background: var(--primary-soft);
  padding: 10px 16px; margin: 12px 0; border-radius: 0 6px 6px 0;
  font-size: 13.5px; color: #7c2d12;
}
.resumen-content pre {
  background: #0f172a; color: #e2e8f0;
  padding: 16px; border-radius: 6px;
  overflow-x: auto; font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 12.5px; line-height: 1.55;
  margin: 12px 0;
  white-space: pre-wrap;
}
.resumen-content code {
  font-family: 'JetBrains Mono', Consolas, monospace;
  background: #f1f5f9; padding: 1px 5px; border-radius: 3px;
  font-size: 12.5px;
}
.resumen-content pre code { background: transparent; padding: 0; }
.resumen-content table {
  border-collapse: collapse; width: 100%; margin: 12px 0;
  font-size: 13px;
}
.resumen-content table th, .resumen-content table td {
  border: 1px solid var(--border); padding: 8px 12px; text-align: left;
}
.resumen-content table th { background: var(--bg-soft); font-weight: 600; }
.resumen-content ul, .resumen-content ol { margin: 8px 0 12px 24px; }
.resumen-content li { margin-bottom: 4px; }

/* DIAPOSITIVAS · galeria de slides Villamedic */
.diapositivas-section { margin-top: 32px; margin-bottom: 32px; }
.diapositivas-section h2 .diapo-count {
  font-size: 12px; font-weight: 700;
  background: var(--vm-gradient-d); color: white;
  padding: 3px 10px; border-radius: 12px;
  margin-left: 10px; vertical-align: middle;
}
.diapos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.diapo-thumb {
  position: relative;
  display: block;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: white;
  transition: all .2s cubic-bezier(.2,.8,.2,1);
  aspect-ratio: 4/3;
  text-decoration: none;
  padding: 0;
  cursor: zoom-in;
  font: inherit;
}
.diapo-thumb:hover {
  border-color: var(--vm-primary);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(255,44,51,.18);
}
.diapo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.diapo-num {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(0,0,0,.75); color: white;
  padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 700;
  font-family: 'JetBrains Mono', Consolas, monospace;
}

/* Lightbox para diapositivas */
.diapo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 25, .92);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.diapo-lightbox.is-open { display: flex; }
.diapo-lightbox .dl-stage {
  max-width: 95vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.diapo-lightbox img {
  max-width: 95vw;
  max-height: 88vh;
  display: block;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  background: white;
}
.diapo-lightbox .dl-close {
  position: absolute;
  top: 18px; right: 22px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--vm-primary);
  color: white;
  border: none;
  font-size: 28px; line-height: 1;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  transition: transform .15s, background .15s;
}
.diapo-lightbox .dl-close:hover { background: var(--vm-secondary); transform: scale(1.05); }
.diapo-lightbox .dl-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: white;
  border: 1px solid rgba(255, 255, 255, .25);
  font-size: 32px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  transition: background .15s;
}
.diapo-lightbox .dl-nav:hover { background: rgba(255, 255, 255, .25); }
.diapo-lightbox .dl-prev { left: 24px; }
.diapo-lightbox .dl-next { right: 24px; }
.diapo-lightbox .dl-caption {
  position: absolute;
  bottom: 16px; left: 50%; transform: translateX(-50%);
  color: white;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 12px;
  background: rgba(0, 0, 0, .55);
  padding: 6px 14px;
  border-radius: 14px;
}
@media (max-width: 600px) {
  .diapo-lightbox .dl-nav { width: 40px; height: 40px; font-size: 24px; }
  .diapo-lightbox .dl-prev { left: 8px; }
  .diapo-lightbox .dl-next { right: 8px; }
  .diapo-lightbox .dl-close { width: 36px; height: 36px; font-size: 22px; top: 12px; right: 12px; }
}
/* Sub-temas (separadores VERDES dentro de un bloque ROJO) */
.diapo-subtema {
  margin-top: 20px;
  padding: 14px 16px 16px;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  border-left: 4px solid #10b981;
  border-radius: 8px;
}
.dst-title {
  font-size: 14.5px; font-weight: 700;
  color: #065f46;
  margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.dst-marker { color: #10b981; font-size: 12px; }
.dst-count {
  margin-left: auto;
  font-size: 11px;
  background: #10b981; color: white;
  padding: 2px 8px; border-radius: 10px;
  font-family: 'JetBrains Mono', Consolas, monospace;
}

/* Bibliografia MINSA - destacadas */
.rp-section.rp-highlighted summary {
  background: linear-gradient(90deg, #fff8f7 0%, #fff4f0 100%);
  border-left: 3px solid var(--vm-secondary);
}
.doc-card.doc-highlighted {
  border-top-color: var(--vm-secondary);
  border-left: 3px solid var(--vm-secondary);
  background: linear-gradient(180deg, #fff8f7 0%, white 30%);
}
.doc-pin {
  display: inline-block;
  margin-right: 4px;
  font-size: 13px;
}

/* === TEXTO EDUCATIVO (lectura introductoria por bloque) === */
.texto-base {
  background: linear-gradient(180deg, #fff8f7 0%, white 100%);
  border: 1px solid var(--vm-primary-lighter);
  border-left: 4px solid var(--vm-primary);
  border-radius: 12px;
  padding: 22px 26px;
  margin: 24px 0 32px;
  box-shadow: 0 2px 8px rgba(255,44,51,.05);
}
.texto-base h2 {
  font-size: 19px;
  border-bottom: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
  color: var(--vm-primary);
}
.tb-intro p {
  font-size: 15px; line-height: 1.7;
  color: #1f2937;
  margin: 0 0 10px;
}
.tb-intro p:last-child { margin-bottom: 0; }
.tb-intro p.tb-finalidad {
  font-size: 14.5px;
  text-align: justify;
  padding: 10px 14px;
  background: #fffbf7;
  border-left: 3px solid var(--vm-secondary);
  border-radius: 4px;
}
.tb-intro p.tb-contexto {
  font-size: 13px;
  color: var(--text-muted);
}
.tb-section {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--vm-primary-lighter);
}
.tb-section h3 {
  font-size: 16px;
  color: var(--vm-secondary);
  margin: 0 0 6px;
  display: flex; align-items: center; gap: 8px;
  font-weight: 800;
}
.tb-section .ti { font-size: 18px; }
.tb-meta {
  font-size: 12.5px; color: var(--text-muted);
  margin: 0 0 12px;
  font-style: italic;
}
.tb-defs {
  margin: 0;
}
.tb-defs dt {
  font-weight: 800; font-size: 13.5px;
  color: var(--vm-primary);
  margin-top: 12px;
  text-transform: none;
}
.tb-defs dd {
  margin: 4px 0 8px 14px;
  font-size: 14px; line-height: 1.55;
  color: #374151;
}
.tb-fuente {
  display: block; margin-top: 4px;
  font-size: 11px; color: var(--text-muted);
  font-style: italic;
  font-weight: 500;
}
.tb-numeric {
  margin: 0; padding-left: 22px;
}
.tb-numeric li {
  font-size: 14px; line-height: 1.55;
  margin-bottom: 8px;
  color: #374151;
}
.tb-slides {
  margin: 0; padding: 0; list-style: none;
}
.tb-slides li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 6px 10px; margin-bottom: 4px;
  background: white;
  border-radius: 5px; border: 1px solid var(--border);
  font-size: 13.5px; line-height: 1.5;
}
.tb-slide-n {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 11px; font-weight: 800;
  background: var(--vm-secondary); color: white;
  padding: 1px 7px; border-radius: 4px;
  flex-shrink: 0;
}
/* Desarrollo del tema (texto narrativo basado en slides) */
.tb-desarrollo p.tb-meta { margin-bottom: 14px; }
.tb-slide-block {
  background: white;
  border: 1px solid var(--border);
  border-left: 3px solid var(--vm-secondary);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
  transition: border-left-color .2s;
}
.tb-slide-block:hover { border-left-color: var(--vm-primary); }
.tb-slide-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 14.5px; line-height: 1.4;
  color: #111827;
}
.tb-slide-head strong { font-weight: 700; color: var(--vm-primary); }
.tb-slide-prose {
  font-size: 14px; line-height: 1.7;
  color: #1f2937;
  margin: 0;
  text-align: justify;
}
.tb-slide-bullets {
  margin: 0; padding-left: 20px;
  list-style: disc;
}
.tb-slide-bullets li {
  font-size: 13.5px; line-height: 1.6;
  color: #374151;
  margin-bottom: 5px;
}
.tb-slide-bullets li.tb-l1 {
  margin-left: 16px; list-style: circle;
  color: #4b5563;
  font-size: 13px;
}
.tb-slide-block .tb-defs { margin-top: 4px; }
.tb-slide-block .tb-defs dt { font-size: 13.5px; }
.tb-slide-block .tb-defs dd { font-size: 13.5px; padding-left: 14px; margin: 0 0 8px; line-height: 1.55; }
.tb-slide-block .tb-slide-prose { margin-top: 8px; }
.tb-subtema {
  margin: 16px 0;
  padding: 10px 14px;
  background: #f0fdf4;
  border-left: 3px solid #10b981;
  border-radius: 6px;
}
.tb-subtema h4 {
  font-size: 14px; font-weight: 700;
  color: #065f46;
  margin: 0 0 8px;
  display: flex; align-items: center; gap: 8px;
}
.tbst-marker { color: #10b981; }
.tb-fuente { color: var(--text-muted); font-size: 11.5px; font-style: italic; }

/* Marco normativo (extraido de las normas MINSA) */
.tb-marco { margin-top: 18px; }
.tb-norma {
  background: #fffbf7;
  border: 1px solid #fde4d3;
  border-left: 3px solid var(--vm-secondary);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.tb-norma h4 {
  font-size: 14.5px; font-weight: 700;
  color: var(--vm-secondary);
  margin: 0 0 8px;
}
.tb-finalidad {
  font-size: 14px; line-height: 1.65;
  color: #1f2937;
  margin: 0 0 10px;
  font-style: normal;
  text-align: justify;
}
.tb-norma-meta {
  font-size: 12.5px; font-weight: 600;
  color: var(--vm-secondary);
  margin: 10px 0 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.tb-norma .tb-defs dt { font-size: 13px; }
.tb-norma .tb-defs dd { font-size: 13px; }

.tb-cierre {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--vm-primary-lighter);
}
.tb-cierre h3 {
  font-size: 16px; color: var(--vm-primary);
  margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.tb-pasos {
  padding-left: 22px; margin: 0;
}
.tb-pasos li {
  font-size: 14px; line-height: 1.55;
  margin-bottom: 6px;
  color: #1f2937;
}
.tb-pasos li strong { color: var(--vm-primary); }

/* === NUEVO LAYOUT: preguntas comentadas al CENTRO === */
.encaps-main { margin-top: 24px; }
.encaps-main-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--vm-primary);
}
.encaps-main-head h2 { margin: 0; padding: 0; border: none; font-size: 22px; }
.encaps-main-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.stat-pill {
  font-size: 12px; font-weight: 700;
  padding: 5px 11px; border-radius: 14px;
}
.stat-pill.stat-total { background: var(--vm-gradient-d); color: white; }
.stat-pill.stat-ok { background: var(--green-soft); color: #14532d; }
.stat-pill.stat-warn { background: var(--orange-soft); color: #7c2d12; }
.encaps-main-info {
  font-size: 14px; color: var(--text-muted); margin-bottom: 22px;
}

.pregunta-big {
  background: white;
  border: 1px solid var(--border);
  border-left: 4px solid var(--vm-primary);
  border-radius: 12px;
  padding: 22px 26px;
  margin-bottom: 24px;
  transition: all .2s cubic-bezier(.2,.8,.2,1);
  animation: fadeInUp .35s cubic-bezier(.2,.8,.2,1) both;
}
.pregunta-big:hover { box-shadow: 0 8px 22px rgba(255,44,51,.10); }

.preg-head-big {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.preg-num-big {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-weight: 800; font-size: 14px;
  background: var(--vm-gradient-d); color: white;
  padding: 4px 11px; border-radius: 6px;
}
.preg-examen-big {
  font-weight: 600; font-size: 12.5px; color: var(--text);
  background: var(--bg-soft); padding: 4px 11px; border-radius: 6px;
}
.preg-clave-big {
  font-size: 13px; color: var(--text-muted);
}
.preg-clave-big strong {
  color: var(--green); background: var(--green-soft);
  padding: 3px 10px; border-radius: 5px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 14px;
}
.lock-badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 12px;
  margin-left: auto;
}
.lock-badge.ok { background: var(--green-soft); color: #14532d; }
.lock-badge.warn { background: var(--orange-soft); color: #7c2d12; }

.preg-enunciado-big {
  font-size: 16px; line-height: 1.65; color: var(--text);
  font-weight: 500; margin-bottom: 18px;
}

.preg-alts-big { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.alt-big {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--border); border-radius: 8px;
  background: white; transition: all .12s;
  font-size: 14.5px; line-height: 1.5;
}
.alt-letra-big {
  flex-shrink: 0; width: 32px; height: 32px;
  border-radius: 50%;
  background: #e2e8f0; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  font-family: 'JetBrains Mono', Consolas, monospace;
}
.alt-texto-big { flex: 1; }
.alt-big.correcta {
  background: var(--green-soft);
  border-color: var(--green); border-width: 2px;
  font-weight: 600; color: #14532d;
  box-shadow: 0 4px 12px rgba(16,185,129,.12);
}
.alt-big.correcta .alt-letra-big {
  background: var(--green); color: white; font-size: 16px;
  box-shadow: 0 2px 8px rgba(16,185,129,.4);
}

.comentario-docente {
  background: var(--vm-bg-naranja-suave);
  border-left: 4px solid var(--vm-secondary);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
}
.comentario-docente.warn {
  background: var(--orange-soft);
  border-left-color: var(--orange);
}
.cd-title {
  font-size: 12.5px; font-weight: 800;
  color: var(--vm-secondary);
  text-transform: uppercase; letter-spacing: .4px;
  margin-bottom: 8px;
}
.comentario-docente.warn .cd-title { color: var(--orange); }
.cd-body {
  font-size: 14px; line-height: 1.65; color: #7c2d12;
}

/* === RIGHT PANEL: docs MINSA + bibliografia + diapositivas (compacto) === */
.right-panel .rp-section {
  margin-bottom: 12px;
  background: var(--bg-soft);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.right-panel .rp-section > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  font-weight: 700; font-size: 13px;
  color: var(--vm-primary);
  border-bottom: 1px solid transparent;
}
.right-panel .rp-section > summary::-webkit-details-marker { display: none; }
.right-panel .rp-section > summary::after {
  content: '▾'; margin-left: auto; color: #94a3b8;
  transition: transform .15s;
}
.right-panel .rp-section[open] > summary::after { transform: rotate(180deg); }
.right-panel .rp-section[open] > summary { border-bottom-color: var(--border); }
.rp-section .rp-icon { font-size: 16px; }
.rp-section .rp-count {
  font-size: 11px; font-weight: 700; padding: 1px 8px;
  background: var(--vm-primary); color: white; border-radius: 10px;
}
.rp-section-body { padding: 12px; background: white; border-radius: 0 0 8px 8px; }

.rp-pdf-btn {
  display: block; padding: 8px 12px;
  background: var(--vm-gradient-d); color: white;
  border-radius: 6px; font-size: 12px; font-weight: 700;
  text-decoration: none; text-align: center;
  margin-bottom: 10px;
}
.rp-pdf-btn:hover { color: white; opacity: .9; text-decoration: none; }

.rp-diapos-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
}
.rp-diapo-thumb {
  position: relative; display: block;
  border: 1px solid var(--border); border-radius: 5px; overflow: hidden;
  aspect-ratio: 4/3;
  transition: all .12s;
}
.rp-diapo-thumb:hover { border-color: var(--vm-primary); }
.rp-diapo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rp-diapo-num {
  position: absolute; bottom: 3px; right: 3px;
  background: rgba(0,0,0,.75); color: white;
  padding: 1px 5px; border-radius: 8px;
  font-size: 9.5px; font-weight: 700;
}

.right-panel .doc-card { padding: 10px 12px; margin-bottom: 8px; font-size: 11.5px; }
.right-panel .doc-card .doc-title { font-size: 12.5px; }
.right-panel .doc-card .doc-meta { gap: 6px; font-size: 10.5px; }
.right-panel .doc-card .doc-desc { font-size: 11.5px; line-height: 1.4; }
.right-panel .doc-card .doc-actions { gap: 4px; flex-wrap: wrap; }
.right-panel .doc-card .doc-actions .btn { padding: 4px 8px; font-size: 11px; }

.biblio-list-rp {
  list-style: none; counter-reset: brp; padding: 0; margin: 0;
}
.biblio-list-rp li {
  counter-increment: brp;
  position: relative;
  padding: 8px 8px 8px 30px;
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
}
.biblio-list-rp li:last-child { border-bottom: none; }
.biblio-list-rp li::before {
  content: counter(brp);
  position: absolute; left: 4px; top: 8px;
  width: 20px; height: 20px;
  background: var(--vm-gradient-d); color: white;
  border-radius: 50%;
  font-size: 10.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.biblio-cite-rp { line-height: 1.5; margin-bottom: 4px; color: var(--text); }
.biblio-meta-rp { display: flex; flex-wrap: wrap; gap: 6px; font-size: 10.5px; color: var(--text-muted); margin-bottom: 4px; }
.biblio-meta-rp .badge { font-size: 9.5px; padding: 1px 5px; border-radius: 7px; }
.biblio-links-rp { font-size: 11px; }
.biblio-links-rp a { margin-right: 4px; }

/* IMPUGNACIONES · claves discordantes MINSA vs Villamedic */
.impugnaciones-list { display: flex; flex-direction: column; gap: 24px; }
.impugnacion {
  background: white; border: 1px solid var(--border);
  border-left: 4px solid var(--vm-secondary);
  border-radius: 12px; padding: 22px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  animation: fadeInUp .35s cubic-bezier(.2,.8,.2,1) both;
}
.impugnacion:hover { box-shadow: 0 8px 20px rgba(254,98,37,.10); }
.imp-head {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.imp-num {
  font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 13px;
  background: var(--vm-gradient-d); color: white;
  padding: 4px 10px; border-radius: 5px;
}
.imp-examen {
  font-weight: 600; font-size: 12px; color: var(--text);
  background: var(--bg-soft); padding: 4px 10px; border-radius: 5px;
}
.imp-claves { margin-left: auto; font-size: 13px; color: var(--text-muted); }
.imp-claves .cl-minsa, .imp-claves .cl-villamedic {
  display: inline-block; padding: 2px 9px; border-radius: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 800;
  margin: 0 4px;
}
.imp-claves .cl-minsa { background: #dbeafe; color: #1e40af; }
.imp-claves .cl-villamedic { background: var(--vm-bg-rojo-suave); color: var(--vm-primary); }
.imp-claves .vs { color: #94a3b8; font-weight: 700; padding: 0 4px; }

.imp-meta {
  display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px;
  color: var(--text-muted); margin-bottom: 12px;
}
.imp-area, .imp-tema { background: var(--bg-soft); padding: 3px 9px; border-radius: 4px; }
.imp-area { font-weight: 600; }

.imp-enunciado {
  font-size: 15px; line-height: 1.55; color: var(--text);
  font-weight: 500; margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--bg-soft); border-radius: 8px;
}
.imp-alts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.imp-alt {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13.5px; line-height: 1.45; background: white;
}
.imp-alt .imp-letra {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: #e2e8f0; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}
.imp-alt .imp-texto { flex: 1; }
.imp-alt.imp-clave-minsa { border-color: #93c5fd; background: #eff6ff; }
.imp-alt.imp-clave-minsa .imp-letra { background: #1e40af; color: white; }
.imp-alt.imp-clave-villamedic { border-color: var(--vm-primary-lighter); background: var(--vm-bg-rojo-suave); }
.imp-alt.imp-clave-villamedic .imp-letra { background: var(--vm-primary); color: white; }
.imp-alt.imp-clave-minsa.imp-clave-villamedic {
  background: linear-gradient(90deg, #eff6ff 0%, var(--vm-bg-rojo-suave) 100%);
  border-color: var(--green);
}
.imp-alt.imp-clave-minsa.imp-clave-villamedic .imp-letra { background: var(--green); color: white; }

.imp-badge {
  font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 12px;
  margin-left: auto; flex-shrink: 0;
}
.imp-badge.minsa-only { background: #1e40af; color: white; }
.imp-badge.villamedic-only { background: var(--vm-primary); color: white; }
.imp-badge.ambas { background: var(--green); color: white; }

.imp-argumentacion {
  background: var(--vm-bg-naranja-suave);
  border-left: 3px solid var(--vm-secondary);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px; margin-bottom: 12px;
}
.imp-arg-title {
  font-weight: 700; font-size: 13px; color: var(--vm-secondary);
  margin-bottom: 6px;
}
.imp-arg-body {
  font-size: 13.5px; line-height: 1.6; color: #7c2d12;
  white-space: pre-line;
}
.imp-bloque-link {
  display: inline-block; margin-top: 4px;
  font-size: 13px; font-weight: 600; color: var(--vm-primary);
  padding: 8px 14px; background: var(--vm-bg-rojo-suave);
  border-radius: 6px;
}
.imp-bloque-link:hover { background: var(--vm-primary); color: white; text-decoration: none; }

/* ENCAPS section · Banco de preguntas reales */
.encaps-section { margin-top: 40px; }
.encaps-empty {
  border: 2px dashed var(--vm-secondary-light);
  border-radius: 12px;
  padding: 36px 24px;
  text-align: center;
  background: linear-gradient(180deg, var(--vm-bg-naranja-suave) 0%, white 100%);
  transition: all .25s cubic-bezier(.2,.8,.2,1);
}
.encaps-empty:hover { border-color: var(--vm-secondary); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(254,98,37,.12); }
.encaps-empty-icon { font-size: 38px; margin-bottom: 10px; opacity: .85; }
.encaps-empty-title { font-size: 17px; font-weight: 700; color: var(--vm-primary); margin-bottom: 8px; }
.encaps-empty-text { font-size: 14px; color: var(--text-muted); max-width: 540px; margin: 0 auto; line-height: 1.55; }
.encaps-empty-text code {
  background: var(--vm-primary-soft); color: var(--vm-primary);
  padding: 2px 8px; border-radius: 5px;
  font-family: 'JetBrains Mono', Consolas, monospace; font-size: 12.5px;
  font-weight: 700;
}

/* Tarjetas de pregunta (en panel lateral derecho) */
.encaps-questions { display: flex; flex-direction: column; gap: 14px; }
.pregunta {
  background: white;
  border: 1px solid var(--border);
  border-left: 3px solid var(--vm-primary);
  border-radius: 8px;
  padding: 14px 14px;
  transition: all .2s cubic-bezier(.2,.8,.2,1);
  animation: fadeInUp .35s cubic-bezier(.2,.8,.2,1) both;
}
.pregunta:hover { box-shadow: 0 8px 22px rgba(255,44,51,.10); border-left-color: var(--vm-secondary); }
.preg-head {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 11px; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.preg-num {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-weight: 800; font-size: 11.5px;
  color: white; background: var(--vm-gradient-d);
  padding: 2px 8px; border-radius: 4px;
}
.preg-examen {
  font-weight: 600; color: var(--text);
  background: var(--bg-soft); padding: 2px 7px; border-radius: 4px;
  font-size: 10.5px;
}
.preg-clave { margin-left: auto; font-size: 10.5px; color: var(--text-muted); }
.preg-clave strong {
  color: var(--green); background: var(--green-soft);
  padding: 1px 6px; border-radius: 3px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 11px;
}
.preg-enunciado {
  font-size: 13.5px; line-height: 1.5; color: var(--text);
  font-weight: 500;
  margin-bottom: 10px;
}
.preg-alts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.preg-alts .alt {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  background: white; transition: all .15s;
  font-size: 12.5px; line-height: 1.45;
}
.preg-alts .alt-letra {
  flex-shrink: 0; width: 22px; height: 22px;
  border-radius: 50%;
  background: #e2e8f0; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 11px;
  font-family: 'JetBrains Mono', Consolas, monospace;
}
.preg-alts .alt-texto { flex: 1; padding-top: 1px; }
.preg-alts .alt.correcta {
  background: var(--green-soft);
  border-color: var(--green);
  border-width: 2px;
  font-weight: 600;
  color: #14532d;
}
.preg-alts .alt.correcta .alt-letra {
  background: var(--green); color: white;
  font-size: 12.5px;
  box-shadow: 0 2px 6px rgba(16,185,129,.4);
}
.justif {
  font-size: 12px; line-height: 1.55;
  background: var(--vm-bg-naranja-suave);
  border-left: 3px solid var(--vm-secondary);
  padding: 10px 12px; border-radius: 0 6px 6px 0;
  color: #7c2d12;
  margin-top: 4px;
}
.justif strong { color: var(--vm-secondary); font-weight: 700; }
.justif .justif-title {
  font-size: 11.5px; font-weight: 800;
  color: var(--vm-secondary);
  text-transform: uppercase; letter-spacing: .4px;
  margin-bottom: 5px;
}
.justif .justif-body {
  font-size: 12.5px; line-height: 1.6;
  color: #7c2d12;
}

/* Bibliografia MINSA */
.bibliografia { margin-top: 40px; }
.biblio-list {
  list-style: none; counter-reset: biblio;
  padding: 0; margin: 0;
}
.biblio-list li {
  counter-increment: biblio;
  position: relative;
  padding: 16px 18px 16px 56px;
  border: 1px solid var(--border); border-radius: 8px;
  background: white;
  margin-bottom: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.biblio-list li:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.biblio-list li::before {
  content: counter(biblio);
  position: absolute; left: 14px; top: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--vm-gradient-d); color: white;
  font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(255,44,51,.25);
}
.biblio-list .biblio-cite {
  font-size: 14px; line-height: 1.55;
  color: var(--text);
  margin-bottom: 8px;
}
.biblio-list .biblio-cite strong { color: #0f172a; }
.biblio-list .biblio-meta {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  font-size: 12px; color: var(--text-muted);
}
.biblio-list .biblio-links { margin-left: auto; }
.biblio-list .biblio-links a {
  margin-right: 4px; font-size: 12.5px;
}

/* Topbar search */
.topbar-search {
  display: flex; align-items: center; gap: 0;
  flex: 1; max-width: 480px; margin: 0 24px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg-soft);
  overflow: hidden; transition: border-color .15s;
}
.topbar-search:focus-within { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(255,44,51,.1); }
.topbar-search input {
  flex: 1; border: none; background: transparent;
  padding: 9px 14px; font-size: 13.5px; outline: none; color: var(--text);
  font-family: inherit;
}
.topbar-search button {
  border: none; background: transparent; padding: 9px 14px;
  font-size: 14px; cursor: pointer; color: var(--text-muted);
}
.topbar-search button:hover { color: var(--primary); }

/* Hero search - Fenix (boton separado afuera del input) */
.hero-search-wrap {
  max-width: 720px; margin: 36px auto 0;
  position: relative;
}
.hero-search {
  display: flex; align-items: stretch;
  gap: 12px;
  background: transparent; border: none;
  position: relative;
}
.hero-search input {
  flex: 1; border: 2px solid rgba(255,255,255,.4);
  background: white;
  padding: 16px 20px; font-size: 16px; outline: none; color: var(--text);
  font-family: inherit;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  transition: all .15s;
}
.hero-search input:focus { border-color: white; box-shadow: 0 12px 32px rgba(0,0,0,.22); }
.hero-search input::placeholder { color: #9CA3AF; }
.hero-search button {
  border: none; background: var(--vm-primary); color: white;
  padding: 0 32px; font-size: 15px; font-weight: 700; cursor: pointer;
  border-radius: 10px;
  transition: all .15s;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
  white-space: nowrap;
}
.hero-search button:hover { background: var(--vm-primary-light); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0,0,0,.22); }
.hero-suggestions {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-top: 20px;
  position: relative;
}
.hero-suggestions a {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  padding: 6px 14px; border-radius: 16px;
  font-size: 12.5px; color: white;
  font-weight: 500;
}
.hero-suggestions a:hover { background: white; color: var(--vm-primary); text-decoration: none; }

/* Brecha (sin docs) */
.brecha-banner {
  background: var(--red-soft); border: 1px solid #fecaca;
  border-radius: 10px; padding: 24px 28px; margin: 24px 0;
}
.brecha-banner h2 { color: var(--red); border: none; padding: 0; margin-bottom: 8px; font-size: 18px;}
.brecha-banner p { font-size: 14px; color: #7f1d1d; margin-bottom: 12px; }
.brecha-banner ul { margin-left: 20px; color: #991b1b; font-size: 13.5px; }

/* Index/landing - Fenix theme */
.hero {
  text-align: center; padding: 80px 24px 64px;
  background: var(--vm-gradient-d);
  color: white;
  border-bottom: 4px solid var(--vm-secondary);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at top right, rgba(255,255,255,.15), transparent 60%);
  pointer-events: none;
}
.hero h1 {
  font-size: 48px; line-height: 1.1; letter-spacing: -1.2px;
  margin-bottom: 16px; color: white; position: relative;
}
.hero h1 .grad {
  background: linear-gradient(180deg, white 0%, #FFAA6F 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  font-weight: 900;
}
.hero-subtitle {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #FFAA6F;
  margin: 4px 0 18px;
  text-transform: uppercase;
  position: relative;
}
.hero p { font-size: 17px; color: rgba(255,255,255,.92); max-width: 680px; margin: 0 auto 8px; position: relative; }
.hero p strong { color: white; }
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px; margin: 36px auto 0; max-width: 720px;
  position: relative;
}
.stat {
  text-align: center;
  background: rgba(255,255,255,.13); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.22); border-radius: 12px;
  padding: 20px 14px;
}
.stat .v { font-size: 32px; font-weight: 800; color: var(--vm-secondary-light); line-height: 1; }
.stat .l { font-size: 11px; color: rgba(255,255,255,.85); margin-top: 6px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }

.areas-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px; margin: 32px 0;
}
.area-card {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 22px; transition: all .2s;
  border-top: 4px solid var(--vm-primary);
  position: relative;
}
.area-card:hover {
  border-color: var(--vm-primary);
  box-shadow: 0 10px 28px rgba(255, 44, 51, .15);
  transform: translateY(-3px);
}
.area-card h3 { font-size: 17px; margin-bottom: 4px; color: var(--vm-primary); font-weight: 700; }
.area-card .area-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.area-card ul { list-style: none; padding: 0; }
.area-card ul li { font-size: 13px; padding: 4px 0; color: var(--text-muted); }
.area-card ul li::before { content: '›'; color: var(--vm-secondary); margin-right: 6px; font-weight: 700; }

/* Area page · lista de bloques */
.subarea-block { margin-bottom: 24px; }
.subarea-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: .4px;
  border-bottom: 2px solid var(--vm-primary);
  padding-bottom: 6px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px;
}
.sub-count {
  font-size: 11px; color: var(--text-muted); font-weight: 500;
  text-transform: none; letter-spacing: 0;
}
.bloques-list { display: grid; grid-template-columns: 1fr; gap: 8px; }
.area-bloque-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border); border-left: 3px solid var(--vm-primary);
  border-radius: 8px; background: white;
  text-decoration: none; color: var(--text);
  transition: all .15s cubic-bezier(.2,.8,.2,1);
}
.area-bloque-item:hover {
  border-left-color: var(--vm-secondary);
  box-shadow: 0 4px 12px rgba(255,44,51,.08);
  transform: translateX(2px);
  text-decoration: none;
}
.abi-bid {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 11px; font-weight: 800;
  background: var(--vm-bg-rojo-suave); color: var(--vm-primary);
  padding: 3px 8px; border-radius: 4px;
  flex-shrink: 0; min-width: 56px; text-align: center;
}
.abi-desc { flex: 1; font-size: 14px; font-weight: 500; }
.abi-stats { display: flex; gap: 10px; flex-shrink: 0; font-size: 12px; }
.abi-q, .abi-d {
  background: var(--bg-soft); padding: 3px 8px; border-radius: 4px;
  color: var(--text-muted); font-weight: 600;
}
.abi-q { background: var(--green-soft); color: #14532d; }

/* Stats / charts section */
.stats-section { padding: 36px 40px 24px; }
.section-head { margin-bottom: 22px; }
.section-head h2 { font-size: 22px; margin-bottom: 4px; letter-spacing: -.2px; }
.section-head p { font-size: 14px; color: var(--text-muted); }
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 20px;
}
.chart-card {
  background: white;
  border: 1px solid var(--border);
  border-top: 4px solid var(--vm-primary);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.chart-card h3 { font-size: 16px; margin-bottom: 2px; color: var(--vm-primary); }
.chart-card .chart-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.chart-card canvas { max-width: 100%; min-height: 360px; }
.chart-wide { width: 100%; }

@media (max-width: 1100px) {
  .charts-grid { grid-template-columns: 1fr; }
  .chart-card canvas { height: 320px !important; }
}

/* ====== QUICK SEARCH DROPDOWN ====== */
.qs-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,.18);
  max-height: 480px; overflow-y: auto;
  z-index: 100;
  padding: 6px;
  animation: fadeIn .15s ease-out both;
}
.qs-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: background .12s;
}
.qs-item:hover { background: var(--bg-soft); text-decoration: none; }
.qs-icon { font-size: 18px; flex-shrink: 0; line-height: 1.4; }
.qs-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.qs-title {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.qs-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qs-tag {
  font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px;
}
.qs-tag.qs-q { background: var(--green-soft); color: #14532d; }
.qs-tag.qs-d { background: var(--vm-bg-rojo-suave); color: var(--vm-primary); }
.qs-bloque { font-size: 11px; color: var(--text-muted); }
.qs-desc {
  font-size: 12px; color: var(--text-muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.qs-empty {
  padding: 18px 14px; font-size: 13px; color: var(--text-muted); text-align: center;
}
.qs-more {
  display: block; padding: 10px;
  text-align: center; font-size: 12.5px; font-weight: 600;
  color: var(--vm-primary);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.qs-more:hover { background: var(--vm-bg-rojo-suave); text-decoration: none; }
.qs-dropdown mark {
  background: #fef3c7; color: var(--text); padding: 0 2px; border-radius: 2px;
}

/* ====== ANIMACIONES SUAVES ====== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 6px 16px rgba(0,0,0,.18); }
  50% { box-shadow: 0 6px 24px rgba(255,44,51,.45); }
}

.hero h1 { animation: fadeInUp .6s cubic-bezier(.2,.8,.2,1) both; }
.hero-subtitle { animation: fadeInUp .7s cubic-bezier(.2,.8,.2,1) .1s both; }
.hero p { animation: fadeInUp .7s cubic-bezier(.2,.8,.2,1) .2s both; }
.hero-search-wrap { animation: fadeInUp .7s cubic-bezier(.2,.8,.2,1) .3s both; }
.area-card { animation: fadeInUp .6s cubic-bezier(.2,.8,.2,1) both; }
.area-card:nth-child(1){animation-delay:.05s} .area-card:nth-child(2){animation-delay:.10s}
.area-card:nth-child(3){animation-delay:.15s} .area-card:nth-child(4){animation-delay:.20s}
.area-card:nth-child(5){animation-delay:.25s} .area-card:nth-child(6){animation-delay:.30s}
.bloque-header { animation: fadeIn .4s ease-out both; }
.doc-card { animation: fadeInUp .35s cubic-bezier(.2,.8,.2,1) both; }
.biblio-list li { animation: fadeInUp .35s cubic-bezier(.2,.8,.2,1) both; }
.tree-drill .lvl-area-body { animation: slideInRight .25s cubic-bezier(.2,.8,.2,1) both; }
.tree-drill .lvl-sub-body { animation: slideInRight .2s cubic-bezier(.2,.8,.2,1) both; }

/* Hero search button glow al focus */
.hero-search:focus-within button { animation: pulse 2.4s ease-in-out infinite; }

/* Doc card lift on hover */
.doc-card { transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s, border-color .2s; }
.doc-card:hover { transform: translateY(-2px); }

/* Btn lift */
.btn { transition: transform .15s cubic-bezier(.2,.8,.2,1), background .15s, box-shadow .15s, color .15s; }
.btn:hover { transform: translateY(-1px); }

/* Smooth scroll y fonts */
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

/* ====== MOBILE MENU BUTTON (oculto en desktop) ====== */
.mobile-menu-btn {
  display: none;
  position: fixed; top: 14px; left: 14px; z-index: 50;
  width: 44px; height: 44px;
  border: none; border-radius: 10px;
  background: var(--vm-gradient-d); color: white;
  font-size: 22px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(255,44,51,.3);
  align-items: center; justify-content: center;
}
.mobile-menu-btn:active { transform: scale(.95); }
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,.5); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .2s;
}
.sidebar-overlay.show { opacity: 1; }

/* ====== RESPONSIVE BREAKPOINTS ====== */
@media (max-width: 1400px) {
  :root { --rightpanel-w: 340px; }
}

@media (max-width: 1200px) {
  /* Right panel oculto por defecto, accesible via boton flotante */
  .layout.has-right-panel .main { margin-right: 0; }
  .right-panel {
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.2,.8,.2,1);
    box-shadow: -4px 0 24px rgba(0,0,0,.3);
    z-index: 45;
    width: 380px;
  }
  .right-panel.open { transform: translateX(0); }
  .layout.has-right-panel .encaps-toggle-btn { display: flex; }
}

@media (max-width: 1100px) {
  :root { --sidebar-w: 270px; }
  .content { padding: 28px 28px 64px; }
  .hero h1 { font-size: 38px; }
  .hero-subtitle { font-size: 19px; letter-spacing: 3px; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 280px; }
  .mobile-menu-btn { display: flex; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.2,.8,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.3);
    z-index: 45;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main { margin-left: 0; }
  .topbar {
    padding: 12px 16px 12px 70px;
    flex-wrap: wrap; gap: 10px;
  }
  .topbar .breadcrumb { font-size: 13.5px; flex: 1 1 100%; order: 1; font-weight: 600; }
  .topbar-search { margin: 0; max-width: 100%; flex: 1; order: 2; }
  .topbar .actions { order: 3; }
  .content { padding: 20px 18px 56px; }
  .hero { padding: 60px 18px 50px; }
  .hero h1 { font-size: 32px; letter-spacing: -.5px; }
  .hero-subtitle { font-size: 16px; letter-spacing: 2.5px; margin-bottom: 12px; }
  .hero p { font-size: 15px; }
  .hero-search { flex-direction: column; gap: 10px; }
  .hero-search input { padding: 14px 16px; font-size: 15px; }
  .hero-search button { padding: 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .areas-grid { grid-template-columns: 1fr; gap: 14px; }
  .bloque-header h1 { font-size: 22px; }
  .bloque-header .meta { gap: 10px; font-size: 12.5px; }
  .doc-card { padding: 14px; }
  .doc-card .doc-head { flex-direction: column; gap: 8px; }
  .biblio-list li { padding: 14px 14px 14px 50px; }
  .biblio-list li::before { width: 28px; height: 28px; font-size: 12px; left: 12px; top: 14px; }
  .resumen-content { padding: 14px 16px; }
  .resumen-content pre { font-size: 11.5px; padding: 12px; }
  .topbar-search input { font-size: 13px; padding: 8px 12px; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 26px; }
  .hero-subtitle { font-size: 14px; letter-spacing: 2px; }
  .stats { grid-template-columns: 1fr; }
  .docs-grid { gap: 10px; }
  .biblio-list .biblio-meta { flex-direction: column; align-items: flex-start; gap: 6px; }
  .biblio-list .biblio-links { margin-left: 0; }
  section h2 { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================================
   LOGIN PAGE · linea grafica Fenix Villamedic
   ===================================================================== */
body.login-page {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 90% -10%, rgba(255, 44, 51, .08), transparent 60%),
    radial-gradient(1000px 500px at -10% 110%, rgba(254, 98, 37, .07), transparent 55%),
    linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--text);
}
.login-shell {
  width: 100%;
  max-width: 1080px;
  background: white;
  border-radius: 18px;
  box-shadow: 0 30px 80px -20px rgba(15, 23, 42, .18), 0 8px 24px rgba(15, 23, 42, .06);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 580px;
}

/* HERO LATERAL */
.login-hero {
  position: relative;
  background: linear-gradient(135deg, #FF2C33 0%, #FE6225 100%);
  color: white;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.login-hero-pattern {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(255, 255, 255, .12), transparent 60%),
    radial-gradient(500px 250px at 0% 100%, rgba(0, 0, 0, .15), transparent 60%);
  pointer-events: none;
}
.login-hero-content { position: relative; z-index: 1; }
.login-hero-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  opacity: .85;
  margin-bottom: 14px;
}
.login-hero-title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 12px;
  letter-spacing: -1.2px;
}
.login-hero-sub {
  font-size: 14px;
  font-weight: 500;
  opacity: .9;
  margin: 0 0 36px;
}
.login-hero-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-hero-features li {
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}
.login-hero-features li .lhf-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

/* CARD DEL FORMULARIO */
.login-card {
  padding: 56px 56px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-card-head {
  margin-bottom: 28px;
  text-align: center;
}
.login-logo {
  width: 130px;
  height: auto;
  margin: 0 auto 22px;
  display: block;
}
.login-card-head h2 {
  display: block;
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
  padding: 0;
  color: var(--text);
  letter-spacing: -.4px;
  text-align: center;
  border: none;
}
.login-card-head p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 auto;
  max-width: 320px;
  line-height: 1.55;
  text-align: center;
}

/* FORM */
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.login-field input {
  font: inherit;
  font-size: 14.5px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.login-field input::placeholder { color: #9ca3af; }
.login-field input:hover { border-color: #cbd5e1; }
.login-field input:focus {
  border-color: var(--vm-primary);
  box-shadow: 0 0 0 3px rgba(255, 44, 51, .12);
}

.login-pass-wrap { position: relative; }
.login-pass-wrap input { width: 100%; box-sizing: border-box; padding-right: 44px; }
.login-pass-toggle {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s, background .15s;
}
.login-pass-toggle:hover { color: var(--vm-primary); background: var(--vm-bg-rojo-suave); }

/* MENSAJE DE ERROR */
.login-error {
  display: none;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 3px solid #ef4444;
  border-radius: 6px;
  color: #b91c1c;
  font-size: 13.5px;
  line-height: 1.5;
}
.login-error.is-visible { display: block; animation: fadeInUp .3s ease; }

/* BOTON SUBMIT */
.login-submit {
  position: relative;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 13px 18px;
  border: none;
  border-radius: 8px;
  background: var(--vm-gradient-h);
  color: white;
  cursor: pointer;
  letter-spacing: .2px;
  margin-top: 4px;
  box-shadow: 0 6px 16px -4px rgba(255, 44, 51, .35);
  transition: transform .12s, box-shadow .15s, opacity .15s;
}
.login-submit:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -6px rgba(255, 44, 51, .45); }
.login-submit:active { transform: translateY(0); }
.login-submit:disabled { opacity: .7; cursor: progress; }
.login-submit .ls-loader {
  display: none;
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: white;
  border-radius: 50%;
  animation: ls-spin .7s linear infinite;
}
.login-submit.is-loading .ls-text { visibility: hidden; }
.login-submit.is-loading .ls-loader { display: block; }
@keyframes ls-spin { to { transform: rotate(360deg); } }

.login-foot {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 18px 0 0;
}

/* RESPONSIVE */
@media (max-width: 880px) {
  .login-shell { grid-template-columns: 1fr; min-height: auto; max-width: 480px; }
  .login-hero { display: none; }
  .login-card { padding: 40px 28px 32px; }
  .login-card-head h2 { font-size: 22px; }
}

/* INDICADOR DE SESION EN SIDEBAR */
.sidebar-user {
  margin: 0 12px 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}
.sidebar-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--vm-gradient-d);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}
.sidebar-user-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar-user-name {
  color: var(--text-side-active);
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-meta {
  color: var(--text-side);
  font-size: 11px;
  opacity: .75;
}
.sidebar-logout {
  background: transparent;
  border: none;
  color: var(--text-side);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex; align-items: center;
  transition: color .15s, background .15s;
}
.sidebar-logout:hover { color: white; background: rgba(255, 255, 255, .1); }

/* Botón cerrar sesión en topbar */
.topbar-logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.topbar-logout:hover {
  border-color: var(--vm-primary);
  box-shadow: 0 4px 12px -4px rgba(255, 44, 51, .25);
}
.topbar-logout .tl-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--vm-gradient-d);
  color: white;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 800;
  flex-shrink: 0;
  letter-spacing: -.2px;
}
.topbar-logout .tl-text { line-height: 1; }
.topbar-logout svg { color: var(--text-muted); transition: color .15s; }
.topbar-logout:hover svg { color: var(--vm-primary); }
@media (max-width: 600px) {
  .topbar-logout .tl-text { display: none; }
  .topbar-logout { padding: 4px; }
}
