/* =================================================================
   MODERN DASHBOARD v3.1 — Clean, Professional Design
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #0f4c35;
    --primary-light: #1a6b4a;
    --primary-hover: #0d3f2c;
    --secondary: #27825e;
    --secondary-light: #34a375;
    --accent: #00897b;

    --success: #10b981;
    --info: #0ea5e9;
    --warning: #f59e0b;
    --danger: #ef4444;
    --purple: #8b5cf6;

    --cerezas: #dc2626;
    --ciruelas: #7c3aed;
    --peras: #a3a30f;
    --nectarin: #ea580c;
    --nectarines: #ea580c;
    --kiwi: #228B22;
    --kiwis: #228B22;

    --bg: #f4f7fa;
    --bg-subtle: #eef2f7;
    --bg-hover: #f0fdf4;
    --card: #ffffff;
    --text: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #94a3b8;
    --border: #e5e9f0;
    --border-light: #f0f3f8;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.1);
    --shadow-card-hover: 0 8px 32px rgba(0,0,0,0.1);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition: all 0.2s var(--ease);
    --transition-fast: all 0.15s var(--ease);
    --transition-slow: all 0.35s var(--ease);

    /* Export button colors */
    --excel-green: #217346;
    --pdf-red: #c62828;

    /* Skeleton loader colors */
    --skeleton-base: var(--border);
    --skeleton-shine: var(--border-light);

    /* Backdrop */
    --backdrop-blur: 6px;
    --backdrop-color: rgba(0, 0, 0, 0.6);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* =================================================================
   NAVBAR
   ================================================================= */

.main-navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(15,76,53,0.2);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: white;
}

.nav-brand img { height: 32px; }

.nav-brand-text {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0;
    opacity: 0.95;
}

@media (max-width: 576px) { .nav-brand-text { display: none; } }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link-item, .nav-user, .nav-logout {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.nav-link-item:hover, .nav-logout:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.nav-user {
    cursor: default;
    opacity: 0.75;
    font-size: 0.8rem;
}

.nav-logout {
    color: rgba(255,255,255,0.7);
    margin-left: 0.25rem;
}

.main-content { padding: 0; }
.main-content-full { padding: 0; min-height: 100vh; }

/* =================================================================
   SKELETON LOADERS
   ================================================================= */

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-text {
    display: inline-block;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    color: transparent !important;
    min-width: 50px;
}

.skeleton-tab {
    width: 110px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.species-tabs-skeleton { display: flex; gap: 0.5rem; }

.chart-skeleton {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    height: 260px;
    padding: 20px;
}

.chart-skeleton.circle { align-items: center; }

.skeleton-bar {
    width: 36px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-bar:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.skeleton-bar:nth-child(2) { height: 70%; animation-delay: 0.2s; }
.skeleton-bar:nth-child(3) { height: 55%; animation-delay: 0.3s; }
.skeleton-bar:nth-child(4) { height: 85%; animation-delay: 0.4s; }
.skeleton-bar:nth-child(5) { height: 45%; animation-delay: 0.5s; }
.skeleton-bar.tall { height: 75%; width: 56px; }

.chart-skeleton.horizontal { flex-direction: column; align-items: flex-start; justify-content: center; }
.skeleton-bar-h {
    height: 26px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-bar-h:nth-child(1) { width: 80%; }
.skeleton-bar-h:nth-child(2) { width: 55%; animation-delay: 0.15s; }
.skeleton-bar-h:nth-child(3) { width: 35%; animation-delay: 0.3s; }

.skeleton-circle {
    width: 170px; height: 170px;
    border-radius: 50%;
    background: linear-gradient(90deg, #e5e9f0 25%, #f0f3f8 50%, #e5e9f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* =================================================================
   DASHBOARD CONTAINER
   ================================================================= */

.dashboard-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 1rem;
}

@media (min-width: 768px) { .dashboard-container { padding: 1.25rem 1.5rem; } }
@media (min-width: 1200px) { .dashboard-container { padding: 1.5rem 2rem; } }

/* =================================================================
   HEADER
   ================================================================= */

.dashboard-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--secondary-light) 100%);
    border-radius: var(--radius-xl);
    padding: 1.5rem 2rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-xl), 0 0 30px rgba(15,76,53,0.12);
    color: white;
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 50%; height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.06) 0%, transparent 60%);
    pointer-events: none;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

@media (min-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.header-left { display: flex; flex-direction: column; gap: 0.1rem; }

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-title {
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    letter-spacing: 0;
}

@media (min-width: 768px) { .dashboard-title { font-size: 1.7rem; } }

.dashboard-title i { font-size: 1.3rem; opacity: 0.9; }

.header-subtitle {
    font-size: 0.85rem;
    opacity: 0.75;
    font-weight: 400;
}

.btn-refresh {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
    font-family: inherit;
    backdrop-filter: blur(10px);
}

.btn-refresh:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.d-none { display: none !important; }
@media (min-width: 576px) { .d-sm-inline { display: inline !important; } }

@keyframes spin { to { transform: rotate(360deg); } }

/* =================================================================
   FILTERS SECTION
   ================================================================= */

.filters-section {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

@media (min-width: 768px) { .filters-section { padding: 1.15rem 1.5rem; } }

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.filters-header h3 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-toggle-filters {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    transition: var(--transition);
    border-radius: var(--radius-sm);
}

.btn-toggle-filters:hover { background: var(--border-light); color: var(--text); }

.filters-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: end;
}

@media (min-width: 576px) { .filters-form { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .filters-form { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .filters-form { grid-template-columns: repeat(5, 1fr); } }

.filters-form.collapsed { display: none; }

.filter-group { display: flex; flex-direction: column; gap: 0.3rem; }

.filter-group.date-range-highlight .filter-input {
    border-color: rgba(15, 76, 53, 0.35);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbf9 100%);
}

.planta-view-selector {
    margin-bottom: 1.1rem;
    border-left: 4px solid var(--primary);
}

.filter-group label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    letter-spacing: 0.01em;
}

.filter-group label i { font-size: 0.72rem; color: var(--primary); }

.filter-input {
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: var(--transition);
    background: white;
    width: 100%;
    font-family: inherit;
    color: var(--text);
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15,76,53,0.08);
}

/* Multi-Select */
.multi-select-wrapper { position: relative; width: 100%; }

.multi-select-display {
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    font-size: 0.85rem;
    color: var(--text);
}

.multi-select-display:hover { border-color: var(--secondary); }

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: white;
    border: 1.5px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-lg);
}

.multi-select-dropdown.show { display: block; }

.multi-select-actions {
    display: flex;
    gap: 0.35rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}

.multi-select-actions button {
    flex: 1;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 500;
    font-family: inherit;
    transition: var(--transition);
}

.multi-select-actions button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.multi-select-options { max-height: 180px; overflow-y: auto; }

.multi-select-option {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    gap: 0.5rem;
    font-size: 0.83rem;
}

.multi-select-option:hover { background: var(--bg-hover); }

.multi-select-option input[type="checkbox"] {
    width: 15px; height: 15px;
    accent-color: var(--primary);
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.btn-filter {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.6rem 1.15rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.83rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    flex: 1;
    font-family: inherit;
}

.btn-filter:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    filter: brightness(1.05);
}

.btn-reset {
    background: white;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.83rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: var(--transition);
    font-family: inherit;
}

.btn-reset:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: #fff5f5;
}

/* =================================================================
   SPECIES TABS
   ================================================================= */

.species-tabs-section { margin-bottom: 1.25rem; }

