:root {
  --app-font: "Manrope", "DM Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --app-bg: #090d16;
  --app-surface: #0f172a;
  --app-surface-2: #1e1b4b;
  --app-text: #f8fafc;
  --app-muted: #94a3b8;
  --app-border: #334155;
  --app-primary: #7c3aed;
  --app-primary-2: #6d28d9;
  --app-primary-light: rgba(124, 58, 237, 0.16);
  --app-danger: #ef4444;
  --app-ok: #10b981;
  --app-radius: 16px;
  --app-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

/* Modo Claro Override */
html[data-theme="light"], body[data-theme="light"], body.light {
  --app-bg: #f8fafc;
  --app-surface: #ffffff;
  --app-surface-2: #f1f5f9;
  --app-text: #0f172a;
  --app-muted: #64748b;
  --app-border: #cbd5e1;
  --app-primary: #7c3aed;
  --app-primary-2: #6d28d9;
  --app-primary-light: #f5f3ff;
  --app-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* Light theme overrides for shared module components */
html[data-theme="light"] body.app-admin,
body.light {
  background-color: var(--app-bg, #f8fafc) !important;
  color: var(--app-text, #0f172a) !important;
}

body[data-theme="light"] .form-card,
body.light .form-card,
body[data-theme="light"] .card,
body.light .card,
body[data-theme="light"] .modal,
body.light .modal,
body[data-theme="light"] .module-surface,
body.light .module-surface {
  background: var(--app-surface, #ffffff) !important;
  color: var(--app-text, #0f172a) !important;
  border-color: var(--app-border, #cbd5e1) !important;
}

body[data-theme="light"] .input,
body.light .input,
body[data-theme="light"] input.input,
body.light input.input,
body[data-theme="light"] select.input,
body.light select.input,
body[data-theme="light"] textarea.input,
body.light textarea.input {
  background: #ffffff !important;
  color: var(--app-text, #0f172a) !important;
  border-color: var(--app-border, #cbd5e1) !important;
}

body[data-theme="light"] .title-stack h2,
body.light .title-stack h2,
body[data-theme="light"] .title-stack h3,
body.light .title-stack h3,
body[data-theme="light"] .modal h3,
body.light .modal h3,
body[data-theme="light"] .form-title,
body.light .form-title,
body[data-theme="light"] label,
body.light label {
  color: var(--app-text, #0f172a) !important;
}

body[data-theme="light"] .small,
body.light .small,
body[data-theme="light"] .muted,
body.light .muted,
body[data-theme="light"] .form-sub,
body.light .form-sub {
  color: var(--app-muted, #64748b) !important;
}

body[data-theme="light"] .hombre-vivo-wrapper,
body.light .hombre-vivo-wrapper {
  background: var(--app-bg, #f8fafc) !important;
  color: var(--app-text, #0f172a) !important;
}

/* Modo Oscuro Override (Paleta Carbón Slate de Reportes - Sin Morado/Lila) */
html[data-theme="dark"], body[data-theme="dark"], body.dark {
  --app-bg: #0d1117;
  --app-surface: #161b22;
  --app-surface-2: #21262d;
  --app-text: #f0f6fc;
  --app-muted: #8b949e;
  --app-border: #30363d;
  --app-primary: #8b5cf6;
  --app-primary-2: #7c3aed;
  --app-primary-light: rgba(139, 92, 246, 0.18);
  --app-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* Dark theme overrides for shared module components */
html[data-theme="dark"] body.app-admin,
body.dark {
  background-color: var(--app-bg, #0d1117) !important;
  color: var(--app-text, #f0f6fc) !important;
}

body[data-theme="dark"] .form-card,
body.dark .form-card,
body[data-theme="dark"] .card,
body.dark .card,
body[data-theme="dark"] .modal,
body.dark .modal,
body[data-theme="dark"] .module-surface,
body.dark .module-surface {
  background: var(--app-surface, #161b22) !important;
  color: var(--app-text, #f0f6fc) !important;
  border-color: var(--app-border, #30363d) !important;
}

body[data-theme="dark"] .input,
body.dark .input,
body[data-theme="dark"] input.input,
body.dark input.input,
body[data-theme="dark"] select.input,
body.dark select.input,
body[data-theme="dark"] textarea.input,
body.dark textarea.input {
  background: var(--app-surface-2, #21262d) !important;
  color: var(--app-text, #f0f6fc) !important;
  border-color: var(--app-border, #30363d) !important;
}

body[data-theme="dark"] .title-stack h2,
body.dark .title-stack h2,
body[data-theme="dark"] .title-stack h3,
body.dark .title-stack h3,
body[data-theme="dark"] .modal h3,
body.dark .modal h3,
body[data-theme="dark"] .form-title,
body.dark .form-title,
body[data-theme="dark"] label,
body.dark label {
  color: var(--app-text, #f0f6fc) !important;
}

body[data-theme="dark"] .small,
body.dark .small,
body[data-theme="dark"] .muted,
body.dark .muted,
body[data-theme="dark"] .form-sub,
body.dark .form-sub {
  color: var(--app-muted, #8b949e) !important;
}

body[data-theme="dark"] .tab,
body.dark .tab {
  color: var(--app-muted, #8b949e);
}
body[data-theme="dark"] .tab:hover,
body.dark .tab:hover {
  color: var(--app-text, #f0f6fc);
  background: rgba(255,255,255,0.06);
}
body[data-theme="dark"] .tab.active,
body.dark .tab.active {
  color: #8b5cf6;
  border-bottom-color: #8b5cf6;
}

.gf-map-label {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(124, 58, 237, 0.3) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
  padding: 4px 10px !important;
  font-family: var(--app-font);
  font-size: 0.82rem !important;
}

[data-theme="dark"] .gf-map-label,
body.dark .gf-map-label {
  background: rgba(15, 23, 42, 0.92) !important;
  color: #f8fafc !important;
  border-color: rgba(139, 92, 246, 0.4) !important;
}

* { box-sizing: border-box; }

body.app-admin {
  margin: 0;
  font-family: var(--app-font);
  color: var(--app-text);
  background: var(--app-bg);
  transition: background-color .25s ease, color .25s ease;
}

/* ============================================================
   LOGIN PAGE — body.app-login
   ============================================================ */

body.app-login {
  margin: 0;
  font-family: var(--app-font);
  color: #f8fafc;
  min-height: 100vh;
  background: linear-gradient(135deg, #090d16 0%, #171026 50%, #2e1065 100%);
  overflow-x: hidden;
  position: relative;
}

/* Background decorative layer */
body.app-login .bg-image-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

body.app-login .bg-image {
  position: absolute;
  inset: -10%;
  background: url('/proyecto/public/media/bg-image.jp.png') center/cover no-repeat;
  opacity: .07;
  filter: blur(2px);
  transition: transform 20s ease-in-out;
}

body.app-login .bg-image.animated {
  transform: scale(1.04) translate(1%, 1%);
}

/* Video background */
body.app-login .bg-video-wrap {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

body.app-login .bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .18;
}

/* ---- Main wrapper ---- */
body.app-login .tracker-admin {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.app-login .main-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 480px 1fr;
  gap: 24px;
  padding: 48px 40px;
  max-width: 1340px;
  margin: 0 auto;
  width: 100%;
  align-items: center;
}

/* ---- Panels ---- */
body.app-login .left-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.app-login .big-logo {
  width: 220px;
  height: 220px;
  background: url('/proyecto/public/logoprincipal.png') center/contain no-repeat;
  opacity: .75;
  filter: drop-shadow(0 0 45px rgba(124, 58, 237, 0.45));
}

body.app-login .center-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

body.app-login .right-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Login card ---- */
body.app-login .card {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(124, 58, 237, 0.25);
  padding: 36px 30px;
  color: #ffffff;
}

body.app-login .stack-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 22px;
}

body.app-login .logo-small {
  width: 68px;
  height: 68px;
  margin-bottom: 14px;
}

body.app-login .logo-small img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
  filter: drop-shadow(0 4px 16px rgba(124, 58, 237, 0.5));
}

body.app-login h2 {
  margin: 0 0 6px;
  font-size: 1.65rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -.02em;
}

body.app-login .hint {
  margin: 0;
  color: #94a3b8;
  font-size: .9rem;
}

/* ---- Flash alert ---- */
body.app-login .alert {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 12px;
}

body.app-login .alert--error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ---- Form fields ---- */
body.app-login .field {
  margin-bottom: 16px;
}

body.app-login .field label {
  display: block;
  margin-bottom: 6px;
  font-size: .88rem;
  font-weight: 600;
  color: #cbd5e1;
}

body.app-login .field input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.7);
  font-size: .95rem;
  font-family: inherit;
  color: #ffffff;
  outline: none;
  transition: all .25s ease;
}

body.app-login .field input::placeholder {
  color: #64748b;
}

body.app-login .field input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
  background: rgba(30, 41, 59, 0.95);
}

/* ---- Submit button ---- */
body.app-login .btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
  transition: all .25s ease;
}

body.app-login .btn:hover {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.5);
}

body.app-login .btn:active {
  transform: scale(0.98);
}

/* ---- Spinner ---- */
body.app-login .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Layout utilities ---- */
body.app-login .row {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.app-login .w-100 { width: 100%; }
body.app-login .small { font-size: .84rem; color: #64748b; }
body.app-login .mt-12 { margin-top: 12px; }
body.app-login .ml-8 { margin-left: 8px; }
body.app-login .hidden { display: none !important; }
body.app-login .invisible { visibility: hidden; }
body.app-login .meta { font-size: .8rem; color: #94a3b8; margin-top: 14px; text-align: center; }

/* ---- Copyright ---- */
body.app-login .copyright {
  text-align: center;
  font-size: .78rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 8px;
}

/* ---- APK download card (right panel) ---- */
body.app-login .apk-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.app-login .apk-card legend {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
  margin-bottom: 6px;
}

body.app-login .apk-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}

body.app-login .apk-option:hover {
  border-color: #1473e6;
  background: #f0f7ff;
}

body.app-login .apk-option .icon {
  color: #1473e6;
  flex-shrink: 0;
}

body.app-login .apk-option .label {
  flex: 1;
  font-size: .9rem;
  font-weight: 600;
  color: #1e293b;
}

body.app-login .apk-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

body.app-login .apk-option .marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  flex-shrink: 0;
  transition: border-color .2s, background .2s;
}

body.app-login .apk-option:has(input:checked) .marker {
  border-color: #1473e6;
  background: #1473e6;
}

body.app-login .apk-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

body.app-login .apk-download {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1473e6, #2f6fb5);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  transition: filter .2s;
}

body.app-login .apk-download:hover {
  filter: brightness(1.08);
}

body.app-login .apk-qr-btn {
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  color: #475569;
  transition: border-color .2s, background .2s;
}

body.app-login .apk-qr-btn:hover {
  border-color: #1473e6;
  background: #f0f7ff;
  color: #1473e6;
}

body.app-login .apk-qr {
  display: none;
  justify-content: center;
  padding: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

body.app-login .apk-qr[aria-hidden="false"] {
  display: flex;
}

body.app-login .footer {
  height: 32px;
}

/* ---- Responsive ---- */
@media (max-width: 1020px) {
  body.app-login .main-grid {
    grid-template-columns: 1fr 420px;
    padding: 32px 24px;
  }

  body.app-login .left-panel {
    display: none;
  }
}

@media (max-width: 680px) {
  body.app-login .main-grid {
    grid-template-columns: 1fr;
    padding: 24px 16px;
  }

  body.app-login .right-panel {
    display: none;
  }

  body.app-login .card {
    padding: 24px 20px;
    border-radius: 18px;
  }
}

/* ===============================
   Admin Shell Unified
   =============================== */
body.app-admin{
  --indigo: #0a84ff;
  --violet: #5e5ce6;
  --sidebar: #171b22;
  --sidebar-sep: rgba(255, 255, 255, .10);
  --link: #eef2f7;
  --muted: #97a6b8;
}body.app-admin *{ box-sizing: border-box }body.app-admin{
  margin: 0;
  font-family: "Manrope", "DM Sans", "Segoe UI", Roboto, Arial, sans-serif;
  display: flex;
  height: 100vh;
  background: linear-gradient(180deg, #f8fafc, #e7ecf2);
}

/* Sidebar */
body.app-admin .sidebar{
  width: 260px;
  background: var(--sidebar);
  color: var(--link);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 15px rgba(0, 0, 0, .35);
}body.app-admin .sidebar h2{
  margin: 0;
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid var(--sidebar-sep);
  background: rgba(255, 255, 255, .04);
  letter-spacing: .3px;
}body.app-admin .menu{ flex: 1; padding: 10px 0; }body.app-admin .menu a{
  display: block;
  padding: 14px 22px;
  margin: 6px 12px;
  color: var(--link);
  text-decoration: none;
  border-radius: 12px;
  transition: all .25s;
}body.app-admin .menu a:hover{
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-2));
  color: #fff;
  transform: translateX(4px);
}body.app-admin .menu a.active{
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-2));
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}

/* Content */
body.app-admin .content{ flex: 1; padding: 22px; overflow: auto; background: var(--app-bg); }body.app-admin header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}body.app-admin header h1{ margin: 0; color: var(--app-text); }body.app-admin .user-info{ color: var(--app-muted); margin-right: 12px }body.app-admin .logout-btn{
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-2));
  border: none;
  color: #fff;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: filter .2s, transform .1s;
}body.app-admin .logout-btn:hover{ filter: brightness(1.1); }body.app-admin .logout-btn:active{ transform: scale(0.97); }body.app-admin .card{
  background: var(--app-surface);
  color: var(--app-text);
  border-radius: 18px;
  box-shadow: var(--app-shadow);
  border: 1px solid var(--app-border);
  padding: 20px;
  margin-bottom: 20px;
}

/* ---- Submódulo Crear Usuario ---- */
body.app-admin .form-wrapper{
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
}body.app-admin .form-wrapper .card{
  width: 100%;
  max-width: 480px;
}body.app-admin .field{ margin-bottom: 16px; }body.app-admin .field label{
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--app-text);
}body.app-admin .field input, body.app-admin .field select{
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface-2);
  color: var(--app-text);
  outline: none;
  font-size: 0.95rem;
  transition: border-color .2s, box-shadow .2s;
}body.app-admin .field input:focus, body.app-admin .field select:focus{
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px var(--app-primary-light);
}
  box-shadow: 0 0 0 3px rgba(10, 132, 255, .18);
}body.app-admin .btn{
  display: inline-block;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: filter .2s, transform .1s;
}body.app-admin .btn-primary{
  width: 100%;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff;
}body.app-admin .btn-primary:hover{ filter: brightness(1.05); }body.app-admin .btn-primary:active{ transform: scale(0.97); }body.app-admin #msg{
  margin-top: 14px;
  font-size: 0.9rem;
}

/* ---- Módulos de usuarios (crear + administrar) ---- */
body.app-admin .user-create{
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(300px, 1fr);
  gap: 22px;
}body.app-admin .user-create__card, body.app-admin .user-create__info{
  position: relative;
  overflow: hidden;
}body.app-admin .user-create__card::before, body.app-admin .user-create__info::before{
  content: "";
  position: absolute;
  inset: -120px auto auto -80px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.16) 0%, rgba(99, 102, 241, 0) 72%);
  pointer-events: none;
}body.app-admin .user-create__card h2{
  margin: 0 0 6px;
  font-size: 1.45rem;
  letter-spacing: .2px;
}body.app-admin .user-create__subtitle{
  margin: 0 0 20px;
  color: #64748b;
  font-size: .95rem;
}body.app-admin .create-user-form{
  display: grid;
  gap: 2px;
}body.app-admin .field--grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}body.app-admin .create-user-form .field input, body.app-admin .create-user-form .field select{
  background: #f8faff;
}body.app-admin .create-user-form .btn-primary{
  margin-top: 8px;
  min-height: 46px;
  font-size: .96rem;
  letter-spacing: .2px;
}body.app-admin .msg-panel{
  margin-top: 14px;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1e3a8a;
}body.app-admin .msg-panel.is-hidden{
  display: none;
}body.app-admin .msg-panel.is-success{
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}body.app-admin .msg-panel.is-error{
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}body.app-admin .msg-panel small{
  display: inline-block;
  margin-bottom: 5px;
  opacity: .85;
}body.app-admin .password-meter{
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}body.app-admin .password-meter__bar{
  display: block;
  height: 100%;
  width: 8%;
  border-radius: inherit;
  background: #94a3b8;
  transition: width .25s ease, background-color .25s ease;
}body.app-admin .password-meter__bar[data-level="weak"]{
  background: #ef4444;
}body.app-admin .password-meter__bar[data-level="medium"]{
  background: #f59e0b;
}body.app-admin .password-meter__bar[data-level="strong"]{
  background: #16a34a;
}body.app-admin .password-meter__label{
  margin: 8px 0 0;
  color: #64748b;
  font-size: .83rem;
}body.app-admin .user-create__info{
  background: linear-gradient(165deg, #0f172a 0%, #111f3f 55%, #1e3a8a 100%);
  color: #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 20px 30px rgba(15, 23, 42, .24);
}body.app-admin .user-create__info h3{
  margin: 0 0 10px;
  font-size: 1.05rem;
}body.app-admin .user-create__info p{
  margin: 0 0 14px;
  color: #cbd5e1;
}body.app-admin .user-create__tips{
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 10px;
}body.app-admin .user-create__tips li{
  font-size: .92rem;
  line-height: 1.45;
}body.app-admin .user-create__legend{
  margin-top: 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}body.app-admin .user-pill{
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}body.app-admin .users-card{
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 0% 0%, rgba(59, 130, 246, .13) 0, rgba(59, 130, 246, 0) 42%),
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, .12) 0, rgba(14, 165, 233, 0) 44%),
    #fff;
}body.app-admin .users-card__title{
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: .2px;
}body.app-admin .users-card__subtitle{
  margin: 6px 0 0;
  color: #64748b;
  font-size: .92rem;
}body.app-admin .users-card__header{
  display: flex;
  flex-direction: column;
  gap: 16px;
}body.app-admin .users-card__controls{
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}body.app-admin .users-card .input, body.app-admin .users-card .select, body.app-admin .users-card .table .inp-nombre, body.app-admin .users-card .table .inp-email, body.app-admin .users-card .table select{
  border: 1px solid #dbe4f4;
  background: #fff;
  color: #0f172a;
  border-radius: 10px;
  min-height: 40px;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}body.app-admin .users-card .input:focus, body.app-admin .users-card .select:focus, body.app-admin .users-card .table .inp-nombre:focus, body.app-admin .users-card .table .inp-email:focus, body.app-admin .users-card .table select:focus{
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
}body.app-admin .users-card .btn{
  min-height: 40px;
  border-radius: 10px;
  font-weight: 700;
  border: 1px solid #dbe4f4;
  background: #fff;
  color: #0f172a;
}body.app-admin .users-card .btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(15, 23, 42, .08);
}body.app-admin .users-card .btn--primary{
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}body.app-admin .users-card .btn--danger{
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}body.app-admin .users-card .table-wrapper{
  margin-top: 4px;
  width: 100%;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}body.app-admin .users-stats{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 10px;
}body.app-admin .users-stats__chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 10px;
  border: 1px solid #dbeafe;
  background: #f8fbff;
  color: #1d4ed8;
  font-size: .82rem;
  font-weight: 600;
}body.app-admin .users-stats__chip strong{
  font-size: .9rem;
}body.app-admin .users-stats__chip--active{
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}body.app-admin .users-stats__chip--inactive{
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}body.app-admin .users-card .table{
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}body.app-admin .users-card .table th{
  position: sticky;
  top: 0;
  text-align: left;
  background: #f8fbff;
  color: #334155;
  font-size: .83rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
}body.app-admin .users-card .table td{
  padding: 12px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}body.app-admin .users-card .table tbody tr:hover{
  background: #f8fbff;
}body.app-admin .users-card .table .actions-cell{
  white-space: nowrap;
}body.app-admin .users-card .table .actions-cell .btn{
  min-height: 36px;
  padding: 8px 11px;
  font-size: .86rem;
}body.app-admin .users-card .table .actions-cell .btn + .btn{
  margin-left: 6px;
}body.app-admin .users-card .table .table-state td{
  text-align: center;
  color: #64748b;
  padding: 20px 14px;
}body.app-admin .users-card .table .table-state--error td{
  color: #b91c1c;
  background: #fef2f2;
}body.app-admin .users-card .table .table-skeleton-row td{
  padding: 12px;
}body.app-admin .skeleton{
  display: inline-block;
  width: 100%;
  height: 15px;
  border-radius: 7px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 45%, #e2e8f0 65%);
  background-size: 250% 100%;
  animation: skeleton-shimmer 1.15s linear infinite;
}body.app-admin .skeleton--id{
  width: 38px;
}body.app-admin .skeleton--actions{
  width: 140px;
}@keyframes skeleton-shimmer{
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}body.app-admin .users-card .table tr.row-flash td{
  animation: row-flash 1s ease;
}@keyframes row-flash{
  0% { background-color: #dcfce7; }
  100% { background-color: transparent; }
}body.app-admin .sr-only{
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}body.app-admin .users-card .pager{
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}body.app-admin .users-card .pager__left, body.app-admin .users-card .pager__right{
  display: flex;
  align-items: center;
  gap: 8px;
}body.app-admin .users-card .pager__info, body.app-admin .users-card .pager__range{
  color: #475569;
  font-size: .9rem;
}body.app-admin .users-card .msg{
  margin-top: 8px;
  min-height: 26px;
}body.app-admin .users-card .msg.msg--error{
  color: #b91c1c;
}body.app-admin .module-shell{
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 20px 16px;
}body.app-admin .module-hero{
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 24px;
  color: #e2e8f0;
  background:
    radial-gradient(circle at top right, rgba(45, 212, 191, 0.24), transparent 30%),
    radial-gradient(circle at left 20%, rgba(59, 130, 246, 0.24), transparent 28%),
    linear-gradient(135deg, #0f172a 0%, #13315c 48%, #0f766e 100%);
  box-shadow: 0 28px 56px rgba(15, 23, 42, 0.22);
}body.app-admin .module-hero::after{
  content: "";
  position: absolute;
  right: -56px;
  bottom: -84px;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}body.app-admin .module-hero__content{
  position: relative;
  z-index: 1;
  max-width: 860px;
}body.app-admin .module-kicker{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #dbeafe;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}body.app-admin .module-title{
  margin: 14px 0 0;
  font-size: clamp(1.7rem, 2.6vw, 2.5rem);
  line-height: 1.04;
  letter-spacing: -.04em;
  font-weight: 950;
}body.app-admin .module-subtitle{
  margin: 14px 0 0;
  max-width: 68ch;
  color: rgba(226, 232, 240, 0.82);
  font-size: .98rem;
  line-height: 1.6;
}body.app-admin .module-meta{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}body.app-admin .module-chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-size: .9rem;
  font-weight: 800;
}@media (max-width: 980px){
body.app-admin .user-create{
    grid-template-columns: 1fr;
  }body.app-admin .user-create__info{
    order: -1;
  }body.app-admin .users-card__controls{
    grid-template-columns: 1fr;
  }body.app-admin .module-shell{
    margin: 16px 12px;
  }body.app-admin .module-hero{
    padding: 20px;
    border-radius: 22px;
  }

}@media (max-width: 720px){
body.app-admin .form-wrapper{
    padding: 14px 0;
  }body.app-admin .user-create__card, body.app-admin .user-create__info{
    padding: 16px;
  }body.app-admin .field--grid{
    grid-template-columns: 1fr;
    gap: 4px;
  }body.app-admin .users-card{
    padding: 14px;
  }body.app-admin .users-card .pager__left{
    width: 100%;
    flex-wrap: wrap;
  }body.app-admin .users-stats{
    margin-top: 0;
  }body.app-admin .module-meta{
    flex-direction: column;
  }

}

/* ===============================
   Admin Shell Layout Unified
   =============================== */
/* ============================================================
   Admin Shell Layout — source file
   Merged with: transform_css(css, "body.app-admin")
   Every rule here gets prefixed with body.app-admin by the
   merge script. Do NOT prefix selectors manually.
   ============================================================ */

/* ============================================================
   1. LAYOUT — grid replaces the body flex from admin.css
   ============================================================ */

body.app-admin{
  --content-max: 1800px;
  --topbar-h: 60px;
  --sidebar-w: 260px;
}

/* Grid: sidebar left spanning both rows,
   topbar top-right, content below. */
body.app-admin{
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar content";
  height: 100vh;
  overflow: hidden;
}body.app-admin .sidebar{
  grid-area: sidebar;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}body.app-admin .topbar{
  grid-area: topbar;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: rgba(248, 250, 252, 0.97);
  border-bottom: 1px solid rgba(203, 213, 225, 0.30);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 50;
  gap: 10px;
}body.app-admin .content{
  grid-area: content;
  overflow-y: auto;
  padding: 18px 22px;
}

/* ============================================================
   2. SIDEBAR — brand block + enhanced menu + footer
   ============================================================ */

body.app-admin .brand-side{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}body.app-admin .brand-side .logo{
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}body.app-admin .brand-copy strong{
  display: block;
  font-size: .92rem;
  font-weight: 700;
  color: #eef2f7;
}body.app-admin .brand-copy small{
  display: block;
  font-size: .72rem;
  color: rgba(151, 166, 184, 0.80);
  margin-top: 2px;
}body.app-admin .menu a{
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}body.app-admin .menu a .icon{
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}body.app-admin .menu a .label-wrap{
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}body.app-admin .menu a .label{
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}body.app-admin .menu a .hint{
  font-size: .70rem;
  color: rgba(151, 166, 184, 0.65);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}body.app-admin .menu a[data-count]:not([data-count="0"])::after{
  content: attr(data-count);
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e6574f;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}body.app-admin .menu a[data-ping="1"]{
  animation: ping-pulse 1.8s ease-in-out infinite;
}@keyframes ping-pulse{
  0%, 100% { box-shadow: 0 0 0 0 rgba(230, 87, 79, 0); }
  50%       { box-shadow: 0 0 0 5px rgba(230, 87, 79, 0.28); }
}body.app-admin .sidebar-footer{
  margin-top: auto;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}body.app-admin .sidebar-footer__title{
  font-size: .70rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: rgba(151, 166, 184, 0.60);
  margin-bottom: 10px;
}body.app-admin .sidebar-footer__grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}body.app-admin .sidebar-metric{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}body.app-admin .sidebar-metric strong{
  font-size: .9rem;
  font-weight: 700;
  color: #eef2f7;
  line-height: 1;
}body.app-admin .sidebar-metric span{
  font-size: .65rem;
  color: rgba(151, 166, 184, 0.65);
  margin-top: 3px;
}

/* ============================================================
   3. TOPBAR — toggle, title, top actions
   ============================================================ */

body.app-admin .topbar-main{
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}body.app-admin .shell-toggle{
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: #475569;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
}body.app-admin .shell-toggle:hover{
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.45);
}body.app-admin .shell-title{
  flex: 1;
  min-width: 0;
}body.app-admin .shell-title h1{
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}body.app-admin .shell-title p{
  margin: 0;
  font-size: .76rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   4. TOP ACTIONS — theme, bell, badge, user info
   ============================================================ */

body.app-admin .top-actions{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}body.app-admin .theme-toggle{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  padding: 5px 10px 5px 6px;
  cursor: pointer;
  color: #475569;
  font-family: inherit;
  font-size: .82rem;
  transition: border-color .2s, background .2s;
}body.app-admin .theme-toggle:hover{
  background: rgba(148, 163, 184, 0.10);
  border-color: rgba(148, 163, 184, 0.50);
}body.app-admin .switch{
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background .25s;
  flex-shrink: 0;
}body.app-admin .theme-toggle[aria-pressed="true"] .switch{
  background: #2563eb;
}body.app-admin .knob{
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #fff;
  transition: transform .25s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.20);
}body.app-admin .theme-toggle[aria-pressed="true"] .knob{
  transform: translateX(12px);
}body.app-admin .theme-label{
  font-size: .78rem;
  font-weight: 600;
  user-select: none;
}body.app-admin .bell{
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  position: relative;
}body.app-admin .bell:hover{
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.45);
}body.app-admin .bell[data-ping="1"]{
  animation: bell-shake 0.9s ease-in-out;
}@keyframes bell-shake{
  0%,  100% { transform: rotate(0deg); }
  15%        { transform: rotate(14deg); }
  30%        { transform: rotate(-12deg); }
  45%        { transform: rotate(8deg); }
  60%        { transform: rotate(-6deg); }
}body.app-admin .top-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e6574f;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
}body.app-admin .top-badge:empty{
  display: none;
}

/* ============================================================
   5. NOTIFICATIONS DROPDOWN
   ============================================================ */

body.app-admin .notif-dropdown{
  position: fixed;
  top: calc(var(--topbar-h, 60px) + 8px);
  right: 16px;
  width: 340px;
  max-height: 430px;
  background: #fff;
  border: 1px solid rgba(203, 213, 225, 0.50);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity .2s, transform .2s;
}body.app-admin .notif-dropdown.open, body.app-admin .notif-dropdown[aria-hidden="false"]{
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}body.app-admin .notif-dropdown .head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  gap: 8px;
}body.app-admin .notif-dropdown .head strong{
  font-size: .9rem;
  font-weight: 700;
}body.app-admin .notif-dropdown .head div{
  display: flex;
  gap: 6px;
}body.app-admin .notif-dropdown .head button{
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 4px 9px;
  font-size: .78rem;
  cursor: pointer;
  color: #475569;
  transition: background .15s;
}body.app-admin .notif-dropdown .head button:hover{
  background: #f1f5f9;
}body.app-admin .notif-dropdown .list{
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}body.app-admin .notif-empty{
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  font-size: .88rem;
}

/* ============================================================
   6. ACTIVITY BAR
   ============================================================ */

body.app-admin .activity-bar{
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 9px 20px;
  font-size: .84rem;
  font-weight: 600;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  white-space: nowrap;
  max-width: calc(100vw - 48px);
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
}body.app-admin .activity-bar.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   7. SHELL OVERVIEW
   ============================================================ */

body.app-admin .shell-overview{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  margin-bottom: 20px;
  align-items: start;
}body.app-admin .shell-banner{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}body.app-admin .shell-banner h2{
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
}body.app-admin .shell-banner p{
  margin: 0;
  color: #64748b;
  font-size: .88rem;
}body.app-admin .shell-pills{
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
}body.app-admin .shell-pill{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: .78rem;
  font-weight: 600;
  color: #475569;
}body.app-admin .shell-pill__dot{
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  animation: dot-pulse 2s ease-in-out infinite;
}@keyframes dot-pulse{
  0%, 100% { opacity: 1; }
  50%       { opacity: .30; }
}body.app-admin .shell-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}body.app-admin .shell-stat{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  text-align: center;
  min-width: 80px;
}body.app-admin .shell-stat strong{
  font-size: 1.1rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.1;
}body.app-admin .shell-stat span{
  font-size: .72rem;
  color: #64748b;
  margin-top: 4px;
}

