/* ══════════════════════════════════════════════════════════════════════════
   FOLIUM — Linear Design System
   ══════════════════════════════════════════════════════════════════════════ */

/* ─── 1. Reset + CSS Custom Properties ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Surfaces */
  --bg-base:        #111113;
  --bg-surface:     #1a1a1d;
  --bg-surface-2:   #212124;
  --bg-surface-3:   #27272b;
  --bg-header:      #111113;

  /* Sidebar */
  --sidebar-bg:     #161618;
  --sidebar-w:      220px;

  /* Borders */
  --border:         rgba(255,255,255,.09);
  --border-light:   rgba(255,255,255,.05);
  --border-strong:  rgba(255,255,255,.13);

  /* Text */
  --text-primary:   #e2e2e5;
  --text-secondary: #a4a4b0;
  --text-muted:     #848494;
  --text-faint:     #606070;

  /* Accent — Linear indigo */
  --accent:         #5e6ad2;
  --accent-hover:   #7c85e0;
  --accent-light:   #a5b4fc;
  --accent-muted:   rgba(94,106,210,.12);

  /* Semantic */
  --success:        #26b986;
  --success-bg:     rgba(38,185,134,.10);
  --success-rgb:    38,185,134;
  --warning:        #d97706;
  --warning-bg:     rgba(217,119,6,.10);
  --warning-rgb:    217,119,6;
  --danger:         #e5484d;
  --danger-bg:      rgba(229,72,77,.10);
  --danger-rgb:     229,72,77;

  /* Aliases */
  --bg-card:              #161617;
  --bg-input:             #1c1c1e;
  --border-solid:         #27272a;
  --accent-blue:          #818cf8;
  --accent-blue-hover:    #6366f1;
  --accent-blue-rgb:      129,140,248;
  --purple:               #8e4ec6;
  --purple-rgb:           142,78,198;
  --purple-muted:         rgba(142,78,198,.15);
}

/* ─── Navy theme ────────────────────────────────────────────────────────── */
[data-theme="navy"] {
  --bg-base:        #0f172a;
  --bg-surface:     #1e293b;
  --bg-surface-2:   #263348;
  --bg-surface-3:   #2d3d56;
  --bg-header:      #0b1322;
  --sidebar-bg:     #0d1829;

  --border:         rgba(255,255,255,.08);
  --border-light:   rgba(255,255,255,.04);
  --border-strong:  rgba(255,255,255,.12);

  --text-primary:   #f1f5f9;
  --text-secondary: #a8bcd4;
  --text-muted:     #7d94ae;
  --text-faint:     #5e7590;

  --accent:         #3b82f6;
  --accent-hover:   #2563eb;
  --accent-light:   #93c5fd;
  --accent-muted:   rgba(59,130,246,.15);

  --success:        #34d399;
  --success-bg:     rgba(52,211,153,.10);
  --success-rgb:    52,211,153;
  --warning:        #fbbf24;
  --warning-bg:     rgba(251,191,36,.10);
  --warning-rgb:    251,191,36;
  --danger:         #f87171;
  --danger-bg:      rgba(248,113,113,.10);
  --danger-rgb:     248,113,113;

  --bg-card:        #1e293b;
  --bg-input:       #263348;
  --border-solid:   #334155;
  --accent-blue:    #60a5fa;
  --accent-blue-hover: #3b82f6;
  --accent-blue-rgb: 96,165,250;
  --purple:         #a78bfa;
  --purple-rgb:     167,139,250;
  --purple-muted:   rgba(167,139,250,.15);
}

/* ─── Dark Minimal theme ────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg-base:        #09090b;
  --bg-surface:     #111113;
  --bg-surface-2:   #18181b;
  --bg-surface-3:   #1f1f23;
  --bg-header:      #050507;
  --sidebar-bg:     #050507;

  --border:         rgba(255,255,255,.06);
  --border-light:   rgba(255,255,255,.03);
  --border-strong:  rgba(255,255,255,.10);

  --text-primary:   #fafafa;
  --text-secondary: #b8b8c0;
  --text-muted:     #90909a;
  --text-faint:     #6c6c78;

  --accent:         #818cf8;
  --accent-hover:   #6366f1;
  --accent-light:   #a5b4fc;
  --accent-muted:   rgba(99,102,241,.15);

  --success:        #4ade80;
  --success-bg:     rgba(74,222,128,.08);
  --success-rgb:    74,222,128;
  --warning:        #facc15;
  --warning-bg:     rgba(250,204,21,.08);
  --warning-rgb:    250,204,21;
  --danger:         #f87171;
  --danger-bg:      rgba(248,113,113,.08);
  --danger-rgb:     248,113,113;

  --bg-card:        #111113;
  --bg-input:       #18181b;
  --border-solid:   #27272a;
  --accent-blue:    #818cf8;
  --accent-blue-hover: #6366f1;
  --accent-blue-rgb: 129,140,248;
  --purple:         #c084fc;
  --purple-rgb:     192,132,252;
  --purple-muted:   rgba(192,132,252,.12);
}

/* ─── Light theme ───────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-base:        #f0f0f4;
  --bg-surface:     #ffffff;
  --bg-surface-2:   #f5f5f8;
  --bg-surface-3:   #ebebef;
  --bg-header:      #ffffff;
  --sidebar-bg:     #ffffff;

  --border:         rgba(0,0,0,.10);
  --border-light:   rgba(0,0,0,.06);
  --border-strong:  rgba(0,0,0,.15);

  --text-primary:   #111113;
  --text-secondary: #3c3c50;
  --text-muted:     #606078;
  --text-faint:     #8e8ea8;

  --accent:         #5e6ad2;
  --accent-hover:   #4d59c9;
  --accent-light:   #4d59c9;
  --accent-muted:   rgba(94,106,210,.10);

  --success:        #1a9e6e;
  --success-bg:     rgba(26,158,110,.09);
  --success-rgb:    26,158,110;
  --warning:        #b86b00;
  --warning-bg:     rgba(184,107,0,.09);
  --warning-rgb:    184,107,0;
  --danger:         #d93025;
  --danger-bg:      rgba(217,48,37,.09);
  --danger-rgb:     217,48,37;

  --bg-card:        #ffffff;
  --bg-input:       #f5f5f8;
  --border-solid:   #d8d8e0;
  --accent-blue:    #4d59c9;
  --accent-blue-hover: #3d4ab8;
  --accent-blue-rgb: 77,89,201;
  --purple:         #7c3aed;
  --purple-rgb:     124,58,237;
  --purple-muted:   rgba(124,58,237,.10);
}

/* Light-specific overrides */
[data-theme="light"] a:hover { color: var(--accent); }
[data-theme="light"] .sidebar {
  border-right: 1px solid var(--border);
  box-shadow: none;
}
[data-theme="light"] .nav-item { color: var(--text-secondary); }
[data-theme="light"] .nav-item:hover { background: var(--bg-surface-3); color: var(--text-primary); }
[data-theme="light"] .nav-item.active { background: var(--accent-muted); color: var(--accent); }
[data-theme="light"] .sidebar-logo { color: var(--text-primary); }
[data-theme="light"] .logo-mark { background: var(--accent); }
[data-theme="light"] .nav-group-label { color: var(--text-muted); }
[data-theme="light"] .nav-divider { background: var(--border); }
[data-theme="light"] .nav-item.nav-sub { color: var(--text-muted); }
[data-theme="light"] .nav-item.nav-sub:hover { color: var(--text-secondary); background: var(--bg-surface-3); }
[data-theme="light"] .nav-item.nav-sub.active { color: var(--accent); background: var(--accent-muted); }
[data-theme="light"] .sidebar-user { border-top-color: var(--border); color: var(--text-secondary); }
[data-theme="light"] .user-avatar { background: var(--bg-surface-3); color: var(--text-secondary); border-color: var(--border); }
[data-theme="light"] .theme-cycle-btn { color: var(--text-muted); border-color: var(--border); }
[data-theme="light"] .theme-cycle-btn:hover { color: var(--text-secondary); background: var(--bg-surface-3); }
[data-theme="light"] .date-input { color-scheme: light; }
[data-theme="light"] .issue-row:hover { background: rgba(0,0,0,.025); }
[data-theme="light"] .card { box-shadow: 0 1px 3px rgba(0,0,0,.08); }
[data-theme="light"] .btn-secondary { color: var(--text-secondary); }
[data-theme="light"] .btn-secondary:hover { color: var(--text-primary); }

