    
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-image: url("../images/fondo.jpg");
    background-repeat: repeat;
    /* background: url("{{ url_for('static', filename='images/logo_pragma.png') }}") no-repeat center center;*/
    background-size: contain;
    background-attachment: fixed; /* opcional */
    background-position: top left;
    background-color: #fffdfd; /* para que no se vea vacío alrededor */
    min-height: 100vh;
}

.welcome {
    text-align: center;
    padding: 1px;
}

button {
    background: none;                  /* sin fondo */
    border: none;                      /* sin borde */
    color: #474747;                       /* color de texto inicial */
    font-family: 'Segoe UI', Georgia, 'Times New Roman', serif; /* letra elegante */
    font-size: 18px;
    font-weight: 500;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;             /* sin subrayado por defecto */
}

button:hover {
    color: #ce5828;                    /* naranja al pasar el mouse */
    text-decoration: underline;        /* subrayado */
    transform: scale(1.05);            /* leve agrandamiento */
}

button:focus {
    outline: none;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


.top-bar {
    position: relative;
    z-index: 10;
    width: 100%;
    background-color: #ffffff;
    padding: 5px 10px; /* 👈 Más padding lateral */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex; /* 👈 Flex para alinear logo y botones */
    align-items: center;
    justify-content: space-between; /* 👈 Logo a la izquierda, botones al centro */
}

/* Botones dentro de la barra superior */
.top-bar .center-buttons {
    display: flex;
    justify-content: center; /* 👈 Centrar botones */
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
    z-index: 11;
    flex: 1; /* 👈 Mantener pero con ajustes */
    margin: 0 auto; /* 👈 Centrar dentro del espacio disponible */
    max-width: calc(100% - 120px); /* 👈 Limitar ancho (100% - ancho del logo) */
}

header {
    position: relative;  
    z-index: 1;        
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.header-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("../images/header-fondo.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-background::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px; /* Línea naranja de separación */
    background: #ce5828;
}

/* Línea de acento */
.header-background::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #fff;
    opacity: 0.3;
    z-index: 2;
}
.header-logo {
    position: relative;
    width: 330px;
    z-index: 2;
}


.tables-container {
    padding: 10px 40px;
}

table {


        /* Elimina transform: scale(0.75) */
    width: 70%; /* Ajusta el ancho manualmente */
    margin: 5px auto; /* Centrado con margen reducido */
    border-collapse: collapse;
    background: white;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.1);
    font-size: 0.9em; /* Reduce el tamaño de la letra */
    overflow: auto;
}

/* #contenido {
    margin: 0;
    padding: 0;
    display: inline-block; 
}
*/
/* contenedor principal */
#contenido {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}
#contenido table {
    margin-bottom: 0;
}

th, td {
    padding: 6px 8px; /* Reduce el padding interno (era 10px) */
    border: 1px solid #ccc;
    text-align: left;
}

h2 {
    margin-top: 10px;
    color: #00695c;
    margin-bottom: 5px;
}

.botones-hojas button {
    margin-right: 5px;
    padding: 5px 10px;
    cursor: pointer;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 3px;
}

.botones-hojas button.active {
    background-color: #218838;
}

.volver-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #31b4f1;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    float: right;
    display: none;
   
}
.volver-btn:hover {
    background-color: #2870ce;
    color: white;
}

/* Botón del logo en la barra superior */
.logo-home-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    transition: transform 0.2s ease;
    margin-right: 2px; /* 👈 Reducir espacio */
    flex-shrink: 0; /* 👈 Evitar que se encoja */
}

.logo-home-btn:hover {
    transform: scale(1.05);
}

.logo-btn-image {
    width: 90px; /* 👈 Tamaño más grande */
    height: auto;
    display: block;
}

#abrirGoogleSheet {
    display: inline-block;
    margin-top: 10px;
    margin-bottom: 5px;
    padding: 10px 20px;
    background-color: #31b4f1; /* Verde en lugar de rojo */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#abrirGoogleSheet:hover {
    background-color: #086ba5; /* Verde más oscuro al pasar el mouse */
}

.graficos-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 5px !important;
    padding-top: 0;
}