/* ============================================================
   8. MODULE STAGE & LOAD ANIMATION
   ============================================================ */

body.app-admin .module-stage{
  min-height: 200px;
  animation: moduleFadeIn .35s ease both;
  max-width: var(--content-max, 1800px);
  width: 100%;
}@keyframes moduleFadeIn{
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}body.app-admin .module-stage__loading{
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 4px;
}body.app-admin .module-stage__skeleton{
  height: 20px;
  border-radius: 10px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 45%, #e2e8f0 65%);
  background-size: 250% 100%;
  animation: sk-shimmer 1.3s linear infinite;
}body.app-admin .module-stage__skeleton--34{ width: 34%; }body.app-admin .module-stage__skeleton--72{ width: 72%; }body.app-admin .module-stage__skeleton--58{ width: 58%; }@keyframes sk-shimmer{
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ============================================================
   9. SHELL COLLAPSED STATE
   ============================================================ */

body.app-admin.shell-collapsed{
  grid-template-columns: 0 1fr;
}body.app-admin.shell-collapsed .sidebar{
  width: 0;
  min-width: 0;
  overflow: hidden;
  padding: 0;
}

/* ============================================================
   10. DARK THEME
   ============================================================ */

body.app-admin[data-theme="dark"]{
  background: linear-gradient(180deg, #0f172a, #1e293b);
  color: #e2e8f0;
}body.app-admin[data-theme="dark"] .topbar{
  background: rgba(15, 23, 42, 0.97);
  border-bottom-color: rgba(51, 65, 85, 0.50);
}body.app-admin[data-theme="dark"] .shell-toggle, body.app-admin[data-theme="dark"] .bell, body.app-admin[data-theme="dark"] .theme-toggle{
  border-color: rgba(71, 85, 105, 0.45);
  color: #94a3b8;
}body.app-admin[data-theme="dark"] .shell-toggle:hover, body.app-admin[data-theme="dark"] .bell:hover, body.app-admin[data-theme="dark"] .theme-toggle:hover{
  background: rgba(71, 85, 105, 0.18);
}body.app-admin[data-theme="dark"] .shell-title h1{
  color: #e2e8f0;
}body.app-admin[data-theme="dark"] .shell-title p{
  color: #64748b;
}body.app-admin[data-theme="dark"] .shell-stat{
  background: rgba(30, 41, 59, 0.70);
  border-color: rgba(71, 85, 105, 0.30);
}body.app-admin[data-theme="dark"] .shell-stat strong{
  color: #e2e8f0;
}body.app-admin[data-theme="dark"] .shell-pill{
  background: rgba(30, 41, 59, 0.60);
  border-color: rgba(71, 85, 105, 0.30);
  color: #94a3b8;
}body.app-admin[data-theme="dark"] .shell-banner p{
  color: #64748b;
}body.app-admin[data-theme="dark"] .notif-dropdown{
  background: #1e293b;
  border-color: rgba(51, 65, 85, 0.60);
  color: #e2e8f0;
}body.app-admin[data-theme="dark"] .notif-dropdown .head{
  border-bottom-color: rgba(51, 65, 85, 0.40);
}body.app-admin[data-theme="dark"] .notif-dropdown .head button{
  border-color: rgba(51, 65, 85, 0.40);
  color: #94a3b8;
}body.app-admin[data-theme="dark"] .notif-dropdown .head button:hover{
  background: rgba(71, 85, 105, 0.20);
}body.app-admin[data-theme="dark"] .notif-empty{
  color: #475569;
}

/* ============================================================
   11. RESPONSIVE
   ============================================================ */

@media (max-width: 1100px){
body.app-admin{
    --sidebar-w: 220px;
  }

}@media (max-width: 720px){
body.app-admin{
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-areas:
      "topbar"
      "content";
  }body.app-admin .sidebar{
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-w, 260px) !important;
    z-index: 80;
    transform: translateX(-100%);
    transition: transform .28s ease;
    min-width: unset;
  }body.app-admin.shell-open .sidebar{
    transform: translateX(0);
  }body.app-admin.shell-collapsed .sidebar{
    transform: translateX(-100%);
    width: var(--sidebar-w, 260px) !important;
    overflow: auto;
    padding: unset;
  }body.app-admin .content{
    padding: 12px 14px;
  }body.app-admin .shell-overview{
    grid-template-columns: 1fr;
  }body.app-admin .shell-grid{
    grid-template-columns: 1fr 1fr;
  }body.app-admin .top-actions .theme-label{
    display: none;
  }

}

/* ============================================================
   12. SHARED MODULE UI TOKENS
   Utility classes used by GPS, Reportes, Rondas and any
   module injected inside body.app-admin.
   ============================================================ */

/* ---- Typography ---- */
body.app-admin .muted{ color: #64748b; font-size: .9rem; }body.app-admin .small{ font-size: .84rem; color: #64748b; }body.app-admin .label-small{ display: block; font-size: .82rem; font-weight: 600; color: #475569; margin-bottom: 4px; }body.app-admin .nowrap{ white-space: nowrap; }body.app-admin .u-gap-8{ gap: 8px; }

/* ---- Layout row ---- */
body.app-admin .row{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}body.app-admin .row.nowrap{ flex-wrap: nowrap; }

/* ---- Section head (title + actions) ---- */
body.app-admin .section-head, body.app-admin .header-actions{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}body.app-admin .title-stack{
  display: flex;
  flex-direction: column;
  gap: 4px;
}body.app-admin .title-stack h2, body.app-admin .title-stack h3{
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #1e293b;
}body.app-admin .head-actions{
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ---- Module inner surface ---- */
body.app-admin .module-surface{
  background: rgba(248, 250, 252, 0.70);
  border: 1px solid rgba(203, 213, 225, 0.40);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}body.app-admin .module-caption{
  font-size: .80rem;
  color: #64748b;
  margin: 4px 0 10px;
}

/* ---- Button variants ---- */
body.app-admin .btn.ghost{
  background: transparent;
  border-color: rgba(148, 163, 184, 0.40);
  color: #475569;
}body.app-admin .btn.ghost:hover{ background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.60); }body.app-admin .btn.secondary{
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #334155;
}body.app-admin .btn.secondary:hover{ background: #e2e8f0; }body.app-admin .btn.primary{
  background: linear-gradient(135deg, #1473e6, #2f6fb5);
  color: #fff;
  border-color: transparent;
}body.app-admin .btn.primary:hover{ filter: brightness(1.07); }body.app-admin .btn.danger{
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  border-color: transparent;
}body.app-admin .btn.danger:hover{ filter: brightness(1.07); }body.app-admin .btn.critical{
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}body.app-admin .btn.critical:hover{ background: #fee2e2; }body.app-admin .btn.critical:disabled, body.app-admin .btn:disabled{ opacity: .50; cursor: not-allowed; pointer-events: none; }body.app-admin .btn.icon-btn{
  padding: 5px 9px;
  min-width: 32px;
  justify-content: center;
  font-size: .9rem;
}

/* ---- Tabs ---- */
body.app-admin .tabs{
  display: flex;
  gap: 2px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 14px;
}body.app-admin .tab{
  position: relative;
  bottom: -2px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: 8px 8px 0 0;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: color .18s, background .18s;
}body.app-admin .tab:hover{ color: #1e293b; background: rgba(148, 163, 184, 0.10); }body.app-admin .tab.active{ color: #1473e6; border-bottom: 2px solid #1473e6; }

/* ---- Inputs (shared form controls) ---- */
body.app-admin .input, body.app-admin input.input, body.app-admin select.input, body.app-admin textarea.input{
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #dbe4f4;
  border-radius: 10px;
  background: #f8fbff;
  color: #1e293b;
  font-family: inherit;
  font-size: .92rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}body.app-admin .input:focus, body.app-admin input.input:focus, body.app-admin select.input:focus, body.app-admin textarea.input:focus{
  border-color: #1473e6;
  box-shadow: 0 0 0 3px rgba(20, 115, 230, 0.14);
  background: #fff;
}body.app-admin textarea.input{ resize: vertical; min-height: 80px; }

/* ---- Chips ---- */
body.app-admin .chips{
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}body.app-admin .chip{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fbff;
  color: #334155;
  font-size: .80rem;
  font-weight: 600;
  cursor: default;
  transition: background .15s;
}body.app-admin button.chip{ cursor: pointer; }body.app-admin button.chip:hover{ background: #e2e8f0; }

/* Status dot */
body.app-admin .chip.dot::before{
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #94a3b8;
}body.app-admin .chip.pend::before{ background: #f59e0b; }body.app-admin .chip.env::before{ background: #3b82f6; }body.app-admin .chip.acept::before{ background: #22c55e; }body.app-admin .chip.prog::before{ background: #a855f7; }body.app-admin .chip.venc::before{ background: #ef4444; }body.app-admin .chip.canc::before{ background: #94a3b8; }body.app-admin .count{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.09);
  font-size: .70rem;
  font-weight: 700;
}

/* ---- Modals ---- */
body.app-admin .modal-backdrop{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1200;
}body.app-admin .modal-backdrop[aria-hidden="false"], body.app-admin .modal-backdrop.open{
  display: flex;
}body.app-admin .modal{
  width: min(740px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(203, 213, 225, 0.40);
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.28);
  padding: 22px;
}body.app-admin .modal h3{
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
}body.app-admin .modal .actions{
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

/* ---- Toasts ---- */
body.app-admin .toasts{
  position: fixed;
  right: 18px;
  bottom: 80px;
  display: grid;
  gap: 8px;
  z-index: 1500;
  pointer-events: none;
}body.app-admin .toast{
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #1473e6;
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 280px;
  max-width: 360px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  pointer-events: auto;
  animation: toast-in .25s ease both;
}@keyframes toast-in{
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}body.app-admin .toast.ok{ border-left-color: #22c55e; }body.app-admin .toast.danger{ border-left-color: #ef4444; }body.app-admin .toast.warn{ border-left-color: #f59e0b; }body.app-admin .toast.panic{ border-left-color: #ef4444; background: #fef2f2; }

/* ---- Clean table ---- */
body.app-admin table.clean{
  width: 100%;
  border-collapse: collapse;
}body.app-admin table.clean th{
  position: sticky;
  top: 0;
  background: #f8fbff;
  color: #334155;
  font-size: .79rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}body.app-admin table.clean td{
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: .9rem;
  color: #334155;
}body.app-admin table.clean tbody tr:hover{ background: #f8fbff; }

/* ---- Kanban Board (Reportes) ---- */
body.app-admin .board{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}body.app-admin .col{
  background: #f8fbff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  min-height: 120px;
}body.app-admin .col h4{
  margin: 0 0 10px;
  font-size: .83rem;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}body.app-admin .col-count{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  font-size: .70rem;
  font-weight: 700;
}

/* ---- Message area ---- */
body.app-admin .msg{
  font-size: .88rem;
  min-height: 22px;
  padding: 4px 0;
  color: #64748b;
}body.app-admin .msg.ok{ color: #16a34a; }body.app-admin .msg.error{ color: #b91c1c; }

/* ===============================
   Dashboard Module Unified
   =============================== */
/* =========================================================
   Dashboard Module — single-pass scoped CSS
   Scope: #dashboardModule  (evita conflictos con admin shell)
   ========================================================= */

/* ---------- tokens ---------- */
#dashboardModule {
  --d-ink:        #1b2430;
  --d-muted:      #64748b;
  --d-line:       rgba(148,163,184,0.28);
  --d-surface:    #f8fafc;
  --d-white:      #ffffff;
  --d-shadow-sm:  0 2px 8px rgba(15,23,42,0.07);
  --d-shadow-md:  0 8px 24px rgba(15,23,42,0.10);
  --d-radius:     16px;
  --d-gap:        16px;
  --d-teal-a:     #0f766e;
  --d-teal-b:     #0f172a;
}

/* dark mode tokens */
[data-theme="dark"] #dashboardModule,
body.dark #dashboardModule {
  --d-ink:       #eef2f7;
  --d-muted:     #94a3b8;
  --d-line:      rgba(255,255,255,0.10);
  --d-surface:   rgba(20,26,40,0.97);
  --d-white:     rgba(28,36,54,0.98);
  --d-shadow-sm: 0 2px 8px rgba(0,0,0,0.28);
  --d-shadow-md: 0 8px 24px rgba(0,0,0,0.38);
}

/* ---------- typography ---------- */
#dashboardModule,
#dashboardModule * {
  font-family: "Manrope","DM Sans","Segoe UI",sans-serif;
  box-sizing: border-box;
}

/* ---------- outer layout ---------- */
#dashboardModule {
  display: flex;
  flex-direction: column;
  gap: var(--d-gap);
  margin: 16px 12px;
}

#dashboardModule .dashboard-main {
  display: flex;
  flex-direction: column;
  gap: var(--d-gap);
  width: 100%;
}

/* ---------- card section ---------- */
#dashboardModule .card-section {
  background: var(--d-white);
  border: 1px solid var(--d-line);
  border-radius: var(--d-radius);
  padding: 16px;
  box-shadow: var(--d-shadow-sm);
}

#dashboardModule .card-section--chat {
  overflow: visible;
}

/* ---------- section head ---------- */
#dashboardModule .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

#dashboardModule .section-head__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--d-ink);
}

/* ---------- stats grid ---------- */
#dashboardModule .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

#dashboardModule .stat {
  position: relative;
  overflow: hidden;
  min-height: 130px;
  padding: 14px;
  background: var(--d-white);
  border: 1px solid var(--d-line);
  border-radius: var(--d-radius);
  box-shadow: var(--d-shadow-sm);
}