/* ─── 2. Base ──────────────────────────────────────────────────────────── */
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-base);
  transition: background .2s, color .2s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { color: #fff; text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.95rem; }

/* Tabular nums para datos, ROLs, folios, conteos */
.tabular-nums,
td, th,
.badge,
.rol-badge,
.stat-number,
[data-numeric] {
  font-variant-numeric: tabular-nums;
}

/* Labels y captions */
.label, .caption, .overline {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── 2b. Lucide Icons ─────────────────────────────────────────────────── */
.icon-inline {
  width: 16px; height: 16px;
  display: inline-block;
  vertical-align: -2px;
  stroke-width: 2;
}
.icon-nav {
  width: 14px; height: 14px;
  display: inline-block;
  vertical-align: -2px;
  stroke-width: 1.75;
  opacity: 0.7;
}
.icon-btn {
  width: 14px; height: 14px;
  display: inline-block;
  vertical-align: -2px;
  stroke-width: 2;
  margin-right: 2px;
}
.icon-sm {
  width: 12px; height: 12px;
  display: inline-block;
  vertical-align: -1px;
  stroke-width: 2;
}
.icon-lg {
  width: 20px; height: 20px;
  display: inline-block;
  vertical-align: -4px;
  stroke-width: 1.75;
}
.icon-xl {
  width: 32px; height: 32px;
  display: block;
  stroke-width: 1.5;
  margin: 0 auto;
  opacity: 0.5;
}
@keyframes icon-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.icon-spin { animation: icon-spin 2s linear infinite; }

/* ─── 2c. Health dot ───────────────────────────────────────────────────── */
#health-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #a6e3a1;
  margin-right: 5px;
  vertical-align: middle;
  transition: background .3s ease;
  box-shadow: 0 0 6px rgba(166,227,161,.5);
}

/* ─── 2d. Job widget ───────────────────────────────────────────────────── */
.job-widget {
  display: none;
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 9000; width: 310px;
  background: #1e2533;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  padding: 1rem 1.1rem;
  font-size: .85rem; color: #cdd6f4;
  transition: opacity .3s ease;
}
.job-widget-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem;
}
.job-widget-header strong { color: #89b4fa; }
.job-widget-close {
  background: none; border: none; color: #585b70;
  cursor: pointer; padding: 2px; line-height: 1;
  border-radius: 4px; transition: color .15s;
}
.job-widget-close:hover { color: #cdd6f4; }
.job-widget-msg {
  color: #a6adc8; margin-bottom: .55rem; min-height: 1.2em; line-height: 1.4;
}
.job-widget-track {
  background: #313244; border-radius: 6px; height: 8px; overflow: hidden; margin-bottom: .5rem;
}
.job-widget-bar {
  height: 100%; width: 0%; background: #89b4fa;
  border-radius: 6px; transition: width .4s ease;
}
.job-widget-footer {
  display: flex; justify-content: space-between; align-items: center;
}
.job-widget-count { color: #585b70; font-size: .8rem; }
.job-widget-result-link {
  color: #a6e3a1; font-weight: 600; text-decoration: none; font-size: .85rem;
}
.job-widget-result-link:hover { color: #fff; text-decoration: none; }
.job-widget-cancel {
  background: none; border: 1px solid #f38ba8; color: #f38ba8;
  border-radius: 5px; padding: 2px 8px; font-size: .78rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  transition: background .15s, color .15s;
}
.job-widget-cancel:hover { background: #f38ba8; color: #1e2533; }
.job-widget-cancel:disabled { opacity: .5; cursor: default; }

/* ─── 3. App Layout ─────────────────────────────────────────────────────── */
body {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
body.login-body,
body.public-body {
  display: block;
  height: auto;
  overflow: auto;
}

/* Sidebar */
.sidebar {
  width: calc(var(--sidebar-w) + 8px);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: sticky;
  top: 0;
  transition: width .2s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -.02em;
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar-logo:hover { color: var(--text-primary); text-decoration: none; }

.sidebar-brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-logo-kicker {
  font-size: 10px;
  line-height: 1;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 3px;
}

.sidebar-logo-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.02em;
}

.logo-mark {
  width: 28px; height: 28px;
  background: linear-gradient(180deg, rgba(129,140,248,.95), rgba(94,106,210,.92));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: white;
  box-shadow: 0 8px 18px rgba(94,106,210,.22);
}

.sidebar-nav {
  display: flex; flex-direction: column; padding: 4px 0 8px;
}

.nav-divider {
  height: 1px; background: var(--border);
  margin: 6px 8px;
}

.nav-group-label {
  font-size: 10.5px; font-weight: 700; color: var(--text-faint);
  letter-spacing: .07em; text-transform: uppercase;
  padding: 10px 16px 4px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 11px;
  font-size: 13px; font-weight: 400; color: var(--text-secondary);
  cursor: pointer; text-decoration: none;
  transition: background .12s, color .12s, border-color .12s;
  user-select: none; border-radius: 12px;
  position: relative;
  margin: 1px 8px;
  border: 1px solid transparent;
}
.nav-item:hover {
  background: rgba(255,255,255,.03);
  color: var(--text-primary);
  text-decoration: none;
  border-color: rgba(255,255,255,.05);
}
.nav-item.active {
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.022));
  color: var(--text-primary);
  border-color: rgba(255,255,255,.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: var(--accent-light);
}

.nav-item-primary {
  align-items: flex-start;
  padding-top: 8px;
  padding-bottom: 8px;
}

.nav-item-search {
  background: linear-gradient(180deg, rgba(var(--accent-blue-rgb), .08), rgba(var(--accent-blue-rgb), .03));
  border-color: rgba(var(--accent-blue-rgb), .14);
}
.nav-item-search:hover {
  background: linear-gradient(180deg, rgba(var(--accent-blue-rgb), .12), rgba(var(--accent-blue-rgb), .05));
  border-color: rgba(var(--accent-blue-rgb), .18);
}
.nav-item-search .nav-label {
  color: var(--text-primary);
}
.nav-item-search .nav-meta {
  color: var(--text-secondary);
}

.nav-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 1px;
}

.nav-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  line-height: 1.2;
}

.nav-meta {
  display: block;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item.nav-sub {
  font-size: 12.5px;
  padding: 5px 11px 5px 18px;
  color: var(--text-muted);
  gap: 8px;
}
.nav-item.nav-sub .nav-icon { width: 13px; height: 13px; opacity: .45; }
.nav-item.nav-sub:hover { color: var(--text-secondary); }
.nav-item.nav-sub.active { color: var(--text-primary); background: rgba(255,255,255,.05); }
.nav-item.nav-sub.active .nav-icon { opacity: .8; }

.nav-icon {
  width: 15px; height: 15px; flex-shrink: 0;
  display: inline-block; vertical-align: middle;
  opacity: .62; stroke-width: 1.6;
  margin-top: 1px;
}
.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: .9; }

.nav-count {
  margin-left: auto;
  align-self: center;
  font-size: 10.5px; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  background: rgba(var(--warning-rgb), .18);
  border: 1px solid rgba(var(--warning-rgb), .18);
  padding: 1px 6px; border-radius: 999px;
}

/* ── Search item kbd badge ── */
.nav-kbd {
  margin-left: auto;
  align-self: center;
  font-size: 10px; color: var(--text-faint);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  padding: 2px 6px; border-radius: 6px;
  font-family: inherit; letter-spacing: .01em;
  transition: opacity .15s;
}
.nav-item:hover .nav-kbd,
.nav-item.active .nav-kbd {
  opacity: 1;
  color: var(--text-muted);
}
[data-theme="light"] .nav-kbd {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.1);
}
[data-theme="light"] .nav-item-search {
  background: rgba(var(--accent-blue-rgb), .08);
  border-color: rgba(var(--accent-blue-rgb), .14);
}

.sidebar-divider {
  height: 1px; background: var(--border);
  margin: 6px 0;
}

.sidebar-user {
  margin-top: auto;
  padding: 10px 14px;
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-secondary);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.user-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-muted);
  border: 1px solid rgba(94,106,210,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: var(--accent-light);
  flex-shrink: 0;
}

/* Theme switcher in sidebar */
.sidebar-theme-row {
  padding: 4px 12px 10px;
}
.theme-cycle-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 5px 8px; border-radius: 6px;
  background: none; border: 1px solid var(--border-strong);
  color: var(--text-muted); font-size: 11px; font-weight: 500;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.theme-cycle-btn:hover { color: var(--text-secondary); background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.18); }

/* ── Sidebar collapse toggle ── */
.sidebar-collapse-btn {
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--text-faint); width: 100%; height: 28px;
  padding: 0; transition: color .15s;
}
.sidebar-collapse-btn:hover { color: var(--text-secondary); }
.sidebar-collapse-btn .collapse-icon { transition: transform .2s; flex-shrink: 0; }
[data-theme="light"] .sidebar-collapse-btn { color: var(--text-muted); }

/* ── Collapsed sidebar ── */
body.sidebar-collapsed .sidebar { width: 54px; }
body.sidebar-collapsed .sidebar-logo {
  padding-left: 0; padding-right: 0; justify-content: center;
}
body.sidebar-collapsed .sidebar-brand-copy { display: none; }
body.sidebar-collapsed .sidebar-logo-kicker { display: none; }
body.sidebar-collapsed .sidebar-logo-text { display: none; }
body.sidebar-collapsed .nav-group-label { display: none; }
body.sidebar-collapsed .nav-divider { margin: 5px 10px; }
body.sidebar-collapsed .nav-item {
  padding: 7px 0; justify-content: center; gap: 0;
}
body.sidebar-collapsed .nav-item.nav-sub { padding-left: 0; }
body.sidebar-collapsed .nav-item-search {
  background: transparent;
  border-color: transparent;
}
body.sidebar-collapsed .nav-copy { display: none; }
body.sidebar-collapsed .nav-label { display: none; }
body.sidebar-collapsed .nav-meta { display: none; }
body.sidebar-collapsed .nav-kbd { display: none; }
body.sidebar-collapsed .nav-count { display: none; }
body.sidebar-collapsed .sidebar-theme-row { display: none; }
body.sidebar-collapsed .sidebar-user {
  padding: 8px 0; justify-content: center;
}
body.sidebar-collapsed .sidebar-user-text { display: none; }
body.sidebar-collapsed .sidebar-user-health { display: none; }
body.sidebar-collapsed .sidebar-user-logout { display: none; }
body.sidebar-collapsed .sidebar-collapse-btn .collapse-icon { transform: scaleX(-1); }
body.sidebar-collapsed .nav-item.active::before { display: none; }

/* App body */
.app-body {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
}

/* Content wrapper inside pages */
.container {
  padding: 1.5rem 1.75rem 2.5rem;
  max-width: 1100px;
  min-width: 0;
  box-sizing: border-box;
  width: 100%;
}
.container-full {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Page toolbar (sticky top bar inside app-body) */
.page-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  min-height: 44px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-base);
  position: sticky; top: 0; z-index: 100;
}
.page-toolbar-title {
  font-size: 13.5px; font-weight: 500; color: var(--text-primary); flex: 1;
}
.page-toolbar-actions { display: flex; align-items: center; gap: 6px; }

.page-title {
  font-size: 1.35rem; font-weight: 600; color: var(--text-primary);
  line-height: 1.2; margin: 0;
}
.page-subtitle {
  font-size: .78rem; color: var(--text-muted);
  margin: 2px 0 0; line-height: 1;
}

/* ─── 4. Header (legacy / login pages) ─────────────────────────────────── */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: .65rem 0;
  display: none;  /* hidden in sidebar layout */
}

/* ─── 5. Footer ────────────────────────────────────────────────────────── */
.site-footer { display: none; } /* no footer in sidebar layout */

/* ─── 6. Alerts ────────────────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error   {
  background: var(--danger-bg);
  border: 1px solid rgba(248,113,113,.2);
  color: var(--danger);
}
.alert-warning {
  background: var(--warning-bg);
  border: 1px solid rgba(251,191,36,.2);
  color: var(--warning);
}
.alert-info    {
  background: var(--accent-muted);
  border: 1px solid rgba(59,130,246,.2);
  color: var(--accent-light);
}
.alert-success {
  background: var(--success-bg);
  border: 1px solid rgba(52,211,153,.2);
  color: var(--success);
}

/* ─── 7. Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: none;
  transition: background .15s, opacity .15s, transform .1s;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { opacity: 1; text-decoration: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-surface-2); color: var(--text-primary); }

.btn-pdf { background: #276749; color: #fff; }
.btn-pdf:hover { background: #22543d; color: #fff; }

.btn-pin-active { background: var(--accent-muted, rgba(59,130,246,.12)); border-color: var(--accent, #3b82f6); color: var(--accent-light, #63b3ed); }
.btn-pin-active:hover { background: rgba(59,130,246,.18); }

.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(248,113,113,.2); }
.btn-danger:hover { background: rgba(248,113,113,.20); }

.btn-success { background: #276749; color: #fff; }
.btn-success:hover { background: #22543d; }

.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }

/* ─── 8. Cards ─────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.card h3 { font-size: 1rem; margin-bottom: 1rem; color: var(--text-primary); }

/* ─── 9. Badges ────────────────────────────────────────────────────────── */
.badge {
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-block;
}
.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(52,211,153,.2);
}
.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,.2);
}
.badge-secondary {
  background: rgba(148,163,184,.08);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(251,191,36,.2);
}

.badge-llm {
  background: rgba(107,70,193,.25);
  color: #b794f4;
  border: 1px solid rgba(107,70,193,.4);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: .75rem;
}

/* Rol badge — Inter con tabular nums en vez de monospace */
.rol-badge {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  background: rgba(148,163,184,.1);
  color: var(--text-secondary);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  letter-spacing: 0.02em;
}

