/**
 * SUNFY (Geslog) · Sistema de diseño
 * Tema claro/oscuro con acento solar
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

/* Spinner de carga reutilizable -- usar dentro de un .empty-state o suelto,
   ej: <div class="spinner"></div> */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 34px; height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--border, rgba(127,127,127,0.3)) 0 30%, var(--accent, #1a73e8) 30% 60%, var(--border, rgba(127,127,127,0.3)) 60% 100%);
  background-size: 300% 100%;
  animation: spin-bar 0.9s linear infinite;
}
.spinner-row {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --bg: #F7F8FA;
  --bg-2: #EEF0F3;
  --surface: #FFFFFF;
  --surface-2: #F1F3F5;
  --border: #E4E7EB;
  --border-strong: #D1D5DB;

  --text: #0F172A;
  --text-muted: #6B7280;
  --text-subtle: #9CA3AF;

  --sidebar-bg: #0B0D10;
  --sidebar-border: rgba(255,255,255,0.06);
  --sidebar-text: #C9CED6;
  --sidebar-text-muted: #6B7280;
  --sidebar-active-bg: rgba(245, 158, 11, 0.1);
  --sidebar-active-text: #FBBF24;

  --accent: #F59E0B;
  --accent-hover: #FBBF24;
  --accent-soft: rgba(245, 158, 11, 0.12);
  --accent-contrast: #0B0D10;

  --success: #10B981;
  --success-soft: rgba(16, 185, 129, 0.12);
  --warning: #F59E0B;
  --warning-soft: rgba(245, 158, 11, 0.12);
  --danger: #EF4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --info: #3B82F6;
  --info-soft: rgba(59, 130, 246, 0.12);

  --sidebar-width: 240px;
  --topbar-height: 56px;
  --radius-sm: 3px;
  --radius: 3px;
  --radius-md: 3px;
  --radius-lg: 3px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 2px 6px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);

  --t-fast: 120ms ease;
  --t: 180ms ease;
}