/* PARA TODO: 2 columnas por defecto */
.grafico-item {
    flex: 1 1 45%; /* 👈 2 columnas */
    max-width: 45%;
    height: 350px;
    background-color: white;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mobile-menu-toggle {
    display: none;
    background: #ce5828;
    color: white;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    border-bottom: 2px solid #a8431f;
}

.mobile-menu {
    display: none;
    background: white;
    border-bottom: 2px solid #e0e0e0;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    padding: 10px;
}

.mobile-center-btn {
    padding: 14px 16px;
    margin: 4px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 16px;
    cursor: pointer;
    text-align: center;
}

.mobile-center-btn:hover {
    background: #f8f8f8;
}

/* SOLO en móvil cambia a 1 columna */
@media (max-width: 768px) {
    .grafico-item {
        flex: 1 1 100%;
        max-width: 100%;
        height: 300px;
    }
    .volver-btn {
        float: none;
        width: 90%;
        margin: 20px auto;
        display: block;
        padding: 12px 16px;
        font-size: 16px;
        text-align: center;
    }
    #abrirGoogleSheet {
        float: none;
        width: 90%;
        margin: 20px auto;
        display: block;
        padding: 12px 16px;
        font-size: 16px;
        text-align: center;
    }
    .mobile-menu-toggle {
        display: block;
    }
    
    .top-bar {
        display: none;
    }
    
    header {
        height: 180px;
    }
    
    .header-logo {
        width: 220px;
    }

    .dashboard-layout {
        gap: 15px;
        padding: 10px 5px;
    }

    .card, 
    .card-predialisis, 
    .card-facturas, 
    .card-rrhh {
        flex: 1 1 130px;
        min-width: 120px;
        max-width: 150px;
        height: 130px;
        padding: 15px 10px;
    }
    
    .card-value,
    .card-predialisis .card-value,
    .card-facturas .card-value,
    .card-rrhh .card-value {
        font-size: 2rem;
        margin-bottom: 2.5px;
    }
    
    .card-title,
    .card-predialisis .card-title,
    .card-facturas .card-title,
    .card-rrhh .card-title {
        font-size: 1.1rem;
    }
    
    .gauge-card {
        flex: 0 0 200px;
        height: 160px;
        padding: 12px;
    }
    
    .gauge-title {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    
    .gauge-container {
        height: 160px;
    }
}

@media (max-width: 600px) {
    table {
        font-size: 0.8rem;
    }

    img {
        margin-top: 0.5rem;
    }
    
    .volver-btn {
        width: 95%;
        margin: 15px auto;
        padding: 14px 16px;
    }
    
    #abrirGoogleSheet {
        width: 95%;
        margin: 15px auto;
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .dashboard-layout {
        gap: 10px;
        padding: 8px 3px;
    }
    
    .card, 
    .card-predialisis, 
    .card-facturas, 
    .card-rrhh {
        flex: 1 1 120px;
        min-width: 110px;
        max-width: 140px;
        height: 120px;
        padding: 10px 8px;
    }
    
    .card-value,
    .card-predialisis .card-value,
    .card-facturas .card-value,
    .card-rrhh .card-value {
        font-size: 1.8rem;
    }
    
    .card-title,
    .card-predialisis .card-title,
    .card-facturas .card-title,
    .card-rrhh .card-title {
        font-size: 0.9rem;
    }
    
    .gauge-card {
        flex: 0 0 170px;
        height: 140px;
    }
    
    .gauge-container {
        height: 140px;
    }
}

/* imágenes/gráficos */
img {
    max-width: 100%;
    height: auto; /* mantiene proporción */
    margin-top: 1rem;
    border-radius: 8px;
}



/* Contenedor scrolleable para la tabla */
.tabla-wrap {
max-height: 70vh;   /* ajustá la altura visible */
overflow: auto;     /* necesario para que position: sticky funcione */
margin: 0 auto;
width: 100%;
}

/* Asegura buen comportamiento de sticky y bordes */
#contenido table {
border-collapse: separate;
border-spacing: 0;
}

/* Congelar fila de encabezado */
#contenido thead th {
position: sticky;
top: 0;
z-index: 2;
background: #f8f8f8;     /* fondo sólido para que no transparente */
background-clip: padding-box;
}

/* Congelar primera columna (nombres) */
#contenido tbody th {
position: sticky;
left: 0;
z-index: 1;
background: #f0f0f0;
background-clip: padding-box;
}

/* Celda esquina (arriba-izquierda) con mayor z-index */
#contenido thead th:first-child {
left: 0;
z-index: 3;
}


.dashboard-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px;
    justify-content: center;
}

/* El gauge es simplemente otra card con tamaño especial */
.gauge-card {
    flex: 0 0 250px;
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    height: 200px;
}