/* ─── 10. Sala tags ─────────────────────────────────────────────────────── */
.sala-tag {
  padding: .12rem .45rem;
  border-radius: 4px;
  font-size: .68rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: .01em;
}
.sala-1 { background: rgba(94,106,210,.10);  color: #8f9de8; }
.sala-2 { background: rgba(229,72,77,.08);   color: #d97375; }
.sala-3 { background: rgba(38,185,134,.08);  color: #52b896; }
.sala-4 { background: rgba(217,119,6,.08);   color: #c9943a; }

/* ─── 11. Inputs / Selects ─────────────────────────────────────────────── */
input, select, textarea {
  background: var(--bg-base);
  border: 1.5px solid var(--border-strong);
  color: var(--text-primary);
  border-radius: 6px;
  padding: .5rem .75rem;
  font-size: .8125rem;
  font-family: 'DM Sans', inherit;
  letter-spacing: 0.01em;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(49,130,206,.15);
}
input::placeholder { color: #475569; }

select {
  min-width: 0;
  padding: .4rem .6rem;
  cursor: pointer;
}

input[type="date"] {
  padding: .3rem .5rem;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ─── 12. Search Form (index.html) ─────────────────────────────────────── */
.search-section { max-width: 640px; }
.search-section h2 { font-size: 1.4rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.search-section .description { color: var(--text-secondary); margin-bottom: 1.5rem; }

.search-form {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.search-form fieldset {
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.search-form legend {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0 0.4rem;
}

.radio-group { display: flex; flex-direction: column; gap: 0.5rem; }
.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  color: var(--text-primary);
}

.radio-with-inputs { flex-wrap: wrap; }

/* Info box */
.info-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  font-size: 0.85rem;
}
.info-box h3 { font-size: 0.95rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.info-box ul { padding-left: 1.2rem; color: var(--text-secondary); }
.info-box li { margin-bottom: 0.25rem; }
.info-box strong { color: var(--text-primary); }

/* ─── 13. Results Table (results.html) ─────────────────────────────────── */
.results-section { }
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.results-header h2 { font-size: 1.25rem; color: var(--text-primary); }

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.count-selected { font-size: 0.85rem; color: var(--accent-light); font-weight: 600; }

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .6rem;
}
.filter-bar input {
  flex: 1;
  max-width: 480px;
  padding: .4rem .75rem;
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: .875rem;
  color: var(--text-primary);
  min-width: unset;
}
.filter-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(49,130,206,.2);
}
.filtro-count { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }

/* Table wrapper */
.table-wrapper { overflow-x: auto; }

.fallos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
  border-radius: 8px;
  overflow: hidden;
}

.fallos-table th {
  background: #0d1b2e;
  color: var(--text-secondary);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .6rem 1rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-strong);
}

.fallos-table td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text-primary);
  font-size: .875rem;
}

.fallos-table tr:hover td { background: var(--bg-surface); }
.fallo-row { cursor: pointer; }
.fallo-row:has(.fallo-checkbox:checked) td { background: #1a2f4a; }

.col-check  { width: 36px; text-align: center; }
.col-rol    { white-space: nowrap; font-weight: 600; }
.col-sala   { white-space: nowrap; }
.col-fecha  { white-space: nowrap; color: var(--text-secondary); }
.col-pdf    { white-space: nowrap; }

.col-resultado { max-width: 220px; }
.resultado-text {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  cursor: help;
  color: var(--text-primary);
}

/* Resultado badges */
.resultado-badge {
  font-size: .78rem;
  font-weight: 700;
  padding: .3rem .7rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.resultado-acogido {
  background: rgba(72,187,120,.15);
  color: var(--success);
  border: 1px solid rgba(72,187,120,.3);
}
.resultado-rechazado {
  background: rgba(252,129,129,.12);
  color: var(--danger);
  border: 1px solid rgba(252,129,129,.25);
}
.resultado-inadmisible {
  background: rgba(246,173,85,.12);
  color: var(--warning);
  border: 1px solid rgba(246,173,85,.25);
}
.resultado-parcialmente_acogido {
  background: rgba(49,130,206,.12);
  color: var(--accent-light);
  border: 1px solid rgba(49,130,206,.25);
}
.resultado-desistido {
  background: rgba(148,163,184,.08);
  color: var(--text-secondary);
  border: 1px solid rgba(148,163,184,.2);
}
.resultado-competencia {
  background: rgba(167,139,250,.1);
  color: #c4b5fd;
  border: 1px solid rgba(167,139,250,.25);
}
.resultado-desierto {
  background: rgba(148,163,184,.08);
  color: var(--text-secondary);
  border: 1px solid rgba(148,163,184,.2);
}
.resultado-otro {
  background: rgba(148,163,184,.08);
  color: var(--text-secondary);
  border: 1px solid rgba(148,163,184,.2);
}

/* Muted */
.muted { color: var(--text-muted); font-style: italic; }

/* ─── 14. Analysis Page (analysis.html) ────────────────────────────────── */
.analysis-section { }
.section-subtitle {
  font-size: 1.1rem;
  margin: 2rem 0 1rem;
  color: var(--text-primary);
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.stat-box {
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 0.9rem;
}
.stat-box h4 { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.5rem; }

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1.1;
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

/* Distributions */
.dist-list { list-style: none; font-size: 0.82rem; }
.dist-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0;
}
.dist-label {
  width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}
.dist-bar-wrap {
  flex: 1;
  background: #1e3a5f;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}
.dist-bar { display: block; height: 100%; background: var(--accent); min-width: 4px; }
.dist-count { font-size: 0.75rem; color: var(--text-muted); width: 24px; text-align: right; }

/* Tags */
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tag {
  display: inline-block;
  background: rgba(49,130,206,.1);
  color: var(--accent-light);
  border-radius: 4px;
  padding: .15rem .45rem;
  font-size: .78rem;
  border: 1px solid rgba(49,130,206,.25);
}
.tag-norma {
  background: rgba(246,173,85,.1);
  color: var(--warning);
  border-color: rgba(246,173,85,.3);
}

/* Keywords cloud */
.keywords-cloud { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.keyword {
  background: rgba(49,130,206,.1);
  border: 1px solid rgba(49,130,206,.25);
  color: var(--accent-light);
  padding: .2rem .5rem;
  border-radius: 12px;
  font-size: .78rem;
}

/* Ficha de fallo (article card) */
.ficha-fallo {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.ficha-titulo {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant: small-caps;
  color: var(--text-primary);
  margin: 0 0 .75rem;
  line-height: 1.4;
}

.ficha-meta-row {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: .82rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.ficha-meta-row .rol { color: var(--text-secondary); }
.ficha-meta-row .fecha { color: var(--text-muted); }

.ficha-datos {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .3rem .75rem;
  font-size: .85rem;
  margin-bottom: 1rem;
  border-top: 1px solid var(--border-strong);
  padding-top: .75rem;
}
.ficha-datos dt {
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.ficha-datos dd { color: #cbd5e0; }

.ficha-seccion {
  margin-top: 1rem;
  border-top: 1px solid var(--border-strong);
  padding-top: .75rem;
}
.ficha-seccion h4 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin: 0 0 .4rem;
}
.ficha-seccion p {
  font-size: .9rem;
  line-height: 1.65;
  color: #cbd5e0;
  margin: 0;
  text-align: justify;
}

.ficha-voto {
  background: rgba(246,173,85,.06);
  border-left: 3px solid #d69e2e;
  padding: .75rem;
  border-radius: 0 4px 4px 0;
  border-top: none;
  margin-top: 1rem;
}
.ficha-voto h4 { color: #d69e2e; }

.ficha-acciones {
  margin-top: 1rem;
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
}

/* ficha-section (alternate naming from design spec) */
.ficha-section {
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: .75rem 1rem;
  margin: .5rem 0;
}
.ficha-label {
  color: var(--text-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  display: block;
  margin-bottom: .2rem;
}
.ficha-value {
  color: #cbd5e0;
  font-size: .88rem;
  line-height: 1.6;
}

/* Re-analyze button */
.btn-reanalizar {
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: .8rem;
  cursor: pointer;
  color: var(--text-secondary);
}
.btn-reanalizar:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border-color: #475569;
}
.btn-reanalizar:disabled { opacity: .5; cursor: default; }

/* Analisis grid (legacy) */
.analisis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
@media (max-width: 640px) {
  .analisis-grid { grid-template-columns: 1fr; }
}
.analisis-col h5 { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.4rem; }

/* DL metadata */
.meta-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.75rem;
  font-size: 0.82rem;
}
.meta-list dt {
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 0.1rem;
}
.meta-list dd { color: #cbd5e0; }

/* Resumen box */
.resumen-box {
  background: var(--bg-base);
  border-left: 3px solid var(--accent);
  padding: .75rem 1rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: .75rem;
}
.resumen-box h5 { font-size: .85rem; color: var(--accent-light); margin-bottom: .4rem; }
.resumen-texto { font-size: .85rem; color: #cbd5e0; line-height: 1.6; }

/* LLM analysis box */
.llm-analisis-box {
  background: rgba(107,70,193,.08);
  border-left: 3px solid #7c3aed;
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
}
.llm-analisis-box h5 {
  font-size: .88rem;
  color: #b794f4;
  margin-bottom: .75rem;
}
.llm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 700px) {
  .llm-grid { grid-template-columns: 1fr; }
}
.llm-col-wide { grid-column: 1; }
.llm-col { grid-column: 2; }
.llm-field { margin-bottom: .75rem; }
.llm-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-secondary);
  margin-bottom: .25rem;
}
.llm-field p { font-size: .84rem; color: #cbd5e0; line-height: 1.6; margin: 0; }
.llm-field-full {
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border-strong);
}
.llm-relevancia {
  background: rgba(246,173,85,.08);
  border-radius: 6px;
  padding: .5rem .75rem;
  border-left: 3px solid #d69e2e;
}
.llm-relevancia .llm-label { color: var(--warning); }
.llm-disidente {
  background: rgba(72,187,120,.08);
  border-radius: 6px;
  padding: .5rem .75rem;
  border-left: 3px solid #48bb78;
}
.llm-disidente .llm-label { color: var(--success); }

.obs-box { font-size: .82rem; margin-top: .5rem; }
.pdf-actions { display: flex; align-items: center; gap: .75rem; margin-top: .75rem; font-size: .82rem; }

/* Agregado section */
.agregado-section, .agregado-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.agregado-card { margin-bottom: 1.5rem; }

/* ─── 15. Jurisprudencia Dashboard (dashboard.html) ────────────────────── */
.dashboard-section {
  padding: 1.5rem 1.75rem 3rem;
  max-width: 1220px;
}

.juri-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1rem;
}
.juri-topbar-copy {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.juri-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: .24rem .6rem;
  border-radius: 999px;
  background: rgba(var(--accent-blue-rgb), .12);
  border: 1px solid rgba(var(--accent-blue-rgb), .24);
  color: var(--accent-light);
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.juri-title {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  line-height: 1.02;
  letter-spacing: -.05em;
  color: var(--text-primary);
}
.juri-subtitle {
  margin: 0;
  max-width: 760px;
  color: var(--text-secondary);
  font-size: .95rem;
  line-height: 1.6;
}
.juri-topbar-actions {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
}
.juri-statsbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
  margin-bottom: 1rem;
}
.juri-statcard {
  display: flex;
  flex-direction: column;
  gap: .18rem;
  padding: .95rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0)),
    var(--bg-surface);
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.juri-statcard-ia { border-color: rgba(167,139,250,.22); }
.juri-statlabel {
  font-size: .72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
}
.juri-statnum {
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--text-primary);
  font-weight: 700;
}
.juri-statnum small {
  font-size: .9rem;
  color: var(--text-muted);
  font-weight: 500;
}
.juri-statmeta {
  font-size: .82rem;
  color: var(--text-secondary);
}

.dash-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}
.dash-left-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.dash-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.dash-sidebar .dash-panel { margin-bottom: 0; }

.dash-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.dash-panel:last-child { margin-bottom: 0; }
.dash-panel-form { margin-bottom: 0; }
.dash-sidepanel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0)),
    var(--bg-surface);
}
.juri-panel-intro {
  padding: 1rem 1rem .65rem;
  border-bottom: 1px solid var(--border);
}
.juri-eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: .67rem;
  font-weight: 700;
  color: var(--accent-light);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: .45rem;
}
.juri-panel-intro h2 {
  margin: 0 0 .28rem;
  font-size: 1.35rem;
  letter-spacing: -.03em;
  color: var(--text-primary);
}
.juri-panel-intro p {
  margin: 0;
  color: var(--text-secondary);
  font-size: .88rem;
  line-height: 1.5;
}
.juri-assist-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0));
}
.juri-assist-item {
  display: flex;
  flex-direction: column;
  gap: .18rem;
  padding: .7rem .85rem;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
}
.juri-assist-item strong {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent-light);
}
.juri-assist-item span {
  font-size: .78rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.dash-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem 1rem .55rem;
  border-bottom: 1px solid var(--border);
}
.dash-panel-heading-block {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.dash-panel-header-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dash-panel-title {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.dash-panel-meta {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 400;
}
.dash-linkghost {
  font-size: .75rem;
  color: var(--accent-light);
  text-decoration: none;
  white-space: nowrap;
}
.dash-linkghost:hover { text-decoration: underline; }
.dash-sidehead { align-items: flex-start; }
.dash-side-eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: .66rem;
  font-weight: 700;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .35rem;
}
.dash-side-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-primary);
  letter-spacing: -.02em;
}
.dash-side-desc {
  margin: .28rem 0 0;
  color: var(--text-secondary);
  font-size: .8rem;
  line-height: 1.5;
  max-width: 34ch;
}

