﻿/* CSS DEL INDEX */


:root {
    --bg: #f5f7fb;
    --text: #142032;
    --muted: #64748b;
    --accent: #1d8f8f;
    --accent-2: #2670f2;
    --card-bg: #ffffff;
    --card-border: #e7ecf5;
    --card-shadow: 0 8px 26px rgba(23,30,54,.08);
    --card-shadow-hover: 0 14px 34px rgba(23,30,54,.12);
    --success: #2e7d32;
    --danger: #c62828;
    --unknown: #6b7280;
    --radius: 12px;
    --radius-sm: 10px;
    --space-1: 8px;
    --space-2: 12px;
    --space-3: 16px;
    --space-4: 20px;
    --
        
        
        
        -h: 70px;
    --footer-h: 40px;
    --altura-header: 60px;
    --altura-controles: 50px;
    --altura-searcher: 60px;
}

/* LETRAS */
html, body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: 0;
}


/* GRID de instalaciones */
.instalaciones {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* Tarjeta de cada instalación */
.instalacion {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 0 8px #ccc;
}

    .instalacion .valor,
    .metric-table td,
    .metric-table .unit {
        font-variant-numeric: tabular-nums lining-nums;
        -moz-font-feature-settings: "tnum","lnum";
        -webkit-font-feature-settings: "tnum","lnum";
        font-feature-settings: "tnum","lnum";
    }

#header .app-title {
    margin: 0;
    color: #fff;
    font-size: 25px;
    font-weight: 600;
    letter-spacing: .1px;
    line-height: 1;
    text-align: center;
}

.eco-main {
    min-height: calc(100vh - var(--header-h) - var(--footer-h));
    display: flex;
    padding: var(--space-3);
}

body.index .eco-main {
    /* que crezca natural y deje scrollear el documento */
    flex: 0 0 auto;
}

/* Grid de instalaciones */
.instalaciones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 22px;
    width: 100%;
    align-content: start;
}

/* Tarjeta instalación */
.instalacion {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease;
}

    .instalacion:hover {
        transform: translateY(-2px);
        box-shadow: var(--card-shadow-hover);
        border-color: color-mix(in oklab, var(--card-border) 60%, var(--accent) 40%);
    }

    /* Título de tarjeta */
    .instalacion .titulo {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        text-align: center;
        font-size: 22px;
        font-weight: 800; /* sin bold */
        color: #132036;
        margin-bottom: 6px;
    }

        .instalacion .titulo i {
            color: var(--accent);
        }

    /* Valores */
    .instalacion .valor {
        font-size: 19px;
        font-weight: 400; /* sin bold */
        color: #0f172a;
    }

/* Tabla de métricas */
.card-body {
    margin-top: 0;
}

.metric-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

    .metric-table th,
    .metric-table td {
        padding: 14px 16px;
        vertical-align: middle;
    }

    /* Nombres de variables */
    .metric-table th {
        display: flex;
        align-items: center;
        gap: 10px;
        white-space: nowrap;
        font-size: 18px;
        font-weight: 400;
        color: #1a2c3d;
    }

        .metric-table th i {
            font-size: 22px;
            min-width: 26px;
            text-align: center;
            color: var(--accent);
            opacity: 1;
        }

    /* Valores */
    .metric-table td {
        text-align: right;
        font-size: 18px;
        font-weight: 400;
        color: #0f172a;
    }

    /* Unidades */
    .metric-table .unit {
        margin-left: 6px;
        font-size: 13px;
        font-weight: 400;
        color: var(--muted);
    }

    /* Zebra + separadores */
    .metric-table tbody tr:nth-child(odd) {
        background: #fafcff;
    }

    .metric-table tbody tr + tr {
        border-top: 1px dashed #eef2f8;
    }

/* Badge turbina */
.badge {
    display: inline-block;
    min-width: 64px; /* más ancho */
    padding: 8px 14px; /* más espacio interno */
    border-radius: 999px; /* pill grande */
    font-size: 15px; /* letra más grande */
    font-weight: 600; /* negrita ligera */
    text-align: center;
    color: #fff;
    letter-spacing: .4px;
}

    .badge.on {
        background: var(--success);
    }

    .badge.off {
        background: var(--danger);
    }

    .badge.unk {
        background: var(--unknown);
    }

/*  NAV TABS */

.nav-tabs {
    border-bottom: 3px solid #507aaa;
    font-size: 17px !important;
    background-color: #EDEDED !important;
}

    .nav-tabs .nav-link {
        color: white !important;
    }

        .nav-tabs .nav-link.active {
            background-color: #2670f2 !important;
            color: #fff !important;
            border-color: #2670f2 #2670f2 #fff !important;
        }