.species-tabs {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.species-tab {
    flex-shrink: 0;
    padding: 0.55rem 1.1rem;
    border: 2px solid var(--border);
    background: white;
    color: var(--text);
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: var(--shadow-sm);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.species-tab::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    width: 0; height: 2.5px;
    transition: var(--transition);
    transform: translateX(-50%);
    border-radius: 2px;
}

.species-tab:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.species-tab:hover::after { width: 50%; }

.species-tab.active {
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.species-tab.active::after { width: 0; }

/* Species colors */
.species-tab.cerezas { border-color: rgba(220,38,38,0.25); }
.species-tab.cerezas::after { background: var(--cerezas); }
.species-tab.cerezas:hover, .species-tab.cerezas.active {
    background: linear-gradient(135deg, var(--cerezas), #b91c1c);
    color: white; border-color: var(--cerezas);
}
.species-tab.cerezas i { color: var(--cerezas); }
.species-tab.cerezas.active i, .species-tab.cerezas:hover i { color: white; }

.species-tab.ciruelas { border-color: rgba(124,58,237,0.25); }
.species-tab.ciruelas::after { background: var(--ciruelas); }
.species-tab.ciruelas:hover, .species-tab.ciruelas.active {
    background: linear-gradient(135deg, var(--ciruelas), #6d28d9);
    color: white; border-color: var(--ciruelas);
}
.species-tab.ciruelas i { color: var(--ciruelas); }
.species-tab.ciruelas.active i, .species-tab.ciruelas:hover i { color: white; }

.species-tab.peras { border-color: rgba(163,163,15,0.25); }
.species-tab.peras::after { background: var(--peras); }
.species-tab.peras:hover, .species-tab.peras.active {
    background: linear-gradient(135deg, var(--peras), #7a7a0a);
    color: white; border-color: var(--peras);
}
.species-tab.peras i { color: var(--peras); }
.species-tab.peras.active i, .species-tab.peras:hover i { color: white; }

.species-tab.nectarin, .species-tab.nectarines { border-color: rgba(234,88,12,0.25); }
.species-tab.nectarin::after, .species-tab.nectarines::after { background: var(--nectarines); }
.species-tab.nectarin:hover, .species-tab.nectarin.active,
.species-tab.nectarines:hover, .species-tab.nectarines.active {
    background: linear-gradient(135deg, var(--nectarines), #c2410c);
    color: white; border-color: var(--nectarines);
}
.species-tab.nectarin i, .species-tab.nectarines i { color: var(--nectarines); }
.species-tab.nectarin.active i, .species-tab.nectarin:hover i,
.species-tab.nectarines.active i, .species-tab.nectarines:hover i { color: white; }

.species-tab.kiwi, .species-tab.kiwis { border-color: rgba(34,139,34,0.25); }
.species-tab.kiwi::after, .species-tab.kiwis::after { background: var(--kiwis); }
.species-tab.kiwi:hover, .species-tab.kiwi.active,
.species-tab.kiwis:hover, .species-tab.kiwis.active {
    background: linear-gradient(135deg, var(--kiwis), #006400);
    color: white; border-color: var(--kiwis);
}
.species-tab.kiwi i, .species-tab.kiwis i { color: var(--kiwis); }
.species-tab.kiwi.active i, .species-tab.kiwi:hover i,
.species-tab.kiwis.active i, .species-tab.kiwis:hover i { color: white; }

.species-tab.generic { border-color: rgba(15,76,53,0.25); }
.species-tab.generic::after { background: var(--primary); }
.species-tab.generic:hover, .species-tab.generic.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; border-color: var(--primary);
}
.species-tab.generic i { color: var(--primary); }
.species-tab.generic.active i, .species-tab.generic:hover i { color: white; }

.species-tab.all {
    border-color: rgba(18,50,43,0.28);
    background: #ffffff;
}
.species-tab.all::after { background: var(--primary); }
.species-tab.all i { color: var(--primary); }
.species-tab.all:hover,
.species-tab.all.active {
    color: #ffffff;
    border-color: var(--primary);
    background: linear-gradient(135deg, #12322b, #0f6b4c);
    box-shadow: 0 12px 26px rgba(18,50,43,0.22);
}
.species-tab.all:hover i,
.species-tab.all.active i { color: #ffffff; }

/* =================================================================
   LOADING
   ================================================================= */

.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(244,247,250,0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}

.loading-spinner {
    text-align: center;
    padding: 2.5rem;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 340px;
    border: 1px solid var(--border);
}

.loading-spinner.error-state { border-top: 3px solid var(--danger); }

.spinner {
    width: 44px; height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1.25rem;
    animation: spin 0.8s linear infinite;
}

.loading-spinner p { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 0.3rem; }
.loading-spinner small { color: var(--text-muted); font-size: 0.8rem; }

.error-icon { font-size: 2.5rem; margin-bottom: 0.75rem; color: var(--danger); }

.btn-retry {
    margin-top: 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.6rem 1.15rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
    font-family: inherit;
    font-size: 0.85rem;
}

.btn-retry:hover { transform: scale(1.03); }

/* =================================================================
   KPIs
   ================================================================= */

.kpis-section { margin-bottom: 1.5rem; }

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0;
}

.section-title i { color: var(--primary); font-size: 0.95rem; }

.kpis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 768px) { .kpis-grid { grid-template-columns: repeat(3, 1fr); gap: 0.85rem; } }
@media (min-width: 1200px) { .kpis-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1440px) { .kpis-grid { grid-template-columns: repeat(7, 1fr); } }

.kpi-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    opacity: 0;
    transition: var(--transition);
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.kpi-card:hover::before { opacity: 1; }

.kpi-card.primary::before { background: var(--primary); }
.kpi-card.success::before { background: var(--success); }
.kpi-card.info::before { background: var(--info); }
.kpi-card.warning::before { background: var(--warning); }
.kpi-card.danger::before { background: var(--danger); }
.kpi-card.purple::before { background: var(--purple); }
.kpi-card.export-kpi::before { background: var(--success); }
.kpi-card.commercial-kpi::before { background: var(--info); }

.kpi-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

@media (min-width: 768px) { .kpi-icon { width: 48px; height: 48px; font-size: 1.1rem; } }

.kpi-card.primary .kpi-icon { background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.kpi-card.success .kpi-icon { background: linear-gradient(135deg, #059669, var(--success)); }
.kpi-card.info .kpi-icon { background: linear-gradient(135deg, #0284c7, var(--info)); }
.kpi-card.warning .kpi-icon { background: linear-gradient(135deg, #d97706, var(--warning)); }
.kpi-card.danger .kpi-icon { background: linear-gradient(135deg, #dc2626, var(--danger)); }
.kpi-card.purple .kpi-icon { background: linear-gradient(135deg, #7c3aed, var(--purple)); }
.kpi-card.export-kpi .kpi-icon { background: linear-gradient(135deg, #059669, var(--success)); }
.kpi-card.commercial-kpi .kpi-icon { background: linear-gradient(135deg, #0284c7, var(--info)); }

.kpi-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.kpi-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.3;
}

@media (min-width: 768px) { .kpi-label { font-size: 0.68rem; } }

.kpi-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: 0;
}

@media (min-width: 768px) { .kpi-value { font-size: 1.5rem; } }

.kpi-unit { font-size: 0.68rem; color: var(--text-muted); font-weight: 500; }

@keyframes kpiPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.kpi-value.updated { animation: kpiPop 0.3s ease; }

/* =================================================================
   CHARTS
   ================================================================= */

/* No-process-data message */
.no-process-alert {
    text-align: center;
    margin: 40px auto;
    max-width: 800px;
    padding: 40px 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid var(--primary, #2e7d32);
    box-shadow: 0 4px 20px rgba(46, 125, 50, 0.12);
}
.no-process-alert .no-process-icon {
    font-size: 48px;
    color: var(--primary, #2e7d32);
    margin-bottom: 16px;
}
.no-process-alert h3 {
    color: var(--primary-dark, #1b5e20);
    margin-bottom: 16px;
    font-size: 1.3rem;
}
.no-process-alert p {
    font-size: 1rem;
    color: #424242;
    margin-bottom: 10px;
    line-height: 1.6;
}
.no-process-alert p:last-child { margin-bottom: 0; }

.charts-section { margin-bottom: 1.5rem; }

.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) { .charts-grid { grid-template-columns: repeat(2, 1fr); } }

#chartsSection .charts-grid,
#recepcionChartsSection .charts-grid {
    grid-template-columns: repeat(var(--client-chart-columns, 2), minmax(0, 1fr)) !important;
}

/* When only one chart is visible in a 2-col row, let it span full width */
.chart-card.full-width-single {
    grid-column: 1 / -1;
}

/* Desktop: ocultar firmeza manteniendo espacio en el grid 2x2 */
.firmeza-hidden-species {
    visibility: hidden;
    pointer-events: none;
}

/* Móvil: eliminar completamente el espacio vacío del gráfico oculto */
@media (max-width: 768px) {
    .firmeza-hidden-species {
        display: none !important;
        visibility: visible; /* Reset visibility para que display:none tome control */
    }
}

/* (defectos-row removed — defect charts are now direct grid children) */

/* Firmeza pie chart full width when alone in its row */
.chart-card.chart-fullwidth {
    grid-column: 1 / -1;
}

.chart-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: all 0.3s var(--ease);
    border: 1px solid var(--border);
}

.chart-card.wide {
    grid-column: 1 / -1;
}

.chart-card:hover {
    box-shadow: var(--shadow-card-hover), 0 2px 8px rgba(0,0,0,0.06);
    border-color: transparent;
    transform: translateY(-2px);
}

.master-dashboard .charts-grid,
#plantaChartsSection .charts-grid {
    grid-template-columns: 1fr !important;
}

.master-dashboard .chart-card,
#plantaChartsSection .chart-card {
    grid-column: 1 / -1;
}

#plantaChartsSection .chart-container {
    min-height: 380px;
}

#plantaComparativaProductoresChart.chart-container {
    min-height: 420px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border-light);
}

.chart-header h3 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.chart-header h3 i { color: var(--primary); font-size: 0.82rem; }

.chart-badge {
    background: var(--bg-subtle);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid var(--border);
}

.chart-body { padding: 0.75rem; min-height: 300px; }
.chart-container { min-height: 280px; }

@media (max-width: 576px) {
    .chart-body { padding: 0.4rem; min-height: 240px; }
    .chart-container { min-height: 220px; }
    .chart-header { padding: 0.65rem 0.85rem; }
    .chart-header h3 { font-size: 0.8rem; }
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1.5rem;
    font-size: 0.88rem;
}

.no-data::before { content: '📊 '; }

.loading-chart {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
    font-style: italic;
}

.loading-chart::before { content: '⏳ '; }

/* ApexCharts tooltip enhancements */
.apexcharts-tooltip {
    border-radius: 10px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18) !important;
    border: none !important;
    backdrop-filter: blur(8px);
}
.apexcharts-tooltip.apexcharts-theme-dark {
    background: rgba(30, 35, 50, 0.95) !important;
    color: #fff !important;
}
.apexcharts-tooltip-title {
    background: rgba(255,255,255,0.08) !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    font-weight: 600 !important;
    padding: 8px 12px !important;
}
.apexcharts-tooltip-text {
    font-family: 'Inter', sans-serif !important;
    font-size: 13px !important;
}
.apexcharts-tooltip-series-group {
    padding: 6px 12px !important;
}

/* ApexCharts datalabel text shadow for readability */
.apexcharts-datalabel-label,
.apexcharts-datalabel-value {
    text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* =================================================================
   TABLES
   ================================================================= */

.tables-section { margin-bottom: 2rem; }

.table-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.tab-button {
    background: white;
    border: 1.5px solid var(--border);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.83rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
    color: var(--text-secondary);
    font-family: inherit;
}

.tab-button:hover {
    border-color: var(--secondary);
    background: #f8fffe;
    color: var(--text);
}

.tab-button.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.tab-count {
    background: rgba(0,0,0,0.06);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
}

.tab-button.active .tab-count { background: rgba(255,255,255,0.25); }

.table-container {
    display: none;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.table-container.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 0.85rem;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
}

.data-table thead th {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.7rem 0.75rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}

.data-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

.data-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s ease;
}

.data-table tbody tr:nth-child(even) { background: #fafbfc; }
.data-table tbody tr:hover { background: var(--bg-hover); }

.data-table tbody td {
    padding: 0.55rem 0.75rem;
    vertical-align: middle;
    color: var(--text-secondary);
}

/* DataTables Custom */
.dataTables_wrapper { padding: 0; }

.dataTables_wrapper .dataTables_filter input {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.85rem;
    margin-left: 0.4rem;
    transition: var(--transition);
    font-family: inherit;
    font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15,76,53,0.08);
}

.dataTables_wrapper .dataTables_length select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem;
    margin: 0 0.35rem;
    font-family: inherit;
}

.dataTables_wrapper .top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.dataTables_wrapper .dt-buttons,
.dataTables_wrapper div.dt-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-left: 0.5rem;
}

.btn-export {
    padding: 0.4rem 0.85rem !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    transition: var(--transition) !important;
    border: none !important;
    font-size: 0.78rem !important;
    font-family: inherit !important;
}

.btn-export.excel {
    background: linear-gradient(135deg, #217346, #2e8b57) !important;
    color: white !important;
}

.btn-export.pdf {
    background: linear-gradient(135deg, #c62828, #e53935) !important;
    color: white !important;
}

.btn-export:hover {
    transform: translateY(-1px) !important;
    box-shadow: var(--shadow-sm) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    margin: 0 1px !important;
    padding: 0.35rem 0.65rem !important;
    transition: background 0.15s ease !important;
    font-size: 0.82rem !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

/* =================================================================
   SCROLLBAR
   ================================================================= */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* =================================================================
   TOAST NOTIFICATIONS
   ================================================================= */

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: white;
    border-radius: var(--radius-md);
    padding: 0.85rem 1.15rem;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    font-size: 0.85rem;
    max-width: 340px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transform: translateX(120%);
    transition: transform 0.35s var(--ease);
}

.toast.show { transform: translateX(0); }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--info); }

/* =================================================================
   MICRO-ANIMATIONS
   ================================================================= */

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.kpis-section, .charts-section, .tables-section {
    animation: slideUp 0.4s ease forwards;
}

.charts-section { animation-delay: 0.08s; }
.tables-section { animation-delay: 0.16s; }

/* =================================================================
   ADMIN DASHBOARD STYLES
   ================================================================= */

.admin-container { max-width: 1400px; margin: 0 auto; padding: 1rem; }

.admin-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--secondary-light));
    border-radius: var(--radius-xl);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    color: white;
    box-shadow: var(--shadow-xl);
}

.admin-header h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.25rem; }
.admin-header p { opacity: 0.85; font-size: 0.9rem; }

.admin-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    background: white;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.admin-tab {
    padding: 0.6rem 1.15rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
}

.admin-tab:hover { background: var(--border-light); color: var(--text); }

.admin-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: var(--shadow-sm);
}

.admin-panel { display: none; animation: fadeIn 0.3s ease; }
.admin-panel.active { display: block; }

.admin-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.admin-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-card h3 i { color: var(--primary); }

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 768px) { .admin-stats-grid { grid-template-columns: repeat(4, 1fr); } }

.admin-stat-card {
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border);
}

.admin-stat-value { font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.admin-stat-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

.admin-table th {
    background: var(--bg-subtle);
    padding: 0.65rem 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    border-bottom: 2px solid var(--border);
}

.admin-table td {
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.admin-table tbody tr:hover { background: var(--bg-hover); }

.admin-btn {
    padding: 0.4rem 0.85rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.78rem;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.admin-btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; }
.admin-btn-danger { background: linear-gradient(135deg, #dc2626, #ef4444); color: white; }
.admin-btn-info { background: linear-gradient(135deg, #0284c7, #0ea5e9); color: white; }
.admin-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.admin-form-group { margin-bottom: 0.85rem; }
.admin-form-group label { display: block; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.3rem; font-size: 0.82rem; }

.admin-form-group input,
.admin-form-group select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    transition: var(--transition);
}

.admin-form-group input:focus,
.admin-form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15,76,53,0.08);
}

.admin-producers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.4rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
}

.admin-producer-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
    font-size: 0.82rem;
}

.admin-producer-item:hover { background: white; }

.species-config-list { list-style: none; padding: 0; }

.species-config-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.35rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: grab;
    transition: var(--transition);
}

.species-config-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.species-config-item .drag-handle { color: var(--text-muted); cursor: grab; }
.species-config-item .species-name { flex: 1; font-weight: 600; font-size: 0.85rem; }
.species-config-item .species-toggle { accent-color: var(--primary); }

/* Status indicator */
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--danger); }
.status-dot.generating { background: var(--warning); animation: pulse 1.5s ease infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* =================================================================
   PRINT STYLES
   ================================================================= */

@media print {
    .filters-section, .btn-refresh, .btn-export,
    .dataTables_filter, .dataTables_length, .dataTables_paginate,
    .species-tabs-section, .main-navbar { display: none !important; }

    .dashboard-header {
        background: var(--primary) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .kpi-card, .chart-card, .table-container {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}


/* =================================================================
   INFORME DE RECEPCIÓN — Nuevo Diseño Modal
   ================================================================= */

/* Modal overlay */
.modal-informe {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--backdrop-color);
    backdrop-filter: blur(var(--backdrop-blur));
    overflow-y: auto;
    padding: 20px;
    justify-content: center;
    align-items: flex-start;
}

.modal-informe-content {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f4 100%);
    margin: 2% auto;
    width: 95%;
    max-width: 1400px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: informeSlideIn 0.35s ease-out;
}

@keyframes informeSlideIn {
    from { opacity: 0; transform: translateY(-30px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header verde oscuro */
.informe-header-new {
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%);
    color: white;
    padding: 18px 30px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 20px;
}

.informe-header-left-new {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
}

.informe-logo-new {
    height: 48px;
    width: auto;
    border-radius: 6px;
    background: rgba(255,255,255,0.15);
    padding: 4px 8px;
}

.informe-header-text-new h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.informe-header-text-new p {
    margin: 4px 0 0 0;
    font-size: 12px;
    opacity: 0.85;
}

.informe-header-right-new {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.informe-lote-badge {
    background: rgba(255, 255, 255, 0.18);
    padding: 8px 18px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border: 1px solid rgba(255,255,255,0.25);
}

.lote-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
}

.lote-number {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
}

.informe-status-tags {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.informe-status-tag, .informe-aptitud-tag {
    font-size: 11px;
    background: rgba(255,255,255,0.15);
    padding: 4px 12px;
    border-radius: 4px;
    white-space: nowrap;
}

.informe-status-tag strong, .informe-aptitud-tag strong {
    font-weight: 700;
}

.close-informe-new {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    line-height: 1;
}

.close-informe-new:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* KPIs (6 columnas) */
.informe-kpis-new {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    padding: 18px 30px;
    background: white;
}

.kpi-item-new {
    text-align: center;
    padding: 14px 10px;
    background: linear-gradient(135deg, #f5f5f5 0%, #fafafa 100%);
    border-radius: 8px;
    border-left: 4px solid #2E7D32;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-item-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.kpi-label-new {
    font-size: 10px;
    color: #666;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value-new {
    font-size: 22px;
    font-weight: 800;
    color: #1B5E20;
    line-height: 1.2;
}

.kpi-sub-new {
    font-size: 9px;
    color: #999;
    margin-top: 3px;
    font-weight: 500;
}

/* Fila de información del productor */
.informe-info-row-new {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
    gap: 1px;
    background: #d0ddd0;
    margin: 0 30px 18px 30px;
    border-radius: 6px;
    overflow: hidden;
}

.info-cell-new {
    background: white;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label-new {
    font-size: 9px;
    color: #888;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value-new {
    font-size: 13px;
    color: #333;
    font-weight: 600;
    line-height: 1.3;
}

/* Gráficos (3 columnas) */
.informe-charts-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 0 30px 16px 30px;
}

/* Layout dinámico según gráficos visibles */
.informe-charts-row-3.layout-1-col {
    grid-template-columns: 1fr !important;
}

.informe-charts-row-3.layout-2-col {
    grid-template-columns: repeat(2, 1fr) !important;
}

.informe-charts-row-3.layout-3-col {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* Legacy aliases */
.informe-charts-row-3.full-width {
    grid-template-columns: 1fr !important;
}

.informe-charts-row-3.three-columns {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* Row 2 layout dinámico */
.informe-charts-row-2.layout-1-col {
    grid-template-columns: 1fr !important;
}

.informe-charts-row-2.layout-2-col {
    grid-template-columns: repeat(2, 1fr) !important;
}

/* Gráficos (2 columnas) */
.informe-charts-row-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 30px 16px 30px;
}

/* Gráficos (1 columna) */
.informe-charts-row-1 {
    padding: 0 30px 16px 30px;
}

.chart-container-new {
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8ece8;
}

.chart-title-new {
    font-size: 12px;
    font-weight: 700;
    color: #1B5E20;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid #e8f5e9;
    padding-bottom: 8px;
}

.chart-title-new i {
    font-size: 13px;
    color: #2E7D32;
}

.chart-subtitle-new {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-left: auto;
    text-transform: none;
}

.chart-total-new {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-left: auto;
    text-transform: none;
}

.informe-chart-container-new {
    min-height: 260px;
}

/* Tabla de colores (SIN columna BRIX) */
.color-table-new {
    width: 100%;
    margin-top: 12px;
    border-collapse: collapse;
    font-size: 12px;
}

.color-table-new th {
    background: #f5f5f5;
    padding: 6px 10px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    border-bottom: 2px solid #2E7D32;
}

.color-table-new td {
    padding: 5px 10px;
    font-size: 11px;
    border-bottom: 1px solid #e0e0e0;
}

.color-table-new td:first-child {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Sección inferior */
.informe-bottom-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 30px 16px 30px;
}

.bottom-section-new {
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8ece8;
}

.section-title-new {
    font-size: 12px;
    font-weight: 700;
    color: #1B5E20;
    margin: 0 0 14px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid #e8f5e9;
    padding-bottom: 8px;
}

.section-title-new i {
    font-size: 13px;
    color: #2E7D32;
}

.camion-data {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.camion-row {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    gap: 8px 12px;
    align-items: center;
}

.camion-label {
    font-size: 11px;
    color: #888;
    font-weight: 600;
}

.camion-value {
    font-size: 13px;
    color: #333;
    font-weight: 700;
}

.camion-temp {
    color: #d32f2f;
}

.observaciones-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.observacion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #333;
    padding: 4px 0;
}

.observacion-item i {
    color: #2E7D32;
    font-size: 16px;
    flex-shrink: 0;
}

/* Footer verde oscuro */
.informe-footer-new {
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%);
    color: white;
    padding: 12px 30px;
    text-align: center;
    font-size: 11px;
    opacity: 0.95;
}

/* Acciones (botón PDF) */
.informe-actions-new {
    padding: 16px 30px;
    display: flex;
    justify-content: flex-end;
    background: white;
    border-radius: 0 0 12px 12px;
}

.download-pdf-btn-new {
    background: linear-gradient(135deg, #2E7D32 0%, #43A047 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
    transition: all 0.3s;
}

.download-pdf-btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 125, 50, 0.4);
}

.download-pdf-btn-new:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.no-data-msg {
    text-align: center;
    color: var(--text-muted, #94a3b8);
    font-size: 0.85rem;
    padding: 30px 20px;
    font-style: italic;
}

/* "Ver Informe" button in table */
.btn-informe-ver {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-informe-ver:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(15,76,53,0.3);
}

.btn-informe-ver i {
    font-size: 0.7rem;
}

/* Responsive Informe Modal */
@media (max-width: 1200px) {
    .informe-charts-row-3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 992px) {
    .informe-kpis-new {
        grid-template-columns: repeat(3, 1fr);
    }
    .informe-charts-row-3 {
        grid-template-columns: 1fr;
    }
    .informe-charts-row-2 {
        grid-template-columns: 1fr;
    }
    .informe-bottom-row {
        grid-template-columns: 1fr;
    }
    .informe-info-row-new {
        grid-template-columns: repeat(3, 1fr);
    }
    .modal-informe-content {
        width: 98%;
        margin: 10px auto;
    }
    .informe-header-new {
        flex-wrap: wrap;
    }
}

@media (max-width: 576px) {
    .informe-kpis-new {
        grid-template-columns: repeat(2, 1fr);
    }
    .informe-info-row-new {
        grid-template-columns: repeat(2, 1fr);
    }
    .informe-header-new {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }
    .informe-header-right-new {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
    }
    .informe-kpis-new,
    .informe-charts-row-3,
    .informe-charts-row-2,
    .informe-bottom-row,
    .informe-info-row-new {
        padding-left: 16px;
        padding-right: 16px;
    }
    .informe-actions-new {
        padding: 12px 16px;
    }
    .download-pdf-btn-new {
        width: 100%;
        justify-content: center;
    }
}



/* =================================================================
   ADMIN CACHE MANAGEMENT — Enhanced Styles
   ================================================================= */

.cache-management-section {
    margin-top: 1.5rem;
}

.cache-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .cache-actions-grid {
        grid-template-columns: 1fr;
    }
}

.cache-action-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: var(--transition);
}

.cache-action-card:hover {
    border-color: var(--secondary-light);
    box-shadow: var(--shadow-md);
}

.cache-action-card h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cache-action-card h5 i {
    color: var(--secondary);
}

.cache-input-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.cache-input-group input,
.cache-input-group select {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--card);
}

.cache-input-group input:focus,
.cache-input-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15,76,53,0.08);
    outline: none;
}

.cache-input-group .btn-cache-action {
    white-space: nowrap;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cache-input-group .btn-cache-action:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.cache-input-group .btn-cache-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cache-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.cache-status-item {
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    text-align: center;
}

.cache-status-item .status-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.cache-status-item .status-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.cache-log {
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-top: 0.75rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.cache-log .log-entry {
    padding: 0.15rem 0;
    border-bottom: 1px solid var(--border-light);
}

.cache-log .log-entry:last-child {
    border-bottom: none;
}

.cache-log .log-success { color: var(--success); }
.cache-log .log-error { color: var(--danger); }
.cache-log .log-info { color: var(--info); }

/* Progress bar for cache generation */
.cache-progress {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 0.5rem;
}

.cache-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary-light));
    border-radius: var(--radius-full);
    transition: width 0.5s var(--ease);
    position: relative;
}

.cache-progress-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s ease-in-out infinite;
    background-size: 200% 100%;
}