.dash-tabs {
  display: flex;
  gap: .25rem;
  padding: .65rem .9rem .5rem;
  border-bottom: 1px solid var(--border);
}
.dash-tab {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  padding: .3rem .8rem;
  transition: all .15s;
  font-family: inherit;
}
.dash-tab:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,.04);
}
.dash-tab.active {
  color: var(--accent);
  background: rgba(94,106,210,.1);
  border-color: rgba(94,106,210,.3);
}

.dash-form {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  padding: 1rem .9rem;
}
.dash-field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.dash-label {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-muted);
}
.dash-hint {
  font-size: .73rem;
  color: var(--text-muted);
  margin: .15rem 0 0;
}
.dash-submit-btn { width: 100%; margin-top: .1rem; }
.juri-form-footnote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
  margin-top: .15rem;
  padding-top: .25rem;
}
.juri-form-footnote span {
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  min-width: 220px;
}
.juri-inline-links {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.juri-inline-links a {
  font-size: .74rem;
  color: var(--accent-light);
  text-decoration: none;
  white-space: nowrap;
}
.juri-inline-links a:hover { text-decoration: underline; }

.periodo-pills {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
}
.periodo-pill { position: relative; }
.periodo-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.periodo-pill span {
  display: inline-block;
  padding: .24rem .65rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  font-size: .78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  user-select: none;
}
.periodo-pill span:hover {
  color: var(--text-secondary);
  border-color: var(--border-strong);
}
.periodo-pill input[type="radio"]:checked + span {
  background: rgba(94,106,210,.12);
  border-color: rgba(94,106,210,.30);
  color: var(--accent-light);
}
.rango-inputs {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.rango-sep {
  color: var(--text-muted);
  font-size: .8rem;
}

.dash-tabla-panel { margin-bottom: 0; }
.dash-tabla-panel .tabla-panel.active {
  max-height: 260px;
  overflow-y: auto;
}
.dash-tabla-panel .tabla-casos td { padding: .28rem .7rem; }
.dash-tabla-panel .tabla-casos th { padding: .3rem .7rem; }
.tabla-sala-tabs {
  display: flex;
  gap: .25rem;
}
.tabla-tab {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: .73rem;
  font-weight: 600;
  padding: .22rem .6rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.tabla-tab:hover {
  color: var(--text-secondary);
  border-color: var(--border);
}
.tabla-tab.active {
  background: rgba(94,106,210,.1);
  color: var(--accent-light);
  border-color: rgba(94,106,210,.3);
}
.tabla-loading {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.2rem;
  color: var(--text-muted);
  font-size: .83rem;
}
.tabla-spinner {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  border: 2px solid rgba(94,106,210,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.tabla-error {
  padding: .9rem 1.2rem;
  font-size: .83rem;
  color: var(--text-muted);
}
.tabla-error a { color: var(--accent-light); }
.tabla-panel { display: none; }
.tabla-panel.active { display: block; }
.tabla-empty {
  padding: .9rem 1.2rem;
  font-size: .83rem;
  color: var(--text-muted);
  font-style: italic;
}
.tabla-tipo-badge {
  font-size: .6rem;
  font-weight: 700;
  background: rgba(94,106,210,.1);
  color: var(--accent-light);
  border: 1px solid rgba(94,106,210,.2);
  border-radius: 4px;
  padding: 0 5px;
  vertical-align: middle;
  margin-left: .35rem;
}
.tabla-casos {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.tabla-casos th {
  background: rgba(255,255,255,.025);
  font-size: .63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  padding: .4rem .8rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.tabla-casos td {
  padding: .42rem .8rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}
.tabla-casos tr:last-child td { border-bottom: none; }
.tabla-casos tr:hover td { background: rgba(255,255,255,.02); }
.tc-num {
  color: var(--text-muted);
  font-size: .7rem;
  width: 28px;
  text-align: center;
}
.tc-caratulado {
  font-weight: 500;
  color: var(--text-primary);
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tc-tipo {
  color: var(--text-muted);
  font-size: .75rem;
  white-space: nowrap;
}
.tc-estado {
  font-size: .72rem;
  white-space: nowrap;
}
.tc-alegato {
  font-size: .72rem;
  text-align: center;
  color: #f6ad55;
  font-weight: 700;
}
.tc-buscar a {
  font-size: .7rem;
  color: var(--accent-light);
  text-decoration: none;
  opacity: .65;
  transition: opacity .15s;
}
.tc-buscar a:hover { opacity: 1; }

.rev-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.rev-row {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.rev-list li:last-child .rev-row { border-bottom: none; }
.rev-row:hover { background: rgba(255,255,255,.025); }
.rev-num {
  flex-shrink: 0;
  font-size: .65rem;
  font-weight: 800;
  color: var(--text-muted);
  opacity: .5;
  width: 14px;
  padding-top: .15rem;
  text-align: center;
}
.rev-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.rev-top {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.rev-rol {
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent-light);
  font-variant-numeric: tabular-nums;
}
.rev-titulo {
  font-size: .79rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rev-stats {
  display: flex;
  gap: .65rem;
  font-size: .7rem;
  color: var(--text-muted);
}

.cp-form {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.cp-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}
.cp-date {
  width: 100%;
  box-sizing: border-box;
}
.cp-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: .9rem 1rem 1rem;
}
.cp-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .8rem .9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
}
.cp-item-info {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  min-width: 0;
}
.cp-item-nombre {
  font-size: .84rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cp-item-meta { font-size: .72rem; color: var(--text-muted); }
.cp-item-sched {
  font-size: .68rem;
  color: var(--text-muted);
  font-style: italic;
}
.cp-item-right {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-shrink: 0;
}
.cp-badge {
  font-size: .7rem;
  padding: .18rem .5rem;
  border-radius: 99px;
  white-space: nowrap;
  font-weight: 600;
  text-decoration: none;
}
.cp-pendiente  { background: rgba(245,158,11,.1); color: #f59e0b; border: 1px solid rgba(245,158,11,.2); }
.cp-ejecutando { background: rgba(99,179,237,.1); color: #63b3ed; border: 1px solid rgba(99,179,237,.2); animation: pulse .8s ease-in-out infinite; }
.cp-completada { background: rgba(104,211,145,.1); color: #68d391; border: 1px solid rgba(104,211,145,.2); }
.cp-error      { background: rgba(252,129,129,.1); color: #fc8181; border: 1px solid rgba(252,129,129,.2); }
.cp-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  opacity: .5;
  transition: opacity .1s, color .1s;
  padding: 0 2px;
}
.cp-del:hover {
  opacity: 1;
  color: #fc8181;
}

.dash-empty {
  font-size: .83rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1.25rem 1rem;
  line-height: 1.55;
}
.dash-empty strong {
  display: block;
  margin-bottom: .28rem;
  color: var(--text-primary);
  font-size: .9rem;
}
.dash-empty span {
  display: block;
  max-width: 40ch;
  margin: 0 auto;
}
.dash-empty-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: .85rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-blue-rgb), .2);
  background: rgba(var(--accent-blue-rgb), .08);
  color: var(--accent-light);
  text-decoration: none;
  font-size: .74rem;
  font-weight: 600;
}
.dash-empty-link:hover { text-decoration: none; background: rgba(var(--accent-blue-rgb), .12); }
.dash-empty-link-button {
  cursor: pointer;
  font-family: inherit;
}

.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .95rem;
  padding: 1rem;
}
.stats-col {
  padding: .95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.016), rgba(255,255,255,0)),
    var(--bg-base);
}
.stats-col-title {
  font-size: .67rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.stats-badge {
  font-size: .55rem;
  font-weight: 700;
  background: rgba(94,106,210,.1);
  color: var(--accent-light);
  border: 1px solid rgba(94,106,210,.2);
  border-radius: 3px;
  padding: 0 4px;
}
.sbar-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  padding: .28rem .4rem;
  margin: 0 -.18rem .16rem;
  transition: background .12s;
}
.sbar-row:hover { background: rgba(94,106,210,.07); }
.sbar-label {
  font-size: .73rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 0 auto;
  max-width: 120px;
}
.sbar-sala { font-size: .6rem !important; padding: .04rem .26rem !important; }
.sbar-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  overflow: hidden;
  min-width: 0;
}
.sbar-fill {
  height: 100%;
  border-radius: 999px;
  background: rgba(94,106,210,.65);
  transition: width .4s ease;
}
.sbar-fill-materia { background: rgba(159,122,234,.65) !important; }
.sbar-count {
  font-size: .69rem;
  font-weight: 700;
  color: var(--text-muted);
  flex: 0 0 auto;
}
.stats-empty {
  font-size: .71rem;
  color: var(--text-muted);
  margin: .2rem 0 0;
  font-style: italic;
}
.stats-empty-card {
  display: flex;
  flex-direction: column;
  gap: .28rem;
  padding: .85rem .95rem;
  border: 1px dashed rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
}
.stats-empty-card strong {
  font-size: .77rem;
  color: var(--text-primary);
}
.stats-empty-card span {
  font-size: .73rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.resultado-label { font-weight: 600; }
.resultado-acogido   { color: var(--success); }
.resultado-rechazado { color: #fc8181; }
.resultado-parcial   { color: #f6ad55; }
.resultado-fill-acogido   { background: var(--success) !important; }
.resultado-fill-rechazado { background: #fc8181 !important; }
.resultado-fill-parcial   { background: #f6ad55 !important; }

.dash-recientes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .9rem;
  padding: 1rem;
}
.dash-reciente-card {
  padding: .95rem 1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.016), rgba(255,255,255,0)),
    var(--bg-base);
  transition: background .12s, border-color .12s, transform .12s;
}
.dash-reciente-card:hover {
  background: rgba(255,255,255,.025);
  border-color: rgba(var(--accent-blue-rgb), .22);
  transform: translateY(-1px);
}
.drc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.drc-rol {
  font-size: .76rem;
  font-weight: 700;
  color: var(--accent-light);
  font-variant-numeric: tabular-nums;
}
.drc-sala { font-size: .63rem; padding: .08rem .35rem; }
.drc-titulo {
  font-size: .84rem;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}
.drc-fecha {
  font-size: .68rem;
  color: var(--text-muted);
}

.consulta-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem 1rem;
  animation: fadeIn .25s ease;
}
.carga-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(94,106,210,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.carga-pasos {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: 100%;
}
.carga-paso {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .83rem;
  color: var(--text-muted);
  transition: color .3s;
}
.carga-paso.active { color: var(--text-primary); font-weight: 500; }
.carga-paso.done   { color: #68d391; }
.carga-ico { font-size: .55rem; transition: color .3s; }
.carga-ico.pending { color: #4a5568; }
.carga-ico.active  { color: var(--accent); animation: pulse .7s ease-in-out infinite; }
.carga-ico.done    { color: #68d391; font-size: .85rem; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
  .juri-statsbar { grid-template-columns: 1fr 1fr; }
  .dash-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .juri-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .juri-assist-strip { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-left-col { gap: 1rem; }
  .dash-sidebar { flex-direction: row; flex-wrap: wrap; }
  .dash-sidebar .dash-panel { flex: 1 1 260px; }
}
@media (max-width: 640px) {
  .dash-tabs {
    flex-wrap: wrap;
  }
  .juri-form-footnote {
    flex-direction: column;
    align-items: flex-start;
  }
  .tabla-sala-tabs {
    width: 100%;
    overflow-x: auto;
    padding-bottom: .2rem;
  }
}
@media (max-width: 520px) {
  .juri-statsbar { grid-template-columns: 1fr; }
  .dash-panel-header-right {
    width: 100%;
    justify-content: flex-start;
  }
  .dash-panel-heading-block {
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
  }
  .dash-stats-grid { grid-template-columns: 1fr; }
  .cp-row { grid-template-columns: 1fr; }
  .cp-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .cp-item-right {
    width: 100%;
    flex-wrap: wrap;
  }
}

/* ─── 16. Login Page ───────────────────────────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-base);
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

.login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.login-logo-icon { font-size: 2.5rem; display: block; margin-bottom: .3rem; }

.login-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}
.login-subtitle { color: var(--text-muted); font-size: .82rem; margin: .2rem 0 0; }

.login-error { margin-bottom: 1rem; }

.login-form { display: flex; flex-direction: column; gap: 1rem; }

.login-field { display: flex; flex-direction: column; gap: .3rem; }
.login-field label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.login-field input {
  padding: .55rem .75rem;
  background: var(--bg-base);
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  font-size: .95rem;
  color: var(--text-primary);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
  min-width: unset;
}
.login-field input::placeholder { color: #475569; }
.login-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49,130,206,.15);
}

.login-btn {
  width: 100%;
  padding: .65rem;
  font-size: 1rem;
  margin-top: .25rem;
  letter-spacing: .02em;
}

.login-footer {
  text-align: center;
  font-size: .75rem;
  color: #475569;
  margin: 1.25rem 0 0;
}

/* ─── 17. Nav user / logout ────────────────────────────────────────────── */
.nav-separator {
  width: 1px; height: 16px;
  background: var(--border-strong);
  display: inline-block;
  vertical-align: middle;
  margin: 0 0.25rem;
}
.nav-user { color: var(--text-muted); font-size: .8rem; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.nav-logout { color: var(--danger) !important; font-size: .8rem; font-weight: 500; }
.nav-logout:hover { color: #feb2b2 !important; text-decoration: none; }

/* ─── Nav dropdown ─────────────────────────────────────────────────────── */
.nav-dropdown { position: relative; display: inline-flex; align-items: center; }
.nav-dropdown-trigger {
  display: inline-flex; align-items: center; gap: .25rem;
  color: var(--accent-light); font-size: .8125rem; font-weight: 500;
  text-decoration: none; letter-spacing: .01em; cursor: pointer;
  padding: .2rem 0;
}
.nav-dropdown-trigger:hover { color: #fff; text-decoration: none; }
.nav-dropdown-menu {
  display: none;
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface-2, #1e2533);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; padding: .4rem .35rem .35rem;
  min-width: 170px; z-index: 1000;
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
  animation: dropIn .15s ease-out;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-item {
  display: flex !important; align-items: center; gap: .45rem;
  padding: .45rem .75rem; border-radius: 7px;
  font-size: .8rem !important; font-weight: 500;
  color: var(--text-secondary) !important; text-decoration: none;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.nav-dropdown-item:hover {
  background: rgba(255,255,255,.07);
  color: var(--text-primary) !important;
  text-decoration: none;
}

/* ─── 18. Toast notification ───────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
  z-index: 9999;
  max-width: 420px;
  font-size: .875rem;
  transition: opacity .3s ease;
  line-height: 1.5;
}

/* ─── Materias frecuentes — pills jerárquicos ────────────────────────────── */

.stat-box--full {
  grid-column: 1 / -1;  /* ocupa todo el ancho del grid */
}

.materia-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
}

.materia-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(49,130,206,.08);
  border: 1px solid rgba(49,130,206,.2);
  border-radius: 6px;
  padding: .3rem .65rem;
  font-size: .78rem;
  max-width: 100%;
  flex-wrap: wrap;
}

.materia-pill-path {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: wrap;
  color: #cbd5e0;
}

.materia-parte {
  color: var(--text-primary);
  font-weight: 500;
}

.materia-parte:last-child {
  color: var(--accent-light);
  font-weight: 600;
}

.materia-sep {
  color: #475569;
  font-size: .7rem;
}

.materia-pill-cnt {
  background: rgba(49,130,206,.2);
  color: var(--accent-light);
  border-radius: 999px;
  padding: .05rem .4rem;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── Monitor Module ────────────────────────────────────────────────────── */

@keyframes monitor-panel-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes monitor-module-spin {
  to { transform: rotate(360deg); }
}

/* Monitor */
.mon-shell .btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.mon-shell .btn-danger {
  background: rgba(var(--danger-rgb), .08);
  color: var(--danger);
  border: 1px solid rgba(var(--danger-rgb), .18);
}
.mon-shell .btn-danger:hover { background: rgba(var(--danger-rgb), .15); }

.mon-shell { padding: .95rem 1.15rem 1.65rem; max-width: 1220px; }
.mon-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .72rem;
  margin-bottom: .52rem;
  flex-wrap: wrap;
}
.mon-hero-copy { display: flex; flex-direction: column; gap: .16rem; }
.mon-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: .2rem .5rem;
  border-radius: 999px;
  background: rgba(var(--accent-blue-rgb), .12);
  border: 1px solid rgba(var(--accent-blue-rgb), .24);
  color: var(--accent-light);
  font-size: .63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.mon-title {
  margin: 0;
  font-size: clamp(1.45rem, 2.2vw, 1.95rem);
  line-height: 1;
  letter-spacing: -.05em;
  color: var(--text-primary);
}
.mon-subtitle {
  margin: 0;
  max-width: 620px;
  color: var(--text-secondary);
  font-size: .76rem;
  line-height: 1.28;
}
.mon-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .44rem;
  margin-bottom: .56rem;
}
.mon-summary-card {
  display: flex;
  flex-direction: column;
  gap: .08rem;
  padding: .52rem .58rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0)),
    var(--bg-surface);
  min-width: 0;
}
.mon-summary-label {
  font-size: .58rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
}
.mon-summary-value {
  font-size: 1.18rem;
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--text-primary);
  font-weight: 700;
}
.mon-summary-meta { font-size: .63rem; color: var(--text-secondary); line-height: 1.18; }
.mon-summary-value.c-amber { color: var(--warning); }
.mon-summary-value.c-accent { color: var(--accent-light); }
.mon-summary-value.c-success { color: var(--success); }
.mon-summary-card--attention { border-color: rgba(var(--warning-rgb), .18); }
.mon-summary-card--structure { border-color: rgba(var(--accent-blue-rgb), .18); }
.mon-summary-card--freshness { border-color: rgba(var(--success-rgb), .18); }
.mon-summary-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  width: fit-content;
  margin-top: .14rem;
  color: var(--accent-light);
  text-decoration: none;
  font-size: .64rem;
  font-weight: 600;
}
.mon-summary-link:hover { text-decoration: underline; }

.mon-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .95fr);
  gap: .44rem;
  margin-bottom: .6rem;
}
.mon-ops-card {
  padding: .56rem .64rem;
  border-radius: 13px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top right, rgba(var(--accent-blue-rgb), .08), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0)),
    var(--bg-surface);
}
.mon-ops-card--primary { border-color: rgba(var(--accent-blue-rgb), .18); }
.mon-ops-kicker {
  display: block;
  margin-bottom: .14rem;
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent-light);
}
.mon-ops-title {
  margin: 0 0 .14rem;
  font-size: .88rem;
  line-height: 1.16;
  color: var(--text-primary);
}
.mon-ops-copy {
  margin: 0;
  color: var(--text-secondary);
  font-size: .68rem;
  line-height: 1.24;
  max-width: 62ch;
}
.mon-ops-actions { display: flex; gap: .34rem; flex-wrap: wrap; margin-top: .46rem; }
.mon-op-inline { display: flex; align-items: center; gap: .34rem; flex-wrap: wrap; margin-top: .42rem; }
.mon-op-meta { color: var(--text-secondary); font-size: .66rem; line-height: 1.24; margin-top: .3rem; }
.mon-op-meta strong { color: var(--text-primary); font-weight: 600; }
.mon-op-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--accent-light);
  text-decoration: none;
  font-size: .66rem;
  font-weight: 600;
}
.mon-op-link:hover { text-decoration: underline; }
.mon-sched-select {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: .22rem .38rem;
  font-size: 10px;
  cursor: pointer;
  font-family: inherit;
}
.mon-auto-badge {
  display: inline-flex;
  align-items: center;
  padding: .12rem .34rem;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}
.mon-auto-on {
  background: rgba(var(--success-rgb), .14);
  color: var(--success);
  border: 1px solid rgba(var(--success-rgb), .22);
}
.mon-auto-off {
  background: rgba(255,255,255,.05);
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,.08);
}