#dashboardModule .stat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#dashboardModule .stat__label {
  font-size: .85rem;
  font-weight: 700;
  color: var(--d-muted);
  line-height: 1.35;
}

#dashboardModule .stat__icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  background: rgba(37,99,235,0.08);
  color: #1d4ed8;
  flex-shrink: 0;
}

[data-theme="dark"] #dashboardModule .stat__icon,
body.dark #dashboardModule .stat__icon {
  background: rgba(96,165,250,0.14);
  color: #93c5fd;
}

#dashboardModule .stat .value {
  display: block;
  margin-top: 14px;
  font-size: 1.9rem;
  line-height: 1;
  font-weight: 800;
  color: var(--d-ink);
}

#dashboardModule .stat .hint {
  display: block;
  margin-top: 8px;
  font-size: .82rem;
  color: var(--d-muted);
  line-height: 1.4;
}

/* KPI pill */
#dashboardModule .kpi-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  border: 1px solid transparent;
}
#dashboardModule .kpi-pill--neutral { color:#334155; background:#e2e8f0; border-color:#cbd5e1; }
#dashboardModule .kpi-pill--low     { color:#166534; background:#dcfce7; border-color:#86efac; }
#dashboardModule .kpi-pill--medium  { color:#92400e; background:#fef3c7; border-color:#fcd34d; }
#dashboardModule .kpi-pill--high    { color:#b91c1c; background:#fee2e2; border-color:#fca5a5; }

/* ---------- hero banner ---------- */
#dashboardModule .dash-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-radius: 18px;
  background: linear-gradient(135deg, #12161d 0%, #1e293b 60%, #0f766e 100%);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(15,23,42,0.22);
}

#dashboardModule .dash-hero__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1;
}

#dashboardModule .dash-hero__title {
  margin: 0;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

#dashboardModule .dash-hero__subtitle {
  margin: 0;
  font-size: .92rem;
  color: rgba(255,255,255,0.75);
  max-width: 56ch;
  line-height: 1.55;
}

#dashboardModule .dash-hero__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

#dashboardModule .dash-hero__chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
}

#dashboardModule .dash-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
#dashboardModule .dash-link-btn:hover { background: rgba(255,255,255,0.20); }

#dashboardModule .dash-hero__visual { z-index: 1; }

/* spotlight */
#dashboardModule .dash-spotlight {
  padding: 14px;
  border-radius: var(--d-radius);
  background: var(--d-white);
  border: 1px solid var(--d-line);
  box-shadow: var(--d-shadow-sm);
}

#dashboardModule .dash-spotlight__title {
  margin: 0 0 4px;
  font-size: .9rem;
  font-weight: 700;
  color: var(--d-ink);
}

/* ---------- chat shell layout ---------- */
#dashboardModule .dashboard-chat-shell {
  display: grid;
  grid-template-columns: minmax(0,1fr) 280px;
  gap: var(--d-gap);
  align-items: start;
}