/* =================================================================
   ENHANCED CARD ANIMATIONS
   ================================================================= */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.chart-card,
.kpi-card {
    animation: fadeInUp 0.4s var(--ease) both;
}

.chart-card:nth-child(1) { animation-delay: 0.05s; }
.chart-card:nth-child(2) { animation-delay: 0.10s; }
.chart-card:nth-child(3) { animation-delay: 0.15s; }
.chart-card:nth-child(4) { animation-delay: 0.20s; }

.kpi-card:nth-child(1) { animation-delay: 0.02s; }
.kpi-card:nth-child(2) { animation-delay: 0.04s; }
.kpi-card:nth-child(3) { animation-delay: 0.06s; }
.kpi-card:nth-child(4) { animation-delay: 0.08s; }
.kpi-card:nth-child(5) { animation-delay: 0.10s; }
.kpi-card:nth-child(6) { animation-delay: 0.12s; }
.kpi-card:nth-child(7) { animation-delay: 0.14s; }

/* =================================================================
   EXPORT BUTTONS — Use Variables
   ================================================================= */

.btn-export-excel {
    background: linear-gradient(135deg, var(--excel-green), #1a5c38) !important;
}

.btn-export-pdf {
    background: linear-gradient(135deg, var(--pdf-red), #b71c1c) !important;
}


/* ========================================
   Loader para Informe de Recepción
   ======================================== */
.informe-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: loaderFadeIn 0.3s ease;
}

.informe-loader-content {
  background: var(--bg-white, #fff);
  padding: 40px 60px;
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-lg, 0 10px 40px rgba(0,0,0,0.2));
  text-align: center;
  animation: loaderSlideUp 0.4s ease;
}

.informe-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border: 4px solid var(--border-color, #e0e0e0);
  border-top: 4px solid var(--primary-green, #1B5E20);
  border-radius: 50%;
  animation: loaderSpin 1s linear infinite;
}

@keyframes loaderSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes loaderFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes loaderSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.informe-loader .loader-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-dark, #333);
  margin: 0;
}

.informe-loader .loader-subtext {
  font-size: 0.875rem;
  color: var(--text-light, #888);
  margin-top: 8px;
  font-weight: 400;
  min-height: 1.2em;
}



/* =================================================================
   MAIN DASHBOARD TABS (Producción / Recepción)
   ================================================================= */

.main-dashboard-tabs {
    display: flex;
    gap: 0;
    margin: 0 0 24px 0;
    background: var(--surface);
    border-radius: var(--radius-lg, 12px);
    padding: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid var(--border, #e2e8f0);
}

.main-tab-button {
    flex: 1;
    padding: 14px 24px;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--radius-md, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
}

.main-tab-button:hover {
    color: var(--primary);
    background: rgba(15, 76, 53, 0.05);
}

.main-tab-button.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    box-shadow: 0 4px 12px rgba(15, 76, 53, 0.3);
}

.main-tab-button.active i {
    color: #fff;
}

.main-tab-button i {
    font-size: 1.1rem;
}

.main-dashboard-tabs.compact {
    margin: 0;
    padding: 4px;
    max-width: 460px;
}

.main-dashboard-tabs.compact .main-tab-button {
    padding: 10px 12px;
    font-size: 0.88rem;
}

/* Section visibility */
.main-dashboard-section {
    animation: fadeSlideIn 0.35s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =================================================================
   RECEPCIÓN SECTION — Species Filter
   ================================================================= */

.recepcion-species-filter {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 24px 0;
    padding: 16px 20px;
    background: var(--surface, #fff);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border: 1px solid var(--border, #e2e8f0);
}

.recepcion-species-filter label {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    font-size: 0.95rem;
    white-space: nowrap;
}

.recepcion-species-filter label i {
    color: var(--primary);
    margin-right: 4px;
}

.recepcion-species-filter select {
    padding: 10px 16px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-md, 8px);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    min-width: 220px;
    background: #fff;
    color: var(--text-primary, #1e293b);
    transition: all 0.2s ease;
}

.recepcion-species-filter select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 76, 53, 0.1);
}

/* Responsive adjustments for main tabs */
@media (max-width: 768px) {
    .main-dashboard-tabs {
        flex-direction: column;
        gap: 4px;
    }
    
    .main-tab-button {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .recepcion-species-filter {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .recepcion-species-filter select {
        width: 100%;
        min-width: unset;
    }
}


/* Toolbar vista planta (productores) */
.planta-productores-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.planta-productores-toolbar .btn.active {
    background: var(--primary-color, #2e7d32);
    color: #fff;
    border-color: var(--primary-color, #2e7d32);
}

.planta-productores-count {
    font-size: 0.9rem;
    color: #5f6b7a;
}

.planta-productores-search {
    margin-left: auto;
    min-width: 240px;
}

.planta-productores-search label {
    display: block;
    font-size: 0.78rem;
    margin-bottom: 4px;
    color: #5f6b7a;
}

@media (max-width: 768px) {
    .planta-productores-search {
        margin-left: 0;
        width: 100%;
        min-width: 100%;
    }
}

/* =================================================================
   OPERATIONAL REDESIGN - 2026 refresh
   ================================================================= */

.dashboard-container {
    max-width: 1680px;
    padding-top: 0.85rem;
}

.dashboard-header {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}

.dashboard-header::before { display: none; }
.dashboard-title { letter-spacing: 0; font-size: 1.35rem; }
.dashboard-title i { color: var(--primary); }
.header-subtitle { color: var(--text-secondary); opacity: 1; }

.dashboard-status-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 38px;
    padding: 0.45rem 0.7rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.status-pill i {
    color: var(--primary);
    flex: 0 0 auto;
}

.status-pill span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-pill.cache-pill i { color: var(--info); }

.filters-section,
.species-tabs-section,
.main-dashboard-tabs,
.kpi-card,
.chart-card,
.table-container,
.admin-card,
.cache-action-card,
.admin-stat-card {
    border-radius: 8px !important;
}

.filters-section {
    padding: 0.8rem 1rem;
    margin-bottom: 0.85rem;
    box-shadow: none;
}

.filters-header { margin-bottom: 0.55rem; }
.filters-header h3 { color: var(--text); font-size: 0.86rem; }

.filters-form {
    gap: 0.65rem;
    align-items: end;
}

.filter-group { gap: 0.22rem; }
.filter-group label {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.filter-input,
.multi-select-display {
    min-height: 38px;
    border-radius: 8px;
    border-color: var(--border);
    background: #fbfcfe;
}

.species-tabs-section {
    background: transparent;
    border: 0;
    box-shadow: none;
    margin-bottom: 0.85rem;
}

.species-tabs {
    gap: 0.4rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.35rem;
}

.species-tab {
    min-height: 38px;
    border-radius: 7px !important;
    box-shadow: none !important;
}

.main-dashboard-tabs {
    justify-content: flex-start;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: none;
    padding: 0.35rem;
    margin-bottom: 0.85rem;
}

.main-tab-button {
    border-radius: 7px;
    min-width: 150px;
    padding: 0.55rem 0.85rem;
    font-size: 0.82rem;
}

.kpis-section .section-title,
.section-title {
    color: var(--text);
    font-size: 0.95rem;
    letter-spacing: 0;
    margin-bottom: 0.65rem;
}

.kpis-grid {
    gap: 0.65rem;
}

.kpi-card {
    min-height: 96px;
    padding: 0.85rem;
    box-shadow: none;
    border: 1px solid var(--border);
}

.kpi-card::before {
    width: 4px;
    opacity: 1;
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.kpi-label {
    font-size: 0.68rem;
    letter-spacing: 0;
}

.kpi-value {
    font-size: 1.25rem;
    letter-spacing: 0;
}

.chart-card {
    box-shadow: none;
    border: 1px solid var(--border);
}

.chart-card:hover {
    transform: none;
    box-shadow: var(--shadow-md);
}

.chart-header {
    padding: 0.7rem 0.9rem;
    background: #fbfcfe;
    border-bottom: 1px solid var(--border);
}

.chart-header h3 {
    font-size: 0.84rem;
    letter-spacing: 0;
}

.chart-container {
    min-height: 280px;
}

.admin-container {
    max-width: 1600px;
}

.admin-header,
.admin-tabs,
.admin-card {
    border-radius: 8px;
}

.admin-card {
    box-shadow: none;
    border: 1px solid var(--border);
}

.cache-action-card {
    box-shadow: none;
    border: 1px solid var(--border);
}

@media (max-width: 900px) {
    .dashboard-status-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .dashboard-status-strip {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        padding: 0.85rem;
    }

    .main-tab-button {
        min-width: 0;
        flex: 1;
    }
}

/* =================================================================
   DASHBOARD VISUAL LIFT - cleaner, brighter, operational
   ================================================================= */

body {
    background:
        linear-gradient(180deg, #f8fbfc 0%, #eef4f7 48%, #f7faf9 100%);
}

.dashboard-container {
    padding: 1.05rem clamp(0.75rem, 1.8vw, 1.6rem) 2rem;
}

.dashboard-header {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 82px;
    padding: 1.1rem 1.35rem;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(247,252,250,0.98) 55%, rgba(255,248,248,0.92) 100%);
    border: 1px solid #dce8e4;
    border-left: 0;
    box-shadow: 0 16px 40px rgba(20, 48, 38, 0.08);
}

.dashboard-header::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 7px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--success) 55%, var(--cerezas) 100%);
}

.dashboard-title {
    gap: 0.65rem;
    font-size: 1.55rem;
    font-weight: 850;
}

.dashboard-title i {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 76, 53, 0.22);
}

.header-subtitle {
    margin-top: 0.25rem;
    font-weight: 600;
}

.dashboard-status-strip {
    grid-template-columns: 1.15fr 1fr 1fr;
    gap: 0.65rem;
}

.status-pill {
    min-height: 44px;
    padding: 0.55rem 0.85rem;
    background: rgba(255,255,255,0.92);
    border: 1px solid #dce8e4;
    box-shadow: 0 10px 28px rgba(15, 76, 53, 0.06);
}

.status-pill i {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    color: var(--primary);
    background: #edf7f2;
}

.filters-section {
    position: relative;
    background: rgba(255,255,255,0.96);
    border: 1px solid #dfe8ed;
    box-shadow: 0 18px 44px rgba(25, 45, 60, 0.08);
    padding: 0.95rem 1.05rem;
}

.filters-section::before {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    top: 0;
    height: 3px;
    border-radius: 0 0 8px 8px;
    background: linear-gradient(90deg, var(--primary), var(--info), var(--cerezas), var(--peras));
}

.filters-header h3 {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.92rem;
    font-weight: 850;
}

.filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 0.75rem;
}

.filter-group label {
    font-weight: 800;
    color: #526071;
}

.filter-input,
.multi-select-display {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid #d8e2ea;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.filter-input:focus,
.multi-select-display:hover {
    border-color: rgba(15, 76, 53, 0.36);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.10);
}

.multi-select-dropdown {
    border: 1px solid #d8e2ea;
    box-shadow: 0 18px 38px rgba(15, 35, 50, 0.16);
}

.multi-select-option:hover {
    background: #f1f8f5;
}

.filter-buttons {
    display: grid;
    grid-template-columns: minmax(112px, 1fr) minmax(92px, 0.7fr);
    align-items: end;
    gap: 0.5rem;
}

.btn-filter,
.btn-reset {
    min-height: 40px;
    border-radius: 8px;
    font-weight: 850;
}

.btn-apply-filters {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 12px 24px rgba(15, 76, 53, 0.18);
}

.btn-reset {
    padding: 0 0.7rem;
    color: #526071;
    background: #f7fafc;
    border: 1px solid #d8e2ea;
}

.species-tabs-section {
    margin-top: 0.15rem;
}

.species-tabs {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    background: rgba(255,255,255,0.86);
    border-color: #dfe8ed;
    box-shadow: 0 12px 30px rgba(25,45,60,0.07);
}

.species-tab {
    border: 1px solid transparent !important;
    color: #1f2937;
    background: transparent;
    font-weight: 850;
    letter-spacing: 0;
}

.species-tab i {
    font-size: 0.95rem;
}

.species-tab.cerezas.active {
    color: #fff !important;
    background: linear-gradient(135deg, #e11d48, #b91c1c) !important;
}

.species-tab.peras.active {
    color: #fff !important;
    background: linear-gradient(135deg, #a3a30f, #7c7c03) !important;
}

.species-tab.kiwis.active,
.species-tab.kiwi.active {
    color: #fff !important;
    background: linear-gradient(135deg, #16803a, #0f6b2d) !important;
}

.species-tab.ciruelas.active {
    color: #fff !important;
    background: linear-gradient(135deg, #7c3aed, #5b21b6) !important;
}

.species-tab.nectarines.active,
.species-tab.nectarin.active {
    color: #fff !important;
    background: linear-gradient(135deg, #f97316, #c2410c) !important;
}

.main-dashboard-tabs {
    background: rgba(255,255,255,0.94);
    box-shadow: 0 14px 34px rgba(25,45,60,0.08);
}

.main-tab-button {
    font-weight: 850;
}

.main-tab-button.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 12px 26px rgba(15, 76, 53, 0.22);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 900;
}

.section-title i {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.kpis-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.kpi-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border-color: #dfe8ed;
    box-shadow: 0 12px 30px rgba(25,45,60,0.07);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(25,45,60,0.11);
}

.kpi-icon {
    box-shadow: 0 10px 20px rgba(15,76,53,0.12);
}

.chart-card,
.table-container {
    background: rgba(255,255,255,0.98);
    border-color: #dfe8ed;
    box-shadow: 0 16px 36px rgba(25,45,60,0.08);
}

.chart-card:hover {
    box-shadow: 0 22px 48px rgba(25,45,60,0.12);
}

.chart-header {
    min-height: 48px;
    background: linear-gradient(180deg, #ffffff, #f7fafc);
}

.chart-header h3 {
    font-weight: 900;
}

.chart-header h3 i {
    color: var(--primary);
}

.chart-badge {
    border: 1px solid #dce8e4;
    background: #eff7f4;
    color: var(--primary);
    font-weight: 850;
}

.data-table thead th {
    background: #f3f7f8;
    color: #334155;
    font-weight: 850;
}

@media (max-width: 900px) {
    .dashboard-status-strip {
        grid-template-columns: 1fr;
    }

    .species-tabs {
        display: flex;
        width: 100%;
        overflow-x: auto;
    }
}

/* =================================================================
   PORTAL CLIENTES 2026 - PRODUCT UI SYSTEM
   ================================================================= */

:root {
    --primary: #12322b;
    --primary-light: #1f5f4b;
    --primary-hover: #0b241e;
    --secondary: #0f8a6a;
    --secondary-light: #2ab68e;
    --accent: #2563eb;
    --accent-warm: #d97706;
    --accent-red: #dc2626;

    --success: #10a66d;
    --info: #2563eb;
    --warning: #d97706;
    --danger: #dc2626;
    --purple: #7c3aed;

    --bg: #f4f7f6;
    --bg-subtle: #eef3f2;
    --bg-hover: #edf8f4;
    --card: #ffffff;
    --text: #17211f;
    --text-secondary: #53615d;
    --text-muted: #84928e;
    --border: #dfe8e5;
    --border-light: #edf3f1;

    --shadow-sm: 0 1px 2px rgba(18, 50, 43, 0.06), 0 1px 3px rgba(18, 50, 43, 0.08);
    --shadow-md: 0 10px 28px rgba(18, 50, 43, 0.08);
    --shadow-lg: 0 18px 48px rgba(18, 50, 43, 0.11);
    --shadow-xl: 0 30px 80px rgba(18, 50, 43, 0.16);

    --radius-sm: 8px;
    --radius-md: 8px;
    --radius-lg: 8px;
    --radius-xl: 8px;
}

html {
    background: #eef3f2;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(244,247,246,0.96) 40%, rgba(239,244,242,1) 100%),
        repeating-linear-gradient(90deg, rgba(18,50,43,0.035) 0 1px, transparent 1px 84px),
        repeating-linear-gradient(0deg, rgba(18,50,43,0.025) 0 1px, transparent 1px 84px);
    color: var(--text);
    letter-spacing: 0;
}

body::selection {
    color: #fff;
    background: var(--primary);
}

a,
button,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 2px;
}

.main-navbar {
    height: 64px;
    padding: 0 clamp(0.75rem, 2vw, 1.5rem);
    background: rgba(255, 255, 255, 0.84);
    border-bottom: 1px solid rgba(210, 224, 219, 0.9);
    box-shadow: 0 10px 36px rgba(18, 50, 43, 0.08);
    backdrop-filter: blur(18px);
}

.nav-inner {
    max-width: 1920px;
    gap: 1rem;
}

.nav-brand {
    min-width: 0;
    color: var(--text);
    gap: 0.7rem;
}

.nav-brand:hover {
    color: var(--primary);
}

.nav-logo-shell {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border: 1px solid rgba(18, 50, 43, 0.12);
    background: #fff;
    box-shadow: 0 8px 20px rgba(18, 50, 43, 0.08);
}

.nav-logo-shell img {
    width: 32px;
    height: auto;
}

.nav-brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.05;
}

.nav-brand-text {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 850;
    letter-spacing: 0;
}

.nav-brand-subtext {
    margin-top: 0.17rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 750;
    text-transform: uppercase;
}

.nav-actions {
    gap: 0.4rem;
    min-width: 0;
}

.nav-link-item,
.nav-user,
.nav-logout {
    min-height: 40px;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 800;
}

.nav-link-item:hover,
.nav-logout:hover {
    color: var(--primary);
    background: #f1f7f4;
    border-color: #dce8e4;
}

.nav-user {
    color: var(--primary);
    background: #eff7f4;
    border-color: #dce8e4;
    opacity: 1;
}

.nav-logout {
    color: var(--danger);
}

.dashboard-container,
.admin-container {
    max-width: 1840px;
    padding: 1.35rem 1.75rem 2.5rem;
}

.dashboard-header,
.admin-header {
    min-height: 96px;
    color: var(--text);
    background:
        linear-gradient(135deg, #ffffff 0%, #f7fbfa 52%, #fff7ed 100%);
    border: 1px solid var(--border);
    border-left: 6px solid var(--primary);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.dashboard-header::before,
.dashboard-header::after {
    display: none;
}

.header-content {
    width: 100%;
}

.dashboard-title,
.admin-header h2 {
    color: var(--text);
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: 0;
}

.dashboard-title i,
.admin-header h2 i {
    width: 42px;
    height: 42px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 8px;
    box-shadow: 0 14px 28px rgba(18, 50, 43, 0.18);
}

.header-subtitle,
.admin-subtitle,
.admin-header p {
    color: var(--text-secondary);
    font-weight: 650;
}

.dashboard-status-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.status-pill {
    border-radius: 8px;
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.filters-section,
.species-tabs-section,
.main-dashboard-tabs,
.table-tabs,
.admin-tabs,
.admin-card,
.admin-stat-card,
.cache-action-card,
.chart-card,
.kpi-card,
.table-container {
    border-radius: 8px;
}

.filters-section {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.94);
    box-shadow: var(--shadow-md);
}

.filters-section::before {
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--accent-warm), var(--accent-red));
}

.filters-header h3,
.section-title,
.chart-header h3,
.admin-card-header h4,
.species-config-panel h5,
.cache-action-card h5 {
    color: var(--text);
    letter-spacing: 0;
}

.filter-input,
.multi-select-display,
.form-input,
.cache-input-group input,
.cache-input-group select,
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    min-height: 42px;
    color: var(--text);
    border: 1px solid #d7e3df;
    border-radius: 8px;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

.filter-input:focus,
.form-input:focus,
.multi-select-display:hover,
.cache-input-group input:focus,
.cache-input-group select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: rgba(37,99,235,0.55);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.11);
}

.btn-filter,
.btn-primary-admin,
.btn-admin-action,
.btn-cache-action,
.download-pdf-btn-new,
.login-btn {
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 14px 28px rgba(18, 50, 43, 0.18);
}

.btn-reset,
.btn-secondary-admin,
.btn-toggle-filters {
    border-radius: 8px;
    background: #f8fbfa;
    border: 1px solid var(--border);
}

.btn-filter:hover,
.btn-primary-admin:hover,
.btn-admin-action:hover,
.btn-cache-action:hover,
.download-pdf-btn-new:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(18, 50, 43, 0.22);
}

.species-tabs,
.main-dashboard-tabs,
.admin-tabs,
.table-tabs {
    padding: 0.28rem;
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.species-tab,
.main-tab-button,
.admin-tab,
.tab-button {
    border-radius: 8px;
    font-weight: 850;
    transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.species-tab:hover,
.main-tab-button:hover,
.admin-tab:hover,
.tab-button:hover {
    transform: translateY(-1px);
}

.main-tab-button.active,
.admin-tab.active,
.tab-button.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 12px 24px rgba(18, 50, 43, 0.18);
}

.kpis-grid {
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
}

.kpi-card {
    min-height: 112px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.kpi-card::before {
    width: 4px;
    opacity: 1;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
}

.kpi-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 850;
}

.kpi-value {
    color: var(--text);
    font-size: 1.45rem;
    line-height: 1.1;
}

.charts-grid {
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

.chart-card,
.table-container,
.admin-card,
.cache-action-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.chart-card:hover,
.kpi-card:hover,
.admin-card:hover,
.cache-action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.chart-header,
.admin-card-header {
    background: linear-gradient(180deg, #ffffff, #f7faf9);
    border-bottom: 1px solid var(--border);
}

.chart-body {
    min-height: 320px;
}

.chart-container {
    min-height: 300px;
}

#chartsSection .charts-grid,
#recepcionChartsSection .charts-grid {
    grid-template-columns: repeat(var(--client-chart-columns, 2), minmax(0, 1fr));
}

.chart-density-control {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    width: 100%;
    margin: -0.25rem 0 0.85rem;
    color: #526b63;
    font-size: 0.75rem;
    font-weight: 850;
}

.dashboard-status-strip .chart-density-control {
    justify-content: space-between;
    width: auto;
    min-height: 38px;
    margin: 0;
    padding: 0.35rem 0.45rem 0.35rem 0.7rem;
    background: #ffffff;
    border: 1px solid #dbe8e3;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.chart-density-options {
    display: inline-flex;
    gap: 0.18rem;
    padding: 0.2rem;
    background: #f3faf7;
    border: 1px solid #d8e6e1;
    border-radius: 8px;
}

.chart-density-options button {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 28px;
    color: #526b63;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.chart-density-options button:hover {
    color: var(--primary);
    background: #ffffff;
}

.chart-density-options button.active {
    color: #ffffff;
    background: linear-gradient(135deg, #12322b, #0f6b4c);
    box-shadow: 0 8px 18px rgba(18,50,43,0.18);
}

@media (max-width: 900px) {
    #chartsSection .charts-grid,
    #recepcionChartsSection .charts-grid {
        grid-template-columns: 1fr !important;
    }

    .chart-density-control {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

.chart-badge,
.tab-count,
.badge,
.producer-group-count,
.planta-productores-count {
    border-radius: 999px;
}

.table-wrapper,
.admin-card-body {
    overflow: auto;
}

.data-table,
.admin-table {
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th,
.admin-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: #33413d;
    background: #edf3f1;
    border-bottom: 1px solid #d7e3df;
}

.data-table tbody td,
.admin-table td {
    border-bottom: 1px solid #edf3f1;
}

.data-table tbody tr:hover,
.admin-table tbody tr:hover {
    background: #f3faf7;
}

.dashboard-container {
    background:
        linear-gradient(180deg, rgba(237,247,242,0.72) 0%, rgba(247,250,249,0) 310px),
        var(--bg);
}

.dashboard-header {
    border: 1px solid rgba(18,50,43,0.18);
    background:
        linear-gradient(135deg, #12322b 0%, #0f6b4c 62%, #20956d 100%);
    box-shadow: 0 22px 50px rgba(18,50,43,0.18);
}

.dashboard-title,
.dashboard-title i,
.header-subtitle {
    color: #ffffff;
}

.dashboard-status-strip {
    border: 1px solid #dbe8e3;
    background: rgba(255,255,255,0.86);
    backdrop-filter: blur(10px);
    box-shadow: 0 14px 34px rgba(18,50,43,0.08);
}

.status-pill {
    min-height: 38px;
    border: 1px solid #dbe8e3;
    background: #f8fcfa;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.78);
}

.filters-section,
.species-tabs-section,
.planta-view-selector {
    border: 1px solid #dbe8e3;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 14px 34px rgba(18,50,43,0.07);
}

.planta-view-selector {
    position: relative;
    overflow: hidden;
}

.planta-view-selector::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #12322b, #21a275, #9ad9be);
}

.section-title {
    color: #162923;
}

.section-title i {
    color: var(--primary);
}

.no-data {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 1.25rem;
    color: #587068;
    background: #f8fcfa;
    border: 1px dashed #cfe0da;
    border-radius: 8px;
    font-weight: 750;
}

.dataTables_wrapper .top {
    gap: 0.75rem;
    padding: 0.9rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.dataTables_wrapper .dt-buttons,
.dataTables_wrapper div.dt-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    margin-left: 0.55rem;
}

.btn-export,
.dt-button {
    border-radius: 8px !important;
    font-weight: 850 !important;
    margin: 0 !important;
}

.species-tab.all.active,
.species-tab.all:hover {
    color: #ffffff !important;
    border-color: var(--primary) !important;
    background: linear-gradient(135deg, #12322b, #0f6b4c) !important;
    box-shadow: 0 12px 26px rgba(18,50,43,0.22) !important;
}

.species-tab.all.active i,
.species-tab.all:hover i {
    color: #ffffff !important;
}

.admin-grid-2col,
.species-config-grid,
.cache-actions-grid,
.cache-status-grid {
    gap: 1rem;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-tabs {
    position: sticky;
    top: 76px;
    z-index: 20;
}

.admin-tab-content {
    animation: fadeSlideUp 0.24s ease both;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.user-avatar {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 8px 18px rgba(18, 50, 43, 0.18);
}

.producer-list,
.producer-checkboxes,
.cache-log {
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fbfdfc;
}

.producer-group-header,
.producer-option,
.species-config-item,
.cache-status-item {
    border-radius: 8px;
}

.btn-sm-action {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
}

.modal-informe {
    backdrop-filter: blur(8px);
}

.modal-informe-content {
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: var(--shadow-xl);
}

.informe-header-new,
.informe-kpis-new,
.informe-info-row-new,
.chart-container-new,
.bottom-section-new {
    border-radius: 8px;
}

.informe-kpis-new,
.informe-info-row-new,
.chart-container-new,
.bottom-section-new {
    border: 1px solid #e2e8f0;
    background: #fff;
}

.loading-spinner,
.informe-loader-content,
.toast {
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.container-fluid.py-4 {
    max-width: 1840px;
    padding: 1.35rem 1.75rem 2.5rem !important;
}

.container-fluid.py-4 > h1 {
    display: flex;
    align-items: center;
    min-height: 88px;
    margin-bottom: 1rem !important;
    padding: 1rem 1.25rem;
    color: var(--text) !important;
    font-size: 1.75rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, #f7fbfa 52%, #fff7ed 100%);
    border: 1px solid var(--border);
    border-left: 6px solid var(--primary);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.container-fluid .card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.container-fluid .card-body {
    padding: 1.1rem;
}

.container-fluid canvas {
    min-height: 280px;
}

.container-fluid .form-control,
.container-fluid .form-select {
    min-height: 42px;
    border: 1px solid #d7e3df;
    border-radius: 8px;
}

.container-fluid .btn {
    min-height: 42px;
    border-radius: 8px;
    font-weight: 850;
}

.login-page {
    background:
        linear-gradient(135deg, rgba(18,50,43,0.96) 0%, rgba(20,68,58,0.95) 42%, rgba(122,43,32,0.88) 100%),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0 1px, transparent 1px 72px),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 72px) !important;
}

.login-bg-shapes {
    display: none;
}

.login-container {
    max-width: 1040px !important;
    padding: 1.75rem !important;
}

.login-container::before {
    content: "Portal de Productores";
    position: absolute;
    left: 2.5rem;
    top: 50%;
    width: min(420px, 42vw);
    transform: translateY(-50%);
    color: rgba(255,255,255,0.96);
    font-size: 4rem;
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: 0;
}

.login-container::after {
    content: "Control de recepcion, produccion y calidad en una experiencia rapida, clara y responsiva.";
    position: absolute;
    left: 2.5rem;
    top: calc(50% + 7rem);
    width: min(430px, 42vw);
    color: rgba(255,255,255,0.76);
    font-weight: 650;
    line-height: 1.45;
}

.login-card {
    width: min(420px, 100%);
    margin-left: auto;
    border-radius: 8px !important;
    border: 1px solid rgba(255,255,255,0.45);
    box-shadow: 0 32px 90px rgba(0,0,0,0.32) !important;
}

.login-title {
    letter-spacing: 0 !important;
}

.login-footer p {
    color: var(--text-muted) !important;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1100px) {
    .login-container::before,
    .login-container::after {
        display: none;
    }

    .login-card {
        margin: 0 auto;
    }
}

@media (max-width: 900px) {
    .main-navbar {
        height: auto;
        min-height: 60px;
    }

    .nav-inner {
        min-height: 60px;
    }

    .nav-brand-subtext,
    .nav-link-label,
    .nav-user span {
        display: none;
    }

    .nav-link-item,
    .nav-user,
    .nav-logout {
        width: 40px;
        justify-content: center;
        padding: 0;
    }

    .dashboard-status-strip,
    .filters-form,
    .admin-grid-2col,
    .species-config-grid,
    .cache-actions-grid {
        grid-template-columns: 1fr !important;
    }

    .admin-tabs {
        top: 64px;
        overflow-x: auto;
    }
}

@media (max-width: 576px) {
    .dashboard-container,
    .admin-container {
        padding: 0.75rem 0.65rem 1.5rem;
    }

    .dashboard-header,
    .admin-header {
        min-height: 0;
        padding: 1rem;
    }

    .dashboard-title,
    .admin-header h2 {
        font-size: 1.18rem;
    }

    .dashboard-title i,
    .admin-header h2 i {
        width: 36px;
        height: 36px;
    }

    .kpis-grid,
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-body {
        min-height: 250px;
    }

    .chart-container {
        min-height: 230px;
    }

    .login-card {
        padding: 1.5rem 1.1rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}

/* =================================================================
   INTERACTION LIFT - EXPANDABLE CHARTS AND MODAL POLISH
   ================================================================= */

body.modal-open {
    overflow: hidden;
}

.chart-header,
.chart-title-new {
    position: relative;
}

.chart-header {
    gap: 0.75rem;
}

.chart-header h3,
.chart-title-new {
    min-width: 0;
}

.chart-expand-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    margin-left: auto;
    color: var(--primary);
    background: #eef7f4;
    border: 1px solid #d6e6e0;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(18, 50, 43, 0.08);
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.chart-title-new .chart-expand-btn {
    float: right;
    margin-top: -0.35rem;
}

.chart-expand-btn:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 12px 24px rgba(18, 50, 43, 0.18);
    transform: translateY(-1px);
}

.chart-expand-btn:active {
    transform: translateY(0);
}

.chart-canvas-wrapper {
    position: relative;
}

.chart-canvas-expand {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
}

.chart-zoom-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background:
        linear-gradient(135deg, rgba(6, 18, 16, 0.84), rgba(18, 50, 43, 0.82)),
        rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(12px);
}

.chart-zoom-modal.show {
    display: flex;
}

.chart-zoom-dialog {
    display: grid;
    grid-template-rows: auto 1fr;
    width: min(1320px, 97vw);
    height: min(820px, 94vh);
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(255,255,255,0.26);
    border-radius: 8px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
    animation: chartZoomIn 0.18s ease both;
}

.chart-zoom-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    color: var(--text);
    background:
        linear-gradient(180deg, #ffffff 0%, #f6faf8 100%);
    border-bottom: 1px solid var(--border);
}

.chart-zoom-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 0.5rem;
    color: var(--primary);
    background: #edf7f2;
    border: 1px solid #d6e6e0;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.chart-zoom-header h2 {
    margin: 0.35rem 0 0;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 0;
}

.chart-zoom-close {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: var(--text-secondary);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.chart-zoom-close:hover {
    color: #fff;
    background: var(--danger);
    transform: translateY(-1px);
}

.chart-zoom-body {
    display: grid;
    align-items: stretch;
    justify-items: stretch;
    min-height: 0;
    padding: 1.1rem;
    background:
        linear-gradient(180deg, #fbfdfc 0%, #f4f7f6 100%);
}

.chart-zoom-render {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.chart-zoom-render .apexcharts-canvas,
.chart-zoom-render svg,
.chart-zoom-render canvas {
    width: 100% !important;
    max-width: 100% !important;
}

.chart-zoom-clone {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.chart-zoom-clone .apexcharts-canvas,
.chart-zoom-clone svg {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
}

.chart-zoom-clone .no-data,
.chart-zoom-clone .no-data-msg {
    width: min(520px, 100%);
    margin: 0 auto;
}

.chart-zoom-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    image-rendering: auto;
}

.chart-card,
.kpi-card,
.admin-card,
.table-container {
    isolation: isolate;
}

.chart-card::after,
.kpi-card::after,
.admin-card::after,
.table-container::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.chart-card,
.kpi-card,
.admin-card,
.table-container {
    position: relative;
}

.kpi-card {
    gap: 0.85rem;
}

.kpi-card::before {
    box-shadow: 0 0 22px rgba(18, 50, 43, 0.22);
}

.data-table tbody tr,
.admin-table tbody tr {
    transition: background 0.16s ease, transform 0.16s ease;
}

.data-table tbody tr:hover,
.admin-table tbody tr:hover {
    transform: translateX(2px);
}

.modal-informe,
.modal-overlay {
    cursor: pointer;
}

.modal-informe-content,
.modal-content,
.chart-zoom-dialog {
    cursor: default;
}

@keyframes chartZoomIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .chart-expand-btn {
        width: 32px;
        height: 32px;
    }

    .chart-zoom-modal {
        padding: 0.5rem;
    }

    .chart-zoom-dialog {
        width: 100%;
        height: 94vh;
    }

    .chart-zoom-header {
        padding: 0.8rem;
    }

    .chart-zoom-header h2 {
        font-size: 0.95rem;
    }

    .chart-zoom-body {
        padding: 0.65rem;
    }
}