.mon-shell .btn.btn-sm {
  min-height: 30px;
  padding: .3rem .6rem;
  font-size: .72rem;
}

.issue-list { display: flex; flex-direction: column; gap: .58rem; }
.issue-group { display: flex; flex-direction: column; gap: .28rem; }
.issue-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 .1rem;
}
.issue-group-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .66rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.issue-group-count { font-size: .64rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.issue-row {
  display: grid;
  grid-template-columns: 22px 10px minmax(0, 1fr) auto;
  align-items: start;
  padding: .5rem .62rem;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .12s;
  text-decoration: none;
  color: inherit;
  gap: .48rem;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01)),
    var(--bg-surface);
}
.issue-row:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015)), var(--bg-surface);
  text-decoration: none;
  border-color: rgba(var(--accent-blue-rgb), .2);
  transform: translateY(-1px);
}
.issue-row--novedad { border-left: 3px solid var(--warning); }
.issue-row--estable { border-left: 3px solid rgba(var(--success-rgb), .55); }
.issue-row--error { border-left: 3px solid var(--danger); }

.issue-check { display: flex; align-items: center; justify-content: center; padding-top: .12rem; }
.issue-check input { accent-color: var(--accent); width: 12px; height: 12px; cursor: pointer; }

.issue-status-dot { width: 6px; height: 6px; border-radius: 50%; justify-self: center; margin-top: .22rem; }
.dot-novedad { background: var(--warning); box-shadow: 0 0 4px rgba(var(--warning-rgb), .5); }
.dot-active { background: rgba(var(--success-rgb), .88); }
.dot-ok { border: 1.5px solid var(--text-faint); background: transparent; }
.dot-error { background: var(--danger); }

