/* ==========================================================================
   CONFIGURACIÓN GLOBAL Y FUENTES
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Inter:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: #ffffff;
}

/* ==========================================================================
   HEADER (PROTEGIDO CONTRA BOOTSTRAP)
   ========================================================================== */
body .header-inner {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 40px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #eaeaea !important;
    height: 90px !important;
    width: 100% !important;
}

/* Contenedores laterales para forzar el centrado del nav */
.header-left, .header-right {
    flex: 0 0 220px !important;
    display: flex !important;
    align-items: center !important;
}

.header-right {
    justify-content: flex-end !important;
}

/* Logos: Proporción mantenida */
body .header-inner img.logo {
    height: 55px !important;
    width: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
}

/* Navegación Central */
body .header-nav {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    gap: 40px !important;
}

body .header-nav a {
    text-decoration: none !important;
    color: #000000 !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   SECCIONES Y GRID DEL DASHBOARD
   ========================================================================== */
main {
    padding: 20px 40px;
}

.section-title {
    background: #ffd9a6;
    border-radius: 24px;
    padding: 14px;
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    margin: 22px 0;
    color: #333;
}

.section-title.warning {
    color: #6b3f00;
}

.grid {
    display: grid;
    gap: 24px;
    margin-bottom: 24px;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* Cards */
.card {
    border: 2px solid #f4a040 !important;
    border-radius: 32px !important;
    padding: 24px !important;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.card span {
    font-size: 32px;
    font-weight: 700;
    color: #dc3545; /* Rojo Desconectado */
}

#total1234 {
    font-size: 40px;
    color: #ff5722;
}

/* Iconos */
.motor {
    height: 100px;
    width: auto;
    margin-top: 10px;
}

.gauge img {
    width: 100px;
    height: auto;
}

/* ==========================================================================
   COMPONENTES DE OPERACIÓN (BOTONES Y SWITCHES)
   ========================================================================== */
.dosificacion-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.unidad-fraccion {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
}

.unidad-fraccion .linea {
    width: 15px;
    height: 2px;
    background: #000;
    margin: 2px 0;
}

.boton {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* ==========================================================================
   TABLAS E HISTORIAL
   ========================================================================== */
.table-wrapper {
    margin-top: 20px;
    border: 2px solid #f4a040;
    border-radius: 20px;
    overflow: hidden;
}

.table {
    width: 100%;
    margin-bottom: 0 !important;
}

.table thead {
    background: #fff3e0;
}

.table th, .table td {
    padding: 15px !important;
    vertical-align: middle !important;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.main-footer {
    background: #f8f9fa;
    margin-top: 50px;
    width: 100%;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 50px;
}

.footer-logos {
    display: flex;
    gap: 30px;
    align-items: center;
}

.footer-logos img {
    height: 60px;
    width: auto;
}

.footer-info {
    text-align: right;
    font-size: 14px;
    color: #555;
}

/* ==========================================================================
   ESTILOS DE LOGIN Y ANIMACIONES
   ========================================================================== */
.body-login {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    height: 100vh;
}

.form-signin {
    width: 100%;
    max-width: 330px;
    padding: 15px;
}

.fade-out {
    animation: fadeOut 3s forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.color-blue { color: #265596; }
.color-light-blue { color: #40a1f8; }