.header-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 70px;
    width: 100%;
    background: linear-gradient(90deg, var(--accent-2), color-mix(in oklab, var(--accent-2) 70%, #4ea4ff));
    box-shadow: 0 2px 14px rgba(0,0,0,.08);
    padding: 0 20px;
}

/* PARA EL LOGOUT */
.header-right {
    display: flex;
    align-items: center;
}

.header-center {
    display: flex;
    justify-content: center;
}

/* BOTÓN LOGOUT PRO */
.header-logout-pro {
    --btn-bg: rgba(255,255,255,0.15);
    --btn-bg-hover: rgba(255,255,255,0.25);
    --btn-border: rgba(255,255,255,0.25);
    --btn-border-hover: rgba(255,255,255,0.40);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .header-logout-pro .icon {
        width: 20px;
        height: 20px;
        display: grid;
        place-items: center;
    }

        .header-logout-pro .icon i {
            font-size: 18px;
            color: #fff;
            opacity: 0.9;
            transition: transform 0.16s ease;
        }

    .header-logout-pro:hover {
        background: var(--btn-bg-hover);
        border-color: var(--btn-border-hover);
        transform: translateY(-1px);
    }

    .header-logout-pro:active {
        transform: translateY(0);
        background: rgba(255,255,255,0.25);
    }

    .header-logout-pro:focus-visible {
        box-shadow: 0 0 0 3px rgba(255,255,255,.45);
    }

    .header-logout-pro:hover .icon i {
        transform: translateX(1px);
    }

/* Responsive */
@media (max-width: 480px) {
    .header-logout-pro .label {
        display: none;
    }

    .header-logout-pro {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Accesibilidad: sin animaciones para reduced motion */
@media (prefers-reduced-motion: reduce) {
    .header-logout-pro,
    .header-logout-pro .icon i {
        transition: none;
        transform: none;
    }
}

.footer {
    border-top: 1px solid var(--card-border);
    background: #fff;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 640px) {
    .instalaciones {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .metric-table th, .metric-table td {
        padding: 12px 12px;
    }

    .metric-table td {
        font-size: 16px;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Valores más pequeños pero bold */
.instalacion .valor,
.metric-table td {
    font-size: 18px; /* más pequeño */
    font-weight: 600; /* negrita ligera */
    color: #0f172a;
}

/* Unidades más discretas */
.metric-table .unit {
    font-size: 12px;
    font-weight: 400;
    color: #6b7a8c;
}

/* --- Colores personalizados por tipo de icono --- */

/* Icono ubicación (título card) → negro */
.instalacion .titulo i.fa-location-dot {
    color: #000 !important;
}

/* Todos los demás iconos siguen el color del header (azul corporativo) */
.instalacion .titulo i,
.metric-table th i {
    color: var(--accent-2);
}

html, body, body.index {
    overflow-y: auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap; /* título + tabs pegados a la izquierda */
}


.footer-proinmec-logo-index {
    height: 23px;
    margin-right: 6px;
    vertical-align: middle;
}

body {
    margin: 0;
    font-family: sans-serif;
    background: #f2f2f2;
    overflow: hidden;
}

main {
    padding: 20px;
}


.titulo {
    font-weight: bold;
    font-size: 18px;
    margin-right: 10px;
    vertical-align: middle;
}

    .titulo img {
        width: 20px;
        margin-right: 10px;
    }

.potencia {
    padding: 5px;
    border-radius: 6px;
}

.primary {
    background: #2670f2;
}

/* Utilidades (Bootstrap-like) */
.ms-4 {
    margin-left: 1.5rem;
}

.text-center {
    text-align: center;
}

.text-end {
    text-align: right;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

html {
    overflow: hidden;
}

#header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #2670f2; /* tu azul */
    padding: 0 1rem; /* espacio a los lados */
    height: 70px;
}

    #header .logo img {
        height: 50px;
    }

    #header .titulo {
        font-size: 1.25rem;
        font-weight: bold;
        color: white;
    }

/* Botones “plana” */
.header-btn,
.header-logout {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    margin: 0 10px;
    padding: 6px 12px;
    cursor: pointer;
}
    /* Hover ligero */
    .header-btn:hover,
    .header-logout:hover {
        background: rgba(255,255,255,0.2);
    }
/* Asegúrate de que el “Cerrar sesión” sigue flotando a la derecha */
.header-logout {
    margin-left: auto;
}