/* Las cards normales - SOLO UNA VEZ */
.card {
    flex: 1 1 200px;
    min-width: 200px;
    max-width: 250px;
    height: 200px; /* 👈 ALTURA FIJA agregada */
    background: linear-gradient(135deg, #f39069, #ce5828);
    color: white;
    border-radius: 15px;
    padding: 20px 15px; /* 👈 Reducido para mejor ajuste */
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 👈 Centra el contenido */
    align-items: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.card-value {
    font-size: 3.2rem; /* 👈 Un poco más pequeño */
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1;
}

.card-title {
    font-size: 1.3rem; /* 👈 Un poco más pequeño */
    opacity: 0.9;
    line-height: 1.2;
}

.card-predialisis {
    flex: 1 1 200px;
    min-width: 200px;
    max-width: 250px;
    height: 200px;
    background: linear-gradient(135deg, #8e8e8f, #464545) !important; /* Gris en lugar de naranja */
    color: #f5f5f5 !important; /* Texto naranja en lugar de blanco */
    border-radius: 15px;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid #dee2e6 !important;
}

.card-predialisis:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.card-predialisis .card-value {
    font-size: 3.2rem;
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1;
    color: #ffffff !important; /* Naranja */
    text-shadow: 
        -1px -1px 0 #ce5828,
        1px -1px 0 #ce5828,
        -1px 1px 0 #ce5828,
        1px 1px 0 #ce5828,
        0 0 4px #ce5828; /* Borde naranja alrededor del texto */

}

.card-predialisis .card-title {
    font-size: 1.3rem;
    opacity: 0.9;
    line-height: 1.2;
    color: #f5f3f2 !important; /* Naranja */
    font-weight: 600;
    text-shadow: 
        -1px -1px 0 #ce5828,
        1px -1px 0 #ce5828,
        -1px 1px 0 #ce5828,
        1px 1px 0 #ce5828,
        0 0 3px #ce5828; /* Borde naranja alrededor del texto */
}

.card-facturas {
    flex: 1 1 200px;
    min-width: 200px;
    max-width: 250px;
    height: 200px;
    background: linear-gradient(135deg, #f7f0ec, #f5f2f2) !important; /* Gris en lugar de naranja */
    color: #f5f5f5 !important; /* Texto naranja en lugar de blanco */
    border-radius: 15px;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid #dee2e6 !important;
}

.card-facturas:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.card-facturas .card-value {
    font-size: 3.2rem;
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1;
    color: #ce5828 !important; /* Naranja */
    text-shadow: 
        -1px -1px 0 #ffffff,
        1px -1px 0 #ffffff,
        -1px 1px 0 #ffffff,
        1px 1px 0 #ffffff,
        0 0 4px #ffffff; /* Borde naranja alrededor del texto */

}

.card-facturas .card-title {
    font-size: 1.3rem;
    opacity: 0.9;
    line-height: 1.2;
    color: #ce5828 !important; /* Naranja */
    font-weight: 600;
    text-shadow: 
        -1px -1px 0 #ffffff,
        1px -1px 0 #ffffff,
        -1px 1px 0 #ffffff,
        1px 1px 0 #ffffff,
        0 0 4px #ffffff; /* Borde naranja alrededor del texto */
}

.card-rrhh {
    flex: 1 1 200px;
    min-width: 200px;
    max-width: 250px;
    height: 200px;
    background: linear-gradient(135deg, #524c48, #e9ba9b) !important; /* Gris en lugar de naranja */
    color: #f5f5f5 !important; /* Texto naranja en lugar de blanco */
    border-radius: 15px;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid #dee2e6 !important;
}

.card-rrhh:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.card-rrhh .card-value {
    font-size: 3.2rem;
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1;
    color: #fffdfc !important; /* Naranja */
    text-shadow: 
        -1px -1px 0 #ce5828,
        1px -1px 0 #ce5828,
        -1px 1px 0 #ce5828,
        1px 1px 0 #ce5828,
        0 0 3px #ce5828; /* Borde naranja alrededor del texto */

}

.card-rrhh .card-title {
    font-size: 1.3rem;
    opacity: 0.9;
    line-height: 1.2;
    color: #fffefd !important; /* Naranja */
    font-weight: 600;
    text-shadow: 
        -1px -1px 0 #ce5828,
        1px -1px 0 #ce5828,
        -1px 1px 0 #ce5828,
        1px 1px 0 #ce5828,
        0 0 3px #ce5828; /* Borde naranja alrededor del texto */
}

.gauge-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #ce5828;
    margin-bottom: 15px;  
}

.gauge-container {
    margin: 10px 0;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}