/* ==============================================
   WhatsApp-style chat — .wa-chat component
   ============================================== */
#dashboardModule .wa-chat {
  display: flex;
  flex-direction: column;
  height: 520px;
  max-height: 70vh;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--d-line);
  box-shadow: var(--d-shadow-md);
}

/* header */
#dashboardModule .wa-chat__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: #128c7e;
  flex-shrink: 0;
}
[data-theme="dark"] #dashboardModule .wa-chat__header,
body.dark #dashboardModule .wa-chat__header {
  background: #075e54;
}

#dashboardModule .wa-chat__avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.20);
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

#dashboardModule .wa-chat__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#dashboardModule .wa-chat__name {
  font-size: .93rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
#dashboardModule .wa-chat__status {
  font-size: .76rem;
  color: rgba(255,255,255,0.75);
}

#dashboardModule .wa-chat__badges {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
#dashboardModule .wa-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
}
#dashboardModule .wa-badge--imp { background: #f59e0b; }

/* message body */
#dashboardModule .wa-chat__body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #e5ddd5;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.5) transparent;
}
[data-theme="dark"] #dashboardModule .wa-chat__body,
body.dark #dashboardModule .wa-chat__body {
  background: #0d1418;
}

/* day separator */
#dashboardModule .wa-day-sep {
  align-self: center;
  padding: 4px 10px;
  border-radius: 7px;
  background: rgba(255,255,255,0.70);
  font-size: .75rem;
  font-weight: 600;
  color: #54656f;
  margin: 6px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.10);
  flex-shrink: 0;
}
[data-theme="dark"] #dashboardModule .wa-day-sep,
body.dark #dashboardModule .wa-day-sep {
  background: rgba(32,44,51,0.85);
  color: #aebac1;
}

/* message rows */
#dashboardModule .wa-msg {
  display: flex;
  flex-direction: column;
  max-width: 72%;
  min-width: 80px;
  width: fit-content;
  align-self: flex-start;
  margin-bottom: 2px;
}
#dashboardModule .wa-msg.wa-msg--me {
  align-self: flex-end;
}

#dashboardModule .wa-msg__sender {
  font-size: .76rem;
  font-weight: 700;
  color: #128c7e;
  margin-bottom: 2px;
  padding-left: 2px;
}
[data-theme="dark"] #dashboardModule .wa-msg__sender,
body.dark #dashboardModule .wa-msg__sender {
  color: #00a884;
}

#dashboardModule .wa-msg__bubble {
  position: relative;
  padding: 7px 10px 22px;
  border-radius: 8px 8px 8px 2px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.14);
  color: #111b21;
  font-size: .91rem;
  line-height: 1.5;
  word-break: break-word;
}
[data-theme="dark"] #dashboardModule .wa-msg__bubble,
body.dark #dashboardModule .wa-msg__bubble {
  background: #202c33;
  color: #e9edef;
  box-shadow: 0 1px 2px rgba(0,0,0,0.30);
}

/* self bubble */
#dashboardModule .wa-msg.wa-msg--me .wa-msg__bubble {
  background: #d9fdd3;
  border-radius: 8px 8px 2px 8px;
  color: #111b21;
}
[data-theme="dark"] #dashboardModule .wa-msg.wa-msg--me .wa-msg__bubble,
body.dark #dashboardModule .wa-msg.wa-msg--me .wa-msg__bubble {
  background: #005c4b;
  color: #e9edef;
}

/* timestamp inside bubble */
#dashboardModule .wa-msg__time {
  position: absolute;
  bottom: 4px;
  right: 8px;
  font-size: .69rem;
  color: #8696a0;
  line-height: 1;
  white-space: nowrap;
}
[data-theme="dark"] #dashboardModule .wa-msg__time,
body.dark #dashboardModule .wa-msg__time {
  color: #667781;
}

/* footer / input bar */
#dashboardModule .wa-chat__footer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px;
  background: #f0f2f5;
  border-top: 1px solid var(--d-line);
  flex-shrink: 0;
}
[data-theme="dark"] #dashboardModule .wa-chat__footer,
body.dark #dashboardModule .wa-chat__footer {
  background: #1f2c34;
  border-color: rgba(255,255,255,0.07);
}

#dashboardModule .wa-chat__input {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  padding: 10px 14px;
  border-radius: 24px;
  border: none;
  background: #fff;
  font-family: inherit;
  font-size: .91rem;
  color: #111b21;
  outline: none;
  resize: none;
  line-height: 1.45;
  overflow-y: auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}
[data-theme="dark"] #dashboardModule .wa-chat__input,
body.dark #dashboardModule .wa-chat__input {
  background: #2a3942;
  color: #e9edef;
}
#dashboardModule .wa-chat__input::placeholder { color: #8696a0; }

#dashboardModule .wa-chat__send {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  border: none;
  background: #128c7e;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, transform .10s;
  padding: 0;
}
#dashboardModule .wa-chat__send:hover    { background: #0f766e; }
#dashboardModule .wa-chat__send:active   { transform: scale(.93); }
#dashboardModule .wa-chat__send:disabled { background: #b0bec5; cursor: default; transform: none; }
[data-theme="dark"] #dashboardModule .wa-chat__send,
body.dark #dashboardModule .wa-chat__send { background: #00a884; }
[data-theme="dark"] #dashboardModule .wa-chat__send:hover,
body.dark #dashboardModule .wa-chat__send:hover { background: #128c7e; }

/* ---------- important messages sidebar ---------- */
#dashboardModule .chat-side-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--d-radius);
  border: 1px solid rgba(234,179,8,0.28);
  background: linear-gradient(180deg, #fffbf0, #fff8e7);
}

[data-theme="dark"] #dashboardModule .chat-side-card,
body.dark #dashboardModule .chat-side-card {
  background: rgba(30,24,10,0.95);
  border-color: rgba(234,179,8,0.20);
}

#dashboardModule .chat-side-card__title {
  margin: 0;
  font-size: .95rem;
  font-weight: 700;
  color: var(--d-ink);
}

#dashboardModule .chat-side-card__copy {
  margin: 0;
  font-size: .84rem;
  color: var(--d-muted);
  line-height: 1.5;
}

#dashboardModule .imp-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 22vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

#dashboardModule .imp-list:empty::after {
  content: "Sin mensajes importantes";
  display: block;
  font-size: .82rem;
  color: var(--d-muted);
  padding: 6px 0;
}

/* ---------- users panel ---------- */
#dashboardModule .users-panel {
  display: flex;
  flex-direction: column;
  gap: var(--d-gap);
}

#dashboardModule .users-shell {
  display: flex;
  flex-direction: column;
  gap: var(--d-gap);
}

#dashboardModule .users-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

#dashboardModule .users-overview__card {
  padding: 12px 14px;
  background: var(--d-white);
  border: 1px solid var(--d-line);
  border-radius: var(--d-radius);
  box-shadow: var(--d-shadow-sm);
}

#dashboardModule .users-overview__card span {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--d-muted);
}

#dashboardModule .users-overview__card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--d-ink);
}

#dashboardModule .users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

#dashboardModule .users-toolbar__filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#dashboardModule .users-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid var(--d-line);
  background: var(--d-white);
  color: var(--d-muted);
  font-size: .8rem;
  font-weight: 700;
}

#dashboardModule .users-group {
  padding: 14px;
  border-radius: var(--d-radius);
  border: 1px solid var(--d-line);
  background: var(--d-white);
  box-shadow: var(--d-shadow-sm);
}

#dashboardModule .users-group__title {
  margin: 0 0 10px;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--d-muted);
}

#dashboardModule .users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 32vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

#dashboardModule .user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--d-surface);
  border: 1px solid var(--d-line);
  transition: box-shadow .12s;
}
#dashboardModule .user-row:hover {
  box-shadow: var(--d-shadow-md);
}

#dashboardModule .avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
  background: linear-gradient(135deg, #0f766e, #0f172a);
  flex-shrink: 0;
}

#dashboardModule .user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

#dashboardModule .user-name {
  font-weight: 700;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--d-ink);
}

#dashboardModule .user-sub {
  font-size: .80rem;
  color: var(--d-muted);
  display: flex;
  gap: 6px;
  align-items: center;
}

#dashboardModule .presence-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex-shrink: 0;
}
#dashboardModule .presence-online  { background: #16a34a; }
#dashboardModule .presence-offline { background: #ef4444; opacity: .8; }

#dashboardModule .user-pill {
  margin-left: auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15,23,42,0.05);
  border: 1px solid var(--d-line);
  font-size: .75rem;
  font-weight: 700;
  color: var(--d-muted);
  flex-shrink: 0;
}

/* ---------- dash empty ---------- */
#dashboardModule .dash-empty {
  padding: 12px;
  border-radius: 10px;
  background: var(--d-surface);
  border: 1px dashed var(--d-line);
  font-size: .85rem;
  color: var(--d-muted);
  text-align: center;
}

/* ---------- toast ---------- */
.__dash_toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 400px;
}

.__dash_toast .t {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(148,163,184,0.35);
  box-shadow: 0 12px 30px rgba(15,23,42,0.12);
  font-size: .88rem;
  font-weight: 600;
  color: #1b2430;
}

.dash-toast-title { font-weight: 700; font-size: .88rem; }
.dash-toast-sub   { font-size: .80rem; color: #64748b; margin-top: 2px; }
.dash-toast-close { background:none; border:none; cursor:pointer; font-size:1.1rem; line-height:1; color:#94a3b8; padding:0; margin-left:auto; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  #dashboardModule .dashboard-chat-shell {
    grid-template-columns: 1fr;
  }
  #dashboardModule .chat-side-card {
    display: none;
  }
}

@media (max-width: 900px) {
  #dashboardModule .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  #dashboardModule .wa-chat {
    height: 420px;
  }
  #dashboardModule .users-overview {
    grid-template-columns: 1fr;
  }
  #dashboardModule .dash-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  #dashboardModule .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  #dashboardModule .chat-messages {
    height: 360px;
  }
  #dashboardModule .chat-input {
    flex-direction: column;
    align-items: stretch;
  }
  #dashboardModule .chat-send-btn {
    width: 100%;
  }
  #dashboardModule .users-overview {
    grid-template-columns: 1fr;
  }
  #dashboardModule .dash-hero {
    grid-template-columns: 1fr;
  }
}

/* ===============================
   Formularios Module Unified
   =============================== */
#formulariosModule{
  --ff-bg: #f4f8ff;
  --ff-card: #ffffff;
  --ff-border: #d8e2ee;
  --ff-text: #1f2d3d;
  --ff-muted: #6b7a8f;
  --ff-accent: #2563eb;
  --ff-accent-2: #1d4ed8;
  --ff-danger: #e11d48;
  --ff-ok: #10b981;
}#formulariosModule .ff-wrap{
  margin: 24px;
  padding: 16px;
  background: var(--ff-bg);
  border: 1px solid var(--ff-border);
  border-radius: 14px;
}#formulariosModule .ff-grid{
  display: grid;
  gap: 12px;
}#formulariosModule .ff-row{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}#formulariosModule .ff-card{
  background: var(--ff-card);
  border: 1px solid var(--ff-border);
  border-radius: 12px;
  padding: 12px;
}#formulariosModule .ff-note-muted{ color: var(--ff-muted); }#formulariosModule .ff-note-danger{ color: var(--ff-danger); }#formulariosModule .ff-note-ok{ color: var(--ff-ok); }#formulariosModule .ff-input, #formulariosModule .ff-select, #formulariosModule .ff-textarea{
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--ff-border);
  border-radius: 10px;
  background: #fff;
  color: var(--ff-text);
}#formulariosModule .ff-btn{
  border: 1px solid var(--ff-border);
  background: #fff;
  color: var(--ff-text);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}#formulariosModule .ff-btn-primary{
  background: var(--ff-accent);
  color: #fff;
  border-color: var(--ff-accent);
}#formulariosModule .ff-btn-primary:hover{ background: var(--ff-accent-2); }#formulariosModule .ff-btn-danger{ background: #fff1f2; border-color: #fecdd3; color: #be123c; }#formulariosModule .ff-editor{
  min-height: 140px;
  border: 1px solid var(--ff-border);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}#formulariosModule .ff-preview-img{
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--ff-border);
}#formulariosModule .ff-responses-list{
  display: grid;
  gap: 8px;
}#formulariosModule .ff-kv{
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px;
}#formulariosModule .ff-k{
  color: var(--ff-muted);
  font-size: 13px;
}#formulariosModule .ff-v{
  color: var(--ff-text);
}@media (max-width: 900px){
#formulariosModule .ff-wrap{
    margin: 10px;
    padding: 10px;
  }#formulariosModule .ff-kv{
    grid-template-columns: 1fr;
  }

}

/* ============================================================
   FORMULARIOS PAGE — standalone layout + utility classes
   All scoped to #formulariosModule by the merge script.
   ============================================================ */

/* Page wrapper */
#formulariosModule{
  --ff-topbar-h: 64px;
  margin: 0;
  font-family: "Manrope", "DM Sans", "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--app-bg, #f4f8ff);
  color: var(--app-text, #1f2d3d);
}

/* Dark Theme Overrides for #formulariosModule (Paleta Carbón Slate de Reportes - Sin Morado/Lila) */
html[data-theme="dark"] #formulariosModule,
body.dark #formulariosModule {
  --app-bg: #0d1117;
  --app-surface: #161b22;
  --app-surface-2: #21262d;
  --app-text: #f0f6fc;
  --app-muted: #8b949e;
  --app-border: #30363d;
  background: #0d1117 !important;
  color: #f0f6fc !important;
}

html[data-theme="dark"] #formulariosModule .form-card,
body.dark #formulariosModule .form-card,
html[data-theme="dark"] #formulariosModule .form-details,
body.dark #formulariosModule .form-details {
  background: #161b22 !important;
  color: #f0f6fc !important;
  border-color: #30363d !important;
}

html[data-theme="dark"] #formulariosModule .form-header,
body.dark #formulariosModule .form-header,
html[data-theme="dark"] #formulariosModule .form-list-wrap,
body.dark #formulariosModule .form-list-wrap {
  background: #21262d !important;
  color: #f0f6fc !important;
  border-color: #30363d !important;
}

html[data-theme="dark"] #formulariosModule .form-title,
body.dark #formulariosModule .form-title,
html[data-theme="dark"] #formulariosModule label,
body.dark #formulariosModule label,
html[data-theme="dark"] #formulariosModule strong,
body.dark #formulariosModule strong {
  color: #f0f6fc !important;
}

html[data-theme="dark"] #formulariosModule .form-sub,
body.dark #formulariosModule .form-sub,
html[data-theme="dark"] #formulariosModule .small,
body.dark #formulariosModule .small,
html[data-theme="dark"] #formulariosModule .meta,
body.dark #formulariosModule .meta,
html[data-theme="dark"] #formulariosModule .ff-note-muted,
body.dark #formulariosModule .ff-note-muted {
  color: #8b949e !important;
}

html[data-theme="dark"] #formulariosModule .form-item,
body.dark #formulariosModule .form-item {
  background: #161b22 !important;
  border: 1px solid #30363d !important;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
  color: #f0f6fc !important;
}

#formulariosModule .form-item {
  background: var(--app-surface, #ffffff);
  border: 1px solid var(--app-border, #cbd5e1);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

html[data-theme="dark"] #formulariosModule .ff-editor,
body.dark #formulariosModule .ff-editor,
html[data-theme="dark"] #formulariosModule .preview,
body.dark #formulariosModule .preview {
  background: #21262d !important;
  border-color: #30363d !important;
  color: #f0f6fc !important;
}

html[data-theme="dark"] #formulariosModule .input,
body.dark #formulariosModule .input,
html[data-theme="dark"] #formulariosModule input.input,
body.dark #formulariosModule input.input,
html[data-theme="dark"] #formulariosModule select.input,
body.dark #formulariosModule select.input,
html[data-theme="dark"] #formulariosModule textarea.input,
body.dark #formulariosModule textarea.input {
  background: #21262d !important;
  color: #f0f6fc !important;
  border-color: #30363d !important;
}