.issue-main { min-width: 0; display: flex; flex-direction: column; gap: .18rem; }
.issue-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .45rem;
  flex-wrap: wrap;
}
.issue-title-wrap { min-width: 0; display: flex; flex-direction: column; gap: .08rem; }
.issue-rol {
  font-size: .66rem;
  font-weight: 600;
  color: var(--accent-light);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.issue-title {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.16;
}
.issue-badge-col { display: flex; align-items: center; justify-content: flex-start; }
.issue-state-group { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.issue-meta {
  display: flex;
  gap: .18rem .5rem;
  flex-wrap: wrap;
  align-items: center;
  color: var(--text-secondary);
  font-size: .66rem;
  line-height: 1.16;
}
.issue-meta-item { display: inline-flex; align-items: center; gap: .3rem; }
.issue-time { color: var(--text-faint); }

.issue-tribunal-cell { position: static; overflow: visible; }
.issue-tribunal {
  font-size: .8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.issue-actions {
  position: static;
  display: flex;
  gap: .28rem;
  align-items: center;
  justify-content: flex-end;
  opacity: 1;
  transition: none;
  padding-top: .02rem;
}
.issue-action-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--accent-light);
  font-size: .66rem;
  font-weight: 600;
}
.issue-action-btn {
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: .18rem .4rem;
  font-size: .62rem;
  cursor: pointer;
  transition: background .1s, color .1s;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}
.issue-action-btn:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.issue-action-btn.danger { color: var(--danger); border-color: rgba(var(--danger-rgb), .25); }
.issue-action-btn.danger:hover { background: rgba(var(--danger-rgb), .1); }

.ibadge {
  display: inline-flex;
  align-items: center;
  padding: .1rem .34rem;
  border-radius: 999px;
  font-size: .6rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .02em;
}
.ibadge-novedad { background: rgba(var(--warning-rgb), .12); color: var(--warning); }
.ibadge-active { background: var(--accent-muted); color: var(--accent-light); }
.ibadge-ok { background: rgba(var(--success-rgb), .1); color: var(--success); }
.ibadge-error { background: rgba(var(--danger-rgb), .1); color: var(--danger); }
.ibadge-epr { background: rgba(var(--purple-rgb), .15); color: var(--purple); }
.ibadge-muted {
  background: var(--bg-surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
}

.mon-panel {
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  background: var(--bg-surface);
  display: none;
}
.mon-panel.show { display: block; animation: monitor-panel-fade-in .2s ease; }
.mon-panel-title { font-size: 13.5px; font-weight: 500; color: var(--text-primary); margin-bottom: 12px; }
.mon-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mon-form-grid .full { grid-column: 1 / -1; }
.mon-form-group { display: flex; flex-direction: column; gap: 3px; }
.mon-form-group label { font-size: 11.5px; font-weight: 500; color: var(--text-muted); }
.mon-form-group input,
.mon-form-group select {
  background: var(--bg-base);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 13px;
  font-family: inherit;
}
.mon-form-group input:focus,
.mon-form-group select:focus { outline: none; border-color: var(--accent); }
.mon-form-actions { display: flex; gap: 6px; margin-top: 10px; }

.excel-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.excel-modal-overlay.show { display: flex; }
.excel-modal {
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  width: 90vw;
  max-width: 950px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.excel-modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.excel-modal-header h3 { margin: 0; font-size: 14px; color: var(--text-primary); }
.excel-modal-close { background: none; border: none; color: var(--text-secondary); font-size: 1.2rem; cursor: pointer; }
.excel-modal-toolbar {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.excel-modal-toolbar .range-input {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 12.5px;
  width: 200px;
  font-family: inherit;
}
.excel-modal-toolbar .range-input:focus { outline: none; border-color: var(--accent); }
.excel-modal-toolbar .sel-info { color: var(--text-secondary); font-size: 12.5px; margin-left: auto; }
.excel-modal-body { overflow-y: auto; flex: 1; }
.excel-preview-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.excel-preview-table th {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 6px 8px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  z-index: 1;
}
.excel-preview-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.excel-preview-table tr:hover td { background: rgba(255,255,255,.025); }
.excel-preview-table tr.duplicada td { opacity: .4; text-decoration: line-through; }
.excel-preview-table input[type="checkbox"] { accent-color: var(--accent); width: 13px; height: 13px; cursor: pointer; }
.excel-dup-badge {
  background: rgba(var(--warning-rgb), .12);
  color: var(--warning);
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
}
.excel-modal-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rev-list { list-style: none; }
.rev-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rev-list li:last-child { border-bottom: none; }
.rev-list-date { color: var(--text-secondary); font-size: 12.5px; }
.rev-list-stats { font-size: 12px; color: var(--text-faint); }
.rev-list-link { color: var(--accent-light); text-decoration: none; font-size: 12.5px; }
.rev-list-link:hover { text-decoration: underline; }

.mon-alert {
  padding: 8px 20px;
  font-size: 13px;
  display: none;
  border-bottom: 1px solid transparent;
}
.mon-alert.show { display: block; }
.mon-alert-ok {
  background: rgba(var(--success-rgb), .08);
  color: var(--success);
  border-color: rgba(var(--success-rgb), .2);
}
.mon-alert-err {
  background: rgba(var(--danger-rgb), .08);
  color: var(--danger);
  border-color: rgba(var(--danger-rgb), .2);
}

/* Monitor report */
.mm-shell,
.inf-shell,
.det-shell {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  margin: 0 auto 1rem;
}
.inf-shell { max-width: 1280px; }
.mm-back,
.inf-back,
.det-back {
  color: var(--accent-blue);
  text-decoration: none;
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.mm-back:hover,
.inf-back:hover,
.det-back:hover { text-decoration: underline; }
.inf-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .55rem;
  margin-bottom: .4rem;
}
.inf-hero-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .42rem;
}
.inf-back-inline {
  gap: .38rem;
  padding: .26rem .44rem .26rem .28rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-blue-rgb), .12);
  background: rgba(var(--accent-blue-rgb), .07);
  color: #c9dbff;
  text-decoration: none;
  transition: border-color .2s, background .2s, transform .2s;
}
.inf-back-inline:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: rgba(var(--accent-blue-rgb), .24);
  background: rgba(var(--accent-blue-rgb), .11);
}
.inf-back-icon-wrap {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--accent-blue-rgb), .14);
  color: var(--accent-blue);
  flex-shrink: 0;
}
.inf-back-label {
  color: #d4e1ff;
  font-size: .74rem;
  font-weight: 600;
}
.inf-sidepanel {
  min-width: 215px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .3rem;
}
.inf-sidepanel-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: .45rem;
  width: 100%;
}
.inf-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .34rem .4rem .34rem .72rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.025);
  flex-shrink: 0;
}
.inf-export-label {
  color: var(--text-faint);
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.inf-export-btns { display: flex; gap: .32rem; }
.btn-export {
  padding: .38rem .72rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  transition: background .2s, transform .2s, border-color .2s, box-shadow .2s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.btn-export:hover { transform: translateY(-1px); }
.btn-export-excel {
  background: rgba(var(--success-rgb), .1);
  color: var(--success);
  border: 1px solid rgba(var(--success-rgb), .22);
}
.btn-export-excel:hover {
  background: rgba(var(--success-rgb), .18);
  box-shadow: 0 0 0 1px rgba(var(--success-rgb), .08);
}
.btn-export-word {
  background: rgba(var(--accent-blue-rgb), .1);
  color: var(--accent-blue);
  border: 1px solid rgba(var(--accent-blue-rgb), .22);
}
.btn-export-word:hover {
  background: rgba(var(--accent-blue-rgb), .18);
  box-shadow: 0 0 0 1px rgba(var(--accent-blue-rgb), .08);
}

.mm-hero,
.inf-hero,
.det-hero {
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(0,0,0,.18);
}
.inf-hero {
  background:
    radial-gradient(circle at top right, rgba(var(--accent-blue-rgb), .15), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
  padding: .96rem 1.05rem .88rem;
}
.mm-chip,
.inf-badge,
.det-badge {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  padding: .34rem .7rem;
  border-radius: 999px;
  background: rgba(var(--accent-blue-rgb), .12);
  color: var(--accent-blue);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.inf-badge {
  gap: .45rem;
  padding: .38rem .72rem;
  margin-bottom: 0;
}
.det-badge { margin-bottom: .95rem; }
.mm-head,
.inf-header,
.det-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .68rem;
  flex-wrap: wrap;
  margin: 0 0 .55rem;
}
.inf-hero-copy,
.det-header-copy { max-width: 760px; }
.inf-title {
  color: var(--text-primary);
  margin: 0;
  font-size: 1.62rem;
  line-height: 1.04;
  letter-spacing: -.04em;
}
.inf-subtitle {
  color: var(--text-secondary);
  font-size: .88rem;
  line-height: 1.38;
  margin: .52rem 0 0;
  max-width: 54ch;
}
.mm-note,
.inf-date,
.det-header-note {
  color: var(--text-secondary);
  font-size: .75rem;
  line-height: 1.38;
  padding: .54rem .68rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 13px;
}
.inf-date,
.det-header-note { min-width: 205px; }
.mm-note strong,
.inf-date strong,
.det-header-note strong {
  display: block;
  color: var(--text-primary);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .1rem;
}
.inf-stampbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .52rem; }
.inf-stamp {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 16px;
  padding: .62rem .74rem;
  min-height: 0;
}
.inf-stamp-label {
  color: var(--text-faint);
  font-size: .64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .18rem;
}
.inf-stamp-value { color: var(--text-primary); font-size: .88rem; font-weight: 700; line-height: 1.2; }
.inf-stamp-meta { color: var(--text-secondary); font-size: .74rem; line-height: 1.28; margin-top: .18rem; }
.inf-stamp-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .16rem .4rem;
  border-radius: 999px;
  margin-top: .1rem;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.inf-stamp-status--done { background: rgba(var(--success-rgb), .12); color: var(--success); }
.inf-stamp-status--running { background: rgba(var(--warning-rgb), .12); color: var(--warning); }
.inf-stamp-status--error { background: rgba(var(--danger-rgb), .12); color: var(--danger); }

.inf-executive {
  border-radius: 14px;
  padding: .46rem .62rem;
  margin: .4rem 0 .4rem;
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .84rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.inf-executive-icon { font-size: 1rem; flex-shrink: 0; }
.inf-executive-text { flex: 1; }
.inf-executive-main { display: block; line-height: 1.2; }
.inf-executive-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .28rem;
  margin-top: .18rem;
}
.inf-executive-pill {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .14rem .4rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.1;
  background: rgba(255,255,255,.08);
  color: currentColor;
}
.inf-executive-pill--muted {
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255,255,255,.045);
}
.inf-executive--green {
  background: rgba(var(--success-rgb), .08);
  border: 1px solid rgba(var(--success-rgb), .2);
  color: var(--success);
}
.inf-executive--red {
  background: rgba(var(--danger-rgb), .08);
  border: 1px solid rgba(var(--danger-rgb), .2);
  color: var(--danger);
}
.inf-executive--yellow {
  background: rgba(var(--warning-rgb), .08);
  border: 1px solid rgba(var(--warning-rgb), .2);
  color: var(--warning);
}

.inf-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .38rem;
  margin-bottom: .24rem;
}
.inf-card {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  border-radius: 14px;
  padding: .46rem .56rem .5rem;
  text-align: left;
  border: 1px solid rgba(255,255,255,.06);
  cursor: pointer;
  transition: all .2s;
  user-select: none;
  position: relative;
  overflow: hidden;
  min-height: 74px;
}
.inf-card:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  transform: translateY(-1px);
}
.inf-card.active { border-width: 2px; }
.inf-card.active::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
}
.inf-card-label {
  color: var(--text-secondary);
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .16rem;
  font-weight: 700;
}
.inf-card-value {
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.05;
  letter-spacing: -.04em;
}
.inf-card-meta {
  color: var(--text-secondary);
  font-size: .68rem;
  line-height: 1.18;
  margin-top: .14rem;
  max-width: none;
}
.inf-card--green .inf-card-value { color: var(--success); }
.inf-card--green.active { border-color: var(--success); background: rgba(var(--success-rgb), .08); }
.inf-card--green.active::after { background: var(--success); }
.inf-card--red .inf-card-value { color: var(--danger); }
.inf-card--red.active { border-color: var(--danger); background: rgba(var(--danger-rgb), .08); }
.inf-card--red.active::after { background: var(--danger); }
.inf-card--gray .inf-card-value { color: var(--text-secondary); }
.inf-card--gray.active { border-color: var(--text-secondary); background: rgba(166,173,200,.08); }
.inf-card--gray.active::after { background: var(--text-secondary); }
.inf-card--blue .inf-card-value { color: var(--accent-blue); }
.inf-card--blue.active { border-color: var(--accent-blue); background: rgba(var(--accent-blue-rgb), .08); }
.inf-card--blue.active::after { background: var(--accent-blue); }
.inf-card--all.active { border-color: var(--accent-blue); background: rgba(var(--accent-blue-rgb), .08); }
.inf-card--all.active::after { background: var(--accent-blue); }
.inf-filter-note {
  color: var(--text-secondary);
  font-size: .68rem;
  line-height: 1.26;
  margin-bottom: .48rem;
  display: flex;
  justify-content: space-between;
  gap: .45rem;
  flex-wrap: wrap;
  padding: 0 .1rem;
}
.inf-filter-copy strong { color: var(--text-primary); font-weight: 600; }

.inf-section { margin-bottom: 1.05rem; }
.inf-section-title {
  font-size: .94rem;
  color: var(--text-primary);
  margin: 0 0 .45rem;
  padding-bottom: .32rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
}
.inf-section-title span { font-size: .72rem; color: var(--text-secondary); font-weight: 400; }

