/* Forzar ancho completo en todo el contenido */
* {
    --fi-layout-max-width: 100% !important;
}
.fi-layout > div,
.fi-layout > div > div,
.fi-layout > div > div > div {
    max-width: 100% !important;
}
div[class*="container"],
div[class*="max-w"] {
    max-width: 100% !important;
}
main > div {
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* ===== Modo oscuro: remapea colores claros fijos (inline) de las vistas propias ===== */
/* Fondos claros -> oscuro. Se fija color claro (sin !important) para que el texto
   SIN color explícito herede claro, y el que SÍ tiene color inline lo conserve. */
.dark [style*="background:white"]:not(button),
.dark [style*="background:#ffffff"]:not(button),
.dark [style*="background:#f9fafb"]:not(button),
.dark [style*="background:#f8fafc"]:not(button),
.dark [style*="background:#fafbff"]:not(button),
.dark [style*="background:#f3f4f6"]:not(button),
.dark [style*="background:#f0f9ff"]:not(button) { background:#0d1117 !important; color:#e5e7eb; }
.dark [style*="background:#e5e7eb"]:not(button),
.dark [style*="background:#d1d5db"]:not(button) { background:#21262d !important; }
/* Tintes de estado -> fondo oscuro con tinte (el texto de estado ya es de color) */
.dark [style*="background:#f0fdf4"]:not(button),
.dark [style*="background:#dcfce7"]:not(button),
.dark [style*="background:#ecfdf5"]:not(button) { background:#0e2a18 !important; color:#e5e7eb; }
.dark [style*="background:#fef2f2"]:not(button) { background:#2a1414 !important; color:#e5e7eb; }
.dark [style*="background:#fffbeb"]:not(button),
.dark [style*="background:#fef3c7"]:not(button),
.dark [style*="background:#fefce8"]:not(button) { background:#2a2410 !important; color:#e5e7eb; }
.dark [style*="background:#eff6ff"]:not(button),
.dark [style*="background:#dbeafe"]:not(button) { background:#0e1b2e !important; color:#e5e7eb; }
.dark [style*="background:#fdf4ff"]:not(button) { background:#231026 !important; color:#e5e7eb; }
/* Texto oscuro explícito -> claro */
.dark [style*="color:#374151"]:not(button),
.dark [style*="color:#111827"]:not(button),
.dark [style*="color:#1f2937"]:not(button) { color:#e5e7eb !important; }
/* Bordes claros */
.dark [style*="#e5e7eb"],
.dark [style*="#f3f4f6"],
.dark [style*="#e2e8f0"] { border-color:#374151 !important; }
.dark [style*="#d1d5db"] { border-color:#3d444d !important; }
/* Tablas: color base claro para celdas sin color explícito (Filament gestiona las suyas) */
.dark table td, .dark table th { color:#e5e7eb; }
/* Campos de formulario */
.dark input[style*="background:white"],
.dark textarea[style*="background:white"],
.dark select { background:#111827 !important; color:#e5e7eb !important; border-color:#374151 !important; }
/* Botones neutros (fondo claro) -> dark que resalta sobre el contenedor */
.dark button[style*="background:white"] { background:#21262d !important; color:#e5e7eb !important; border-color:#3d444d !important; }
/* Pulsador redondo blanco de los toggles: se mantiene blanco */
.dark [style*="border-radius:50%"][style*="background:white"] { background:#ffffff !important; }
/* Logos de sistema en blanco para visibilidad en oscuro */
.dark img[alt="Yubii / Home Center"],
.dark img[alt="RISCO"], .dark img[src*="risco"] { filter: brightness(0) invert(1); }