html[data-theme="dark"] #formulariosModule .btn,
body.dark #formulariosModule .btn {
  background: #21262d !important;
  color: #f0f6fc !important;
  border-color: #30363d !important;
}

html[data-theme="dark"] #formulariosModule .btn.primary,
body.dark #formulariosModule .btn.primary {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

/* ---- Main layout ---- */
#formulariosModule .formularios-wrap{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}#formulariosModule .form-left{
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---- Card container ---- */
#formulariosModule .form-card{
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--app-surface, #fff);
  color: var(--app-text, #0f172a);
  border-radius: 18px;
  box-shadow: var(--app-shadow);
  border: 1px solid var(--app-border, rgba(203, 213, 225, 0.35));
  margin: 20px;
  overflow: hidden;
}

/* ---- Card header bar ---- */
#formulariosModule .form-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--app-border, #e2e8f0);
  background: var(--app-surface-2, #f8fbff);
}#formulariosModule .form-title{
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--app-text, #1e293b);
  letter-spacing: -.02em;
}#formulariosModule .form-sub{
  font-size: .80rem;
  color: var(--app-muted, #94a3b8);
  margin-top: 3px;
}#formulariosModule .form-controls{
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ---- Main two-column grid ---- */
#formulariosModule .form-main-grid{
  display: grid;
  grid-template-columns: 280px 1fr;
  flex: 1;
  min-height: 0;
}#formulariosModule .form-list-wrap{
  border-right: 1px solid var(--app-border, #e2e8f0);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  background: var(--app-surface-2, #fafcff);
}#formulariosModule .form-search{
  flex-shrink: 0;
}#formulariosModule .forms-list{
  flex: 1;
  display: grid;
  gap: 6px;
  align-content: start;
}#formulariosModule .form-details{
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  background: var(--app-surface, #fff);
  color: var(--app-text, #0f172a);
}

/* ---- Send actions layout ---- */
#formulariosModule .ff-send-actions{
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: flex-end;
  flex-shrink: 0;
}#formulariosModule .ff-btn-block{
  display: block;
  width: 100%;
  text-align: center;
}

/* ---- Utility helpers ---- */
#formulariosModule .ff-flex-1{ flex: 1; }#formulariosModule .ff-min-240{ min-width: 240px; }#formulariosModule .ff-min-h-120{ min-height: 120px; }#formulariosModule .ff-mt-6{ margin-top: 6px; }#formulariosModule .ff-mt-8{ margin-top: 8px; }#formulariosModule .ff-mt-12{ margin-top: 12px; }#formulariosModule .ff-gap-8{ gap: 8px; }#formulariosModule .ff-gap-12{ gap: 12px; }#formulariosModule .ff-row-center{ align-items: center; }#formulariosModule .ff-row-between{ justify-content: space-between; }#formulariosModule .ff-row-wrap{ flex-wrap: wrap; }#formulariosModule .ff-note-muted{ color: var(--ff-muted); font-size: .82rem; }

/* ---- Tabs ---- */
#formulariosModule .tabs{
  display: flex;
  gap: 2px;
  border-bottom: 2px solid #e2e8f0;
}#formulariosModule .tab{
  position: relative;
  bottom: -2px;
  padding: 7px 14px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: .86rem;
  font-weight: 600;
  color: var(--ff-muted);
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: color .18s, background .18s;
}#formulariosModule .tab:hover{ color: var(--ff-text); background: rgba(148, 163, 184, 0.10); }#formulariosModule .tab.active{ color: var(--ff-accent); border-bottom: 2px solid var(--ff-accent); }

/* ---- Input / Button (standalone page uses unscoped .btn, .input) ---- */
#formulariosModule .input, #formulariosModule input.input, #formulariosModule select.input, #formulariosModule textarea.input{
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--ff-border);
  border-radius: 10px;
  background: #f8fbff;
  color: var(--ff-text);
  font-family: inherit;
  font-size: .92rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}#formulariosModule .input:focus, #formulariosModule input.input:focus, #formulariosModule select.input:focus, #formulariosModule textarea.input:focus{
  border-color: var(--ff-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  background: #fff;
}#formulariosModule textarea.input{ resize: vertical; min-height: 70px; }#formulariosModule .btn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1px solid var(--ff-border);
  border-radius: 10px;
  background: #fff;
  color: var(--ff-text);
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, border-color .18s, filter .18s;
}#formulariosModule .btn:hover{ background: #f8fbff; border-color: #c2d0e8; }#formulariosModule .btn.ghost{
  background: transparent;
  border-color: rgba(148, 163, 184, 0.35);
  color: var(--ff-muted);
}#formulariosModule .btn.ghost:hover{ background: rgba(148, 163, 184, 0.10); }#formulariosModule .btn.primary{
  background: linear-gradient(135deg, var(--ff-accent), var(--ff-accent-2));
  color: #fff;
  border-color: transparent;
}#formulariosModule .btn.primary:hover{ filter: brightness(1.07); }#formulariosModule .btn.critical{
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}#formulariosModule .btn.critical:hover{ background: #fee2e2; }#formulariosModule .btn.critical:disabled{ opacity: .5; cursor: not-allowed; }

/* ---- Small text ---- */
#formulariosModule .small{ font-size: .83rem; color: var(--ff-muted); }

/* ---- ff-editor override (min height + overflow) ---- */
#formulariosModule .ff-editor{
  overflow: auto;
}

/* ---- Responsive ---- */
@media (max-width: 900px){
#formulariosModule .form-card{
    margin: 10px;
    border-radius: 14px;
  }#formulariosModule .form-main-grid{
    grid-template-columns: 1fr;
  }#formulariosModule .form-list-wrap{
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    max-height: 260px;
  }#formulariosModule .ff-send-actions{
    flex-direction: row;
    align-self: auto;
  }#formulariosModule .ff-btn-block{
    width: auto;
  }

}

/* ===============================
   GPS Module Unified
   =============================== */
#gpsModule{
  --gps-bg: var(--app-bg, #f3f7fc);
  --gps-card: var(--app-surface, #ffffff);
  --gps-border: var(--app-border, #d7e2ef);
  --gps-text: var(--app-text, #1f2d3d);
  --gps-muted: var(--app-muted, #6b7a8f);
  --gps-primary: var(--app-primary, #2563eb);
  --gps-ok: #10b981;
  --gps-danger: #ef4444;
  color: var(--app-text, #1f2d3d);
}

/* Dark Theme Overrides for #gpsModule (Paleta Carbón Slate de Reportes - Sin Morado/Lila) */
html[data-theme="dark"] #gpsModule,
body.dark #gpsModule {
  --gps-bg: #0d1117;
  --gps-card: #161b22;
  --gps-border: #30363d;
  --gps-text: #f0f6fc;
  --gps-muted: #8b949e;
  background: #0d1117 !important;
  color: #f0f6fc !important;
}

html[data-theme="dark"] #gpsModule .card,
body.dark #gpsModule .card,
html[data-theme="dark"] #gpsModule .module-surface,
body.dark #gpsModule .module-surface,
html[data-theme="dark"] #gpsModule #geofence-panel,
body.dark #gpsModule #geofence-panel {
  background: #161b22 !important;
  color: #f0f6fc !important;
  border-color: #30363d !important;
}

html[data-theme="dark"] #gpsModule .live-summary-bar,
body.dark #gpsModule .live-summary-bar,
html[data-theme="dark"] #gpsModule .sb-cell,
body.dark #gpsModule .sb-cell,
html[data-theme="dark"] #gpsModule .gf-header,
body.dark #gpsModule .gf-header,
html[data-theme="dark"] #gpsModule .history-table-wrap,
body.dark #gpsModule .history-table-wrap {
  background: #21262d !important;
  color: #f0f6fc !important;
  border-color: #30363d !important;
}

html[data-theme="dark"] #gpsModule .btn,
body.dark #gpsModule .btn,
html[data-theme="dark"] #gpsModule button.btn,
body.dark #gpsModule button.btn {
  background: #21262d !important;
  color: #f0f6fc !important;
  border-color: #30363d !important;
}

html[data-theme="dark"] #gpsModule .btn:hover,
body.dark #gpsModule .btn:hover {
  background: #161b22 !important;
}

html[data-theme="dark"] #gpsModule .btn.primary,
body.dark #gpsModule .btn.primary {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

html[data-theme="dark"] #gpsModule select,
body.dark #gpsModule select,
html[data-theme="dark"] #gpsModule input,
body.dark #gpsModule input {
  background: #21262d !important;
  color: #f0f6fc !important;
  border-color: #30363d !important;
}

/* Leaflet map layer control & popup dark mode fix */
html[data-theme="dark"] .leaflet-control-layers,
body.dark .leaflet-control-layers,
html[data-theme="dark"] .leaflet-control-layers-expanded,
body.dark .leaflet-control-layers-expanded {
  background: #161b22 !important;
  color: #f0f6fc !important;
  border: 1px solid #30363d !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
  padding: 8px 12px !important;
}

html[data-theme="dark"] .leaflet-control-layers label,
body.dark .leaflet-control-layers label,
html[data-theme="dark"] .leaflet-control-layers span,
body.dark .leaflet-control-layers span {
  color: #f0f6fc !important;
  font-weight: 600 !important;
}

html[data-theme="dark"] .leaflet-popup-content-wrapper,
body.dark .leaflet-popup-content-wrapper {
  background: #161b22 !important;
  color: #f0f6fc !important;
  border: 1px solid #30363d !important;
  border-radius: 14px !important;
}

html[data-theme="dark"] .leaflet-popup-tip,
body.dark .leaflet-popup-tip {
  background: #161b22 !important;
}

/* Light Theme explicit rules for Leaflet Layer Control */
html[data-theme="light"] .leaflet-control-layers,
body.light .leaflet-control-layers {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}
html[data-theme="light"] .leaflet-control-layers label,
body.light .leaflet-control-layers label,
html[data-theme="light"] .leaflet-control-layers span,
body.light .leaflet-control-layers span {
  color: #0f172a !important;
}#gpsModule .section-head, #gpsModule .row, #gpsModule .head-actions, #gpsModule .map-actions, #gpsModule .history-toolbar, #gpsModule .gf-actions, #gpsModule .gf-row, #gpsModule .gps-gf-color-row, #gpsModule .gps-modal-actions, #gpsModule .gps-todo-add{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}#gpsModule .map-wrap{
  position: relative;
  border: 1px solid var(--gps-border);
  border-radius: 12px;
  overflow: hidden;
  background: #e9f0fa;
}#gpsModule #map{
  width: 100%;
  min-height: 420px;
  height: 56vh;
}#gpsModule #gps-card.map-full #map{
  height: 72vh;
}#gpsModule .live-summary-bar{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  border: 1px solid var(--gps-border);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 10px;
}#gpsModule .sb-cell{
  padding: 6px 10px;
  border-radius: 999px;
  background: #f6f9ff;
  border: 1px solid #e3ebf6;
  font-size: 13px;
}#gpsModule .sb-dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}#gpsModule .sb-dot.fresh{ background: var(--gps-ok); }#gpsModule .sb-dot.old{ background: var(--gps-danger); }#gpsModule #geofence-panel{
  display: none; /* hidden until .open is added via JS */
  position: absolute;
  top: 12px;
  right: 12px;
  width: min(380px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--gps-border);
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, .18);
  z-index: 500;
}#gpsModule #geofence-panel.open{
  display: block;
}#gpsModule .gf-header, #gpsModule .gf-body{
  padding: 10px;
}#gpsModule .history-table-wrap{
  overflow: auto;
  border: 1px solid var(--gps-border);
  border-radius: 10px;
}#gpsModule .gps-history-table{
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}#gpsModule .gps-history-table th, #gpsModule .gps-history-table td{
  border-bottom: 1px solid #e6edf7;
  padding: 8px;
  text-align: left;
  font-size: 13px;
}#gpsModule .modal-backdrop{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .45);
  z-index: 1200;
}#gpsModule .modal{
  width: min(760px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--gps-border);
  padding: 14px;
}#gpsModule .toasts{
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 8px;
  z-index: 1500;
}#gpsModule .toast{
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--gps-border);
  border-left: 4px solid var(--gps-primary);
  border-radius: 10px;
  padding: 10px;
  min-width: 280px;
  box-shadow: 0 10px 18px rgba(15, 23, 42, .12);
}#gpsModule .toast.panic{ border-left-color: var(--gps-danger); }#gpsModule .toast.ok{ border-left-color: var(--gps-ok); }

/* Leaflet hardening to prevent broken tile sizing in merged contexts */
#gpsModule .leaflet-container img, #gpsModule .leaflet-container .leaflet-tile, #gpsModule .leaflet-container .leaflet-marker-icon, #gpsModule .leaflet-container .leaflet-marker-shadow{
  max-width: none !important;
  max-height: none !important;
}@media (max-width: 900px){
#gpsModule #map{
    min-height: 320px;
    height: 52vh;
  }#gpsModule #geofence-panel{
    left: 10px;
    right: 10px;
    width: auto;
  }

}

/* ============================================================
   GPS MODULE — additional component styles
   ============================================================ */

/* Shell wrapper */
#gpsModule.gps-shell{
  padding: 0;
}

/* ---- Icon buttons ---- */
#gpsModule .icon-btn{
  padding: 5px 9px;
  min-width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  line-height: 1;
}

/* ---- Geofence panel header ---- */
#gpsModule .gf-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gps-border);
  background: #f8fbff;
  border-radius: 12px 12px 0 0;
}#gpsModule .gps-header-actions{
  display: flex;
  gap: 4px;
  align-items: center;
}

/* ---- Controls bars ---- */
#gpsModule .gps-controls-live, #gpsModule .gps-controls-hist{
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--gps-border);
}

/* ---- Inline labels (label + select inline) ---- */
#gpsModule .gps-inline-label{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--gps-muted);
  white-space: nowrap;
}

/* ---- Filter selects ---- */
#gpsModule .gps-filter-select{
  padding: 6px 10px;
  border: 1.5px solid var(--gps-border);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: .88rem;
  color: var(--gps-text);
  outline: none;
  transition: border-color .2s;
}#gpsModule .gps-filter-select:focus{
  border-color: var(--gps-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

/* ---- Info / loading indicators ---- */
#gpsModule .gps-info-status{
  font-size: .84rem;
  color: var(--gps-muted);
}#gpsModule .gps-loading-wrap{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .84rem;
  color: var(--gps-muted);
}#gpsModule .sb-loading{
  width: 14px;
  height: 14px;
  border: 2px solid #e2e8f0;
  border-top-color: var(--gps-primary);
  border-radius: 50%;
  animation: gps-spin .75s linear infinite;
  flex-shrink: 0;
}@keyframes gps-spin{ to { transform: rotate(360deg); } }

/* ---- Summary note (in live bar) ---- */
#gpsModule .gps-summary-note{
  font-size: .74rem;
  color: var(--gps-muted);
}

/* ---- Map actions row ---- */
#gpsModule .map-actions{
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 0;
}

/* ---- History toolbar ---- */
#gpsModule .history-toolbar{
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 0;
  border-top: 1px solid var(--gps-border);
}

/* ---- Geofence rows ---- */
#gpsModule .gf-row{
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--gps-border);
}#gpsModule .gps-gf-color-row{
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
}

/* ---- Modal actions ---- */
#gpsModule .gps-modal-actions{
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--gps-border);
}

/* ---- Todo items ---- */
#gpsModule .gps-todo-add{
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
}#gpsModule .gps-todo-row{
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}

/* ---- History table sticky wrapper ---- */
#gpsModule .history-table-wrap{
  border-radius: 12px;
  overflow: auto;
}