.inf-causa {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border-radius: 16px;
  padding: .72rem .82rem;
  margin-bottom: .58rem;
  border: 1px solid rgba(255,255,255,.06);
  border-left: 4px solid var(--success);
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
}
.inf-causa.inf-causa--error { border-left-color: var(--danger); }
.inf-causa.inf-causa--sin { border-left-color: var(--text-muted); }
.inf-causa-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: .28rem;
  margin-bottom: .3rem;
}
.inf-causa-info { flex: 1; min-width: 200px; }
.inf-causa-name { font-size: .9rem; font-weight: 600; color: var(--text-primary); }
.inf-causa-meta { color: var(--text-secondary); font-size: .74rem; margin-top: .06rem; }
.inf-causa-meta .inf-rol { color: var(--accent-blue); font-weight: 600; font-variant-numeric: tabular-nums; }
.inf-causa-actions { display: flex; gap: .3rem; flex-shrink: 0; }
.btn-inf {
  padding: .22rem .46rem;
  border-radius: 6px;
  font-size: .69rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  transition: background .2s;
  border: 1px solid;
}
.btn-inf-blue {
  background: rgba(var(--accent-blue-rgb), .1);
  color: var(--accent-blue);
  border-color: rgba(var(--accent-blue-rgb), .25);
}
.btn-inf-blue:hover { background: rgba(var(--accent-blue-rgb), .2); }
.btn-inf-green {
  background: rgba(var(--success-rgb), .1);
  color: var(--success);
  border-color: rgba(var(--success-rgb), .25);
}
.btn-inf-green:hover { background: rgba(var(--success-rgb), .2); }

.inf-cuaderno { margin-top: .34rem; }
.inf-cuaderno-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .6rem;
  margin-bottom: .2rem;
}
.inf-cuaderno-name { font-weight: 600; color: var(--warning); font-size: .8rem; }
.inf-cuaderno-summary {
  color: var(--text-secondary);
  font-size: .73rem;
  line-height: 1.3;
  margin: -.05rem 0 .28rem;
}
.inf-folio-change {
  background: var(--border-solid);
  border-radius: 5px;
  padding: .1rem .45rem;
  font-size: .8rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.inf-folio-arrow { color: var(--success); margin: 0 .1rem; }
.inf-badge-new {
  background: var(--success);
  color: var(--bg-base);
  font-weight: 700;
  font-size: .72rem;
  border-radius: 4px;
  padding: .1rem .4rem;
}
.inf-primera-vez {
  background: var(--accent-blue);
  color: var(--bg-base);
  font-weight: 700;
  font-size: .72rem;
  border-radius: 4px;
  padding: .1rem .35rem;
}

.inf-table-wrap { overflow-x: auto; }
.inf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  background: var(--bg-base);
  border-radius: 8px;
  overflow: hidden;
}
.inf-table th {
  background: var(--border-solid);
  color: var(--text-primary);
  text-align: left;
  padding: .45rem .6rem;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.inf-table td {
  padding: .45rem .6rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--bg-surface);
}
.inf-table tr:last-child td { border-bottom: none; }
.inf-table tr:hover td { background: rgba(var(--accent-blue-rgb), .06); }
.inf-table .inf-col-folio { white-space: nowrap; color: var(--accent-blue); font-weight: 600; width: 55px; }
.inf-table .inf-col-tramite { color: var(--warning); width: 130px; }
.inf-table .inf-col-fecha { white-space: nowrap; width: 90px; color: var(--text-secondary); }
.inf-table tr.mov-urgente td { background: rgba(var(--danger-rgb), .06); }
.inf-table tr.mov-urgente .inf-col-tramite { color: var(--danger); font-weight: 700; }
.inf-urgency-tag {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  padding: .05rem .3rem;
  border-radius: 3px;
  margin-left: .3rem;
  vertical-align: middle;
}
.inf-urgency-tag--alta { background: rgba(var(--danger-rgb), .2); color: var(--danger); }
.inf-urgency-tag--media { background: rgba(var(--warning-rgb), .2); color: var(--warning); }

.inf-accion-requerida {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin-top: .5rem;
  padding: .5rem .7rem;
  border-radius: 6px;
  font-size: .8rem;
  border-left: 3px solid;
}
.inf-accion-alta { background: rgba(var(--danger-rgb), .1); border-color: var(--danger); color: var(--danger); }
.inf-accion-media { background: rgba(var(--warning-rgb), .1); border-color: var(--warning); color: var(--warning); }
.inf-accion-baja { background: rgba(166,173,200,.1); border-color: var(--text-secondary); color: var(--text-secondary); }
.inf-accion-icon { font-size: 1rem; flex-shrink: 0; line-height: 1.2; }
.inf-accion-body { flex: 1; }
.inf-accion-body strong { color: inherit; }
.inf-accion-confianza {
  display: inline-block;
  font-size: .68rem;
  opacity: .7;
  margin-left: .4rem;
  font-style: italic;
}

.inf-escritos-pending {
  margin-top: .5rem;
  border: 1px solid rgba(var(--accent-blue-rgb), .2);
  border-radius: 6px;
  overflow: hidden;
  font-size: .8rem;
}
.inf-ep-title {
  background: rgba(var(--accent-blue-rgb), .08);
  padding: .35rem .7rem;
  color: var(--accent-blue);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.inf-ep-count {
  background: rgba(var(--accent-blue-rgb), .2);
  color: var(--accent-blue);
  border-radius: 10px;
  padding: .05rem .4rem;
  font-size: .72rem;
  font-weight: 700;
}
.inf-ep-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .4rem;
  padding: .35rem .7rem;
  border-top: 1px solid rgba(255,255,255,.04);
  color: var(--text-primary);
}
.inf-ep-contraparte { background: rgba(var(--accent-blue-rgb), .04); }
.inf-ep-propia { background: rgba(var(--success-rgb), .03); }
.inf-ep-folio { color: var(--text-faint); font-size: .72rem; min-width: 32px; }
.inf-ep-tramite { color: var(--text-primary); font-weight: 500; }
.inf-ep-desc { color: var(--text-secondary); flex: 1; }
.inf-ep-meta { color: var(--text-muted); font-size: .73rem; width: 100%; margin-top: .1rem; }
.inf-ep-meta strong { color: var(--warning); }
.inf-ep-badge-epr {
  background: rgba(var(--purple-rgb), .15);
  color: var(--purple);
  border: 1px solid rgba(var(--purple-rgb), .3);
  border-radius: 4px;
  padding: .05rem .35rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
  margin-right: .2rem;
}

.inf-baseline-card {
  background: linear-gradient(180deg, rgba(var(--accent-blue-rgb), .08), rgba(255,255,255,.015));
  border: 1px solid rgba(var(--accent-blue-rgb), .2);
  border-radius: 14px;
  padding: .8rem 1rem;
  margin-bottom: .6rem;
  border-left: 3px solid var(--accent-blue);
}
.inf-baseline-header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.inf-baseline-name { color: var(--text-primary); font-weight: 600; font-size: .88rem; }
.inf-baseline-meta { color: var(--text-secondary); font-size: .78rem; }
.inf-baseline-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .68rem;
  font-weight: 600;
  padding: .2rem .5rem;
  border-radius: 4px;
  background: rgba(var(--accent-blue-rgb), .12);
  color: var(--accent-blue);
}
.inf-baseline-cuadernos { margin-top: .4rem; display: flex; flex-direction: column; gap: .2rem; }
.inf-baseline-cuad {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  padding: .25rem .5rem;
  background: rgba(var(--accent-blue-rgb), .05);
  border-radius: 4px;
}
.inf-baseline-cuad-name { color: var(--warning); font-weight: 500; min-width: 90px; }
.inf-baseline-cuad-folio { color: var(--text-secondary); }
.inf-baseline-cuad-tramite { color: var(--text-secondary); flex: 1; }

.inf-sc-group {
  background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.01));
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.06);
  padding: .75rem 1rem;
  margin-bottom: .6rem;
}
.inf-sc-item {
  padding: .45rem 0;
  color: var(--text-secondary);
  font-size: .85rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
}
.inf-sc-item:last-child { border-bottom: none; }
.inf-sc-item .inf-rol { color: var(--accent-blue); font-weight: 600; font-variant-numeric: tabular-nums; }
.inf-sc-folio { font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.inf-sc-trace { font-size: .75rem; color: var(--text-faint); margin-left: .25rem; }

.inf-error-msg { color: var(--danger); font-size: .82rem; margin-top: .2rem; }

.btn-retry {
  padding: .4rem .9rem;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: rgba(var(--warning-rgb), .1);
  color: var(--warning);
  border: 1px solid rgba(var(--warning-rgb), .25);
  transition: all .2s;
}
.btn-retry:hover { background: rgba(var(--warning-rgb), .2); }
.btn-retry:disabled { opacity: .5; cursor: not-allowed; }

.mm-status,
.inf-status,
.det-status {
  display: none;
  border: 1px solid transparent;
}
.inf-status {
  padding: .85rem 1rem;
  border-radius: 14px;
  margin: 0 0 1rem;
  font-size: .85rem;
  align-items: center;
  gap: .5rem;
}
.mm-status.show,
.inf-status.show,
.det-status.show { display: flex; align-items: center; }
.mm-status-loading,
.inf-status-loading,
.det-status-loading {
  background: rgba(var(--accent-blue-rgb), .1);
  color: var(--accent-blue);
  border: 1px solid rgba(var(--accent-blue-rgb), .2);
}
.mm-status-ok,
.inf-status-ok,
.det-status-ok {
  background: rgba(var(--success-rgb), .1);
  color: var(--success);
  border: 1px solid rgba(var(--success-rgb), .2);
}
.mm-status-err,
.inf-status-err,
.det-status-err {
  background: rgba(var(--danger-rgb), .1);
  color: var(--danger);
  border: 1px solid rgba(var(--danger-rgb), .2);
}
.mm-spinner,
.inf-spinner,
.det-spinner {
  display: inline-block;
  border-top-color: transparent;
  border-radius: 50%;
  animation: monitor-module-spin .7s linear infinite;
}
.inf-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent-blue);
}
.inf-time-rel { color: var(--text-muted); font-size: .78rem; font-style: italic; }

/* Monitor cause detail */
.det-shell { max-width: 1240px; }

.det-hero {
  background:
    radial-gradient(circle at top right, rgba(var(--accent-blue-rgb), .14), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
  padding: 1.45rem 1.55rem 1.3rem;
}
.det-header h2 {
  color: var(--text-primary);
  margin: 0 0 .3rem;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1.02;
  letter-spacing: -.05em;
}
.det-meta { color: var(--text-secondary); font-size: .92rem; line-height: 1.55; }
.det-meta .det-rol { color: var(--accent-blue); font-weight: 700; font-variant-numeric: tabular-nums; }
.det-header-note {
  max-width: 300px;
}

.det-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-top: .2rem;
}
.det-summary-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  padding: .9rem .95rem;
  min-height: 116px;
}
.det-summary-label {
  display: block;
  color: var(--text-faint);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .35rem;
}
.det-summary-value {
  display: block;
  color: var(--text-primary);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.04em;
}
.det-summary-meta {
  display: block;
  color: var(--text-secondary);
  font-size: .82rem;
  line-height: 1.45;
  margin-top: .38rem;
}
.det-summary-value.c-attention { color: var(--warning); }
.det-summary-value.c-success { color: var(--success); }
.det-summary-value.c-danger { color: var(--danger); }
.det-summary-value.c-accent { color: var(--accent-blue); }

.det-actions { display: flex; gap: .5rem; margin: 0 0 1.2rem; flex-wrap: wrap; }
.btn-det {
  padding: .5rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, opacity .2s;
  text-decoration: none;
}
.btn-det:disabled { opacity: .5; cursor: not-allowed; }
.btn-det-primary { background: var(--accent-blue); color: var(--bg-base); }
.btn-det-primary:hover:not(:disabled) { background: var(--accent-blue-hover); }
.btn-det-secondary { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-solid); }
.btn-det-secondary:hover:not(:disabled) { background: #3b3d54; }

.det-signal {
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid transparent;
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  margin-top: .2rem;
}
.det-signal-icon { flex-shrink: 0; padding-top: .05rem; }
.det-signal-body { flex: 1; }
.det-signal-title { color: var(--text-primary); font-size: 1rem; font-weight: 700; margin-bottom: .18rem; }
.det-signal-copy { color: var(--text-secondary); font-size: .84rem; line-height: 1.55; }
.det-signal--attention { background: rgba(var(--warning-rgb), .1); border-color: rgba(var(--warning-rgb), .2); }
.det-signal--stable { background: rgba(var(--success-rgb), .08); border-color: rgba(var(--success-rgb), .18); }
.det-signal--error { background: rgba(var(--danger-rgb), .08); border-color: rgba(var(--danger-rgb), .18); }
.det-signal--baseline { background: rgba(var(--accent-blue-rgb), .08); border-color: rgba(var(--accent-blue-rgb), .18); }
.det-signal--empty { background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.06); }

