/* assets/css/style.css - Archivo Maestro de Estilos */

/* --- GLOBALES --- */
html {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #333;
    /* Flexbox para Sticky Footer */
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    flex: 1; /* Empuja el footer hacia abajo */
    box-sizing: border-box;
}

/* --- CABECERA WEB (Se oculta al imprimir) --- */
header {
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 15px 0;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 80px; /* Tamaño logo web */
    margin-right: 15px;
    width: auto;
}

.empresa-nombre {
    font-size: 1.8rem;
    font-family: 'Brush Script MT', cursive;
    color: #333;
    margin: 0;
}

/* --- NAVEGACIÓN --- */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 25px;
}

nav ul li a {
    text-decoration: none;
    color: #555;
    font-weight: 600;
    transition: color 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9rem;
}

nav ul li a:hover {
    color: #e63946;
}

.icon {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.btn-logout {
    color: #e63946 !important;
}

/* --- LOGIN --- */
.login-body {
    background: #f4f4f4;
    justify-content: center;
    align-items: center;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 350px;
    text-align: center;
    margin: auto; /* Centrado vertical/horizontal en flex */
}

.login-box input {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 15px 0;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #e63946;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
}

.login-box button:hover {
    background: #c42b38;
}

.error-msg {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

/* --- DASHBOARD (INDEX) --- */
.dashboard-welcome {
    text-align: center;
    padding: 40px 20px;
}

.dashboard-welcome h2 {
    font-size: 2.5rem;
    color: #444;
    margin-bottom: 20px;
}

.dashboard-welcome p {
    font-size: 1.2rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto 40px auto;
}

.action-cards {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    padding: 30px;
    width: 280px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: #444;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: #e63946;
}

/* --- ESTILOS DE REPORTES Y TABLAS (WEB) --- */
.report-controls {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.control-group select, .control-group input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    min-width: 200px;
}

.btn-print {
    background-color: #e63946;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-print:hover {
    background-color: #c42b38;
}

/* Tabla General Web */
table.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-radius: 8px;
    overflow: hidden;
}

table.report-table th, table.report-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table.report-table th {
    background-color: #f8f9fa;
    font-weight: 700;
    color: #444;
}

.weekend-row {
    background-color: #fcfcfc;
    color: #888;
}

/* Estados */
.status-ok { color: green; font-weight: bold; }
.status-ko { color: red; font-weight: bold; }
.descanso-tag { font-size: 0.8em; color: #666; background: #f0f0f0; padding: 2px 4px; border-radius: 3px; }

/* --- FOOTER --- */
.main-footer {
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    padding: 20px 0;
    margin-top: 40px;
    font-size: 0.9rem;
    color: #666;
    width: 100%;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-left a, .footer-right a {
    color: #555;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.footer-left a:hover, .footer-right a:hover {
    color: #e63946;
}

.footer-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.separator { color: #ccc; }

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .footer-right {
        flex-direction: column;
        gap: 5px;
    }
    .separator { display: none; }
}

/* Elementos ocultos por defecto en web */
.print-header { display: none; }

/* ========================================= */
/* DISEÑO DE IMPRESIÓN (PDF)           */
/* ========================================= */
@media print {
    /* 1. Ocultar todo lo que no es el reporte */
    header, .no-print, .btn-print, .report-controls, 
    .dashboard-welcome, footer, .main-footer, .footer-note {
        display: none !important;
    }

    /* 2. Resetear el cuerpo para papel */
    body {
        background: #fff;
        font-family: 'Courier New', Courier, monospace; /* Fuente monoespaciada pro */
        font-size: 10pt;
        color: #000;
        margin: 0;
        padding: 0;
        display: block; /* Quitar flex para imprimir */
    }

    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    /* 3. Cabecera Compacta Repetible */
    .print-header {
        display: flex !important;
        justify-content: space-between;
        align-items: flex-end;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
        margin-bottom: 15px;
        height: 70px;
    }

    .print-header-left {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .print-header img {
        height: 45px;
        width: auto;
    }

    .print-header h1 {
        font-size: 14pt;
        margin: 0;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    
    .print-header p {
        margin: 0; 
        font-size: 8pt;
    }

    .print-meta-box {
        text-align: right;
        font-size: 9pt;
        border-left: 1px solid #ccc;
        padding-left: 15px;
        line-height: 1.3;
    }

    /* 4. Tabla optimizada para papel */
    table.report-table {
        width: 100%;
        border-collapse: collapse;
        border: none;
        box-shadow: none;
        font-size: 9pt;
    }

    /* TRUCO: Repite encabezados en cada hoja */
    thead {
        display: table-header-group;
    }

    /* TRUCO: Evita cortar filas por la mitad */
    tr {
        page-break-inside: avoid;
    }

    table.report-table th {
        background-color: #eee !important;
        color: #000;
        border-top: 2px solid #000;
        border-bottom: 2px solid #000;
        text-transform: uppercase;
        font-size: 8pt;
        padding: 4px;
        -webkit-print-color-adjust: exact; /* Forzar impresión de fondo gris */
        print-color-adjust: exact;
    }

    table.report-table td {
        border-bottom: 1px dotted #ccc;
        padding: 3px 4px;
        vertical-align: middle;
    }

    /* Columna de "Suma y Sigue" destacada */
    .col-balance {
        background-color: #f5f5f5 !important;
        font-weight: bold;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Fines de semana limpios */
    .weekend-row {
        background-color: transparent !important; /* Ahorrar tinta */
    }

    /* Vacaciones resaltadas en papel */
    tr[style*="background-color: #f0f0f0"] {
        background-color: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
    }

    /* Totales al final */
    tfoot {
        display: table-footer-group;
    }
    
    tfoot td {
        border-top: 2px solid #000 !important;
        font-weight: bold;
        font-size: 11pt;
        padding-top: 10px;
    }

    /* 5. Firmas */
    .firma-box {
        margin-top: 30px;
        display: flex;
        justify-content: space-between;
        page-break-inside: avoid;
    }

    .firma {
        width: 45%;
        border-top: 1px solid #000;
        padding-top: 5px;
        font-size: 8pt;
        text-align: center;
        text-transform: uppercase;
    }

    /* Configuración de página */
    @page {
        margin: 1cm;
        size: A4;
    }
}

/* assets/css/style.css - AÑADIR AL FINAL */

/* --- DASHBOARD MODERNO --- */
.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding-bottom: 40px;
}

/* 1. SECCIÓN DE ACCIONES (BOTONES) */
.actions-grid {
    display: grid;
    /* En PC: Columnas automáticas de mínimo 200px. En Móvil: Se ajustan solas */
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
    gap: 20px;
}

.action-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px 15px;
    text-align: center;
    text-decoration: none;
    color: #444;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    border-color: #e63946;
    color: #e63946;
}

.action-card .icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #e63946;
}

.action-card h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.action-card p {
    margin: 5px 0 0 0;
    font-size: 0.85rem;
    color: #888;
}

/* 2. SECCIÓN DE GRÁFICOS */
.charts-section-title {
    font-size: 1.2rem;
    color: #333;
    border-left: 5px solid #e63946;
    padding-left: 15px;
    margin-bottom: 20px;
}

.charts-grid {
    display: grid;
    /* En PC: 2 columnas si caben. En Móvil: 1 columna */
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.chart-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 10px;
}

.chart-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.total-hours-badge {
    background: #e63946;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

/* Ajuste específico para móviles */
@media (max-width: 600px) {
    .charts-grid {
        grid-template-columns: 1fr; /* Una sola columna obligatoria */
    }
    .action-card {
        padding: 15px; /* Menos padding */
    }
}