/* ---- GPS Buttons (extend shared .btn) ---- */
#gpsModule .btn{
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #fff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .18s, border-color .18s, filter .18s;
}#gpsModule .btn:hover{ background: #f8fbff; border-color: rgba(148, 163, 184, 0.50); }#gpsModule .btn.primary{ background: linear-gradient(135deg, var(--gps-primary), #1d4ed8); color: #fff; border-color: transparent; }#gpsModule .btn.primary:hover{ filter: brightness(1.07); }#gpsModule .btn.ghost{ background: transparent; color: var(--gps-muted); }#gpsModule .btn.ghost:hover{ background: rgba(148, 163, 184, 0.12); }#gpsModule .btn.secondary{ background: #f1f5f9; border-color: #e2e8f0; color: #334155; }#gpsModule .btn.secondary:hover{ background: #e2e8f0; }#gpsModule .btn.danger{ background: linear-gradient(135deg, var(--gps-danger), #b91c1c); color: #fff; border-color: transparent; }

/* ---- Tabs ---- */
#gpsModule .tabs{
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--gps-border);
  margin-bottom: 14px;
}#gpsModule .tab{
  position: relative;
  bottom: -2px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  color: var(--gps-muted);
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: color .18s, background .18s;
}#gpsModule .tab:hover{ color: var(--gps-text); background: rgba(148, 163, 184, 0.10); }#gpsModule .tab.active{ color: var(--gps-primary); border-bottom: 2px solid var(--gps-primary); }

/* ---- Label small ---- */
#gpsModule .label-small{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .83rem;
  font-weight: 600;
  color: var(--gps-muted);
}

/* ============================================================
   GEOFENCE PANEL — form inputs & controls
   ============================================================ */

/* Panel body padding */
#gpsModule .gf-body{
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Section labels inside panel */
#gpsModule .gf-body .small{
  margin-top: 8px;
  font-size: .80rem;
  font-weight: 700;
  color: var(--gps-muted);
  letter-spacing: .01em;
}#gpsModule .gf-body .small:first-child{
  margin-top: 0;
}

/* Name input */
#gpsModule .gps-gf-input{
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--gps-border);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--gps-text);
  font-family: inherit;
  font-size: .88rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color .2s, box-shadow .2s;
}#gpsModule .gps-gf-input:focus{
  border-color: var(--gps-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  background: #fff;
}

/* Users multi-select */
#gpsModule .gps-gf-users{
  display: block;
  width: 100%;
  min-height: 90px;
  padding: 6px 8px;
  border: 1.5px solid var(--gps-border);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--gps-text);
  font-family: inherit;
  font-size: .86rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color .2s, box-shadow .2s;
}#gpsModule .gps-gf-users:focus{
  border-color: var(--gps-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  background: #fff;
}#gpsModule .gps-gf-users option{
  padding: 4px 6px;
}

/* User count hint */
#gpsModule .gps-gf-count{
  font-size: .78rem;
  color: var(--gps-muted);
  font-style: italic;
}

/* Color swatch preview box */
#gpsModule .gps-gf-color-swatch, #gpsModule .color-swatch{
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid var(--gps-border);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .2s;
}#gpsModule .gps-gf-color-swatch:hover, #gpsModule .color-swatch:hover{
  border-color: var(--gps-primary);
}

/* Native color input */
#gpsModule .gps-gf-color-picker{
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Opacity select */
#gpsModule .gps-gf-opacity{
  flex: 1;
  padding: 6px 10px;
  border: 1.5px solid var(--gps-border);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--gps-text);
  font-family: inherit;
  font-size: .84rem;
  outline: none;
  transition: border-color .2s;
}#gpsModule .gps-gf-opacity:focus{
  border-color: var(--gps-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

/* Grow button — fills flex space equally with siblings */
#gpsModule .gps-grow-btn{
  flex: 1;
  justify-content: center;
}

/* Actions row in geofence panel */
#gpsModule .gf-actions{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--gps-border);
}

/* Help hint below actions */
#gpsModule .gps-help-text{
  font-size: .78rem;
  color: var(--gps-muted);
  line-height: 1.45;
  margin-top: 8px;
}

/* Status line at the bottom of the panel */
#gpsModule .gps-status-text{
  font-size: .82rem;
  color: var(--gps-muted);
  min-height: 18px;
  margin-top: 6px;
  padding: 4px 6px;
  background: #f8fbff;
  border-radius: 6px;
}

/* Minimized state — hide body, keep header */
#gpsModule #geofence-panel.min .gf-body{
  display: none;
}

/* Existing geocercas list (injected by JS into gf-body) */
#gpsModule .gf-existing-title{
  font-size: .82rem;
  font-weight: 700;
  color: #334155;
  margin: 12px 0 6px;
  padding-top: 12px;
  border-top: 1px solid var(--gps-border);
}#gpsModule .gf-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--gps-border);
  background: #fafcff;
  margin-bottom: 5px;
  font-size: .84rem;
}#gpsModule .gf-item:hover{
  background: #f0f4fb;
}#gpsModule .gf-item-label{
  flex: 1;
  font-weight: 600;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}#gpsModule .gf-item-swatch{
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}#gpsModule .gf-item-del{
  flex-shrink: 0;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: .76rem;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  cursor: pointer;
  transition: background .18s;
}#gpsModule .gf-item-del:hover{
  background: #fee2e2;
}

/* ===============================
   Llamadas Module Unified
   =============================== */