.det-status {
  padding: .8rem 1.2rem;
  border-radius: 10px;
  margin-bottom: 1.2rem;
  font-size: .9rem;
}
.det-status.show { gap: .6rem; }
.det-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent-blue);
}

.estado-box {
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 1.2rem 1.3rem;
  margin-bottom: 1.5rem;
}
.estado-title { font-size: 1.08rem; font-weight: 700; color: var(--text-primary); margin: 0 0 .32rem; }
.estado-timestamp {
  font-size: .82rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.estado-timestamp .dot-ok { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.estado-timestamp .dot-err { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.estado-sin-datos { color: var(--text-muted); font-style: italic; font-size: .9rem; }

.cuad-card {
  background: var(--bg-surface);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: .7rem;
  border: 1px solid rgba(255,255,255,.06);
  min-width: 0;
  overflow: hidden;
}
.cuad-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .55rem;
  flex-wrap: wrap;
}
.cuad-name { font-weight: 700; color: var(--warning); font-size: .95rem; margin-bottom: .35rem; }
.cuad-status {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}
.cuad-status--stable {
  background: rgba(var(--success-rgb), .12);
  color: var(--success);
  border: 1px solid rgba(var(--success-rgb), .22);
}
.cuad-status--changed {
  background: rgba(var(--warning-rgb), .12);
  color: var(--warning);
  border: 1px solid rgba(var(--warning-rgb), .22);
}
.cuad-status--baseline {
  background: rgba(var(--accent-blue-rgb), .12);
  color: var(--accent-blue);
  border: 1px solid rgba(var(--accent-blue-rgb), .22);
}
.cuad-status--uncertain {
  background: rgba(var(--danger-rgb), .12);
  color: var(--danger);
  border: 1px solid rgba(var(--danger-rgb), .22);
}
.cuad-status--empty {
  background: rgba(255,255,255,.04);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,.08);
}
.cuad-primary {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.cuad-verified {
  color: var(--text-secondary);
  font-size: .8rem;
  line-height: 1.45;
}
.cuad-trace {
  color: var(--text-primary);
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: .18rem;
}
.cuad-trace-detail {
  color: var(--text-secondary);
  font-size: .81rem;
  line-height: 1.5;
  margin-bottom: .55rem;
}
.cuad-meta {
  color: var(--text-secondary);
  font-size: .82rem;
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
}
.cuad-meta span {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cuad-desc {
  color: var(--text-faint);
  max-width: min(100%, 56ch);
}
.folio-badge {
  background: rgba(var(--accent-blue-rgb), .15);
  color: var(--accent-blue);
  padding: .15rem .5rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}

.det-caratulado {
  background: rgba(var(--success-rgb), .06);
  border: 1px solid rgba(var(--success-rgb), .15);
  border-radius: 8px;
  padding: .55rem 1rem;
  margin-bottom: 1rem;
  font-size: .88rem;
  color: var(--success);
}
.det-caratulado strong { color: var(--text-primary); }

.hist-section { margin-bottom: 2rem; }
.hist-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 0 0 .8rem; }

.rev-card {
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  margin-bottom: .7rem;
  transition: border-color .2s;
}
.rev-card.rev-novedad { border-left: 4px solid var(--success); }
.rev-card.rev-sin-cambios { border-left: 4px solid var(--text-muted); }
.rev-card.rev-error { border-left: 4px solid var(--danger); }
.rev-card.rev-primera-vez { border-left: 4px solid var(--accent-blue); background: rgba(var(--accent-blue-rgb), .04); }

.rev-badge-baseline { background: rgba(var(--accent-blue-rgb), .18); color: var(--accent-blue); }

.rev-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .3rem;
}
.rev-fecha { font-size: .85rem; color: var(--text-primary); font-weight: 600; }
.rev-badge {
  font-size: .75rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.rev-badge-novedad { background: rgba(var(--success-rgb), .15); color: var(--success); }
.rev-badge-sin { background: rgba(88,91,112,.3); color: var(--text-secondary); }
.rev-badge-error { background: rgba(var(--danger-rgb), .15); color: var(--danger); }

.rev-body { font-size: .84rem; color: var(--text-secondary); }
.rev-cuad-line { margin: .2rem 0; }
.rev-cuad-line .cuad-label { color: var(--warning); font-weight: 600; }
.rev-folio-change { color: var(--accent-blue); font-variant-numeric: tabular-nums; font-weight: 600; }

.epr-section { margin-bottom: 1.5rem; }
.epr-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.epr-badge {
  background: rgba(var(--purple-rgb), .15);
  color: var(--purple);
  border: 1px solid rgba(var(--purple-rgb), .3);
  border-radius: 4px;
  padding: .05rem .4rem;
  font-size: .72rem;
  font-weight: 700;
}
.epr-cuad-label { font-size: .8rem; font-weight: 600; color: var(--warning); margin: .6rem 0 .25rem; }
.epr-card {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
  background: var(--bg-base);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 10px;
  padding: .4rem .7rem;
  margin-bottom: .3rem;
  font-size: .82rem;
  border-left: 3px solid rgba(var(--purple-rgb), .4);
}
.epr-tipo { color: var(--text-primary); font-weight: 600; flex: 1; }
.epr-meta { color: var(--text-faint); font-size: .76rem; }
.epr-meta strong { color: var(--warning); }

.movs-section { margin-bottom: 2rem; }
.movs-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 0 0 .8rem; }
.movs-empty { color: var(--text-muted); font-style: italic; font-size: .88rem; }

.mov-card {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: .65rem .8rem;
  margin-bottom: .45rem;
  border: 1px solid rgba(255,255,255,.05);
  border-left: 3px solid var(--success);
}
.mov-row1 { display: flex; align-items: baseline; gap: .45rem; min-width: 0; }
.mov-folio {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent-blue);
  font-size: .8rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.mov-tramite {
  color: var(--warning);
  font-weight: 600;
  font-size: .82rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mov-row2 { display: flex; gap: .5rem; align-items: baseline; margin-top: .06rem; min-width: 0; }
.mov-desc {
  color: var(--text-secondary);
  font-size: .76rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mov-fecha-rev { color: var(--text-muted); font-size: .73rem; white-space: nowrap; flex-shrink: 0; }

.mov-tipo {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .1rem .4rem;
  border-radius: 4px;
  display: inline-block;
  vertical-align: middle;
}
.mov-tipo-resolucion { background: rgba(250,179,135,.15); color: #fab387; }
.mov-tipo-escrito { background: rgba(148,226,213,.15); color: #94e2d5; }
.mov-tipo-otro { background: rgba(88,91,112,.3); color: var(--text-secondary); }

.mov-card-resolucion { border-left-color: #fab387; }
.mov-card-escrito { border-left-color: #94e2d5; }

.det-live { display: none; }
.det-live.show { display: block; }
.det-live h3 { color: var(--text-primary); font-size: 1.1rem; margin: 0 0 .5rem; }

.det-cuad-live {
  background: var(--bg-surface);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  margin-bottom: .8rem;
  border-left: 4px solid var(--accent-blue);
}
.det-cuad-live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .5rem;
}
.det-cuad-live-name { font-weight: 700; color: var(--warning); font-size: 1rem; }
.det-cuad-live-stats { display: flex; gap: .5rem; font-size: .82rem; }
.det-stat-pill { padding: .15rem .5rem; border-radius: 4px; font-weight: 600; }
.det-stat-folio { background: rgba(var(--accent-blue-rgb), .15); color: var(--accent-blue); }
.det-stat-count { background: rgba(var(--success-rgb), .12); color: var(--success); }
.det-stat-tramite { background: rgba(var(--warning-rgb), .12); color: var(--warning); }

.det-table-wrap { overflow-x: auto; max-height: 500px; overflow-y: auto; }
.det-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  background: var(--bg-base);
  border-radius: 8px;
  overflow: hidden;
}
.det-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--border-solid);
  color: var(--text-primary);
  text-align: left;
  padding: .5rem .65rem;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.det-table td { padding: .45rem .65rem; color: var(--text-primary); border-bottom: 1px solid var(--bg-surface); }
.det-table tr:last-child td { border-bottom: none; }
.det-table tr:hover td { background: rgba(var(--accent-blue-rgb), .06); }
.det-table .col-folio { white-space: nowrap; color: var(--accent-blue); font-weight: 600; width: 55px; }
.det-table .col-tramite { color: var(--warning); width: 120px; }
.det-table .col-fecha { white-space: nowrap; width: 95px; color: var(--text-secondary); }
.det-table .col-desc { max-width: 350px; }

.det-cuad-toggle {
  background: none;
  border: 1px solid var(--border-solid);
  color: var(--text-secondary);
  padding: .3rem .7rem;
  border-radius: 6px;
  font-size: .78rem;
  cursor: pointer;
  transition: background .2s;
}
.det-cuad-toggle:hover { background: var(--border-solid); color: var(--text-primary); }

@media (max-width: 900px) {
  .mon-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mon-ops-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .mon-form-grid { grid-template-columns: 1fr; }
  .excel-modal { width: 98vw; }
  .mon-ops-actions,
  .mon-op-inline { flex-direction: column; align-items: flex-start; }
  .issue-row { grid-template-columns: 22px 10px minmax(0, 1fr); }
  .issue-actions { grid-column: 3; justify-content: flex-start; padding-top: 0; }
  .issue-topline { flex-direction: column; align-items: flex-start; }

  .inf-shell { gap: .85rem; }
  .inf-hero-top { margin-bottom: .55rem; }
  .inf-hero-nav { flex-direction: column; align-items: flex-start; }
  .inf-sidepanel { width: 100%; min-width: 0; }
  .inf-sidepanel-row {
    flex-direction: column;
    align-items: stretch;
    gap: .45rem;
  }
  .inf-topbar-actions {
    width: 100%;
    justify-content: space-between;
    border-radius: 16px;
    padding: .4rem .48rem .4rem .62rem;
  }
  .inf-export-btns { justify-content: flex-end; flex-wrap: wrap; }
  .inf-hero { padding: 1.25rem 1rem 1.1rem; border-radius: 18px; }
  .inf-header { flex-direction: column; }
  .inf-title { font-size: 1.7rem; }
  .inf-date { width: 100%; min-width: 0; }
  .inf-stampbar { grid-template-columns: 1fr; }
  .inf-summary { grid-template-columns: repeat(2, 1fr); }
  .inf-filter-note { flex-direction: column; }
  .inf-causa-header { flex-direction: column; }
  .inf-cuaderno-header { flex-direction: column; align-items: flex-start; }

  .det-hero { padding: 1.2rem 1rem 1rem; border-radius: 18px; }
  .det-header { flex-direction: column; }
  .det-header-note { max-width: none; min-width: 0; width: 100%; }
  .det-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .det-actions { flex-direction: column; align-items: flex-start; }
  .rev-header { flex-direction: column; align-items: flex-start; }
  .cuad-meta { flex-direction: column; gap: .3rem; }
  .cuad-primary { align-items: flex-start; }
  .det-cuad-live-header { flex-direction: column; align-items: flex-start; }
  .mov-row1,
  .mov-row2 { flex-wrap: wrap; }
  .mov-tramite,
  .mov-desc { white-space: normal; }
  .mov-fecha-rev { font-size: .7rem; }
}

@media (max-width: 560px) {
  .mon-shell { padding: 1.2rem 1rem 2rem; }
  .mon-summary { grid-template-columns: 1fr; }
  .issue-meta { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .issue-tribunal { white-space: normal; }
}

@media (max-width: 520px) {
  .inf-summary { grid-template-columns: 1fr; }
  .inf-card { min-height: 0; }

  .det-shell { gap: .85rem; }
  .det-summary { grid-template-columns: 1fr; }
}
