/* AIDINET unified UI layer
   Este archivo centraliza el aspecto visual de los módulos: colores, tarjetas,
   cabeceras, tablas, formularios, botones y estados. */
:root{
  --aidinet-bg:#f8fafc;
  --aidinet-panel:#ffffff;
  --aidinet-panel-soft:#f1f5f9;
  --aidinet-text:#0f172a;
  --aidinet-muted:#64748b;
  --aidinet-border:#e2e8f0;
  --aidinet-brand:#f97316;
  --aidinet-brand-2:#fb923c;
  --aidinet-primary:#2563eb;
  --aidinet-success:#059669;
  --aidinet-danger:#dc2626;
  --aidinet-radius:16px;
  --aidinet-shadow:0 10px 30px rgba(15,23,42,.08);
}
.dark{
  --aidinet-bg:#0f172a;
  --aidinet-panel:#1e293b;
  --aidinet-panel-soft:#111827;
  --aidinet-text:#f8fafc;
  --aidinet-muted:#94a3b8;
  --aidinet-border:#334155;
  --aidinet-shadow:0 14px 40px rgba(0,0,0,.28);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  font-family:'Inter',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif!important;
  background:var(--aidinet-bg)!important;
  color:var(--aidinet-text)!important;
  -webkit-font-smoothing:antialiased;
}
a{transition:color .18s ease,background .18s ease,border-color .18s ease,transform .18s ease,box-shadow .18s ease}
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px}
.dark ::-webkit-scrollbar-thumb{background:#475569}
.aidinet-topbar,
body>header{
  background:#020617!important;
  border-bottom:1px solid #1e293b!important;
  box-shadow:0 8px 28px rgba(2,6,23,.28)!important;
}
.aidinet-logo{filter:drop-shadow(0 0 12px rgba(249,115,22,.28))}
.aidinet-page,
main{width:100%}
.aidinet-page-title,
h1{letter-spacing:-.025em}
.aidinet-card,
.module-card,
.glass,
body main .bg-white,
.dark body main .dark\:bg-slate-800{
  border-radius:var(--aidinet-radius)!important;
  border:1px solid var(--aidinet-border)!important;
  box-shadow:var(--aidinet-shadow);
}
.aidinet-card{background:var(--aidinet-panel)!important;color:var(--aidinet-text)!important}
.dark .aidinet-card{background:linear-gradient(145deg,rgba(30,41,59,.98),rgba(15,23,42,.98))!important}
.aidinet-soft{background:var(--aidinet-panel-soft)!important;border:1px solid var(--aidinet-border)!important}
.aidinet-table-wrap{background:var(--aidinet-panel)!important;border:1px solid var(--aidinet-border)!important;border-radius:18px!important;overflow:hidden;box-shadow:var(--aidinet-shadow)}
table{border-collapse:separate;border-spacing:0;width:100%}
thead{background:rgba(148,163,184,.10)!important}
th{font-size:11px!important;text-transform:uppercase;letter-spacing:.08em;color:var(--aidinet-muted)!important;font-weight:800!important}
td{vertical-align:middle}
tbody tr{transition:background .15s ease}
tbody tr:hover{background:rgba(249,115,22,.055)!important}
input,select,textarea{
  border-radius:12px!important;
  border:1px solid var(--aidinet-border)!important;
  background:var(--aidinet-panel)!important;
  color:var(--aidinet-text)!important;
  outline:none!important;
}
input:focus,select:focus,textarea:focus{border-color:var(--aidinet-brand)!important;box-shadow:0 0 0 4px rgba(249,115,22,.14)!important}
.aidinet-btn,
a[href$="nuevo.php"],
a[href*="nueva.php"],
button[type="submit"]{
  border-radius:12px!important;
  font-weight:800!important;
  letter-spacing:.02em;
}
.aidinet-btn-primary{background:linear-gradient(135deg,var(--aidinet-brand),var(--aidinet-brand-2))!important;color:#fff!important;box-shadow:0 12px 24px rgba(249,115,22,.22)!important}
.aidinet-btn-primary:hover{transform:translateY(-1px);box-shadow:0 16px 32px rgba(249,115,22,.28)!important}
.aidinet-badge{display:inline-flex;align-items:center;gap:.35rem;padding:.28rem .65rem;border-radius:999px;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;border:1px solid transparent}
.aidinet-badge-warning{background:rgba(245,158,11,.12);color:#b45309;border-color:rgba(245,158,11,.22)}
.aidinet-badge-success{background:rgba(16,185,129,.12);color:#047857;border-color:rgba(16,185,129,.22)}
.aidinet-badge-info{background:rgba(59,130,246,.12);color:#1d4ed8;border-color:rgba(59,130,246,.22)}
.aidinet-badge-danger{background:rgba(239,68,68,.12);color:#b91c1c;border-color:rgba(239,68,68,.22)}
.dark .aidinet-badge-warning{color:#fbbf24}.dark .aidinet-badge-success{color:#34d399}.dark .aidinet-badge-info{color:#60a5fa}.dark .aidinet-badge-danger{color:#f87171}
.aidinet-muted{color:var(--aidinet-muted)!important}
.row-hidden{display:none!important}
@media (max-width:768px){main{padding-left:1rem!important;padding-right:1rem!important} body>header>div{padding-left:1rem!important;padding-right:1rem!important}}

/* Tema claro/oscuro global y correcciones de consistencia */
html:not(.dark), html[data-theme="light"]{
  color-scheme:light;
}
html.dark, html[data-theme="dark"]{
  color-scheme:dark;
}
html:not(.dark) body{
  background:var(--aidinet-bg)!important;
  color:var(--aidinet-text)!important;
}
html.dark body{
  background:var(--aidinet-bg)!important;
  color:var(--aidinet-text)!important;
}
.aidinet-theme-floating{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:9999;
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  padding:.75rem .95rem;
  border-radius:999px;
  border:1px solid var(--aidinet-border);
  background:var(--aidinet-panel);
  color:var(--aidinet-text);
  box-shadow:var(--aidinet-shadow);
  font-weight:800;
  font-size:13px;
  cursor:pointer;
}
.aidinet-theme-floating:hover{transform:translateY(-1px)}
@media(max-width:640px){.aidinet-theme-floating{right:12px;bottom:12px;padding:.65rem}.aidinet-theme-floating span[data-aidinet-theme-label]{display:none}}
html:not(.dark) .bg-slate-900,
html:not(.dark) .bg-slate-950,
html:not(.dark) .dark\:bg-slate-900,
html:not(.dark) .dark\:bg-slate-950,
html:not(.dark) .dark\:bg-slate-800{
  background-color:var(--aidinet-panel)!important;
}
html:not(.dark) .text-slate-100,
html:not(.dark) .text-slate-200,
html:not(.dark) .dark\:text-slate-100,
html:not(.dark) .dark\:text-slate-200{
  color:var(--aidinet-text)!important;
}
html:not(.dark) .border-slate-700,
html:not(.dark) .border-slate-800,
html:not(.dark) .dark\:border-slate-700,
html:not(.dark) .dark\:border-slate-800{
  border-color:var(--aidinet-border)!important;
}
html:not(.dark) .aidinet-topbar,
html:not(.dark) body>header{
  background:#ffffff!important;
  border-bottom:1px solid var(--aidinet-border)!important;
  box-shadow:0 8px 28px rgba(15,23,42,.08)!important;
}
html:not(.dark) .aidinet-topbar a,
html:not(.dark) body>header a,
html:not(.dark) .aidinet-topbar h1,
html:not(.dark) body>header h1,
html:not(.dark) .aidinet-topbar .text-white,
html:not(.dark) body>header .text-white{
  color:#0f172a!important;
}
html:not(.dark) #theme-toggle{
  color:#334155!important;
  background:#f8fafc!important;
}
html.dark #theme-toggle{
  color:#e2e8f0!important;
}
.aidinet-action-button{transition:transform .18s ease, box-shadow .18s ease}
.aidinet-action-button:hover{transform:translateY(-1px)}

/* Selector de tema AIDINET corregido */
.aidinet-theme-toggle,
#theme-toggle.aidinet-theme-toggle,
.aidinet-theme-floating{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:.55rem!important;
  min-width:42px!important;
  min-height:42px!important;
  padding:.55rem .75rem!important;
  border-radius:999px!important;
  border:1px solid var(--aidinet-border)!important;
  background:var(--aidinet-panel)!important;
  color:var(--aidinet-text)!important;
  box-shadow:0 8px 22px rgba(15,23,42,.10)!important;
  cursor:pointer!important;
  line-height:1!important;
  transition:transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease!important;
}
.aidinet-theme-toggle:hover,
#theme-toggle.aidinet-theme-toggle:hover,
.aidinet-theme-floating:hover{
  transform:translateY(-1px)!important;
  box-shadow:0 12px 28px rgba(15,23,42,.16)!important;
}
html.dark .aidinet-theme-toggle,
html.dark #theme-toggle.aidinet-theme-toggle,
html.dark .aidinet-theme-floating{
  background:#1e293b!important;
  color:#fbbf24!important;
  border-color:#334155!important;
  box-shadow:0 10px 28px rgba(0,0,0,.26)!important;
}
html:not(.dark) .aidinet-theme-toggle,
html:not(.dark) #theme-toggle.aidinet-theme-toggle,
html:not(.dark) .aidinet-theme-floating{
  background:#ffffff!important;
  color:#334155!important;
  border-color:#e2e8f0!important;
}
.aidinet-theme-icon-wrap{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:22px!important;height:22px!important;flex:0 0 22px!important;}
.aidinet-theme-icon{width:22px!important;height:22px!important;display:block!important;}
.aidinet-theme-label{font-size:12px!important;font-weight:800!important;white-space:nowrap!important;}
.aidinet-theme-floating{position:fixed!important;right:18px!important;bottom:18px!important;z-index:9999!important;}
@media(max-width:640px){.aidinet-theme-floating{right:12px!important;bottom:12px!important;padding:.65rem!important}.aidinet-theme-floating .aidinet-theme-label{display:none!important}}

/* Fix definitivo modo claro/oscuro: se basa en data-theme, no solo en .dark */
html[data-theme="light"], html[data-theme="light"] body{background:#f8fafc!important;color:#0f172a!important;color-scheme:light!important;}
html[data-theme="dark"], html[data-theme="dark"] body{color-scheme:dark!important;}
html[data-theme="light"] .aidinet-topbar,
html[data-theme="light"] body>header,
html[data-theme="light"] header{background:#ffffff!important;color:#0f172a!important;border-color:#e2e8f0!important;box-shadow:0 8px 28px rgba(15,23,42,.08)!important;}
html[data-theme="light"] header a,
html[data-theme="light"] header h1,
html[data-theme="light"] header .text-white,
html[data-theme="light"] .aidinet-topbar a,
html[data-theme="light"] .aidinet-topbar h1,
html[data-theme="light"] .aidinet-topbar .text-white{color:#0f172a!important;}
html[data-theme="light"] .bg-\[\#020617\],
html[data-theme="light"] .bg-slate-950,
html[data-theme="light"] .bg-slate-900,
html[data-theme="light"] .bg-slate-800{background-color:#ffffff!important;}
html[data-theme="light"] .text-white,
html[data-theme="light"] .text-slate-100,
html[data-theme="light"] .text-slate-200{color:#0f172a!important;}
html[data-theme="light"] .text-slate-300,
html[data-theme="light"] .text-slate-400,
html[data-theme="light"] .text-slate-500{color:#64748b!important;}
html[data-theme="light"] .border-slate-800,
html[data-theme="light"] .border-slate-700{border-color:#e2e8f0!important;}

html[data-theme="light"] .aidinet-logo{
  filter: none !important;
}

/* Limpieza visual de botones y navegación - AIDINET */
.aidinet-nav-actions{
  display:flex!important;
  align-items:center!important;
  gap:.55rem!important;
  flex-wrap:wrap!important;
}
.aidinet-nav-pill{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:38px!important;
  padding:.55rem .95rem!important;
  border-radius:999px!important;
  border:1px solid var(--aidinet-border)!important;
  background:var(--aidinet-panel)!important;
  color:var(--aidinet-text)!important;
  font-size:13px!important;
  font-weight:800!important;
  line-height:1!important;
  box-shadow:0 6px 18px rgba(15,23,42,.06)!important;
  text-decoration:none!important;
}
.aidinet-nav-pill:hover{
  transform:translateY(-1px)!important;
  border-color:rgba(249,115,22,.45)!important;
  color:var(--aidinet-brand)!important;
  box-shadow:0 10px 24px rgba(15,23,42,.10)!important;
}
.aidinet-nav-pill-active{
  background:rgba(249,115,22,.10)!important;
  border-color:rgba(249,115,22,.35)!important;
  color:#ea580c!important;
}
html[data-theme="dark"] .aidinet-nav-pill,
html.dark .aidinet-nav-pill{
  background:#111827!important;
  border-color:#334155!important;
  color:#e5e7eb!important;
  box-shadow:0 10px 24px rgba(0,0,0,.18)!important;
}
html[data-theme="dark"] .aidinet-nav-pill:hover,
html.dark .aidinet-nav-pill:hover{
  color:#fed7aa!important;
  border-color:rgba(249,115,22,.48)!important;
}
html[data-theme="dark"] .aidinet-nav-pill-active,
html.dark .aidinet-nav-pill-active{
  background:rgba(249,115,22,.16)!important;
  color:#fdba74!important;
  border-color:rgba(249,115,22,.50)!important;
}
.aidinet-btn{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:.45rem!important;
  border-radius:12px!important;
  border:1px solid transparent!important;
  font-weight:800!important;
  line-height:1.1!important;
  text-decoration:none!important;
  cursor:pointer!important;
  transition:transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease!important;
}
.aidinet-btn-sm{min-height:34px!important;padding:.48rem .75rem!important;font-size:12px!important;}
.aidinet-btn-md{min-height:40px!important;padding:.62rem 1rem!important;font-size:13px!important;}
.aidinet-btn-primary{
  background:linear-gradient(135deg,#f97316,#fb923c)!important;
  color:#111827!important;
  border-color:rgba(249,115,22,.35)!important;
  box-shadow:0 10px 22px rgba(249,115,22,.18)!important;
}
.aidinet-btn-primary:hover{transform:translateY(-1px)!important;box-shadow:0 14px 30px rgba(249,115,22,.24)!important;}
.aidinet-btn-soft{
  background:rgba(100,116,139,.08)!important;
  color:var(--aidinet-text)!important;
  border-color:var(--aidinet-border)!important;
  box-shadow:0 8px 20px rgba(15,23,42,.05)!important;
}
.aidinet-btn-soft:hover{
  transform:translateY(-1px)!important;
  background:rgba(249,115,22,.08)!important;
  border-color:rgba(249,115,22,.32)!important;
  color:var(--aidinet-brand)!important;
}
html[data-theme="dark"] .aidinet-btn-soft,
html.dark .aidinet-btn-soft{
  background:rgba(15,23,42,.78)!important;
  color:#e5e7eb!important;
  border-color:#334155!important;
  box-shadow:0 10px 22px rgba(0,0,0,.18)!important;
}
html[data-theme="dark"] .aidinet-btn-primary,
html.dark .aidinet-btn-primary{
  color:#111827!important;
}
.aidinet-card-actions{
  display:flex!important;
  align-items:center!important;
  gap:.75rem!important;
  flex-wrap:wrap!important;
}
.aidinet-card-actions .aidinet-btn{flex:0 0 auto!important;}
.aidinet-line-remove{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:28px!important;
  height:28px!important;
  border-radius:999px!important;
  border:1px solid rgba(239,68,68,.22)!important;
  background:rgba(239,68,68,.08)!important;
  color:#dc2626!important;
  font-size:18px!important;
  font-weight:900!important;
  line-height:1!important;
}
.aidinet-line-remove:hover{background:rgba(239,68,68,.14)!important;transform:translateY(-1px)!important;}

/* Logo claro/oscuro: sin filtros que lo deformen */
html[data-theme="light"] img[src*="logo-aidinet"],
html:not(.dark) img[src*="logo-aidinet"]{
  filter:none!important;
  mix-blend-mode:normal!important;
  opacity:1!important;
}
html[data-theme="dark"] img[src*="logo-aidinet"],
html.dark img[src*="logo-aidinet"]{
  mix-blend-mode:normal!important;
  opacity:1!important;
}

/* FIX fuerte de logo AIDINET: el logo no debe heredar filtros ni sombras del modo oscuro */
img.aidinet-logo,
img[alt*="Aidinet"],
img[alt*="AIDINET"],
img[src*="logo-aidinet"]{
  filter:none!important;
  -webkit-filter:none!important;
  mix-blend-mode:normal!important;
  opacity:1!important;
  object-fit:contain!important;
  background:transparent!important;
  box-shadow:none!important;
}
html[data-theme="light"] img.aidinet-logo,
html[data-theme="light"] img[alt*="Aidinet"],
html[data-theme="light"] img[alt*="AIDINET"],
html[data-theme="light"] img[src*="logo-aidinet"]{
  filter:none!important;
  -webkit-filter:none!important;
  mix-blend-mode:normal!important;
  opacity:1!important;
  background:transparent!important;
  box-shadow:none!important;
}


/* ==========================================================
   AIDINET: banner superior siempre oscuro
   El modo claro solo afecta al contenido; la cabecera queda fija.
   ========================================================== */
.aidinet-topbar,
body > header,
header.aidinet-topbar{
  background:#020617!important;
  color:#f8fafc!important;
  border-bottom:1px solid #1e293b!important;
  box-shadow:0 8px 28px rgba(2,6,23,.28)!important;
}
.aidinet-topbar *,
body > header *,
header.aidinet-topbar *{
  border-color:rgba(148,163,184,.22);
}
.aidinet-topbar a,
body > header a,
header.aidinet-topbar a,
.aidinet-topbar h1,
body > header h1,
header.aidinet-topbar h1,
.aidinet-topbar .text-white,
body > header .text-white,
header.aidinet-topbar .text-white,
.aidinet-topbar .text-slate-100,
body > header .text-slate-100,
.aidinet-topbar .text-slate-200,
body > header .text-slate-200,
.aidinet-topbar .text-slate-300,
body > header .text-slate-300{
  color:#f8fafc!important;
}
.aidinet-topbar .text-slate-400,
body > header .text-slate-400,
.aidinet-topbar .text-slate-500,
body > header .text-slate-500{
  color:#cbd5e1!important;
}
.aidinet-topbar .bg-white,
body > header .bg-white,
.aidinet-topbar .bg-slate-50,
body > header .bg-slate-50,
.aidinet-topbar .bg-slate-100,
body > header .bg-slate-100{
  background-color:rgba(255,255,255,.08)!important;
}
.aidinet-topbar #theme-toggle,
body > header #theme-toggle,
.aidinet-topbar .aidinet-theme-toggle,
body > header .aidinet-theme-toggle{
  background:rgba(255,255,255,.08)!important;
  color:#f8fafc!important;
  border-color:rgba(148,163,184,.32)!important;
}
.aidinet-logo{
  filter:none!important;
  -webkit-filter:none!important;
  mix-blend-mode:normal!important;
  opacity:1!important;
}
html[data-theme="light"] .aidinet-topbar,
html[data-theme="light"] body > header,
html[data-theme="light"] header.aidinet-topbar,
html:not(.dark) .aidinet-topbar,
html:not(.dark) body > header{
  background:#020617!important;
  color:#f8fafc!important;
  border-bottom:1px solid #1e293b!important;
  box-shadow:0 8px 28px rgba(2,6,23,.28)!important;
}
html[data-theme="light"] .aidinet-topbar a,
html[data-theme="light"] body > header a,
html[data-theme="light"] .aidinet-topbar h1,
html[data-theme="light"] body > header h1,
html[data-theme="light"] .aidinet-topbar .text-white,
html[data-theme="light"] body > header .text-white,
html:not(.dark) .aidinet-topbar a,
html:not(.dark) body > header a,
html:not(.dark) .aidinet-topbar h1,
html:not(.dark) body > header h1,
html:not(.dark) .aidinet-topbar .text-white,
html:not(.dark) body > header .text-white{
  color:#f8fafc!important;
}

/* =========================================================
   AIDINET FIX GLOBAL 2026-06-08
   Banner superior siempre oscuro. El logo queda sin tocar.
   El modo claro/oscuro solo afecta al contenido.
   ========================================================= */
:root{
  --aidinet-bg:#f8fafc;
  --aidinet-panel:#ffffff;
  --aidinet-panel-soft:#f1f5f9;
  --aidinet-text:#0f172a;
  --aidinet-muted:#64748b;
  --aidinet-border:#e2e8f0;
  --aidinet-brand:#f97316;
  --aidinet-brand-hover:#ea580c;
  --aidinet-shadow:0 10px 30px rgba(15,23,42,.08);
}
html.dark, html[data-theme="dark"]{
  --aidinet-bg:#0f172a;
  --aidinet-panel:#1e293b;
  --aidinet-panel-soft:#111827;
  --aidinet-text:#f8fafc;
  --aidinet-muted:#94a3b8;
  --aidinet-border:#334155;
  --aidinet-shadow:0 14px 40px rgba(0,0,0,.28);
}
html[data-theme="light"] body,
html:not(.dark) body{background:#f8fafc!important;color:#0f172a!important;}
html[data-theme="dark"] body,
html.dark body{background:#0f172a!important;color:#f8fafc!important;}

/* Header/banner SIEMPRE oscuro, también en modo claro */
.aidinet-topbar,
body > header,
header,
.app-header,
.topbar,
.navbar,
.aidinet-header{
  background:#020617!important;
  background-image:none!important;
  color:#f8fafc!important;
  border-bottom:1px solid #1e293b!important;
  box-shadow:0 8px 28px rgba(2,6,23,.28)!important;
}
.aidinet-topbar *,
body > header *,
header.aidinet-topbar *,
.app-header *,
.topbar *,
.navbar *,
.aidinet-header *{
  border-color:rgba(148,163,184,.32);
}
.aidinet-topbar a,
body > header a,
header a,
.app-header a,
.topbar a,
.navbar a,
.aidinet-header a,
.aidinet-topbar h1,
body > header h1,
header h1,
.aidinet-topbar .text-white,
body > header .text-white,
header .text-white,
.aidinet-topbar .text-slate-100,
.aidinet-topbar .text-slate-200,
.aidinet-topbar .text-slate-300,
body > header .text-slate-100,
body > header .text-slate-200,
body > header .text-slate-300,
header .text-slate-100,
header .text-slate-200,
header .text-slate-300{
  color:#f8fafc!important;
}
.aidinet-topbar .text-slate-400,
.aidinet-topbar .text-slate-500,
body > header .text-slate-400,
body > header .text-slate-500,
header .text-slate-400,
header .text-slate-500{
  color:#cbd5e1!important;
}
.aidinet-logo,
header img,
body > header img{
  filter:none!important;
  -webkit-filter:none!important;
  mix-blend-mode:normal!important;
  opacity:1!important;
}

/* El botón de tema dentro del banner conserva estética oscura */
.aidinet-topbar #theme-toggle,
body > header #theme-toggle,
header #theme-toggle,
.aidinet-topbar .aidinet-theme-toggle,
body > header .aidinet-theme-toggle,
header .aidinet-theme-toggle{
  background:rgba(255,255,255,.08)!important;
  color:#f8fafc!important;
  border-color:rgba(148,163,184,.32)!important;
  box-shadow:none!important;
}
.aidinet-theme-toggle,
.aidinet-theme-floating{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:.5rem!important;
  min-height:40px!important;
  padding:.55rem .75rem!important;
  border-radius:999px!important;
  border:1px solid var(--aidinet-border)!important;
  background:var(--aidinet-panel)!important;
  color:var(--aidinet-text)!important;
  box-shadow:var(--aidinet-shadow)!important;
  font-weight:800!important;
  cursor:pointer!important;
}
.aidinet-theme-icon-wrap{display:inline-flex!important;width:21px!important;height:21px!important;align-items:center!important;justify-content:center!important;}
.aidinet-theme-icon{width:21px!important;height:21px!important;display:block!important;}
.aidinet-theme-label{font-size:12px!important;font-weight:800!important;white-space:nowrap!important;}
.aidinet-theme-floating{position:fixed!important;right:18px!important;bottom:18px!important;z-index:9999!important;}

/* Navegación y botones unificados: sin colores chillones */
.aidinet-nav-actions{display:flex!important;align-items:center!important;gap:.5rem!important;flex-wrap:wrap!important;}
.aidinet-nav-pill,
.aidinet-tab,
.aidinet-btn-soft{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  min-height:40px!important;padding:.55rem .9rem!important;border-radius:999px!important;
  background:rgba(255,255,255,.08)!important;color:#f8fafc!important;border:1px solid rgba(148,163,184,.22)!important;
  font-weight:800!important;text-decoration:none!important;box-shadow:none!important;
}
.aidinet-nav-pill:hover,.aidinet-tab:hover,.aidinet-btn-soft:hover{background:rgba(255,255,255,.13)!important;transform:translateY(-1px);}
.aidinet-nav-pill-active,.aidinet-tab-active{background:rgba(249,115,22,.18)!important;border-color:rgba(249,115,22,.45)!important;color:#fff!important;}
.aidinet-btn-primary,
button.aidinet-btn-primary,
a.aidinet-btn-primary{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  background:var(--aidinet-brand)!important;color:#fff!important;border:1px solid var(--aidinet-brand)!important;
  border-radius:12px!important;padding:.7rem 1rem!important;font-weight:900!important;box-shadow:0 10px 24px rgba(249,115,22,.18)!important;
}
.aidinet-btn-primary:hover{background:var(--aidinet-brand-hover)!important;border-color:var(--aidinet-brand-hover)!important;}
.aidinet-btn-table{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  min-height:32px!important;padding:.35rem .65rem!important;border-radius:10px!important;
  background:var(--aidinet-panel-soft)!important;color:var(--aidinet-text)!important;border:1px solid var(--aidinet-border)!important;
  font-size:12px!important;font-weight:800!important;box-shadow:none!important;text-decoration:none!important;
}
.aidinet-btn-table:hover{border-color:rgba(249,115,22,.45)!important;color:var(--aidinet-brand)!important;}

/* En modo claro, no conviertas el banner en blanco aunque haya reglas antiguas posteriores */
html:not(.dark) .aidinet-topbar,
html:not(.dark) body > header,
html:not(.dark) header,
html[data-theme="light"] .aidinet-topbar,
html[data-theme="light"] body > header,
html[data-theme="light"] header{
  background:#020617!important;
  color:#f8fafc!important;
  border-bottom-color:#1e293b!important;
}
html:not(.dark) .aidinet-topbar a,
html:not(.dark) body > header a,
html:not(.dark) header a,
html:not(.dark) .aidinet-topbar h1,
html:not(.dark) body > header h1,
html:not(.dark) header h1,
html[data-theme="light"] .aidinet-topbar a,
html[data-theme="light"] body > header a,
html[data-theme="light"] header a,
html[data-theme="light"] .aidinet-topbar h1,
html[data-theme="light"] body > header h1,
html[data-theme="light"] header h1{
  color:#f8fafc!important;
}

/* Normalización extra de botones antiguos con colores Tailwind dentro del contenido */
main .bg-blue-600,
main .hover\:bg-blue-700,
main .bg-emerald-600,
main .hover\:bg-emerald-700,
main .bg-green-600,
main .hover\:bg-green-700,
main .bg-sky-600,
main .hover\:bg-sky-700{
  background:var(--aidinet-panel-soft)!important;
  color:var(--aidinet-text)!important;
  border:1px solid var(--aidinet-border)!important;
  box-shadow:none!important;
}
main button[type="submit"].bg-blue-600,
main button[type="submit"].bg-emerald-600,
main button[type="submit"].bg-green-600,
main input[type="submit"],
main .aidinet-main-action{
  background:var(--aidinet-brand)!important;
  color:#fff!important;
  border-color:var(--aidinet-brand)!important;
  box-shadow:0 10px 24px rgba(249,115,22,.18)!important;
}
main button[type="submit"].bg-blue-600:hover,
main button[type="submit"].bg-emerald-600:hover,
main button[type="submit"].bg-green-600:hover{
  background:var(--aidinet-brand-hover)!important;
  border-color:var(--aidinet-brand-hover)!important;
}


/* Selector claro/oscuro como icono único tipo Apple */
#theme-toggle.aidinet-theme-toggle,
.aidinet-theme-toggle,
.aidinet-theme-floating{
  width:42px!important;
  min-width:42px!important;
  height:42px!important;
  min-height:42px!important;
  padding:0!important;
  gap:0!important;
  font-size:20px!important;
  line-height:1!important;
}
.aidinet-theme-emoji{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:24px!important;
  height:24px!important;
  font-size:20px!important;
  line-height:1!important;
}
.aidinet-theme-label,
#theme-toggle-text{
  display:none!important;
}

/* =========================================================
   AIDINET UI compartida definitiva
   Menú superior, tema y componentes comunes para todos los módulos.
   ========================================================= */
:root{
  --aidinet-font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --aidinet-topbar-height: 66px;
  --aidinet-orange: #F28F22;
  --aidinet-orange-soft: #fb923c;
  --aidinet-dark: #020617;
  --aidinet-dark-2: #0f172a;
  --aidinet-light: #f8fafc;
  --aidinet-card-bg: #ffffff;
  --aidinet-card-border: #e2e8f0;
  --aidinet-card-text: #0f172a;
  --aidinet-card-muted: #64748b;
}
html.dark{
  --aidinet-card-bg: #111827;
  --aidinet-card-border: #334155;
  --aidinet-card-text: #f8fafc;
  --aidinet-card-muted: #94a3b8;
}
body{font-family:var(--aidinet-font)!important;}
.aidinet-shared-topbar{
  position:sticky!important;top:0!important;z-index:9999!important;
  width:100%!important;height:var(--aidinet-topbar-height)!important;
  background:#020617!important;color:#fff!important;
  border-bottom:1px solid rgba(148,163,184,.22)!important;
  box-shadow:0 8px 28px rgba(2,6,23,.26)!important;
}
.aidinet-topbar-inner{
  max-width:1600px!important;margin:0 auto!important;height:100%!important;
  padding:0 24px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:20px!important;
}
.aidinet-topbar-left{display:flex!important;align-items:center!important;gap:18px!important;min-width:0!important;}
.aidinet-topbar-logo-link{display:flex!important;align-items:center!important;flex:0 0 auto!important;text-decoration:none!important;}
.aidinet-topbar-logo{height:34px!important;width:auto!important;display:block!important;filter:drop-shadow(0 0 10px rgba(242,143,34,.28))!important;}
.aidinet-topbar-separator{width:1px!important;height:28px!important;background:rgba(148,163,184,.35)!important;display:inline-block!important;}
.aidinet-topbar-back,.aidinet-topbar-current{
  color:#e5e7eb!important;text-decoration:none!important;font-size:14px!important;font-weight:750!important;white-space:nowrap!important;
}
.aidinet-topbar-back:hover{color:#fff!important;}
.aidinet-topbar-current{color:#fff!important;font-size:16px!important;overflow:hidden!important;text-overflow:ellipsis!important;}
.aidinet-topbar-actions{display:flex!important;align-items:center!important;gap:12px!important;flex:0 0 auto!important;}
.aidinet-topbar-action{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;height:38px!important;
  padding:0 14px!important;border-radius:11px!important;border:1px solid rgba(148,163,184,.28)!important;
  background:rgba(15,23,42,.50)!important;color:#e5e7eb!important;text-decoration:none!important;
  font-size:13px!important;font-weight:800!important;line-height:1!important;white-space:nowrap!important;
  transition:background .18s ease,border-color .18s ease,color .18s ease,transform .18s ease!important;
}
.aidinet-topbar-action:hover{background:rgba(242,143,34,.16)!important;border-color:rgba(242,143,34,.60)!important;color:#fff!important;transform:translateY(-1px)!important;}
.aidinet-topbar-logout{color:#fed7aa!important;}
.aidinet-topbar-user{display:inline-flex!important;align-items:center!important;gap:10px!important;color:#fff!important;}
.aidinet-topbar-avatar{width:36px!important;height:36px!important;border-radius:999px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;background:linear-gradient(135deg,#F28F22,#fb923c)!important;color:#111827!important;font-weight:900!important;font-size:12px!important;box-shadow:0 10px 24px rgba(242,143,34,.24)!important;}
.aidinet-topbar-user-text{display:flex!important;flex-direction:column!important;line-height:1.1!important;max-width:180px!important;}
.aidinet-topbar-user-text strong{font-size:13px!important;color:#fff!important;font-weight:850!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
.aidinet-topbar-user-text small{font-size:10px!important;color:#fb923c!important;font-weight:800!important;text-transform:uppercase!important;letter-spacing:.05em!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
/* Botón claro/oscuro: solo icono Apple emoji, sin fondo, sin borde y sin pastilla blanca */
#theme-toggle,
.aidinet-theme-toggle,
#theme-toggle.aidinet-theme-toggle,
.aidinet-theme-icon-button,
.aidinet-topbar #theme-toggle,
.aidinet-shared-topbar #theme-toggle{
  width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;
  padding:0!important;margin:0!important;border:0!important;border-radius:0!important;
  background:transparent!important;background-color:transparent!important;box-shadow:none!important;outline:none!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  color:inherit!important;font-size:21px!important;line-height:1!important;cursor:pointer!important;
  appearance:none!important;-webkit-appearance:none!important;
}
#theme-toggle:hover,.aidinet-theme-toggle:hover,.aidinet-theme-icon-button:hover{
  background:transparent!important;background-color:transparent!important;border:0!important;box-shadow:none!important;transform:scale(1.08)!important;
}
#theme-toggle:focus,.aidinet-theme-toggle:focus,.aidinet-theme-icon-button:focus{outline:none!important;box-shadow:none!important;}
#theme-toggle svg,.aidinet-theme-toggle svg,#theme-toggle [id*="icon"],#theme-toggle span:not(.aidinet-theme-emoji){display:none!important;}
.aidinet-theme-emoji{display:inline-block!important;line-height:1!important;font-size:21px!important;filter:none!important;}
html:not(.dark) .aidinet-shared-topbar{background:#020617!important;color:#fff!important;}
html:not(.dark) .aidinet-shared-topbar a,html:not(.dark) .aidinet-shared-topbar span,html:not(.dark) .aidinet-shared-topbar strong{color:inherit;}
.aidinet-card,.module-card{font-family:var(--aidinet-font)!important;}
input,select,textarea,button{font-family:var(--aidinet-font)!important;}
@media(max-width:900px){
  .aidinet-topbar-inner{padding:0 14px!important;gap:10px!important;}
  .aidinet-topbar-current{display:none!important;}
  .aidinet-topbar-user-text{display:none!important;}
  .aidinet-topbar-back{display:none!important;}
  .aidinet-topbar-actions{gap:8px!important;}
  .aidinet-topbar-action{height:36px!important;padding:0 10px!important;font-size:12px!important;}
}
@media(max-width:520px){
  .aidinet-topbar-separator,.aidinet-topbar-action:not(.aidinet-topbar-logout){display:none!important;}
  .aidinet-topbar-logo{height:30px!important;}
}

/* ==========================================================
   AIDINET Shared UI v2 - menú y tema únicos para todos módulos
   ========================================================== */
.aidinet-shared-topbar{
  position:sticky!important;
  top:0!important;
  z-index:9990!important;
  width:100%!important;
  min-height:66px!important;
  background:#020617!important;
  color:#ffffff!important;
  border-bottom:1px solid rgba(148,163,184,.22)!important;
  box-shadow:0 12px 34px rgba(2,6,23,.24)!important;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
}
.aidinet-topbar-inner{
  max-width:1700px!important;
  margin:0 auto!important;
  min-height:66px!important;
  padding:0 24px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:20px!important;
}
.aidinet-topbar-left,.aidinet-topbar-actions{display:flex!important;align-items:center!important;gap:12px!important;min-width:0!important}
.aidinet-topbar-actions{justify-content:flex-end!important;flex-wrap:wrap!important}
.aidinet-topbar-logo{height:34px!important;width:auto!important;display:block!important;max-width:170px!important;object-fit:contain!important}
.aidinet-topbar-logo-link{display:inline-flex!important;align-items:center!important;text-decoration:none!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important}
.aidinet-topbar-separator{display:inline-block!important;width:1px!important;height:28px!important;background:rgba(255,255,255,.16)!important}
.aidinet-topbar-back,.aidinet-topbar-current,.aidinet-topbar-action,.aidinet-topbar-user{font-family:inherit!important}
.aidinet-topbar-back{color:#cbd5e1!important;text-decoration:none!important;font-size:14px!important;font-weight:800!important;white-space:nowrap!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important}
.aidinet-topbar-back:hover{color:#fb923c!important}
.aidinet-topbar-current{color:#ffffff!important;font-size:15px!important;font-weight:950!important;letter-spacing:.02em!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:360px!important}
.aidinet-topbar-action{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-height:38px!important;padding:0 14px!important;border-radius:999px!important;text-decoration:none!important;background:rgba(15,23,42,.72)!important;border:1px solid rgba(148,163,184,.26)!important;color:#f8fafc!important;font-size:13px!important;font-weight:900!important;box-shadow:none!important;line-height:1!important;white-space:nowrap!important;transition:background .16s ease,color .16s ease,border-color .16s ease,transform .16s ease!important}
.aidinet-topbar-action:hover{background:#f97316!important;border-color:#fb923c!important;color:#111827!important;transform:translateY(-1px)!important}
.aidinet-topbar-logout{background:rgba(127,29,29,.72)!important;border-color:rgba(248,113,113,.28)!important;color:#fee2e2!important}
.aidinet-topbar-logout:hover{background:#ef4444!important;color:#ffffff!important;border-color:#ef4444!important}
.aidinet-topbar-user{display:inline-flex!important;align-items:center!important;gap:9px!important;color:#e2e8f0!important;min-height:38px!important;padding:0 4px 0 0!important;background:transparent!important;border:0!important;box-shadow:none!important;white-space:nowrap!important}
.aidinet-topbar-avatar{width:34px!important;height:34px!important;border-radius:999px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;background:linear-gradient(135deg,#f97316,#fb923c)!important;color:#111827!important;font-weight:950!important;font-size:12px!important;letter-spacing:.02em!important;box-shadow:0 8px 20px rgba(249,115,22,.24)!important}
.aidinet-topbar-user-text{display:flex!important;flex-direction:column!important;line-height:1.05!important;min-width:0!important}
.aidinet-topbar-user-text strong{font-size:13px!important;color:#f8fafc!important;font-weight:950!important;max-width:160px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.aidinet-topbar-user-text small{font-size:10px!important;color:#94a3b8!important;font-weight:800!important;text-transform:uppercase!important;letter-spacing:.04em!important;margin-top:3px!important}

/* Icono claro/oscuro: solo emoji Apple/OS, sin fondo, sin borde, sin halo blanco */
.aidinet-theme-toggle,
#theme-toggle.aidinet-theme-toggle,
button[data-aidinet-theme-toggle="1"]{
  appearance:none!important;
  -webkit-appearance:none!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  min-height:38px!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  outline:0!important;
  border-radius:999px!important;
  background:transparent!important;
  color:inherit!important;
  box-shadow:none!important;
  cursor:pointer!important;
  line-height:1!important;
  overflow:visible!important;
}
.aidinet-theme-toggle:hover,
#theme-toggle.aidinet-theme-toggle:hover,
button[data-aidinet-theme-toggle="1"]:hover{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  transform:scale(1.08)!important;
}
.aidinet-theme-toggle:focus,
#theme-toggle.aidinet-theme-toggle:focus,
button[data-aidinet-theme-toggle="1"]:focus{
  outline:0!important;
  box-shadow:none!important;
}
.aidinet-theme-emoji{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:30px!important;
  height:30px!important;
  font-size:22px!important;
  line-height:1!important;
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",system-ui,sans-serif!important;
  color:initial!important;
  text-shadow:none!important;
  filter:none!important;
  opacity:1!important;
}
html.dark .aidinet-theme-toggle,
html.dark #theme-toggle.aidinet-theme-toggle,
html.dark button[data-aidinet-theme-toggle="1"],
html:not(.dark) .aidinet-theme-toggle,
html:not(.dark) #theme-toggle.aidinet-theme-toggle,
html:not(.dark) button[data-aidinet-theme-toggle="1"]{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  color:inherit!important;
}
html:not(.dark) .aidinet-shared-topbar{background:#ffffff!important;color:#0f172a!important;border-bottom:1px solid #e2e8f0!important;box-shadow:0 10px 30px rgba(15,23,42,.08)!important}
html:not(.dark) .aidinet-topbar-separator{background:#e2e8f0!important}
html:not(.dark) .aidinet-topbar-back{color:#334155!important}
html:not(.dark) .aidinet-topbar-current{color:#0f172a!important}
html:not(.dark) .aidinet-topbar-action{background:#f8fafc!important;border-color:#e2e8f0!important;color:#0f172a!important}
html:not(.dark) .aidinet-topbar-action:hover{background:#f97316!important;border-color:#fb923c!important;color:#111827!important}
html:not(.dark) .aidinet-topbar-logout{background:#fff1f2!important;border-color:#fecdd3!important;color:#be123c!important}
html:not(.dark) .aidinet-topbar-logout:hover{background:#ef4444!important;border-color:#ef4444!important;color:#ffffff!important}
html:not(.dark) .aidinet-topbar-user-text strong{color:#0f172a!important}
html:not(.dark) .aidinet-topbar-user-text small{color:#64748b!important}
@media(max-width:850px){
  .aidinet-topbar-inner{height:auto!important;min-height:66px!important;padding:12px 16px!important;align-items:flex-start!important;flex-direction:column!important;gap:10px!important}
  .aidinet-topbar-left,.aidinet-topbar-actions{width:100%!important;justify-content:flex-start!important;flex-wrap:wrap!important}
  .aidinet-topbar-current{max-width:100%!important}
  .aidinet-topbar-user-text{display:none!important}
}

/* ==========================================================
   AIDINET UI v3 - Botones estables entre modo claro y oscuro
   El tema puede cambiar fondos de página/tarjetas, pero los botones
   de navegación y acción mantienen SIEMPRE los mismos colores.
   ========================================================== */
:root,
html.dark,
html[data-theme="dark"],
html[data-theme="light"]{
  --aidinet-button-bg:#0f172a;
  --aidinet-button-bg-hover:#f97316;
  --aidinet-button-text:#f8fafc;
  --aidinet-button-text-hover:#111827;
  --aidinet-button-border:rgba(148,163,184,.28);
  --aidinet-button-danger-bg:rgba(127,29,29,.72);
  --aidinet-button-danger-hover:#ef4444;
  --aidinet-button-soft-bg:#f8fafc;
  --aidinet-button-soft-text:#0f172a;
  --aidinet-button-soft-border:#e2e8f0;
}

/* El menú superior queda SIEMPRE oscuro y sus botones no cambian con el tema */
html:not(.dark) .aidinet-shared-topbar,
html.dark .aidinet-shared-topbar,
html[data-theme="light"] .aidinet-shared-topbar,
html[data-theme="dark"] .aidinet-shared-topbar,
.aidinet-shared-topbar,
.aidinet-topbar{
  background:#020617!important;
  color:#ffffff!important;
  border-bottom:1px solid rgba(148,163,184,.22)!important;
  box-shadow:0 12px 34px rgba(2,6,23,.24)!important;
}
html:not(.dark) .aidinet-shared-topbar a,
html:not(.dark) .aidinet-shared-topbar span,
html:not(.dark) .aidinet-shared-topbar strong,
html[data-theme="light"] .aidinet-shared-topbar a,
html[data-theme="light"] .aidinet-shared-topbar span,
html[data-theme="light"] .aidinet-shared-topbar strong,
.aidinet-shared-topbar a,
.aidinet-shared-topbar span,
.aidinet-shared-topbar strong{
  color:inherit!important;
}
html:not(.dark) .aidinet-topbar-separator,
html.dark .aidinet-topbar-separator,
html[data-theme="light"] .aidinet-topbar-separator,
html[data-theme="dark"] .aidinet-topbar-separator,
.aidinet-topbar-separator{
  background:rgba(255,255,255,.16)!important;
}
html:not(.dark) .aidinet-topbar-back,
html.dark .aidinet-topbar-back,
html[data-theme="light"] .aidinet-topbar-back,
html[data-theme="dark"] .aidinet-topbar-back,
.aidinet-topbar-back{
  color:#cbd5e1!important;
}
html:not(.dark) .aidinet-topbar-current,
html.dark .aidinet-topbar-current,
html[data-theme="light"] .aidinet-topbar-current,
html[data-theme="dark"] .aidinet-topbar-current,
.aidinet-topbar-current{
  color:#ffffff!important;
}
html:not(.dark) .aidinet-topbar-user-text strong,
html.dark .aidinet-topbar-user-text strong,
html[data-theme="light"] .aidinet-topbar-user-text strong,
html[data-theme="dark"] .aidinet-topbar-user-text strong,
.aidinet-topbar-user-text strong{
  color:#f8fafc!important;
}
html:not(.dark) .aidinet-topbar-user-text small,
html.dark .aidinet-topbar-user-text small,
html[data-theme="light"] .aidinet-topbar-user-text small,
html[data-theme="dark"] .aidinet-topbar-user-text small,
.aidinet-topbar-user-text small{
  color:#94a3b8!important;
}

/* Botones del menú superior: mismo color siempre */
html:not(.dark) .aidinet-topbar-action,
html.dark .aidinet-topbar-action,
html[data-theme="light"] .aidinet-topbar-action,
html[data-theme="dark"] .aidinet-topbar-action,
.aidinet-topbar-action{
  background:var(--aidinet-button-bg)!important;
  border:1px solid var(--aidinet-button-border)!important;
  color:var(--aidinet-button-text)!important;
  box-shadow:none!important;
}
html:not(.dark) .aidinet-topbar-action:hover,
html.dark .aidinet-topbar-action:hover,
html[data-theme="light"] .aidinet-topbar-action:hover,
html[data-theme="dark"] .aidinet-topbar-action:hover,
.aidinet-topbar-action:hover{
  background:var(--aidinet-button-bg-hover)!important;
  border-color:#fb923c!important;
  color:var(--aidinet-button-text-hover)!important;
}
html:not(.dark) .aidinet-topbar-logout,
html.dark .aidinet-topbar-logout,
html[data-theme="light"] .aidinet-topbar-logout,
html[data-theme="dark"] .aidinet-topbar-logout,
.aidinet-topbar-logout{
  background:var(--aidinet-button-danger-bg)!important;
  border-color:rgba(248,113,113,.28)!important;
  color:#fee2e2!important;
}
html:not(.dark) .aidinet-topbar-logout:hover,
html.dark .aidinet-topbar-logout:hover,
html[data-theme="light"] .aidinet-topbar-logout:hover,
html[data-theme="dark"] .aidinet-topbar-logout:hover,
.aidinet-topbar-logout:hover{
  background:var(--aidinet-button-danger-hover)!important;
  border-color:var(--aidinet-button-danger-hover)!important;
  color:#ffffff!important;
}

/* Botones generales AIDINET: colores estables */
html:not(.dark) .aidinet-btn-primary,
html.dark .aidinet-btn-primary,
html[data-theme="light"] .aidinet-btn-primary,
html[data-theme="dark"] .aidinet-btn-primary,
.aidinet-btn-primary,
button.aidinet-btn-primary,
a.aidinet-btn-primary,
main button[type="submit"].aidinet-btn-primary,
main .aidinet-main-action{
  background:#f97316!important;
  color:#ffffff!important;
  border-color:#f97316!important;
  box-shadow:0 10px 24px rgba(249,115,22,.18)!important;
}
html:not(.dark) .aidinet-btn-primary:hover,
html.dark .aidinet-btn-primary:hover,
html[data-theme="light"] .aidinet-btn-primary:hover,
html[data-theme="dark"] .aidinet-btn-primary:hover,
.aidinet-btn-primary:hover{
  background:#ea580c!important;
  border-color:#ea580c!important;
  color:#ffffff!important;
}
html:not(.dark) .aidinet-btn-soft,
html.dark .aidinet-btn-soft,
html[data-theme="light"] .aidinet-btn-soft,
html[data-theme="dark"] .aidinet-btn-soft,
.aidinet-btn-soft,
.aidinet-btn-table{
  background:var(--aidinet-button-soft-bg)!important;
  color:var(--aidinet-button-soft-text)!important;
  border-color:var(--aidinet-button-soft-border)!important;
  box-shadow:0 8px 20px rgba(15,23,42,.05)!important;
}
html:not(.dark) .aidinet-btn-soft:hover,
html.dark .aidinet-btn-soft:hover,
html[data-theme="light"] .aidinet-btn-soft:hover,
html[data-theme="dark"] .aidinet-btn-soft:hover,
.aidinet-btn-soft:hover,
.aidinet-btn-table:hover{
  background:#fff7ed!important;
  color:#ea580c!important;
  border-color:rgba(249,115,22,.38)!important;
}

/* Icono claro/oscuro: solo emoji, siempre visible, sin fondo ni borde */
.aidinet-theme-toggle,
#theme-toggle.aidinet-theme-toggle,
button[data-aidinet-theme-toggle="1"],
html:not(.dark) .aidinet-theme-toggle,
html.dark .aidinet-theme-toggle,
html[data-theme="light"] .aidinet-theme-toggle,
html[data-theme="dark"] .aidinet-theme-toggle{
  background:transparent!important;
  background-color:transparent!important;
  border:0!important;
  box-shadow:none!important;
  outline:0!important;
  color:inherit!important;
  width:38px!important;
  min-width:38px!important;
  height:38px!important;
  min-height:38px!important;
  padding:0!important;
  overflow:visible!important;
}
.aidinet-theme-toggle:hover,
#theme-toggle.aidinet-theme-toggle:hover,
button[data-aidinet-theme-toggle="1"]:hover{
  background:transparent!important;
  background-color:transparent!important;
  border:0!important;
  box-shadow:none!important;
  transform:scale(1.08)!important;
}
.aidinet-theme-emoji{
  font-size:0!important;
  width:30px!important;
  height:30px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
  filter:none!important;
  text-shadow:none!important;
  opacity:1!important;
}
.aidinet-theme-emoji::before{
  content:"🌙";
  font-size:22px!important;
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",system-ui,sans-serif!important;
  line-height:1!important;
}
html.dark .aidinet-theme-emoji::before,
html[data-theme="dark"] .aidinet-theme-emoji::before{
  content:"☀️";
}

/* ==========================================================
   AIDINET UI v4 - fix definitivo del cambio claro/oscuro
   ========================================================== */
:root,
html[data-theme="light"]{
  --aidinet-bg:#f8fafc;
  --aidinet-panel:#ffffff;
  --aidinet-panel-soft:#f1f5f9;
  --aidinet-text:#0f172a;
  --aidinet-muted:#64748b;
  --aidinet-border:#e2e8f0;
}
html.dark,
html[data-theme="dark"]{
  --aidinet-bg:#0f172a;
  --aidinet-panel:#111827;
  --aidinet-panel-soft:#1e293b;
  --aidinet-text:#f8fafc;
  --aidinet-muted:#94a3b8;
  --aidinet-border:#334155;
}
html[data-theme="light"] body,
body[data-theme="light"]{
  background:#f8fafc!important;
  color:#0f172a!important;
  color-scheme:light!important;
}
html[data-theme="dark"] body,
html.dark body,
body[data-theme="dark"]{
  background:#0f172a!important;
  color:#f8fafc!important;
  color-scheme:dark!important;
}
html[data-theme="light"] main,
html[data-theme="light"] .aidinet-page{background:transparent!important;color:#0f172a!important;}
html[data-theme="dark"] main,
html[data-theme="dark"] .aidinet-page{background:transparent!important;color:#f8fafc!important;}
html[data-theme="light"] .aidinet-card,
html[data-theme="light"] .module-card,
html[data-theme="light"] .glass,
html[data-theme="light"] main .bg-white{
  background:#ffffff!important;
  color:#0f172a!important;
  border-color:#e2e8f0!important;
}
html[data-theme="dark"] .aidinet-card,
html[data-theme="dark"] .module-card,
html[data-theme="dark"] .glass,
html[data-theme="dark"] main .bg-white,
html[data-theme="dark"] main .dark\:bg-slate-800,
html[data-theme="dark"] main .dark\:bg-slate-900{
  background:#111827!important;
  color:#f8fafc!important;
  border-color:#334155!important;
}
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea{
  background:#ffffff!important;
  color:#0f172a!important;
  border-color:#e2e8f0!important;
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
  background:#0f172a!important;
  color:#f8fafc!important;
  border-color:#334155!important;
}
/* El menú superior y sus botones mantienen siempre el mismo color */
html[data-theme="light"] .aidinet-shared-topbar,
html[data-theme="dark"] .aidinet-shared-topbar,
.aidinet-shared-topbar{
  background:#020617!important;
  color:#ffffff!important;
  border-bottom-color:rgba(148,163,184,.22)!important;
}
html[data-theme="light"] .aidinet-topbar-action,
html[data-theme="dark"] .aidinet-topbar-action,
.aidinet-topbar-action{
  background:#0f172a!important;
  color:#f8fafc!important;
  border-color:rgba(148,163,184,.28)!important;
}
html[data-theme="light"] .aidinet-topbar-action:hover,
html[data-theme="dark"] .aidinet-topbar-action:hover,
.aidinet-topbar-action:hover{
  background:#f97316!important;
  color:#111827!important;
  border-color:#fb923c!important;
}
html[data-theme="light"] .aidinet-topbar-logout,
html[data-theme="dark"] .aidinet-topbar-logout,
.aidinet-topbar-logout{
  background:rgba(127,29,29,.72)!important;
  color:#fee2e2!important;
  border-color:rgba(248,113,113,.28)!important;
}
html[data-theme="light"] .aidinet-topbar-logout:hover,
html[data-theme="dark"] .aidinet-topbar-logout:hover,
.aidinet-topbar-logout:hover{
  background:#ef4444!important;
  color:#ffffff!important;
  border-color:#ef4444!important;
}
/* Icono del tema: sin borde/fondo. El contenido lo pone JS para evitar dobles cambios. */
#theme-toggle,
#themeToggle,
#toggle-theme,
.aidinet-theme-toggle,
button[data-aidinet-theme-toggle="1"]{
  appearance:none!important;
  -webkit-appearance:none!important;
  width:38px!important;
  min-width:38px!important;
  height:38px!important;
  min-height:38px!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  outline:0!important;
  border-radius:0!important;
  background:transparent!important;
  background-color:transparent!important;
  box-shadow:none!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  cursor:pointer!important;
  line-height:1!important;
}
#theme-toggle:hover,
#themeToggle:hover,
#toggle-theme:hover,
.aidinet-theme-toggle:hover,
button[data-aidinet-theme-toggle="1"]:hover{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  transform:scale(1.08)!important;
}
.aidinet-theme-emoji{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:30px!important;
  height:30px!important;
  font-size:22px!important;
  line-height:1!important;
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",system-ui,sans-serif!important;
  color:initial!important;
  text-shadow:none!important;
  filter:none!important;
  opacity:1!important;
}
.aidinet-theme-emoji::before{content:none!important;}
#theme-toggle svg,
#themeToggle svg,
#toggle-theme svg,
.aidinet-theme-toggle svg,
#theme-toggle-dark-icon,
#theme-toggle-light-icon,
#theme-toggle-label,
#theme-toggle-text{
  display:none!important;
}

/* ===== AIDINET UI COMÚN v7: topbar y tema obligatorios en módulos y subsecciones ===== */
html[data-theme="light"], html.light{ color-scheme:light!important; }
html[data-theme="dark"], html.dark{ color-scheme:dark!important; }

/* El menú común siempre conserva el mismo aspecto, sin depender del tema ni del CSS del módulo. */
.aidinet-shared-topbar,
header[data-aidinet-shared-topbar="1"],
body > header[data-aidinet-shared-topbar="1"]{
  position:sticky!important;
  top:0!important;
  z-index:9990!important;
  width:100%!important;
  background:#020617!important;
  color:#ffffff!important;
  border-bottom:1px solid rgba(148,163,184,.22)!important;
  box-shadow:0 8px 24px rgba(2,6,23,.24)!important;
  font-family:'Inter',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif!important;
}
.aidinet-topbar-inner{
  max-width:1480px!important;
  margin:0 auto!important;
  padding:.78rem 1.25rem!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:1rem!important;
}
.aidinet-topbar-left,.aidinet-topbar-actions{display:flex!important;align-items:center!important;gap:.75rem!important;flex-wrap:wrap!important;}
.aidinet-topbar-logo{height:34px!important;width:auto!important;display:block!important;max-width:none!important;}
.aidinet-topbar-separator{width:1px!important;height:26px!important;background:rgba(148,163,184,.35)!important;display:inline-block!important;}
.aidinet-topbar-current{color:#f8fafc!important;font-weight:900!important;letter-spacing:-.01em!important;}
.aidinet-topbar-back{color:#cbd5e1!important;text-decoration:none!important;font-weight:800!important;font-size:.9rem!important;}
.aidinet-topbar-back:hover{color:#fb923c!important;}
.aidinet-topbar-action{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:.45rem!important;
  min-height:36px!important;padding:.5rem .85rem!important;border-radius:10px!important;
  background:#0f172a!important;color:#f8fafc!important;border:1px solid rgba(148,163,184,.28)!important;
  text-decoration:none!important;font-weight:850!important;font-size:.875rem!important;line-height:1!important;
  box-shadow:none!important;white-space:nowrap!important;
}
.aidinet-topbar-action:hover{background:#f97316!important;color:#111827!important;border-color:#fb923c!important;}
.aidinet-topbar-logout{background:rgba(127,29,29,.72)!important;color:#fee2e2!important;border-color:rgba(248,113,113,.28)!important;}
.aidinet-topbar-logout:hover{background:#ef4444!important;color:#fff!important;border-color:#ef4444!important;}
.aidinet-topbar-user{display:inline-flex!important;align-items:center!important;gap:.55rem!important;color:#f8fafc!important;}
.aidinet-topbar-avatar{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:34px!important;height:34px!important;border-radius:999px!important;background:#f97316!important;color:#111827!important;font-weight:900!important;font-size:.78rem!important;}
.aidinet-topbar-user-text{display:flex!important;flex-direction:column!important;line-height:1.1!important;}
.aidinet-topbar-user-text strong{font-size:.84rem!important;color:#fff!important;}
.aidinet-topbar-user-text small{font-size:.72rem!important;color:#94a3b8!important;}

/* Icono de tema: solo emoji Apple/según sistema, sin caja, borde ni fondo. */
#theme-toggle,
#themeToggle,
#toggle-theme,
.aidinet-theme-toggle,
button[data-aidinet-theme-toggle="1"]{
  appearance:none!important;-webkit-appearance:none!important;
  width:38px!important;min-width:38px!important;height:38px!important;min-height:38px!important;
  padding:0!important;margin:0!important;border:0!important;outline:0!important;border-radius:0!important;
  background:transparent!important;background-color:transparent!important;box-shadow:none!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;cursor:pointer!important;line-height:1!important;
}
#theme-toggle:hover,#themeToggle:hover,#toggle-theme:hover,.aidinet-theme-toggle:hover,button[data-aidinet-theme-toggle="1"]:hover{
  background:transparent!important;border:0!important;box-shadow:none!important;transform:scale(1.08)!important;
}
.aidinet-theme-emoji{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:30px!important;height:30px!important;font-size:22px!important;line-height:1!important;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",system-ui,sans-serif!important;color:initial!important;text-shadow:none!important;filter:none!important;opacity:1!important;}
#theme-toggle svg,#themeToggle svg,#toggle-theme svg,.aidinet-theme-toggle svg,#theme-toggle-dark-icon,#theme-toggle-light-icon,#theme-toggle-label,#theme-toggle-text{display:none!important;}

/* Agenda nueva */
.aidinet-agenda-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:1px;background:var(--aidinet-border);border:1px solid var(--aidinet-border);border-radius:18px;overflow:hidden;box-shadow:var(--aidinet-shadow)}
.aidinet-agenda-head,.aidinet-agenda-day{background:var(--aidinet-panel);padding:.75rem;min-height:112px;color:var(--aidinet-text)}
.aidinet-agenda-head{min-height:auto;text-align:center;font-size:.78rem;font-weight:900;text-transform:uppercase;letter-spacing:.06em;color:var(--aidinet-muted);background:var(--aidinet-panel-soft)}
.aidinet-agenda-day.is-muted{opacity:.42}.aidinet-agenda-day.is-today{outline:2px solid var(--aidinet-brand);outline-offset:-2px}.aidinet-agenda-number{font-weight:900;margin-bottom:.45rem}.aidinet-agenda-event{display:block;margin:.25rem 0;padding:.32rem .45rem;border-radius:9px;background:rgba(249,115,22,.13);border:1px solid rgba(249,115,22,.22);color:var(--aidinet-text);font-size:.75rem;font-weight:800;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.aidinet-agenda-panel{background:var(--aidinet-panel);border:1px solid var(--aidinet-border);border-radius:18px;box-shadow:var(--aidinet-shadow);padding:1.25rem}.aidinet-agenda-toolbar{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:1.25rem}.aidinet-agenda-toolbar a,.aidinet-agenda-toolbar button,.aidinet-agenda-btn{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:38px;padding:.55rem .9rem;border-radius:11px;border:1px solid var(--aidinet-border);background:var(--aidinet-panel);color:var(--aidinet-text);font-weight:850;text-decoration:none}.aidinet-agenda-btn-primary{background:linear-gradient(135deg,var(--aidinet-brand),var(--aidinet-brand-2))!important;color:#111827!important;border-color:transparent!important}.aidinet-agenda-list{display:grid;gap:.65rem}.aidinet-agenda-list-item{padding:.75rem;border:1px solid var(--aidinet-border);border-radius:14px;background:var(--aidinet-panel-soft)}
@media(max-width:860px){.aidinet-topbar-inner{align-items:flex-start}.aidinet-topbar-user-text,.aidinet-topbar-current,.aidinet-topbar-separator{display:none!important}.aidinet-agenda-grid{font-size:.82rem}.aidinet-agenda-day{min-height:92px;padding:.45rem}.aidinet-agenda-event{font-size:.68rem}}