/* ===== Llamadas: UI (mejoras estéticas sin romper funcionalidad) ===== */
:root{
  --bg:#edf1f5;
  --card:rgba(251,252,254,.96);
  --muted:#64748b;
  --text:#1b2430;
  --accent:#0a84ff;
  --accent-2:#5e5ce6;
  --ok:#34c759;
  --danger:#ff453a;
  --radius:20px;
  --gap:12px;
  --surface-soft:#eef2f6;
}
@media (prefers-color-scheme: dark){
  :root{ --bg:#0f1115; --card:rgba(23,27,34,.96); --muted:#97a6b8; --text:#eef2f7; --accent:#0a84ff; --accent-2:#5e5ce6; --surface-soft:#11151b; }
}
html[data-theme="dark"], body.dark, .theme-dark{ --bg:#0f1115; --card:rgba(23,27,34,.96); --muted:#97a6b8; --text:#eef2f7; --accent:#0a84ff; --accent-2:#5e5ce6; --surface-soft:#11151b; }

/* container */
#mod-llamadas{
  font-family:"Manrope", "DM Sans", "Segoe UI", Roboto, Arial, sans-serif;
  color:var(--text);
  background:linear-gradient(180deg,#f8fafc,var(--bg) 120%);
  padding:0 16px 16px;
}

/* cards */
#mod-llamadas .card{
  background:var(--card);
  border:1px solid rgba(148,163,184,.22);
  border-radius:var(--radius);
  padding:16px;
  box-shadow:0 18px 42px rgba(15,23,42,.10);
}
#mod-llamadas .module-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;flex-wrap:wrap;margin:20px 0 18px;padding:16px 18px;border-radius:18px;border:1px solid rgba(148,163,184,.22);background:var(--surface-soft)}
#mod-llamadas .module-head h1{margin:0;font-size:1.3rem;letter-spacing:-.02em}
#mod-llamadas .module-head p{margin:6px 0 0;color:var(--muted);max-width:66ch;line-height:1.55}
#mod-llamadas .module-head__chips{display:flex;gap:8px;flex-wrap:wrap}
#mod-llamadas .module-head__chip{display:inline-flex;align-items:center;padding:8px 12px;border-radius:999px;border:1px solid rgba(148,163,184,.22);background:rgba(255,255,255,.6);color:var(--muted);font-size:.84rem;font-weight:800}
html[data-theme="dark"] #mod-llamadas .card, body.dark #mod-llamadas .card, .theme-dark #mod-llamadas .card{box-shadow:0 18px 42px rgba(0,0,0,.28)}
html[data-theme="dark"] #mod-llamadas .module-head__chip, body.dark #mod-llamadas .module-head__chip, .theme-dark #mod-llamadas .module-head__chip{background:rgba(255,255,255,.04)}

/* header */
.header-row{display:flex;justify-content:space-between;align-items:center;gap:var(--gap);flex-wrap:wrap}
.controls{display:flex;gap:8px;align-items:center}

/* buttons */
.btn{
  display:inline-flex;align-items:center;gap:8px;padding:10px 12px;border-radius:12px;border:1px solid rgba(148,163,184,.22);
  cursor:pointer;font-weight:800;background:linear-gradient(180deg,#fff,#f8fafc);
}
.btn.primary{background:linear-gradient(180deg,var(--accent),var(--accent-2));color:#fff;border-color:transparent}

/* list items */
.room-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px;border-radius:8px}
.room-row:hover{background:rgba(15,118,110,0.05)}
.participants{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.participant{padding:6px 10px;border-radius:999px;background:#f1fdfb;border:1px solid rgba(15,118,110,.12);font-weight:800}

/* audio */
.audio-row{display:flex;gap:12px;flex-wrap:wrap;margin-top:8px;align-items:center}
.remote-audio{width:220px;border-radius:10px;border:1px solid rgba(2,6,23,.04);margin:6px;padding:8px;background:#fff;display:flex;gap:8px;align-items:center}
.audio-meta{display:flex;flex-direction:column;min-width:0}
.audio-meta b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* status & log */
.peer-status{font-size:.85rem;color:#374151}
.small-muted{color:var(--muted);font-size:.9rem}
#log{font-family:ui-monospace,Menlo,Monaco,monospace;font-size:.84rem;max-height:220px;overflow:auto;padding:8px;border-radius:12px;background:#fbfdff;border:1px solid rgba(148,163,184,.20);margin-top:12px}

/* ghost container (offscreen, preserves audio when module removed) */
#llamadas-ghost{position:fixed;left:-9999px;top:0;width:1px;height:1px;overflow:hidden;pointer-events:none;z-index:999999}

/* ===============================
   Monitor Module Unified
   =============================== */
.monitor-app{
  --mon-bg: #edf1f5;
  --mon-card: #fbfcfe;
  --mon-panel: #eef2f6;
  --mon-text: #1b2430;
  --mon-muted: #64748b;
  --mon-border: #d6dee8;
  --mon-accent: #0a84ff;
  --mon-accent-2: #5e5ce6;
  --mon-ok: #34c759;
  --mon-warn: #ff9f0a;
  --mon-err: #ff453a;
  --mon-radius: 16px;
  --mon-radius-sm: 11px;
  --mon-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
}html[data-theme="dark"] .monitor-app, body.dark .monitor-app, .theme-dark .monitor-app{
  --mon-bg: #0f1115;
  --mon-card: #171b22;
  --mon-panel: #11151b;
  --mon-text: #eef2f7;
  --mon-muted: #97a6b8;
  --mon-border: rgba(255, 255, 255, 0.10);
  --mon-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}.monitor-app, .monitor-app *{
  box-sizing: border-box;
  font-family: "Manrope", "DM Sans", "Avenir Next", "Segoe UI", sans-serif;
}.monitor-app{
  max-width: 1560px;
  margin: 0 auto;
  padding: 12px 10px 22px;
}.monitor-app .monitor-shell{
  border: 1px solid var(--mon-border);
  border-radius: var(--mon-radius);
  background: var(--mon-card);
  box-shadow: var(--mon-shadow);
  overflow: hidden;
}.monitor-app .monitor-head, .monitor-app .monitor-toolbar, .monitor-app .monitor-ribbon{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--mon-border);
}.monitor-app .monitor-head h1{
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: 0.01em;
}.monitor-app .monitor-head p{
  margin: 4px 0 0;
  color: var(--mon-muted);
  font-size: 0.84rem;
}.monitor-app .monitor-summary, .monitor-app .monitor-controls, .monitor-app .monitor-toolbar__left, .monitor-app .monitor-actions__row, .monitor-app .monitor-meta, .monitor-app .monitor-ribbon{
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}.monitor-app .monitor-pill, .monitor-app .monitor-chip, .monitor-app .monitor-badge{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--mon-border);
  border-radius: 999px;
  background: var(--mon-panel);
  color: var(--mon-muted);
  font-size: 0.72rem;
  font-weight: 800;
}.monitor-app .monitor-chip.ok, .monitor-app .monitor-badge.ok{
  color: var(--mon-ok);
}.monitor-app .monitor-chip.warn, .monitor-app .monitor-badge.warn{
  color: var(--mon-warn);
}.monitor-app .monitor-chip.err, .monitor-app .monitor-badge.err{
  color: var(--mon-err);
}.monitor-app .monitor-stats{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--mon-border);
  background: var(--mon-panel);
}.monitor-app .monitor-stat{
  border: 1px solid var(--mon-border);
  border-radius: 12px;
  background: var(--mon-card);
  padding: 10px 12px;
}.monitor-app .monitor-stat__label{
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mon-muted);
}.monitor-app .monitor-stat__value{
  margin-top: 4px;
  font-size: 1.2rem;
  font-weight: 900;
}.monitor-app .monitor-input, .monitor-app .monitor-select, .monitor-app .btn{
  border-radius: var(--mon-radius-sm);
  border: 1px solid var(--mon-border);
  background: var(--mon-card);
  color: var(--mon-text);
}.monitor-app .monitor-input, .monitor-app .monitor-select{
  height: 40px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}.monitor-app .monitor-input{
  min-width: 150px;
}.monitor-app .btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 11px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 800;
}.monitor-app .btn.sm{
  min-height: 30px;
  padding: 5px 9px;
  font-size: 0.78rem;
  border-radius: 9px;
}.monitor-app .btn.primary{
  background: linear-gradient(180deg, var(--mon-accent), var(--mon-accent-2));
  color: #fff;
  border-color: transparent;
}.monitor-app .btn.ok{
  background: linear-gradient(180deg, #16a34a, #15803d);
  color: #fff;
  border-color: transparent;
}.monitor-app .btn.ghost{
  background: transparent;
  color: var(--mon-muted);
}.monitor-app .monitor-table-wrap{
  overflow: auto;
  scrollbar-gutter: stable;
}.monitor-app .monitor-table{
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}.monitor-app .monitor-table th{
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--mon-border);
  background: var(--mon-panel);
  color: var(--mon-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}.monitor-app .monitor-table td{
  padding: 10px;
  border-bottom: 1px solid var(--mon-border);
  vertical-align: top;
}.monitor-app .monitor-table tbody tr:nth-child(even){
  background: var(--mon-panel);
}.monitor-app .monitor-row--monitor-on{
  box-shadow: inset 3px 0 0 var(--mon-warn);
}.monitor-app .monitor-row--offline{
  opacity: 0.88;
}.monitor-app .monitor-device{
  display: grid;
  gap: 3px;
}.monitor-app .monitor-device__name{
  font-size: 0.9rem;
  font-weight: 900;
}.monitor-app .monitor-device__email, .monitor-app .monitor-sub, .monitor-app .monitor-status, .monitor-app .monitor-meta{
  color: var(--mon-muted);
  font-size: 0.78rem;
}.monitor-app .monitor-stack, .monitor-app .monitor-actions, .monitor-app .monitor-actions__group, .monitor-app .monitor-video, .monitor-app .monitor-video__side{
  display: flex;
  flex-direction: column;
  gap: 6px;
}.monitor-app .monitor-video{
  min-width: 200px;
}.monitor-app .monitor-video img, .monitor-app .monitor-video__fallback{
  width: 206px;
  height: 142px;
  border-radius: 10px;
  border: 1px solid var(--mon-border);
  background: #020617;
  object-fit: cover;
}.monitor-app .monitor-video__fallback{
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  font-weight: 700;
}.monitor-app .monitor-video--dual{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  min-width: 430px;
}.monitor-app .monitor-video__side img{
  width: 100%;
  max-width: 206px;
  height: 142px;
}.monitor-app .monitor-actions{
  min-width: 200px;
  gap: 7px;
}.monitor-app .monitor-actions__label{
  color: var(--mon-muted);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}.monitor-app .monitor-status{
  min-height: 30px;
  padding: 7px 14px;
}.monitor-app .monitor-empty{
  padding: 20px 16px;
  color: var(--mon-muted);
  font-weight: 700;
}.monitor-app .monitor-battery{
  width: 56px;
  height: 8px;
  border-radius: 999px;
  background: var(--mon-border);
  overflow: hidden;
}.monitor-app .monitor-battery > span{
  display: block;
  height: 100%;
  border-radius: 999px;
}.monitor-app .monitor-loading{
  display: grid;
  gap: 12px;
  padding: 20px;
}.monitor-app .monitor-skeleton{
  height: 14px;
  border-radius: 999px;
  background: var(--mon-border);
}.monitor-app .monitor-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--mon-ok);
  display: inline-block;
}@media (max-width: 1200px){
.monitor-app .monitor-table{
    min-width: 980px;
  }.monitor-app .monitor-video--dual{
    min-width: 390px;
  }.monitor-app .monitor-video img, .monitor-app .monitor-video__fallback{
    width: 186px;
    height: 130px;
  }.monitor-app .monitor-video__side img{
    max-width: 186px;
    height: 130px;
  }

}@media (max-width: 900px){
.monitor-app .monitor-stats{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}@media (max-width: 680px){
.monitor-app .monitor-toolbar__left, .monitor-app .monitor-controls{
    width: 100%;
  }.monitor-app .monitor-controls .btn, .monitor-app .monitor-controls .monitor-select, .monitor-app .monitor-controls .monitor-input{
    width: 100%;
  }.monitor-app .monitor-table{
    min-width: 780px;
  }.monitor-app .monitor-video--dual{
    grid-template-columns: 1fr;
    min-width: 210px;
  }.monitor-app .monitor-video, .monitor-app .monitor-actions{
    min-width: 170px;
  }

}.monitor-app{
  --mon-bg:#eef4ff;
  --mon-card:rgba(255,255,255,.98);
  --mon-panel:#f6f9ff;
  --mon-text:#0f172a;
  --mon-muted:#64748b;
  --mon-border:rgba(148,163,184,.24);
  --mon-accent:#0b7285;
  --mon-accent-2:#0f766e;
  --mon-ok:#16a34a;
  --mon-warn:#b45309;
  --mon-err:#dc2626;
  --mon-radius:18px;
  --mon-radius-sm:12px;
  --mon-shadow:0 18px 44px rgba(15,23,42,.09);
}html[data-theme="dark"] .monitor-app, body.dark .monitor-app, .theme-dark .monitor-app{
  --mon-bg:#07111f;
  --mon-card:rgba(11,18,32,.98);
  --mon-panel:#0b1628;
  --mon-text:#e2e8f0;
  --mon-muted:#94a3b8;
  --mon-border:rgba(255,255,255,.12);
  --mon-accent:#14b8a6;
  --mon-accent-2:#0d9488;
  --mon-ok:#22c55e;
  --mon-warn:#f59e0b;
  --mon-err:#ef4444;
  --mon-shadow:0 18px 44px rgba(0,0,0,.32);
}.monitor-app *{box-sizing:border-box}.monitor-app, .monitor-app{height:100%;margin:0}.monitor-app{
  background:
    radial-gradient(1200px 420px at 10% -12%, rgba(20,184,166,.14), transparent 66%),
    radial-gradient(900px 360px at 100% 0%, rgba(45,212,191,.08), transparent 64%),
    linear-gradient(180deg,var(--mon-card),var(--mon-bg));
  color:var(--mon-text);
  font-family:"Manrope","DM Sans","Avenir Next","Segoe UI",sans-serif;
  -webkit-font-smoothing:antialiased;
}.monitor-app{max-width:1500px;margin:0 auto;padding:16px 14px 28px}.monitor-app .monitor-shell{border:1px solid var(--mon-border);border-radius:var(--mon-radius);background:color-mix(in srgb,var(--mon-card) 94%,#fff);box-shadow:var(--mon-shadow);overflow:hidden;backdrop-filter:blur(4px)}.monitor-app .monitor-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:18px 20px;border-bottom:1px solid var(--mon-border)}.monitor-app .monitor-head h1{margin:0;font-size:1.22rem;font-weight:900}.monitor-app .monitor-head p{margin:6px 0 0;color:var(--mon-muted);font-size:.92rem}.monitor-app .monitor-summary{display:flex;gap:10px;flex-wrap:wrap}.monitor-app .monitor-pill{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border-radius:999px;border:1px solid var(--mon-border);background:var(--mon-panel);font-size:.78rem;font-weight:900;color:var(--mon-muted)}.monitor-app .monitor-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;padding:14px 20px;border-bottom:1px solid var(--mon-border);background:linear-gradient(90deg,var(--mon-panel),color-mix(in srgb,var(--mon-panel) 88%,#fff))}.monitor-app .monitor-stat{border:1px solid var(--mon-border);background:var(--mon-card);border-radius:14px;padding:12px 14px}.monitor-app .monitor-stat__label{font-size:.72rem;font-weight:900;letter-spacing:.1em;text-transform:uppercase;color:var(--mon-muted)}.monitor-app .monitor-stat__value{margin-top:4px;font-size:1.4rem;font-weight:900;line-height:1.05}.monitor-app .monitor-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 20px;border-bottom:1px solid var(--mon-border)}.monitor-app .monitor-toolbar__left{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.monitor-app .monitor-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.monitor-app .monitor-input, .monitor-app .monitor-select{height:38px;border-radius:11px;border:1px solid var(--mon-border);background:var(--mon-card);padding:8px 10px;color:var(--mon-text);font-size:.84rem;font-weight:700}.monitor-app .monitor-input{min-width:210px}.monitor-app .monitor-meta{font-size:.84rem;color:var(--mon-muted);font-weight:700}.monitor-app .monitor-dot{width:8px;height:8px;border-radius:999px;background:var(--mon-ok);display:inline-block;animation:none}@keyframes monitor-blink{0%,100%{opacity:1}50%{opacity:.3}}.monitor-app .monitor-ribbon{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:10px 20px;border-bottom:1px solid var(--mon-border);background:linear-gradient(90deg,color-mix(in srgb,var(--mon-panel) 92%,#fff),var(--mon-panel))}.monitor-app .monitor-ribbon__label{font-size:.7rem;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:var(--mon-muted)}.monitor-app .btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:38px;padding:8px 12px;border-radius:var(--mon-radius-sm);border:1px solid var(--mon-border);background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(248,250,252,.92));color:var(--mon-text);font-size:.85rem;font-weight:800;cursor:pointer}.monitor-app .btn:hover{transform:none}.monitor-app .btn:disabled{opacity:.6;cursor:not-allowed;transform:none}.monitor-app .btn.primary{background:linear-gradient(180deg,var(--mon-accent),var(--mon-accent-2));border-color:transparent;color:#fff}.monitor-app .btn.ok{background:linear-gradient(180deg,#16a34a,#15803d);border-color:transparent;color:#fff}.monitor-app .btn.ghost{background:transparent;color:var(--mon-muted)}.monitor-app .btn.sm{min-height:32px;padding:6px 10px;font-size:.79rem;border-radius:10px}.monitor-app .monitor-table-wrap{overflow:auto}.monitor-app .monitor-table{width:100%;border-collapse:collapse;min-width:1220px}.monitor-app .monitor-table th{position:sticky;top:0;z-index:2;padding:10px 12px;border-bottom:1px solid var(--mon-border);background:var(--mon-panel);color:var(--mon-muted);font-size:.72rem;font-weight:900;letter-spacing:.08em;text-transform:uppercase;text-align:left}.monitor-app .monitor-table td{padding:12px;border-bottom:1px solid var(--mon-border);vertical-align:top}.monitor-app .monitor-table tbody tr:nth-child(even){background:color-mix(in srgb,var(--mon-panel) 32%,transparent)}.monitor-app .monitor-table tbody tr:hover{background:color-mix(in srgb,var(--mon-accent) 8%,transparent)}.monitor-app .monitor-row--monitor-on{box-shadow:inset 3px 0 0 var(--mon-warn)}.monitor-app .monitor-row--offline{opacity:.88}.monitor-app .monitor-device{display:grid;gap:3px}.monitor-app .monitor-device__name{font-weight:900;font-size:.94rem}.monitor-app .monitor-device__email{color:var(--mon-muted);font-size:.8rem}.monitor-app .monitor-badge, .monitor-app .monitor-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 8px;border-radius:999px;border:1px solid var(--mon-border);font-size:.74rem;font-weight:900;color:var(--mon-muted);background:rgba(255,255,255,.6)}.monitor-app .monitor-chip.ok, .monitor-app .monitor-badge.ok{color:var(--mon-ok)}.monitor-app .monitor-chip.warn, .monitor-app .monitor-badge.warn{color:var(--mon-warn)}.monitor-app .monitor-chip.err, .monitor-app .monitor-badge.err{color:var(--mon-err)}.monitor-app .monitor-stack{display:flex;flex-direction:column;gap:5px}.monitor-app .monitor-sub{font-size:.8rem;color:var(--mon-muted);line-height:1.42}.monitor-app .monitor-video{display:flex;flex-direction:column;gap:6px;min-width:220px}.monitor-app .monitor-video img{width:224px;height:154px;object-fit:cover;border-radius:12px;border:1px solid var(--mon-border);background:#020617}.monitor-app .monitor-video__fallback{width:224px;height:154px;border-radius:12px;border:1px dashed var(--mon-border);background:linear-gradient(160deg,#0b1628,#020617);color:#64748b;display:flex;align-items:center;justify-content:center;text-align:center;padding:12px;font-size:.8rem;font-weight:800}.monitor-app .monitor-video--dual{display:grid;grid-template-columns:1fr 1fr;gap:8px;min-width:460px}.monitor-app .monitor-video__side{display:flex;flex-direction:column;gap:6px}.monitor-app .monitor-video__side img{width:100%;max-width:220px;height:154px;object-fit:cover;border-radius:12px;border:1px solid var(--mon-border);background:#020617}.monitor-app .monitor-video__title{color:var(--mon-text)}.monitor-app .monitor-actions{display:grid;gap:8px;min-width:220px}.monitor-app .monitor-actions__group{display:grid;gap:4px}.monitor-app .monitor-actions__label{font-size:.66rem;text-transform:uppercase;letter-spacing:.08em;color:var(--mon-muted);font-weight:900}.monitor-app .monitor-actions__row{display:flex;gap:6px;flex-wrap:wrap}.monitor-app .monitor-status{min-height:34px;padding:8px 20px;display:flex;align-items:center;font-size:.84rem;color:var(--mon-muted)}.monitor-app .monitor-empty{padding:24px 20px;color:var(--mon-muted);font-weight:700}.monitor-app .monitor-battery{width:56px;height:8px;border-radius:999px;background:var(--mon-border);overflow:hidden}.monitor-app .monitor-battery>span{display:block;height:100%;border-radius:999px}.monitor-app .monitor-loading{display:grid;gap:12px;padding:20px}.monitor-app .monitor-skeleton{height:14px;border-radius:999px;background:linear-gradient(90deg,var(--mon-border),color-mix(in srgb,var(--mon-border) 65%,transparent),var(--mon-border));background-size:200% 100%;animation:monitor-shimmer 1.2s linear infinite}@keyframes monitor-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}@media (max-width:980px){
.monitor-app .monitor-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.monitor-app .monitor-head, .monitor-app .monitor-toolbar, .monitor-app .monitor-ribbon{padding:14px}.monitor-app{padding:10px 8px 20px}.monitor-app .monitor-summary{display:none}.monitor-app .monitor-input{min-width:170px}

}

/* Massive clean overrides */
.monitor-app{
  --mon-bg:#edf3f8;
  --mon-card:#ffffff;
  --mon-panel:#f6fafc;
  --mon-text:#111827;
  --mon-muted:#64748b;
  --mon-border:#dbe5f1;
  --mon-accent:#0f766e;
  --mon-accent-2:#0ea5a5;
  --mon-radius:14px;
  --mon-radius-sm:12px;
  --mon-shadow:0 8px 24px rgba(15,23,42,.07);
}html[data-theme="dark"] .monitor-app, body.dark .monitor-app, .theme-dark .monitor-app{
  --mon-bg:#0b1422;
  --mon-card:#111c2f;
  --mon-panel:#0f1a2d;
  --mon-text:#e2e8f0;
  --mon-muted:#9ca3af;
  --mon-border:rgba(255,255,255,.14);
  --mon-shadow:0 14px 34px rgba(2,6,23,.36);
}.monitor-app{
  font-family:"Manrope","DM Sans","Avenir Next","Segoe UI",sans-serif;
  background:linear-gradient(180deg,var(--mon-card),var(--mon-bg));
}.monitor-app .monitor-shell, .monitor-app .monitor-stat, .monitor-app .monitor-pill, .monitor-app .monitor-table th, .monitor-app .monitor-table td, .monitor-app .monitor-input, .monitor-app .monitor-select, .monitor-app .monitor-video img, .monitor-app .monitor-video__fallback, .monitor-app .btn{
  box-shadow:none;
}.monitor-app .monitor-shell{backdrop-filter:none}.monitor-app .monitor-stats, .monitor-app .monitor-ribbon, .monitor-app .monitor-table tbody tr:nth-child(even){background:var(--mon-panel)}.monitor-app .btn:hover, .monitor-app .monitor-table tbody tr:hover{transform:none}.monitor-app .btn{
  background:var(--mon-card);
  border:1px solid var(--mon-border);
  transition:background-color .18s ease,border-color .18s ease,color .18s ease;
}.monitor-app .btn.primary{background:linear-gradient(180deg,var(--mon-accent),var(--mon-accent-2))}.monitor-app .monitor-dot, .monitor-app .monitor-skeleton{animation:none}.monitor-app .monitor-video--dual{min-width:440px}

/* Massive visual pass (organized + clean + fluid) */
.monitor-app, .monitor-app *{
  font-family:"Manrope","DM Sans","Avenir Next","Segoe UI",sans-serif;
}.monitor-app{max-width:1560px;padding:12px 10px 22px}.monitor-app .monitor-shell{border-radius:16px}.monitor-app .monitor-head{padding:14px 16px;gap:12px}.monitor-app .monitor-head h1{font-size:1.08rem;letter-spacing:.01em}.monitor-app .monitor-head p{margin-top:4px;font-size:.84rem}.monitor-app .monitor-stats{gap:8px;padding:10px 14px}.monitor-app .monitor-stat{border-radius:12px;padding:10px 12px}.monitor-app .monitor-stat__value{font-size:1.2rem}.monitor-app .monitor-toolbar, .monitor-app .monitor-ribbon{padding:10px 14px}.monitor-app .monitor-input, .monitor-app .monitor-select{height:40px;border-radius:11px;font-size:.82rem}.monitor-app .btn{border-radius:11px;min-height:36px;padding:7px 11px}.monitor-app .btn.sm{min-height:30px;padding:5px 9px;border-radius:9px}.monitor-app .monitor-table{min-width:1120px}.monitor-app .monitor-table th{padding:9px 10px;font-size:.68rem}.monitor-app .monitor-table td{padding:10px}.monitor-app .monitor-actions{min-width:200px;gap:7px}.monitor-app .monitor-video{min-width:200px;gap:5px}.monitor-app .monitor-video img, .monitor-app .monitor-video__fallback{width:206px;height:142px;border-radius:10px}.monitor-app .monitor-video--dual{min-width:430px;gap:7px}.monitor-app .monitor-video__side img{max-width:206px;height:142px;border-radius:10px}.monitor-app .monitor-empty{padding:20px 16px;font-size:.9rem}.monitor-app .monitor-status{min-height:30px;padding:7px 14px;font-size:.82rem}

/* Third visual pass: precision polish */
.monitor-app .monitor-summary{gap:8px}.monitor-app .monitor-pill{min-height:32px;padding:6px 10px;font-size:.74rem}.monitor-app .monitor-actions__label{font-size:.64rem;letter-spacing:.07em}.monitor-app .monitor-actions__row{gap:5px}.monitor-app .monitor-device__name{font-size:.9rem}.monitor-app .monitor-device__email{font-size:.76rem}.monitor-app .monitor-sub{font-size:.76rem;line-height:1.36}.monitor-app .monitor-chip, .monitor-app .monitor-badge{padding:3px 7px;font-size:.7rem}.monitor-app .monitor-table-wrap{scrollbar-gutter:stable}.monitor-app .monitor-table th:first-child, .monitor-app .monitor-table td:first-child{position:sticky;left:0;background:var(--mon-card);z-index:1}.monitor-app .monitor-table th:first-child{z-index:3}@media (max-width: 1200px){
.monitor-app .monitor-table{min-width:980px}.monitor-app .monitor-video--dual{min-width:390px}.monitor-app .monitor-video img, .monitor-app .monitor-video__fallback{width:186px;height:130px}.monitor-app .monitor-video__side img{max-width:186px;height:130px}

}@media (max-width: 900px){
.monitor-app .monitor-head, .monitor-app .monitor-toolbar, .monitor-app .monitor-ribbon{padding:10px 12px}.monitor-app .monitor-stats{grid-template-columns:repeat(2,minmax(0,1fr));padding:10px 12px}.monitor-app .monitor-input{min-width:150px}

}@media (max-width: 680px){
.monitor-app .monitor-toolbar__left, .monitor-app .monitor-controls{width:100%}.monitor-app .monitor-controls .btn, .monitor-app .monitor-controls .monitor-select, .monitor-app .monitor-controls .monitor-input{width:100%}.monitor-app .monitor-table{min-width:780px}.monitor-app .monitor-video--dual{grid-template-columns:1fr;min-width:210px}.monitor-app .monitor-video, .monitor-app .monitor-actions{min-width:170px}

}

/* ===============================
   Reportes Module Unified
   =============================== */
/* ============================================================
   Reportes Module — source file
   Merged with: transform_css(css, "#mod-reportes")
   All selectors are prefixed with #mod-reportes by the script.
   ============================================================ */

/* ---- Root tokens ---- */
#mod-reportes{
  --rep-border: #dbe4f4;
  --rep-card:   #ffffff;
  --rep-text:   #1e293b;
  --rep-muted:  #64748b;
  --rep-ok:     #22c55e;
  --rep-danger: #ef4444;
  --rep-primary: #1473e6;
}

/* ---- Module wrapper ---- */
#mod-reportes{
  padding: 4px 0 24px;
}