[data-theme="dark"] {
  --bg: #0B0D10;
  --bg-2: #0F1115;
  --surface: #12151A;
  --surface-2: #1A1F27;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);

  --text: #E6E8EB;
  --text-muted: #8B92A0;
  --text-subtle: #6B7280;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 2px 8px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* Layout --------------------------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}
.layout-main { display: flex; flex-direction: column; min-width: 0; }

/* Sidebar -------------------------------------------- */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-x: hidden;
  min-width: 0;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--sidebar-border);
  cursor: pointer; user-select: none;
  transition: background var(--t-fast);
}
.sidebar-brand:hover { background: rgba(255,255,255,0.03); }
.sidebar-brand:focus-visible { outline: 1px solid var(--accent); outline-offset: -2px; }
.sidebar-brand .logo {
  width: 30px; height: 30px; border-radius: 3px;
  background: var(--accent); color: var(--accent-contrast);
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px;
}
.sidebar-brand .name { color: #fff; font-weight: 600; letter-spacing: -0.01em; }
.sidebar-brand .env {
  color: var(--sidebar-text-muted); font-size: 11px;
  font-family: var(--font-mono); margin-left: auto;
}
.sidebar-section {
  padding: 18px 16px 8px;
  color: var(--sidebar-text-muted);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
/* Por defecto cada sección ocupa solo lo que su contenido necesita (sin
   scroll, sin estirarse) -- así "Principal" se ve siempre entero. Solo la
   sección marcada como --scroll (la "en cuarentena", ver menu-definition.php)
   absorbe el espacio sobrante y se desborda con scroll vertical propio. */
.sidebar-nav { padding: 4px 8px; flex: 0 0 auto; overflow-y: visible; min-width: 0; }
.sidebar-nav--scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px; font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
  min-width: 0;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.04); color: #fff; }
.sidebar-nav a.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); }
.sidebar-nav a .i {
  width: 18px; height: 18px;
  flex: 0 0 auto;
  display: inline-grid; place-items: center;
  font-size: 15px; opacity: 0.85;
}
.sidebar-nav a .label {
  min-width: 0; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
}
.sidebar-foot {
  border-top: 1px solid var(--sidebar-border);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-foot .avatar {
  width: 36px; height: 36px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px;
  position: relative; overflow: hidden;
}
.sidebar-foot .avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sidebar-foot .who { flex: 1; min-width: 0; }
.sidebar-foot .who strong {
  display: block; color: #fff;
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-foot .who span { display: block; color: var(--sidebar-text-muted); font-size: 11px; }
.sidebar-foot a.logout {
  color: var(--sidebar-text-muted);
  font-size: 16px; padding: 4px 6px;
  border-radius: 3px; transition: color var(--t-fast);
}
.sidebar-foot a.logout:hover { color: #fff; }

/* Sidebar colapsado --------------------------------- */
.app-shell { transition: grid-template-columns var(--t); }
html[data-sidebar="collapsed"] .app-shell { grid-template-columns: 64px 1fr; }
html[data-sidebar="collapsed"] .sidebar { overflow-x: hidden; }
html[data-sidebar="collapsed"] .sidebar-brand {
  padding: 18px 0; justify-content: center;
}
html[data-sidebar="collapsed"] .sidebar-brand .name,
html[data-sidebar="collapsed"] .sidebar-brand .env,
html[data-sidebar="collapsed"] .sidebar-section,
html[data-sidebar="collapsed"] .sidebar-foot .who {
  display: none;
}
html[data-sidebar="collapsed"] .sidebar-nav { padding: 4px 6px; }
html[data-sidebar="collapsed"] .sidebar-nav a {
  font-size: 0; padding: 9px 0; justify-content: center; gap: 0;
}
html[data-sidebar="collapsed"] .sidebar-nav a .i { font-size: 15px; }
html[data-sidebar="collapsed"] .sidebar-foot {
  padding: 12px 6px; justify-content: center;
}


/* Topbar --------------------------------------------- */
.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 10;
}
.topbar-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.topbar-title .crumb { color: var(--text-muted); font-weight: 500; }
.topbar-title .sep { color: var(--text-subtle); }
.topbar-spacer { flex: 1; }
.topbar-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  display: grid; place-items: center;
  cursor: pointer; transition: all var(--t-fast);
  font-size: 14px;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }

/* Content -------------------------------------------- */
/* Sin tope de ancho: la pantalla se aprovecha entera (antes max-width:1600px dejaba un hueco vacío a la derecha en monitores grandes) */
.content { padding: 24px 32px 40px; width: 100%; box-sizing: border-box; }
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; margin-bottom: 24px;
}
.page-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.page-head p { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

/* Cards ---------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--t-fast);
}
.card:hover { border-color: var(--border-strong); }
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.card-body { color: var(--text); }

/* KPIs / Stats --------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative; overflow: hidden;
}
.stat-card .label {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
}
.stat-card .number {
  font-family: var(--font-mono);
  font-size: 28px; font-weight: 600;
  color: var(--text); margin-top: 8px;
  letter-spacing: -0.02em;
}
.stat-card .trend { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Menu grid ------------------------------------------ */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.menu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: block; color: var(--text);
  transition: all var(--t-fast);
}
.menu-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.menu-card .icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-size: 18px; margin-bottom: 14px;
}
.menu-card h2 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.menu-card p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.menu-card.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #EA580C 100%);
  border-color: transparent; color: #0B0D10;
}
.menu-card.primary .icon { background: rgba(11,13,16,0.12); color: #0B0D10; }
.menu-card.primary p { color: rgba(11,13,16,0.75); }

/* Buttons -------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  background: var(--surface); color: var(--text);
  transition: all var(--t-fast);
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #059669; border-color: #059669; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: var(--accent-contrast); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; border-color: #DC2626; }
.btn-info { background: var(--info); border-color: var(--info); color: #fff; }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 42px; padding: 0 18px; font-size: 14px; }

/* Badges --------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px; font-weight: 600;
  line-height: 1.5;
  border: 1px solid transparent;
}
.badge::before {
  content: ''; width: 6px; height: 6px;
  border-radius: 3px;
  background: currentColor; opacity: 0.9;
}
.badge-success, .badge-active, .badge-online { background: var(--success-soft); color: var(--success); }
.badge-warning, .badge-suspended, .badge-maintenance { background: var(--warning-soft); color: var(--warning); }
.badge-error, .badge-inactive, .badge-offline { background: var(--danger-soft); color: var(--danger); }
.badge-info, .badge-prospect { background: var(--info-soft); color: var(--info); }
.badge-gray, .badge-individual, .badge-residential, .badge-client { background: var(--surface-2); color: var(--text-muted); }
.badge-company, .badge-commercial, .badge-tech { background: var(--info-soft); color: var(--info); }
.badge-community, .badge-industrial { background: var(--warning-soft); color: var(--warning); }
.badge-agricultural { background: var(--success-soft); color: var(--success); }
.badge-public { background: var(--info-soft); color: var(--info); }
.badge-admin { background: var(--accent-soft); color: var(--accent); }
.badge-superadmin { background: var(--danger-soft); color: var(--danger); }

/* Forms ---------------------------------------------- */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; margin-bottom: 6px;
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
}
.form-group input,
.form-group select,
.form-group textarea,
.toolbar input,
.toolbar select {
  width: 100%; height: 36px; padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px; font-family: inherit;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-group textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 72px; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.toolbar input:focus,
.toolbar select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-row-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 14px; }
.form-section {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
  margin: 20px 0 12px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.form-section:first-child { margin-top: 0; }

/* Toolbar -------------------------------------------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.toolbar input[type="text"] { flex: 1; min-width: 220px; }
.toolbar input, .toolbar select { width: auto; }

/* Tables --------------------------------------------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  padding: 10px 16px; text-align: left;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }
.actions { display: flex; gap: 6px; white-space: nowrap; }
.client-name, .inst-info { display: flex; flex-direction: column; }
.client-name small, .inst-info small { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* Pagination ----------------------------------------- */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 20px; }
.pagination button {
  min-width: 32px; height: 32px; padding: 0 10px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text); font-size: 13px;
  transition: all var(--t-fast);
}
.pagination button:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }
.pagination button.active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Empty state ---------------------------------------- */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .icon { font-size: 32px; opacity: 0.5; margin-bottom: 10px; }
.empty-state p { font-size: 13px; }

