:root {
    --primary-color: #0077b6;
    --primary-hover: #023e8a;
    --secondary-color: #00b4d8;
    --accent-color: #ff6f61;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-color: #212529;
    --label-color: #495057;
    --border-color: #dee2e6;
    --error-color: #d93025;
    --success-color: #1e8e3e;
    --theme-bg-dark: #03045e;
    --theme-bg-main: #edf6ff;
}

body {
    font-family: 'Poppins', "Segoe UI", Roboto, Arial, sans-serif;
    background-color: var(--background-color);
    margin: 0;
    height: 100vh;
    overflow: hidden; /* Evita el scroll en el body */
}

/* --- ESTILOS DE LOGIN --- */
#login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}
.login-card {
    background: var(--card-background);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.07), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 380px;
    box-sizing: border-box;
    text-align: center;
}
.login-card-header h2 { margin: 0 0 8px 0; font-size: 28px; font-weight: 700; color: var(--primary-hover); }
.login-card-header p { margin: 0 0 28px 0; color: var(--label-color); }
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--label-color); }
.form-group input {
    width: 100%; padding: 12px 16px; font-size: 16px; border: 1px solid var(--border-color);
    border-radius: 8px; box-sizing: border-box; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.25); }
.login-card button {
    margin-top: 12px; width: 100%; padding: 14px; background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 16px; font-weight: 600;
    transition: all 0.3s ease; background-size: 150% 150%;
}
.login-card button:hover { background-position: right center; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0, 150, 200, 0.3); }
.message { margin-top: 16px; padding: 12px; border-radius: 8px; font-size: 14px; text-align: center; }
.error { background-color: #fbeae9; color: var(--error-color); }

/* --- ESTILOS DEL PANEL PRINCIPAL --- */
#main-content { 
    display: none; /* Oculto por defecto */
    width: 100%; height: 100%; flex-direction: column; overflow-y: auto; 
    background-color: var(--theme-bg-main);
}
.main-header {
    background-color: var(--theme-bg-dark); padding: 4px 32px; display: grid;
    grid-template-columns: 1fr auto 1fr; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky; top: 0; z-index: 10;
}
.brand { font-size: 24px; font-weight: 700; color: #ffffff; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.brand img { height: 50px; }
.main-header nav { justify-self: center; display: flex; gap: 8px; }
.main-header nav a, #logoutBtn {
    color: #ffffff; text-decoration: none; font-weight: 600; font-size: 16px; background: none; border: none;
    cursor: pointer; padding: 8px 16px; border-radius: 8px; transition: background-color 0.2s, color 0.2s;
}
.main-header nav a:hover, #logoutBtn:hover { background-color: rgba(255, 255, 255, 0.1); }
.header-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.title-banner { text-align: center; padding: 0; font-size: 1.5em; font-weight: 600; color: var(--primary-hover); background-color: transparent; margin-bottom: 24px; width: 100%; }
.title-banner img { height: 1em; vertical-align: middle; }
.dashboard-container { flex-grow: 1; padding: 32px; display: flex; flex-direction: column; align-items: center; gap: 0; width: 100%; max-width: 1400px; margin: 0 auto; box-sizing: border-box; }
.dashboard-row { width: 100%; display: flex; justify-content: center; align-items: stretch; gap: 32px; }
.info-card { background-color: var(--card-background); padding: 28px; border-radius: 16px; box-shadow: 0 8px 24px rgba(17, 93, 153, 0.06); flex: 1; min-width: 280px; transition: transform 0.3s ease, box-shadow 0.3s ease; border-top: 4px solid var(--primary-color); }
.info-card:hover { transform: translateY(-6px); box-shadow: 0 12px 32px rgba(17, 93, 153, 0.1); }
.info-card h3 { margin-top: 0; font-size: 1.4em; color: var(--primary-hover); padding-bottom: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.info-card p, .info-card ul { line-height: 1.7; }
.info-card ul { list-style: none; padding-left: 0; margin: 0; color: var(--label-color); }
.info-card li { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.info-card li strong { color: var(--text-color); }
.info-card .icon { font-size: 20px; line-height: 1.7; color: var(--secondary-color); min-width: 24px; text-align: center; }
.main-image { max-width: 350px; border-radius: 16px; box-shadow: 0 8px 24px rgba(17, 93, 153, 0.06); object-fit: cover; align-self: center; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.main-image:hover { transform: translateY(-6px) scale(1.03); box-shadow: 0 12px 32px rgba(17, 93, 153, 0.12); }
#fincas-page, #alimento-page, #combustible-page, #larva-page, #pisc-madres-page { padding: 32px; flex-grow: 1; text-align: center; display: none; flex-direction: column; align-items: center; justify-content: center; }
#fincas-page h1, #alimento-page h1, #combustible-page h1, #larva-page h1, #pisc-madres-page h1 { color: var(--primary-hover); margin-bottom: 40px; font-weight: 700; }
.fincas-container { display: flex; justify-content: center; align-items: center; gap: 40px; flex-wrap: wrap; }
.finca-btn { border: none; border-radius: 16px; padding: 40px 60px; font-size: 24px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; color: white; }
.btn-gradient { background: linear-gradient(45deg, #0077b6, #00b4d8); }
.finca-btn:hover { transform: translateY(-8px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15); }
#excel-viewer-page, #agrodirecto-viewer-page, #alimento-viewer-page, #combustible-viewer-page, #larva-viewer-page, #pisc-madres-viewer-page { display: none; flex-direction: column; width: 100%; height: 100%; background-color: var(--background-color); }
#excel-viewer-page iframe, #agrodirecto-viewer-page iframe, #alimento-viewer-page iframe, #combustible-viewer-page iframe, #larva-viewer-page iframe, #pisc-madres-viewer-page iframe { flex-grow: 1; border: none; }

/* --- ESTILOS RESPONSIVE --- */
@media (max-width: 1100px) { 
    .dashboard-row { flex-direction: column; align-items: center; } 
    .info-card, .main-image { width: 100%; max-width: 600px; } 
    .main-header nav { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 768px) {
    .main-header {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 16px;
        padding: 16px;
    }
    .header-right {
        grid-row: 3;
        justify-self: center;
    }
    .main-header nav {
        gap: 4px;
    }
    .main-header nav a, #logoutBtn {
        font-size: 14px;
        padding: 6px 10px;
    }
    .dashboard-container, #fincas-page, #alimento-page, #combustible-page, #larva-page, #pisc-madres-page {
        padding: 24px 16px;
    }
    .title-banner {
        font-size: 1.2em;
    }
    .fincas-container {
        flex-direction: column;
        gap: 20px;
        width: 100%;
    }
    .finca-btn {
        width: 100%;
        max-width: 400px;
        padding: 25px 30px;
        font-size: 20px;
    }
    .login-card {
        padding: 32px 24px;
        margin: 0 16px;
    }
    h1 {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    .brand {
        font-size: 20px;
    }
    .brand img {
        height: 40px;
    }
    .main-header nav a, #logoutBtn {
        font-size: 12px;
    }
    .info-card {
        padding: 20px;
    }
    .info-card h3 {
        font-size: 1.2em;
    }
    .info-card p, .info-card ul {
        font-size: 0.95em;
    }
}