/* ---- Header actions bar ---- */
#mod-reportes .header-actions{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}#mod-reportes .header-actions h2{
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--rep-text);
}

/* ---- Section titles ---- */
#mod-reportes .rep-section-title{
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--rep-text);
  letter-spacing: -.01em;
}

/* ---- Spacing / layout helpers ---- */
#mod-reportes .rep-mb-8{ margin-bottom: 8px;  }#mod-reportes .rep-mb-10{ margin-bottom: 10px; }#mod-reportes .rep-mb-12{ margin-bottom: 12px; }#mod-reportes .rep-row-between{ justify-content: space-between; }#mod-reportes .rep-row-end{ justify-content: flex-end; }#mod-reportes .rep-row-top{ align-items: flex-start; }#mod-reportes .rep-row-wrap{ flex-wrap: wrap; }

/* ---- Field layouts ---- */
#mod-reportes .rep-field-grow{
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .88rem;
  font-weight: 600;
  color: #475569;
}#mod-reportes .rep-field-grow input, #mod-reportes .rep-field-grow select, #mod-reportes .rep-field-grow textarea{
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--rep-border);
  border-radius: 10px;
  background: #f8fbff;
  color: var(--rep-text);
  font-family: inherit;
  font-size: .92rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}#mod-reportes .rep-field-grow input:focus, #mod-reportes .rep-field-grow select:focus, #mod-reportes .rep-field-grow textarea:focus{
  border-color: var(--rep-primary);
  box-shadow: 0 0 0 3px rgba(20, 115, 230, 0.14);
  background: #fff;
}#mod-reportes .rep-field-mid{
  width: 180px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .88rem;
  font-weight: 600;
  color: #475569;
}#mod-reportes .rep-field-mid input, #mod-reportes .rep-field-mid select{
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--rep-border);
  border-radius: 10px;
  background: #f8fbff;
  color: var(--rep-text);
  font-family: inherit;
  font-size: .92rem;
  outline: none;
  transition: border-color .2s;
}#mod-reportes .rep-field-mid input:focus, #mod-reportes .rep-field-mid select:focus{
  border-color: var(--rep-primary);
  box-shadow: 0 0 0 3px rgba(20, 115, 230, 0.14);
  background: #fff;
}#mod-reportes .rep-field-wide{
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .88rem;
  font-weight: 600;
  color: #475569;
}#mod-reportes .rep-field-wide textarea{
  width: 100%;
  min-height: 80px;
  padding: 9px 12px;
  border: 1.5px solid var(--rep-border);
  border-radius: 10px;
  background: #f8fbff;
  color: var(--rep-text);
  font-family: inherit;
  font-size: .92rem;
  outline: none;
  resize: vertical;
  transition: border-color .2s;
}#mod-reportes .rep-field-wide textarea:focus{
  border-color: var(--rep-primary);
  box-shadow: 0 0 0 3px rgba(20, 115, 230, 0.14);
  background: #fff;
}

/* ---- Multi-user toggle row ---- */
#mod-reportes .rep-toggle-row{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  cursor: pointer;
}#mod-reportes .rep-multi-wrap{
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}#mod-reportes .rep-multi-wrap select{
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--rep-border);
  border-radius: 10px;
  background: #f8fbff;
  font-family: inherit;
  font-size: .92rem;
  color: var(--rep-text);
  outline: none;
  transition: border-color .2s;
}#mod-reportes .rep-multi-wrap select:focus{
  border-color: var(--rep-primary);
  box-shadow: 0 0 0 3px rgba(20, 115, 230, 0.14);
}#mod-reportes .rep-multi-actions{
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---- Overdue banner ---- */
#mod-reportes .rep-row-between{
  justify-content: space-between;
}

/* ---- Info card ---- */
#mod-reportes .rep-info-card{
  padding: 16px 18px;
}

/* ---- No-response placeholder ---- */
#mod-reportes .rep-no-response{
  font-size: .9rem;
  text-align: center;
  padding: 20px;
  color: var(--rep-muted);
}

/* ---- Kanban Board ---- */
#mod-reportes .board{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}#mod-reportes .col{
  background: #f8fbff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  min-height: 100px;
}#mod-reportes .col h4{
  margin: 0 0 10px;
  font-size: .83rem;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}#mod-reportes .col-count{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  font-size: .70rem;
  font-weight: 700;
}

/* ---- Board cards ---- */
#mod-reportes .rep-board-card-main{
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 7px;
  cursor: pointer;
  transition: box-shadow .18s, border-color .18s;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}#mod-reportes .rep-board-card-main:hover{
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.10);
  border-color: #c0d0e8;
}#mod-reportes .rep-board-card-title{
  font-size: .88rem;
  font-weight: 600;
  color: var(--rep-text);
  line-height: 1.35;
}#mod-reportes .rep-board-card-side{
  flex-shrink: 0;
}

/* ---- Groups summary ---- */
#mod-reportes .rep-groups-shell{
  padding: 16px 18px;
  margin-top: 14px;
}#mod-reportes .rep-groups-title{
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--rep-text);
}#mod-reportes .rep-groups-container{
  display: grid;
  gap: 10px;
}

/* ---- Table wrapper ---- */
#mod-reportes .rep-table-wrap{
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-top: 14px;
  background: #fff;
}

/* ---- Table ---- */
#mod-reportes table.clean{
  width: 100%;
  border-collapse: collapse;
}#mod-reportes table.clean th{
  position: sticky;
  top: 0;
  background: #f8fbff;
  color: #334155;
  font-size: .79rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}#mod-reportes table.clean td{
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: .9rem;
  color: #334155;
}#mod-reportes table.clean tbody tr:hover{ background: #f8fbff; }

/* ---- Responsive ---- */
@media (max-width: 860px){
#mod-reportes .board{
    grid-template-columns: 1fr 1fr;
  }

}@media (max-width: 560px){
#mod-reportes .board{
    grid-template-columns: 1fr;
  }#mod-reportes .rep-field-mid{
    width: 100%;
  }

}

/* ===============================
   Monitor Rondas Unified
   =============================== */
/* ============================================================
   Monitor Rondas Module — source file
   Merged with: transform_css(css, "#monitorRondasModule")
   All selectors are prefixed by the merge script.
   ============================================================ */

/* ---- Root tokens ---- */
#monitorRondasModule{
  --r-border:   #dbe4f4;
  --r-card:     #ffffff;
  --r-text:     #1e293b;
  --r-muted:    #64748b;
  --r-primary:  #1473e6;
  --r-ok:       #22c55e;
  --r-danger:   #ef4444;
}

/* ---- Outer wrapper ---- */
#monitorRondasModule .wrap{
  max-width: 1400px;
  margin: 0 auto;
  padding: 4px 0 24px;
}

/* ---- Hero header ---- */
#monitorRondasModule .hero{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 22px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 55%, #1473e6 100%);
  color: #e2e8f0;
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.22);
}#monitorRondasModule .hero h1{
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #fff;
}#monitorRondasModule .hero p{
  margin: 0;
  font-size: .92rem;
  color: rgba(226, 232, 240, 0.80);
  max-width: 60ch;
  line-height: 1.55;
}#monitorRondasModule .hero .chips{
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-self: flex-start;
  margin-top: 4px;
}#monitorRondasModule .hero .chip{
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.10);
  color: rgba(226, 232, 240, 0.90);
  font-size: .80rem;
  font-weight: 700;
}

/* ---- Two-column grid ---- */
#monitorRondasModule .grid{
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 18px;
  align-items: start;
}

/* ---- Form inputs inside rondas ---- */
#monitorRondasModule .wrap input[type="text"], #monitorRondasModule .wrap input[type="number"], #monitorRondasModule .wrap input[type="datetime-local"], #monitorRondasModule .wrap select, #monitorRondasModule .wrap textarea{
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--r-border);
  border-radius: 10px;
  background: #f8fbff;
  color: var(--r-text);
  font-family: inherit;
  font-size: .92rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  margin-top: 4px;
}#monitorRondasModule .wrap input:focus, #monitorRondasModule .wrap select:focus, #monitorRondasModule .wrap textarea:focus{
  border-color: var(--r-primary);
  box-shadow: 0 0 0 3px rgba(20, 115, 230, 0.14);
  background: #fff;
}#monitorRondasModule .wrap textarea{ resize: vertical; min-height: 70px; }#monitorRondasModule .wrap label{
  display: block;
  font-size: .86rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 2px;
}

/* ---- Form layout helpers ---- */
#monitorRondasModule .rounds-form-row{
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 12px;
  margin-top: 12px;
}#monitorRondasModule .rounds-form-grow{ flex: 1; }#monitorRondasModule .rounds-form-side{ width: 160px; flex-shrink: 0; }#monitorRondasModule .rounds-block{
  margin-top: 14px;
}#monitorRondasModule .rounds-title-spaced{
  margin: 18px 0 10px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--r-text);
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

/* ---- Controls bar ---- */
#monitorRondasModule .controls{
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

/* ---- Message area ---- */
#monitorRondasModule .msg{
  font-size: .88rem;
  min-height: 22px;
  padding: 3px 0;
  color: var(--r-muted);
}#monitorRondasModule .msg.ok{ color: #16a34a; }#monitorRondasModule .msg.error{ color: #b91c1c; }

/* ---- Buttons ---- */
#monitorRondasModule .btn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, border-color .18s, filter .18s;
}#monitorRondasModule .btn:hover{ background: #f8fbff; border-color: rgba(148, 163, 184, 0.50); }#monitorRondasModule .btn.primary{
  background: linear-gradient(135deg, var(--r-primary), #2f6fb5);
  color: #fff;
  border-color: transparent;
}#monitorRondasModule .btn.primary:hover{ filter: brightness(1.07); }#monitorRondasModule .btn.ghost{
  background: transparent;
  border-color: rgba(148, 163, 184, 0.35);
  color: var(--r-muted);
}#monitorRondasModule .btn.ghost:hover{ background: rgba(148, 163, 184, 0.10); }

/* ---- Aside (rounds list panel) ---- */
#monitorRondasModule aside h3{
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--r-text);
}#monitorRondasModule .rounds-filter-row{
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}#monitorRondasModule .rounds-list{
  display: grid;
  gap: 8px;
}

/* ---- Round cards ---- */
#monitorRondasModule .round-card{
  background: #fff;
  border: 1px solid var(--r-border);
  border-radius: 12px;
  padding: 12px 14px;
  transition: box-shadow .18s, border-color .18s;
}#monitorRondasModule .round-card:hover{
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.10);
  border-color: #c0d0e8;
}#monitorRondasModule .rounds-card-main{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}#monitorRondasModule .rounds-card-title{
  font-size: .92rem;
  font-weight: 700;
  color: var(--r-text);
  line-height: 1.3;
}#monitorRondasModule .rounds-card-id{
  font-size: .76rem;
  color: var(--r-muted);
  font-weight: 400;
}#monitorRondasModule .rounds-card-points, #monitorRondasModule .rounds-card-assigned{
  font-size: .82rem;
  color: var(--r-muted);
  margin-bottom: 4px;
  line-height: 1.5;
}#monitorRondasModule .rounds-card-points strong, #monitorRondasModule .rounds-card-assigned strong{
  color: #475569;
  font-weight: 600;
}#monitorRondasModule .rounds-card-actions{
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

/* ---- Points list ---- */
#monitorRondasModule .points-list{
  display: grid;
  gap: 8px;
}#monitorRondasModule .p-item{
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  background: #f8fbff;
  border: 1px solid var(--r-border);
  border-radius: 10px;
  padding: 8px 10px;
}#monitorRondasModule .p-desc{
  flex: 1;
  min-width: 140px;
  padding: 7px 10px;
  border: 1.5px solid var(--r-border);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: .88rem;
  outline: none;
  transition: border-color .2s;
}#monitorRondasModule .p-desc:focus{ border-color: var(--r-primary); }#monitorRondasModule .rounds-input-120{
  width: 120px;
  flex-shrink: 0;
  padding: 7px 10px;
  border: 1.5px solid var(--r-border);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: .88rem;
  outline: none;
  transition: border-color .2s;
}#monitorRondasModule .rounds-input-110{
  width: 110px;
  flex-shrink: 0;
  padding: 7px 10px;
  border: 1.5px solid var(--r-border);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: .88rem;
  outline: none;
  transition: border-color .2s;
}#monitorRondasModule .rounds-input-120:focus, #monitorRondasModule .rounds-input-110:focus{ border-color: var(--r-primary); }

/* ---- Modal ---- */
#monitorRondasModule .modal-backdrop{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 1200;
}#monitorRondasModule .rounds-modal-hidden{ display: none !important; }#monitorRondasModule .modal-backdrop[aria-hidden="false"], #monitorRondasModule .modal-backdrop.open{
  display: flex;
}#monitorRondasModule .modal{
  width: min(680px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(203, 213, 225, 0.40);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
  padding: 20px;
}#monitorRondasModule .rounds-modal-pre{
  background: #f8fbff;
  border: 1px solid var(--r-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: .84rem;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}#monitorRondasModule .rounds-modal-actions{
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

/* ---- Responsive ---- */
@media (max-width: 900px){
#monitorRondasModule .grid{
    grid-template-columns: 1fr;
  }#monitorRondasModule .rounds-form-row{
    grid-template-columns: 1fr;
  }#monitorRondasModule .rounds-form-side{
    width: 100%;
  }

}