/* Modal ---------------------------------------------- */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(11, 13, 16, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center; align-items: flex-start;
  padding: 4vh 20px; overflow-y: auto;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 800px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal.modal-wide { max-width: 1200px; }
.modal.modal-wide .modal-body { max-height: 72vh; }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface);
  position: sticky; top: 0; z-index: 1;
}
.modal-header h2 { font-size: 15px; font-weight: 600; }
.modal-close {
  background: none; border: none;
  font-size: 20px; cursor: pointer;
  color: var(--text-muted);
  width: 28px; height: 28px; border-radius: 3px;
  transition: all var(--t-fast);
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--surface);
}

/* Modales de aviso y confirmación (public/assets/js/modal-service.js) ------------- */
.msv-overlay { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(11, 13, 16, 0.55); opacity: 0; transition: opacity 120ms ease; }
.msv-overlay.msv-in { opacity: 1; }
.msv-box { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 3px; box-shadow: var(--shadow-lg); transform: translateY(8px); transition: transform 120ms ease; overflow: hidden; }
.msv-in .msv-box { transform: none; }
.msv-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.msv-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
.msv-icon { flex: none; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 3px; font-size: 14px; font-weight: 800; color: #fff; background: #3B82F6; }
.msv-success .msv-icon { background: var(--success); }
.msv-error .msv-icon, .msv-danger .msv-icon { background: var(--danger); }
.msv-warning .msv-icon { background: #F59E0B; }
.msv-body { padding: 10px 20px 4px 56px; font-size: 13.5px; line-height: 1.5; color: var(--text); white-space: pre-line; word-break: break-word; }
.msv-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 18px; }
.msv-btn { padding: 8px 16px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px; cursor: pointer; }
.msv-btn:hover { filter: brightness(.96); }
.msv-btn:focus-visible { outline: 2px solid #3B82F6; outline-offset: 2px; }
.msv-btn-primary { color: #fff; background: #2563EB; border-color: #2563EB; }
.msv-danger .msv-btn-primary, .msv-error .msv-btn-primary { background: var(--danger); border-color: var(--danger); }
.msv-success .msv-btn-primary { background: var(--success); border-color: var(--success); }

/* Grid helpers + utilities --------------------------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }

/* Responsive ----------------------------------------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .form-row-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -100%; width: 280px; z-index: 50; transition: left var(--t); }
  .sidebar.open { left: 0; }
  .content { padding: 20px 16px 40px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
}

/* Crear / editar como página (navegación) en vez de ventana modal: ver public/assets/js/page-nav.js */
.modal-overlay.page-mode { position: static; inset: auto; background: none; backdrop-filter: none; padding: 0; overflow: visible; z-index: auto; display: none; }
.modal-overlay.page-mode.active { display: block; }
.modal-overlay.page-mode > .modal { max-width: none !important; width: 100%; box-shadow: none; overflow: visible; }
.modal-overlay.page-mode .modal-body,
.modal-overlay.page-mode .modal.modal-wide .modal-body { max-height: none; overflow: visible; }
.modal-overlay.page-mode .modal-header { position: static; justify-content: flex-start; gap: 14px; }
.modal-overlay.page-mode .modal-close { display: none; }
.modal-overlay.page-mode .modal-footer { position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -2px 8px rgba(0, 0, 0, .06); }
@keyframes spin-bar { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* globo rojo del menú lateral (p. ej. instalaciones con el esquema modificado) */
.sidebar-nav a .nav-badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
