/* ======================================================
   FincaDev — Cuaderno de Campo Digital
   Design System & Styles
   ====================================================== */

/* ---- CSS Custom Properties ---- */
:root {
    /* Primary crop palette - Mockup Match & Refined */
    --pistachio-50: #f4f9ed;
    --pistachio-100: #e7f2da;
    --pistachio-200: #d1e6b8;
    --pistachio-300: #b8d990;
    --pistachio-400: #a3d65e; /* Main Brand Accent */
    --pistachio-500: #86b840;
    --pistachio-600: #688f32;
    --pistachio-700: #3d7a1c;
    --pistachio-800: #2a5513;

    /* Earth / Bark Tones - Deepened */
    --earth-100: #f5f0e1;
    --earth-200: #e8dcc5;
    --earth-300: #cbbfa3;
    --earth-400: #b5a585;
    --earth-500: #827153;
    --earth-600: #5e4f3a;
    --earth-700: #3d3326;

    /* Gold Accents - More Metallic */
    --gold-400: #e5c058;
    --gold-500: #c5a55a;
    --gold-600: #9e8448;

    /* Dark Theme Background - Deeper & Richer */
    --bg-deepest: #050805;
    --bg-deep: #0a0f0b;
    --bg-base: #0f1610;
    --bg-elevated: #151f16;
    --bg-surface: #1b281d;
    --bg-hover: #233325;
    --bg-active: #2b402e;

    /* Text - High Contrast & Soft */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.45);
    --text-accent: #a3d65e;

    /* --- Theme Core --- */
    --accent-primary: #a3d65e;
    --primary: var(--accent-primary);
    --primary-light: rgba(163, 214, 94, 0.2);
    --accent-glow: rgba(163, 214, 94, 0.4);
    --pistacho-light: #cfe89a;
    
    /* --- Fondos y Capas (Oscuros y Profundos) --- */
    --bg-main: #141a0f;    /* Fondo principal */
    --bg-sidebar: rgba(15, 20, 12, 0.85);
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.45);
    
    /* --- Glassmorphism 5.0 (Ultra-Premium) --- */
    --glass-bg: rgba(10, 15, 12, 0.72);
    --glass-bg-hover: rgba(15, 25, 18, 0.85);
    --glass-border: rgba(163, 214, 94, 0.18);
    --glass-blur: blur(2px) saturate(110%); /* Reduced from 35px which was causing extreme issues on some devices */
    --card-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    
    /* --- Sombras y Efectos --- */
    --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.6);
    
    /* --- Geometría --- */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;   /* Cantos muy redondeados como el mockup */
    --sidebar-width: 280px;
    
    /* --- Transiciones --- */
    --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.2s ease;
    --transition-slow: 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

    /* ---- Semantic Aliases (stability) ---- */
    --glass-bg-elevated: rgba(12, 18, 11, 0.88);
    --glass-border-bright: rgba(163, 214, 94, 0.28);
    --success: #8ec34f;
    --info: #4db6ac;
    --danger: #ef5350;
    --text-main: var(--text-primary);
}

/* ---- Light Theme ---- */
body.light-theme {
    --bg-deepest: #e8e8e0;
    --bg-deep: #f0ede8;
    --bg-base: #f5f5f0;
    --bg-elevated: #fafaf5;
    --bg-surface: #ffffff;
    --bg-hover: #f0ede8;
    --bg-active: #e5e5dd;

    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #777777;
    --text-accent: #4a7a24;

    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-bg-hover: rgba(245, 245, 240, 0.95);
    --glass-bg-elevated: rgba(255, 255, 255, 0.92);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-border-bright: rgba(90, 138, 46, 0.35);

    --primary: #5a8a2e;
    --primary-light: rgba(90, 138, 46, 0.15);
    --accent-glow: rgba(90, 138, 46, 0.25);
    --accent-primary: #5a8a2e;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
}

body.light-theme .card {
    background: var(--glass-bg);
}

body.light-theme .card:hover {
    background: var(--glass-bg-hover);
}

body.light-theme .form-group input,
body.light-theme .form-group select,
body.light-theme .form-group textarea {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .form-group input:focus,
body.light-theme .form-group select:focus,
body.light-theme .form-group textarea:focus {
    background: #ffffff;
    border-color: var(--primary);
}

body.light-theme .stat-card {
    background: rgba(255, 255, 255, 0.85);
}

body.light-theme .list-item {
    background: rgba(255, 255, 255, 0.7);
}

body.light-theme .recent-item {
    background: rgba(245, 245, 240, 0.8);
}

body.light-theme .weather-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.6), rgba(245, 245, 240, 0.8));
}

body.light-theme .sidebar {
    background: rgba(20, 25, 20, 0.95);
}

body.light-theme .mobile-header {
    background: rgba(20, 25, 20, 0.95);
}

/* ---- Theme Toggle Button ---- */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-deepest);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.65;
    letter-spacing: -0.015em;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
    background: var(--pistachio-600);
    border-radius: 3px;
}

/* ---- Loading Skeleton ---- */
.skeleton {
    background: linear-gradient(90deg, #1b281d 25%, #233325 50%, #1b281d 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite linear;
    color: transparent !important;
    border-radius: 4px;
    display: inline-block;
    min-width: 60px;
    height: 1.2em;
    vertical-align: middle;
}

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

/* ==================================================
   TOAST NOTIFICATIONS
   ================================================== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 450px;
    animation: toast-slide-in 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    pointer-events: auto;
    border-left: 4px solid var(--pistachio-500);
}

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

.toast-icon { font-size: 1.25rem; }
.toast-message { font-size: 0.95rem; font-weight: 500; }

.toast.fade-out {
    animation: toast-fade-out 0.4s ease forwards;
}

@keyframes toast-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-fade-out {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Mesh Gradient Background */
.login-screen::before,
.app::before {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    width: 200vw;
    height: 200vh;
    background-image: 
        radial-gradient(at 0% 0%, hsla(88, 54%, 25%, 0.15) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(112, 45%, 15%, 0.15) 0, transparent 50%), 
        radial-gradient(at 100% 100%, hsla(43, 85%, 20%, 0.1) 0, transparent 50%), 
        radial-gradient(at 0% 100%, hsla(88, 54%, 30%, 0.15) 0, transparent 50%);
    transform: translate(-50%, -50%);
    filter: blur(80px);
    z-index: -1;
    pointer-events: none;
    animation: background-swirl 20s ease-in-out infinite alternate;
}

@keyframes background-swirl {
    0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
    100% { transform: translate(-50%, -50%) rotate(5deg) scale(1.1); }
}

.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.login-screen[hidden],
#app[hidden],
[hidden] {
    display: none !important;
}

.login-bg-decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.login-leaf {
    position: absolute;
    font-size: 4rem;
    opacity: 0.07;
    animation: float 15s ease-in-out infinite;
}

.leaf-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
    font-size: 5rem;
}

.leaf-2 {
    top: 20%;
    right: 15%;
    animation-delay: 3s;
    font-size: 3.5rem;
}

.leaf-3 {
    bottom: 15%;
    left: 20%;
    animation-delay: 6s;
    font-size: 4.5rem;
}

.leaf-4 {
    bottom: 25%;
    right: 10%;
    animation-delay: 9s;
    font-size: 3rem;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-20px) rotate(5deg);
    }

    50% {
        transform: translateY(-10px) rotate(-3deg);
    }

    75% {
        transform: translateY(-25px) rotate(3deg);
    }
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 3.5rem;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 10;
    box-shadow: var(--shadow-lg);
    animation: cardAppear 1s var(--transition-base) both;
}

.login-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(163, 214, 94, 0.1), transparent 40%);
    pointer-events: none;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 20px rgba(163, 214, 94, 0.3));
    animation: logo-float 6s ease-in-out infinite;
}

@keyframes logo-float {
    0%, 100% { transform: translateY(0); filter: drop-shadow(0 0 15px rgba(163, 214, 94, 0.2)); }
    50% { transform: translateY(-10px); filter: drop-shadow(0 0 30px rgba(163, 214, 94, 0.5)); }
}

.sidebar-logo-img {
    width: 85px;
    height: 85px;
    object-fit: contain;
    margin-right: 0.5rem;
    vertical-align: middle;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.mobile-logo-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.fab-logo-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    margin-right: 0.5rem;
    vertical-align: middle;
}

@keyframes pulse-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(163, 214, 94, 0.3));
    }

    50% {
        filter: drop-shadow(0 0 20px rgba(163, 214, 94, 0.6));
    }
}

.login-logo h1 {
    font-size: 2.5rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--pistachio-300), var(--gold-400));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.5rem;
    letter-spacing: 0.5px;
}

.login-error {
    background: rgba(239, 83, 80, 0.15);
    border: 1px solid rgba(239, 83, 80, 0.3);
    color: #ef5350;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

.btn-login {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* ==================================================
   LAYOUT — App Shell
   ================================================== */
.app {
    display: none; /* Occult by default, shown via _showApp */
    min-height: 100vh;
}

.app:not([hidden]) {
    display: flex;
    padding-left: var(--sidebar-width);
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--glass-bg-elevated);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 2000;
    transition: transform var(--transition-slow);
}


.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 2rem 1rem 1.2rem;
    border-bottom: 1px solid var(--glass-border);
    text-align: center;
}

.sidebar-logo-img {
    width: 80px !important;
    height: 80px !important;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(163, 214, 94, 0.2);
    box-shadow: 0 0 15px rgba(163,214,94,0.1);
}
.sidebar-logo-img img {
    width: 100%;
    height: 135%;
    object-fit: cover;
    object-position: center 0px;
    transform: scale(1.15);
    mix-blend-mode: screen;
}

.sidebar-header:hover .sidebar-logo-img {
    transform: rotate(5deg) scale(1.1);
}

.sidebar-header h2 {
    font-size: 1rem;
    background: linear-gradient(135deg, var(--pistachio-300), var(--gold-400));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-subtitle {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.sidebar-nav {
    flex: 1;
    min-height: 0; /* Permite que el flex child se encoja correctamente y haga scroll en pantallas pequeñas */
    padding: 0.6rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 100px; /* Pill shape like mockup */
    font-weight: 500;
    font-size: 0.88rem;
    transition: background var(--transition-base), color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
    margin-bottom: 0.15rem;
    width: 100%;
}

.nav-item:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--accent-primary);
    color: var(--bg-deep);
    font-weight: 700;
    box-shadow: 0 8px 25px rgba(163, 214, 94, 0.4);
}

.nav-item.active .nav-icon {
    filter: brightness(0.2);
}


.nav-icon {
    font-size: 1.2rem;
    width: 1.5rem;
    text-align: center;
}

.sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.user-avatar {
    font-size: 1.2rem;
}

.btn-logout {
    background: rgba(239, 83, 80, 0.1);
    border: 1px solid rgba(239, 83, 80, 0.2);
    color: var(--danger);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-logout:hover {
    background: rgba(239, 83, 80, 0.2);
    border-color: rgba(239, 83, 80, 0.4);
}

/* ---- Mobile Header ---- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--glass-border);
    align-items: center;
    padding: 0 1rem;
    z-index: 90;
    gap: 1rem;
}

.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

.mobile-logo-img {
    height: 32px;
    width: auto;
    vertical-align: middle;
    margin-right: -4px;
}

.mobile-title {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--pistachio-300), var(--gold-400));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mobile-user-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    margin-left: auto;
    max-width: 140px;
    overflow: hidden;
}

.mobile-user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    position: relative;
    /* Evita que flex child se expanda más allá de la pantalla en Chrome */
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: 0;
    padding: 2rem;
    min-height: 100vh;
    padding-bottom: 120px; /* Increased for mobile floating buttons */
    overflow-x: hidden;
}

.content-section {
    display: none;
    animation: fadeIn 0.35s ease;
    padding: 2rem;
    width: 100%;
    margin: 0;
    min-height: calc(100vh - 80px); /* Asegura que ocupe el espacio pero no empuje */
    position: relative;
    top: 0;
    max-width: 100%;
    min-width: 0;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Section Header ---- */
.section-header {
    margin-bottom: 2rem;
}

.section-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ---- SIEX Custom Cards ---- */
.card-fito-mode {
    background: rgba(239, 83, 80, 0.05);
    border-color: rgba(239, 83, 80, 0.2);
}

.card-abono-mode {
    background: rgba(163, 214, 94, 0.05);
    border-color: rgba(163, 214, 94, 0.2);
}

/* ---- Footer ---- */
.main-footer {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width); /* Usando la variable del sistema */
    width: calc(100% - var(--sidebar-width));
    text-align: center;
    padding: 1rem;
    background: rgba(18, 18, 18, 0.85); /* Fondo oscuro semitransparente */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.95rem;
    z-index: 1000; /* Asegurar que esté por encima de todo */
    box-sizing: border-box; /* Prevenir desbordamientos en Chrome */
}

.main-footer p {
    margin: 0;
}

.main-footer a {
    color: #ffffff; /* Blanco puro como pidió el usuario */
    text-decoration: none;
    font-weight: 700; 
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4); 
    transition: all var(--transition-fast);
}

.main-footer a:hover {
    color: var(--pistachio-400); /* Destello verde al pasar el ratón */
    text-shadow: 0 0 12px rgba(163, 214, 94, 0.8);
}

/* ==================================================

   COMPONENTS
   ================================================== */

/* ---- Cards ---- */
.card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
}
.highlight-flash {
    animation: highlight-flash 2s ease-out;
}
@keyframes highlight-flash {
    0% { background-color: rgba(163, 214, 94, 0.4); }
    100% { background-color: transparent; }
}

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

.card-header-flex h3 {
    margin-bottom: 0;
}

/* ---- Stats Grid ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    opacity: 0.8;
}

.stat-parcelas::after { background: var(--pistachio-400); }
.stat-trabajos::after { background: var(--gold-400); }
.stat-registros::after { background: var(--info); }
.stat-mes::after { background: var(--success); }
.stat-money::after { background: var(--gold-500); }

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--glass-border-bright);
}

.stat-icon {
    font-size: 2.25rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.stat-number {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08em;
}


/* ---- Weather Card ---- */
.weather-card {
    margin-bottom: 2rem;
    background: linear-gradient(145deg, rgba(27, 40, 29, 0.4), rgba(15, 22, 16, 0.6));
    border: 1px solid var(--glass-border);
    position: relative;
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.weather-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.weather-status-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.weather-location-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.weather-header-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.plan-summary-card {
    margin: 1rem 0 1.25rem;
    border: 1px solid rgba(163, 214, 94, 0.22);
    background: linear-gradient(135deg, rgba(163,214,94,0.12), rgba(255,255,255,0.03));
}

.plan-summary-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.plan-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid rgba(163, 214, 94, 0.25);
    background: rgba(163, 214, 94, 0.12);
    color: var(--text-primary);
}

.plan-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.55rem;
    margin-top: 0.9rem;
}

.plan-feature {
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.12);
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.plan-feature.locked { opacity: 0.55; text-decoration: line-through; }

.input-sm {
    min-height: 36px;
    padding: 0.45rem 0.8rem;
    font-size: 0.85rem;
}

.weather-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-right: 3rem;
    border-right: 1px solid var(--glass-border);
}

.weather-icon {
    font-size: 4rem;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
}

.weather-temp {
    font-size: 3.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.05em;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.weather-detail {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.wd-icon {
    font-size: 1.5rem;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", emoji;
    /* color: var(--pistachio-400); - Quitado para no romper emojis */
    margin-bottom: 0;
}

.wd-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.wd-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}


.wd-info {
    display: flex;
    flex-direction: column;
}

.wd-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.wd-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.advice-box {
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.advice-info {
    background: rgba(163, 214, 94, 0.1);
    border: 1px solid rgba(163, 214, 94, 0.2);
    color: var(--text-primary);
}

.advice-warning {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #ffb74d;
}

.advice-danger {
    background: rgba(239, 83, 80, 0.1);
    border: 1px solid rgba(239, 83, 80, 0.3);
    color: #ef5350;
}

@media (max-width: 768px) {
    .weather-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .weather-main {
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        padding-right: 0;
        padding-bottom: 1rem;
    }
    .weather-details {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* List Item Mobile Optimization */
    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.2rem;
    }

    .list-item-info {
        width: 100%;
    }

    .list-item-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.5rem;
        border-top: 1px solid var(--glass-border);
        padding-top: 0.8rem;
    }

    .list-item-actions .btn {
        flex: 1 0 auto;
        justify-content: center;
        padding: 0.6rem;
    }
}

/* ---- 7-Day Weather Forecast ---- */
.weather-week-forecast {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start; /* Chrome fix: space-between rompe el cálculo de overflow */
    gap: 1rem; /* Más separación explícita */
    margin-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Ocultar barra de scroll en navegadores webkit pero mantener la funcionalidad */
.weather-week-forecast::-webkit-scrollbar {
    height: 4px;
}
.weather-week-forecast::-webkit-scrollbar-track {
    background: transparent;
}
.weather-week-forecast::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.forecast-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto; /* Chrome fix: No encoger, no crecer, respetar tamaño */
    min-width: 50px;
    font-size: 0.85rem;
}

.forecast-dayname {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.forecast-icon {
    font-size: 1.5rem;
    margin: 0.25rem 0;
}

.forecast-temps {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.forecast-max {
    font-weight: 600;
    color: var(--text-primary);
}

.forecast-min {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ---- Componentes Dashboard ---- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
}

/* ---- Activity Chart (bar chart) ---- */
.activity-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chart-bar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chart-bar-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    min-width: 90px;
    text-align: right;
}

.chart-bar-track {
    flex: 1;
    height: 24px;
    background: var(--bg-deepest);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.chart-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--pistachio-600), var(--pistachio-400));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bg-deepest);
    min-width: 28px;
}

/* ---- Recent List ---- */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 360px;
    overflow-y: auto;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-base);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--pistachio-500);
    transition: background var(--transition-fast);
}

.recent-item:hover {
    background: var(--bg-hover);
}

.recent-item-icon {
    font-size: 1.3rem;
}

.recent-item-info {
    flex: 1;
}

.recent-item-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.recent-item-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.recent-item-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-base);
    outline: none;
    backdrop-filter: blur(4px);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--pistachio-400);
    background: rgba(163, 214, 94, 0.05);
    box-shadow: 0 0 0 4px rgba(163, 214, 94, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a8b0a9'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

.form-group select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    flex: 1;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1rem;
    align-items: flex-end;
}

.inline-form .form-group {
    flex: 1;
    min-width: 180px;
}

.inline-form .btn {
    margin-bottom: 1rem;
    white-space: nowrap;
}

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

.register-form .btn-full {
    margin-top: 0.5rem;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.8rem 1.75rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.925rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--pistachio-400), var(--pistachio-600));
    color: #fff;
    box-shadow: 0 8px 20px -6px rgba(122, 182, 72, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--pistachio-300), var(--pistachio-500));
    transform: translateY(-2px);
    box-shadow: 0 12px 25px -8px rgba(122, 182, 72, 0.5);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--glass-border-bright);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--pistachio-400);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(239, 83, 80, 0.08);
    color: var(--danger);
    border: 1px solid rgba(239, 83, 80, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 83, 80, 0.15);
    border-color: rgba(239, 83, 80, 0.4);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-full {
    width: 100%;
}


/* ---- Items List ---- */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: var(--bg-base);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.list-item:hover {
    border-color: var(--glass-border);
    background: var(--bg-elevated);
}

.list-item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.list-item-info > div {
    min-width: 0;
    flex: 1;
}

.list-item-icon {
    font-size: 1.4rem;
    width: 2rem;
    text-align: center;
}

.list-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: normal; /* Permite envolver en móvil */
    word-break: break-word;
    display: block;
}

.list-item-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: normal; /* Permite envolver en móvil */
    display: block;
    line-height: 1.4;
}

.list-item-actions {
    display: flex;
    gap: 0.5rem;
}

.list-item-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(163, 214, 94, 0.12);
    color: var(--text-accent);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- Filters ---- */
.filter-card {
    padding: 1.25rem 1.5rem;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: flex-end;
}

.filters-row .form-group {
    flex: 1;
    min-width: 140px;
    margin-bottom: 0;
}

.filters-row .btn {
    margin-bottom: 0;
}

/* ---- Table ---- */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
}

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

.data-table th {
    text-align: left;
    padding: 1.25rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--glass-border-bright);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(163, 214, 94, 0.05);
    vertical-align: middle;
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: all var(--transition-base);
}

.data-table tbody tr:hover {
    background: rgba(163, 214, 94, 0.03);
    transform: scale(1.002);
}

.table-footer {
    padding: 1rem;
    font-size: 0.825rem;
    color: var(--text-muted);
    font-weight: 500;
}


/* ---- Empty state ---- */
.empty-msg {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.9rem;
}

/* ---- Toast Notifications ---- */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
}

.toast {
    background: var(--glass-bg-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border-bright);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: toastIn 0.5s var(--ease-out-expo), toastOut 0.5s var(--ease-out-expo) 3s forwards;
    max-width: 400px;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.toast-success::before {
    background: var(--success);
}

.toast-error::before {
    background: var(--danger);
}

/* Entry Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s var(--ease-out-expo) both;
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }


.toast-info {
    border-left: 3px solid var(--info);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* ---- Sidebar Overlay (mobile) ---- */
#sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1500;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

#sidebar-overlay.open {
    display: block;
}

/* ---- Sync Indicator ---- */
.sync-indicator {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sync-indicator.offline {
    color: var(--danger);
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.sync-dot.online {
    background: var(--success);
}

.sync-dot.offline {
    background: var(--danger);
    animation: pulse 1.5s infinite;
}

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

/* ==================================================
   RESPONSIVE
   ================================================== */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app:not([hidden]) {
        padding-left: 0;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-header {
        display: flex;
    }

    .main-content {
        width: 100%;
        max-width: 100vw;
        margin-left: 0;
        padding: 70px 0.5rem 2rem;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .card {
        padding: 1.25rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .inline-form {
        flex-direction: column;
    }

    .inline-form .form-group {
        min-width: 100%;
    }

    .filters-row {
        flex-direction: column;
    }

    .filters-row .form-group {
        min-width: 100%;
    }

    .table-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .data-table {
        font-size: 0.8rem;
        min-width: 600px; /* Fuerza el scroll horizontal en lugar de aplastar la tabla */
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }

    .table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-top: 1rem;
    }
    
    .filters-row {
        gap: 0.5rem;
    }
    
    .inline-form {
        gap: 0.8rem;
    }

    .planing-grid {
        grid-template-columns: 1fr;
    }
    
    .planing-controls {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .planing-controls .form-group {
        width: 100%;
    }
    
    .planing-controls select {
        width: 100%;
    }

    /* Ajuste de Footer para Mobile: Ocultar para ganar espacio en pantalla */
    .main-footer {
        display: none;
    }
}

/* ---- Section overflow guards ---- */
#section-consultar,
#section-galeria,
#section-planing,
#section-almacen,
#section-maquinaria {
    min-width: 0;
}

#section-consultar .card,
#section-galeria .card,
#section-planing .card,
#section-almacen .card,
#section-maquinaria .card,
#section-almacen .inline-form,
#section-maquinaria .inline-form {
    min-width: 0;
    max-width: 100%;
}

#section-consultar .filters-row,
#section-almacen .inline-form,
#section-maquinaria .inline-form {
    width: 100%;
    overflow: hidden;
}

#section-consultar .filters-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto auto;
    align-items: end;
}

#section-consultar .filters-row .form-group {
    min-width: 0;
}

@media (max-width: 1200px) {
    #section-consultar .filters-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---- Layout Hotfix v46 ---- */
@media (min-width: 769px) {
    #app.app:not([hidden]) {
        display: grid;
        grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
        padding-left: 0 !important;
    }

    #app .sidebar {
        position: sticky;
        top: 0;
        left: auto;
        transform: none !important;
    }

    #app .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
    }

    #section-consultar .filters-row {
        display: flex;
        flex-wrap: wrap;
        gap: 0.6rem 1rem;
        align-items: flex-end;
    }

    #section-consultar .filters-row .form-group {
        flex: 1 1 180px;
        min-width: 180px;
    }
}

@media (max-width: 768px) {
    #app.app:not([hidden]) {
        display: block;
        padding-left: 0 !important;
    }

    #app .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 120;
    }

    #app .main-content {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        padding: 76px 0.85rem 1.5rem !important;
    }

    #app .mobile-header {
        height: 58px;
        padding: 0 0.6rem;
        gap: 0.35rem;
    }

    #app .mobile-title {
        flex: 1;
        min-width: 0;
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        gap: 0.35rem;
    }

    #app .mobile-logo-img {
        width: 22px !important;
        height: 22px !important;
        margin-right: 0;
        flex: 0 0 22px;
    }

    #app .mobile-user-pill {
        max-width: 82px;
        padding: 0.22rem 0.45rem;
    }

    #app .mobile-logout-btn {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    #section-consultar .filters-row {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
    }

    #section-consultar .filters-row .form-group {
        width: 100%;
        flex: none;
    }

    #section-consultar .filters-row .btn {
        width: 100%;
        flex: none;
        margin-top: 0.2rem;
    }
}

.planing-controls {
    flex-wrap: wrap;
    gap: 0.75rem;
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .login-card {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }
}

/* ==================================================
   GALLERY / PHOTO UPLOAD
   ================================================== */

/* ---- Upload Zone ---- */
.upload-zone {
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--bg-base);
    margin-bottom: 1rem;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--pistachio-400);
    background: rgba(163, 214, 94, 0.05);
}

.upload-zone-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.upload-zone-content p {
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.upload-zone-content strong {
    color: var(--pistachio-400);
}

.upload-zone-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ---- Upload Preview ---- */
.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.upload-preview-item {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.upload-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview-item .remove-preview {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Year Tabs ---- */
.year-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.year-tab {
    padding: 0.45rem 1rem;
    border-radius: 20px;
    background: var(--bg-base);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.year-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.year-tab.active {
    background: var(--pistachio-600);
    color: #fff;
    border-color: var(--pistachio-500);
}

.year-tab-all {
    background: transparent;
}

/* ---- Photo Grid ---- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.photo-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--glass-border);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding-bottom: 0; /* Override previous padding hack if any */
    aspect-ratio: auto;
    height: auto;
}

.photo-card:hover {
    transform: translateY(-5px);
    border-color: var(--pistachio-400);
    box-shadow: 0 8px 25px rgba(163, 214, 94, 0.15);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(30, 45, 20, 0.8) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(45, 35, 10, 0.6) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(15, 20, 10, 1) 0%, #0e120b 100%);
    z-index: -1;
}

/* Overlay sutil para profundidad */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://www.transparenttextures.com/patterns/carbon-fibre.png');
    opacity: 0.02;
    z-index: -1;
    pointer-events: none;
}
.photo-card-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #000;
}

.photo-card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.photo-card:hover .photo-card-img-wrapper img {
    transform: scale(1.05);
}

.photo-card-type-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.1rem;
    border: 1px solid var(--glass-border);
}

.photo-card-info {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.photo-card-main {
    flex: 1;
    min-width: 0;
}

.photo-card-desc {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-card-meta {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.photo-card-delete {
    background: rgba(239, 83, 80, 0.1);
    color: #ef5350;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.7;
}

.photo-card-delete:hover {
    background: #ef5350;
    color: white;
    opacity: 1;
}

.photo-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    opacity: 0;
    transition: opacity var(--transition-fast);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.photo-card:hover .photo-card-overlay {
    opacity: 1;
}

/* ==================================================
   FINANZAS & COSECHAS
   ================================================== */

.highlight-balance {
    background: linear-gradient(135deg, rgba(163, 214, 94, 0.15), rgba(76, 175, 80, 0.05));
    border: 1px solid rgba(163, 214, 94, 0.3);
}

.highlight-balance #stat-saldo {
    color: var(--pistachio-400);
    text-shadow: 0 0 15px rgba(163, 214, 94, 0.3);
}

.balance-display-modern {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 1.5rem;
}

.balance-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balance-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.finanzas-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.fin-card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.fin-card:hover {
    transform: translateY(-5px);
}

.fin-card.income {
    border-left: 4px solid var(--success);
}

.fin-card.expense {
    border-left: 4px solid var(--danger);
}

.fin-card-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.fin-card-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.income .fin-card-value { color: var(--success); }
.expense .fin-card-value { color: var(--danger); }

.monto-ingreso { color: var(--success); font-weight: 700; }
.monto-gasto { color: var(--danger); font-weight: 700; }

.table-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.select-mini {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.cosechas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Premium Spaced-out Modern Table */
.table-container {
    padding: 1.5rem;
    background: var(--glass-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    overflow-x: auto;
}

.table-inner-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.8rem;
}

.table-modern th {
    text-align: left;
    padding: 0 1.2rem 0.8rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table-modern td {
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    vertical-align: middle;
}

.table-modern tr td:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.table-modern tr td:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.table-modern tbody tr {
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.table-modern tbody tr:hover td {
    background: rgba(255, 255, 255, 0.06);
}

.table-modern tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.list-item-badge {
    background: var(--surface-light);
    color: var(--pistachio-400);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(163, 214, 94, 0.2);
}

@media (max-width: 768px) {
    .balance-display-modern {
        align-items: flex-start;
        margin-right: 0;
        margin-bottom: 1rem;
    }
}

/* Section Header Premium */
.section-header-premium {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeInDown 0.6s ease-out;
}

.section-title-block {
    display: flex;
    flex-direction: column;
}

.section-subtitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.section-actions {
    display: flex;
    gap: 1rem;
}

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

@media (max-width: 768px) {
    .section-header-premium {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

.photo-card-desc {
    font-size: 0.75rem;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-card-date {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.7);
}

.photo-card-delete {
    background: rgba(239, 83, 80, 0.8);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition-fast);
}

.photo-card-delete:hover {
    background: var(--danger);
}

/* ---- Lightbox ---- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    opacity: 0;
    animation: fadeInLightbox 0.25s ease forwards;
}

@keyframes fadeInLightbox {
    to { opacity: 1; }
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    display: flex; flex-direction: column;
    align-items: center;
}

.lightbox img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex; align-items: center; justify-content: center;
}

.lightbox-desc {
    color: white;
    margin-top: 1rem;
    font-size: 1.1rem;
    text-align: center;
    padding: 0.5rem 1.25rem;
    background: rgba(0,0,0,0.5);
    border-radius: 20px;
}

/* Gallery Lightbox */
.lightbox-gallery-container {
    width: 95%; max-width: 1200px;
    height: 90vh;
    display: flex; flex-direction: column;
    padding: 20px;
}

.lightbox-header {
    display: flex; justify-content: space-between; align-items: center;
    color: white; margin-bottom: 15px;
}

.lightbox-header h3 { margin: 0; font-size: 1.2rem; color: var(--pistachio-400); }

.lightbox-main {
    flex: 1; position: relative;
    display: flex; align-items: center; justify-content: center;
    min-height: 0;
}

.lightbox-prev, .lightbox-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.1); color: white;
    border: none; width: 60px; height: 60px; border-radius: 50%;
    font-size: 1.5rem; cursor: pointer; transition: 0.3s;
    user-select: none; z-index: 5;
}

.lightbox-prev:hover, .lightbox-next:hover { background: var(--pistachio-500); }
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

/* ---- Gallery Controls ---- */
.gallery-controls {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
    /* Ensure controls wrap on small screens */
}

.gallery-controls .form-group {
    flex: 1;
    min-width: 200px;
    /* Force wrapping when too narrow */
    max-width: 400px;
    margin-bottom: 0;
}

/* Ensure Camera Buttons wrap correctly on tiny screens */
.camera-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    /* Prevent button overflow */
    margin-bottom: 1rem;
}

.camera-buttons .btn {
    flex: 1;
    min-width: 140px;
    /* Keep buttons legible */
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 0.5rem;
    }

    .photo-card-overlay {
        opacity: 1;
        /* Always show overlay on mobile so delete button is reachable */
        padding: 0.35rem;
    }

    .photo-card-delete {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
    }

    .photo-card-desc {
        font-size: 0.65rem;
    }

    .gallery-controls .form-group {
        width: 100%;
        max-width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* ==================================================
   PLANING ANUAL
   ================================================== */
.planing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.planing-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.planing-header {
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.planing-month {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.planing-icon {
    font-size: 1.5rem;
}

.planing-month h2 {
    font-size: 1.15rem;
    margin: 0;
    color: var(--text-primary);
}

.planing-status {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--pistachio-500);
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(122, 182, 72, 0.3);
}

.planing-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.planing-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.planing-badge {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.planing-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* --- Active Month Styling --- */
.planing-card.month-active {
    border-color: var(--pistachio-400);
    box-shadow: 0 0 25px rgba(122, 182, 72, 0.15), inset 0 0 20px rgba(122, 182, 72, 0.05);
    transform: translateY(-2px);
    background: linear-gradient(180deg, rgba(36, 53, 39, 0.7) 0%, rgba(24, 34, 25, 0.6) 100%);
}

.planing-card.month-active .planing-header {
    background: rgba(122, 182, 72, 0.1);
    border-bottom-color: rgba(163, 214, 94, 0.3);
}

.planing-card.month-active .planing-month h2 {
    color: var(--text-accent);
}

.planing-card.month-active .planing-badge {
    background: rgba(163, 214, 94, 0.1);
    border-color: rgba(163, 214, 94, 0.2);
    color: var(--text-primary);
}

/* ==================================================
   PRINT STYLES
   ================================================== */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }

    .sidebar,
    .mobile-header,
    .sidebar-overlay,
    .toast-container,
    .filter-card,
    .no-print,
    .btn,
    .nav-item,
    .section-desc,
    .table-actions {
        display: none !important;
    }

    .app {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    .content-section {
        display: none !important;
    }

    #section-consultar {
        display: block !important;
    }

    .card {
        background: none;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        padding: 0;
    }

    .section-header h1 {
        color: #000;
        font-size: 1.5rem;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table th {
        background: #eee !important;
        color: #000;
        border-bottom: 2px solid #333;
    }

    .data-table td {
        border-bottom: 1px solid #ccc;
        color: #000;
    }

    .table-footer {
        color: #666;
        margin-top: 1.5rem;
    }

    .card {
        padding: 1rem;
    }

    .main-footer {
        left: 0;
        width: 100%;
        padding: 0.75rem;
    }

    @page {
        margin: 1.5cm;
    }

    /* Print header */
    #section-consultar .section-header::after {
        content: 'FincaDev — Cuaderno de Campo Digital';
        display: block;
        font-size: 0.8rem;
        color: #666;
        margin-top: 0.25rem;
    }
}

/* ==================================================
   ALMACÉN & MAQUINARIA SPECIAL STYLES
   ================================================== */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-fast);
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
    border-color: var(--pistachio-400);
}

.list-item-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.list-item-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.list-item-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
}

.list-item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.empty-msg {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-style: italic;
}

.inline-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) auto;
    gap: 1rem;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .inline-form {
        grid-template-columns: 1fr;
    }
}
/* --- FincaDev Logo Branding --- */
.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
}


/* --- Sidebar Header Correction --- */
.sidebar-header {
    gap: 1rem;
    align-items: center;
}

.sidebar-logo, .login-logo-icon {
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Work Timer (Cronómetro) --- */
.timer-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.work-timer {
    display: flex;
    align-items: center;
    background: rgba(163, 214, 94, 0.05);
    border: 1px dashed var(--accent-primary);
    border-radius: var(--radius-md);
    padding: 0.6rem 1rem;
    gap: 1.5rem;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.work-timer:hover {
    background: rgba(163, 214, 94, 0.1);
}

.timer-clock {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 1px;
}

.btn-timer {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    background: var(--accent-primary);
    color: var(--bg-main);
    transition: all 0.2s ease;
}

.btn-timer:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-timer.active {
    background: #ff4757;
    color: white;
    animation: pulse-timer 2s infinite;
}

@keyframes pulse-timer {
    0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 71, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

/* Dashboard Tabs Navigation */
.dashboard-tabs-container {
    display: flex;
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    width: fit-content;
    border: 1px solid var(--glass-border);
}

.dashboard-tab {
    padding: 0.65rem 1.4rem;
    border-radius: calc(var(--radius-md) - 4px);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
}

.dashboard-tab i {
    font-size: 0.85rem;
    opacity: 0.7;
    transition: transform 0.3s ease;
}

.dashboard-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.dashboard-tab:hover i {
    transform: translateY(-1px);
    opacity: 1;
}

.dashboard-tab.active {
    background: var(--primary);
    color: #0b110b; /* Texto oscuro sobre fondo brillante */
    font-weight: 600;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.dashboard-tab.active i {
    opacity: 1;
    color: inherit;
}

/* Dashboard Content Visibility */
.tab-content {
    transition: opacity var(--transition-base), transform var(--transition-base);
}

.tab-content:not(.active) {
    display: none;
    opacity: 0;
    transform: translateY(10px);
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ---- Dashboard Specific ---- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

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

.stat-money {
    background: rgba(255, 183, 77, 0.05);
}

.chart-container {
    transition: transform 0.3s ease;
}

.chart-container:hover {
    transform: scale(1.01);
}

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

/* --- Plot Documentation (Recuadros) --- */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.doc-card {
    background: rgba(163, 214, 94, 0.05);
    border: 1px solid rgba(163, 214, 94, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.doc-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-primary);
    background: rgba(163, 214, 94, 0.1);
}

.doc-card-title {
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    display: block;
}

.doc-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.doc-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(163, 214, 94, 0.1);
    padding-top: 0.8rem;
    margin-top: auto;
}

.btn-doc-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-doc-link:hover {
    text-decoration: underline;
}

.btn-delete-doc {
    background: none;
    border: none;
    color: #ef5350;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-delete-doc:hover {
    background: rgba(239, 83, 80, 0.1);
}

.modal, .modal-overlay {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal.active, .modal-overlay[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    background: var(--glass-bg-elevated);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border-bright);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 2.2rem;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Utility: Modern Input Groups (Globalized) */
.input-group-modern {
    margin-bottom: 1.25rem;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group-modern label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.input-modern {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 0.85rem 1.2rem;
    border-radius: 12px;
    width: 100%;
    transition: all 0.2s;
}

.input-modern:focus {
    border-color: var(--pistachio-400);
    box-shadow: 0 0 15px rgba(163, 214, 94, 0.2);
    background: rgba(255,255,255,0.08);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 1rem;
}

.close-modal, .btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    position: relative;
    z-index: 100;
    padding: 10px;
    margin: -10px;
}

.close-modal:hover, .btn-close:hover {
    color: var(--danger);
}

/* --- AI Assistant --- */
.main-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 2.5rem 1.2rem;
    transition: transform var(--transition-base);
}
.pistachin-wrapper {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 3000;
    display: flex;
    flex-direction: column-reverse; /* Fix: Button at bottom, chat above it */
    align-items: flex-end;
    gap: 1rem;
    pointer-events: none;
}

.pistachin-fab {
    pointer-events: auto;
    background: var(--accent-primary);
    color: var(--bg-main);
    border: none;
    padding: 1.2rem 2.2rem;
    border-radius: 60px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(163, 214, 94, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pistachin-fab:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 35px rgba(163, 214, 94, 0.5);
}

/* ---- Premium Stat Cards (Mockup-Specific) ---- */
.stat-premium-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.stat-premium-card:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.stat-premium-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-premium-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem; /* Reduced gap */
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.highlight-balance .stat-premium-value {
    font-size: 1.65rem; /* Even smaller for global balance to avoid horizontal scroll/overlap */
}

.stat-premium-badge {
    height: fit-content;
    padding: 0.15rem 0.4rem;
    background: rgba(163, 214, 94, 0.15);
    color: var(--accent-primary);
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0;
    flex-shrink: 0;
}

.currency-symbol {
    font-size: 0.8em;
    opacity: 0.7;
    margin-left: 0.2rem;
    font-weight: 500;
}

.stat-premium-badge.gold {
    background: rgba(255, 183, 77, 0.15);
    color: #ffb74d;
}

.fab-logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
}

.pistachin-chat-window {
    width: 420px;
    height: 650px;
    background: rgba(30, 35, 25, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(163, 214, 94, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.pistachin-chat-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.pistachin-header {
    background: rgba(163, 214, 94, 0.05);
    padding: 1.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    min-height: 100px;
}

.pistachin-status {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.pistachin-avatar-img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    background: var(--glass-bg);
    border-radius: 50%;
    padding: 8px;
    border: 3px solid var(--accent-primary);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.pistachin-name {
    display: block;
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 1rem;
}

.pistachin-online {
    font-size: 0.7rem;
    color: #a3d65e;
    opacity: 0.8;
}

.pistachin-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.pistachin-messages-area {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 90%;
    padding: 0.8rem 1rem;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: msgIn 0.3s ease;
}

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

.message.bot {
    align-self: flex-start;
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    border-bottom-left-radius: 2px;
}

.message.user {
    align-self: flex-end;
    background: var(--accent-primary);
    color: var(--bg-main);
    font-weight: 500;
    border-bottom-right-radius: 2px;
}

.pistachin-quick-actions {
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: center; /* Centrar el botón de ayuda */
    border-top: 1px solid rgba(163, 214, 94, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.quick-action-btn {
    background: var(--accent-primary);
    color: var(--bg-main);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(163, 214, 94, 0.2);
    border: none;
}

.quick-action-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-main);
    transform: translateY(-2px);
}

/* Asistente y ayuda */
.pistachin-help-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 0.5rem 0;
}

.help-category {
    margin-top: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.5rem;
}

.help-category:last-child {
    border-bottom: none;
}

.help-category-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--accent-primary);
    opacity: 0.6;
    margin-bottom: 0.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.help-items-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
}

.help-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.help-item:hover {
    background: rgba(163, 214, 94, 0.12);
    border-color: rgba(163, 214, 94, 0.4);
    color: white;
    transform: translateX(3px);
}

.help-item i {
    font-size: 1rem;
    opacity: 0.9;
}

.pistachin-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pistachin-icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px;
    border-radius: 50%;
}

.pistachin-icon-btn:hover {
    background: rgba(255,255,255,0.05);
    color: var(--accent-primary);
}

.pistachin-icon-btn.active {
    color: var(--accent-primary);
    background: rgba(163, 214, 94, 0.1);
}

/* Indicador de pensamiento del asistente */
.message.bot.thinking {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    min-width: 60px;
}

.message.bot.thinking span {
    width: 6px;
    height: 6px;
    background: var(--pistacho-light);
    border-radius: 50%;
    display: inline-block;
    animation: pistachin-blink 1.4s infinite both;
}

.message.bot.thinking span:nth-child(2) { animation-delay: 0.2s; }
.message.bot.thinking span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pistachin-blink {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.2); }
}


.pistachin-mic-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(163, 214, 94, 0.1);
    color: var(--text-muted);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pistachin-mic-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.pistachin-mic-btn.listening {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    animation: mic-pulse 1.5s infinite;
}

@keyframes mic-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 83, 80, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(239, 83, 80, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 83, 80, 0); }
}

.pistachin-upload-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(163, 214, 94, 0.1);
    color: var(--text-muted);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pistachin-upload-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.pistachin-image-preview {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--accent-primary);
    background: #000;
}

.pistachin-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pistachin-image-preview button {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}


.pistachin-input-area {
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    display: flex;
    gap: 0.7rem;
    align-items: center;
}

.pistachin-input-area input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(163, 214, 94, 0.1);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 25px;
    outline: none;
}

.pistachin-input-area input:focus {
    border-color: var(--accent-primary);
}

.pistachin-send-btn {
    background: var(--accent-primary);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.pistachin-send-btn:hover {
    transform: scale(1.1) rotate(-10deg);
}

@media (max-width: 480px) {
    .content-section {
        padding-bottom: 8rem; /* Space for floating buttons */
    }
    .pistachin-wrapper {
        bottom: 5.5rem; /* Raised more to clear card buttons */
        right: 1.2rem;
        left: auto;
        align-items: flex-end;
    }
    .pistachin-chat-window {
        width: calc(100vw - 2rem) !important;
        height: 75vh;
        bottom: 5.5rem;
    }
    .pistachin-fab {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
    }
    .pistachin-fab .fab-label {
        display: none; /* Hide label on mobile to save space */
    }
    .pistachin-fab .fab-icon {
        font-size: 1.8rem;
    }
}

.pistachin-fab.has-alert {
    animation: pulseAlert 2s infinite;
    background: var(--pistachio-400); /* Slightly brighter */
}

.pistachin-fab.has-alert::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: #ff4757;
    border-radius: 50%;
    border: 2px solid var(--bg-main);
}

@keyframes pulseAlert {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(163, 214, 94, 0.6); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
}

/* --- Connection Status --- */
.connection-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    width: fit-content;
    border: 1px solid rgba(255,255,255,0.05);
}

.connection-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.connection-badge.online .dot { background: #a3d65e; box-shadow: 0 0 8px rgba(163, 214, 94, 0.5); }
.connection-badge.offline .dot { background: #ef5350; box-shadow: 0 0 8px rgba(239, 83, 80, 0.5); }
.connection-badge.online .label { color: #a3d65e; }
.connection-badge.offline .label { color: #ef5350; }

.connection-badge-mini {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: 1.25rem;
}
.connection-badge-mini.online { background: #a3d65e; }
.connection-badge-mini.offline { background: #ef5350; animation: pulseRed 2s infinite; }

@keyframes pulseRed {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* ---- Parcelas Section Layout ---- */
.parcelas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .parcelas-grid {
        grid-template-columns: 1fr;
    }
}

.map-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 500px;
}

#map {
    flex: 1;
    width: 100%;
    min-height: 450px;
    border-radius: var(--radius-md);
    z-index: 10;
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.3);
}

.form-card {
    height: 100%;
}

.parcelas-grid .card {
    margin-bottom: 0;
}

/* "Mapa" button on parcela cards */
.btn-tree-map {
    background: rgba(66, 165, 245, 0.15);
    color: #42a5f5;
    border: 1px solid rgba(66, 165, 245, 0.3);
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.btn-tree-map:hover {
    background: rgba(66, 165, 245, 0.3);
    border-color: #42a5f5;
}

/* Safety: hide any legacy tree-map elements if they persist in cache */
#modal-tree-map, .modal-treemap, .treemap-legend, .legend-palette {
    display: none !important;
}

/* ---- Sidebar Footer & Profile (Mockup Style) ---- */
.sidebar-footer {
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid var(--glass-border);
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem;
    background: rgba(255, 255, 255, 0.05); /* Slightly clearer */
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 0.4rem;
}

.profile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.profile-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-settings-sidebar {
    width: 100%;
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.8rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-settings-sidebar:hover {
    background: var(--glass-bg-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* ---- Dashboard Header Premium (Mockup Style) ---- */
.dashboard-header-premium {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
}

.greeting-block {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.date-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.greeting-text {
    font-size: 2.5rem; /* Large and bold as mockup */
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.header-actions .btn {
    padding: 0.95rem 2rem;
    border-radius: 100px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 10px 20px rgba(163, 214, 94, 0.25);
}

/* ---- Sidebar Footer Actions ---- */
.sidebar-footer-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05); /* Separador sutil */
}

.btn-sidebar-secondary, .btn-sidebar-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(163, 214, 94, 0.15);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.btn-sidebar-secondary:hover {
    background: rgba(163, 214, 94, 0.12);
    border-color: var(--accent-primary);
    transform: translateX(5px);
}

.btn-sidebar-secondary.active {
    background: var(--accent-primary);
    color: var(--bg-deep) !important;
    font-weight: 700;
    box-shadow: 0 8px 25px rgba(163, 214, 94, 0.4);
}

.btn-sidebar-logout:hover {
    background: rgba(239, 83, 80, 0.15);
    border-color: #ef5350;
    color: #ef5350;
    transform: translateX(5px);
}

/* ---- Mobile Responsive Tweaks ---- */
@media (max-width: 768px) {
    .dashboard-header-premium {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }
    
    .greeting-text {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .stat-premium-card {
        padding: 1.2rem;
    }
    
    .stat-premium-value {
        font-size: 1.8rem;
    }
}

/* ---- V2 2026 DARK GLASSMORPHISM REDESIGN ---- */
:root {
    --bg-base: #060805;
    --bg-surface: #0a0e08;
    --surface-1: rgba(14, 21, 12, 0.75);
    --surface-2: rgba(18, 26, 15, 0.85);
    --surface-stroke: rgba(163, 214, 94, 0.12);
    --surface-stroke-strong: rgba(163, 214, 94, 0.25);
    
    --shadow-premium: 0 16px 40px -8px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(163, 214, 94, 0.05);
    --shadow-premium-soft: 0 8px 24px -4px rgba(0, 0, 0, 0.6);
    
    --pistachio-glow: 0 0 20px rgba(163, 214, 94, 0.15);
}

body {
    background: var(--bg-base);
    color: var(--text-primary);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 10% 20%, rgba(163, 214, 94, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 183, 77, 0.03) 0%, transparent 40%),
        linear-gradient(180deg, var(--bg-base) 0%, #080b06 100%);
    z-index: -1;
    pointer-events: none;
}

/* Sidebar Ultra-Premium - Simplified for stability */
.sidebar {
    background: linear-gradient(180deg, rgba(8, 11, 7, 0.95) 0%, rgba(6, 8, 5, 0.98) 100%);
    border-right: 1px solid var(--surface-stroke);
    box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Hard constraints for logos to prevent massive regressions */
.sidebar-logo-img { 
    width: 150px !important; 
    height: 150px !important; 
    object-fit: contain; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 1rem;
}
.sidebar-logo-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mask-image: radial-gradient(circle, black 50%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle, black 50%, transparent 100%);
    mix-blend-mode: screen;
}
.login-logo-img { width: 140px !important; height: 140px !important; object-fit: contain; display: flex; align-items: center; justify-content: center; }
.mobile-logo-img { width: 48px !important; height: 48px !important; object-fit: contain; display: inline-flex; align-items: center; vertical-align: middle; }
.fab-logo-img { width: 60px !important; height: 60px !important; object-fit: contain; display: flex; align-items: center; justify-content: center; }
/* Removed redundant avatar definition */

/* V2 Cards */
.card, .stat-premium-card, .list-item, .login-card {
    background: var(--surface-1);
    border: 1px solid var(--surface-stroke);
    box-shadow: var(--shadow-premium-soft);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover, .stat-premium-card:hover, .list-item:hover {
    transform: translateY(-4px);
    border-color: var(--surface-stroke-strong);
    box-shadow: var(--shadow-premium), var(--pistachio-glow);
    background: var(--surface-2);
}

.stat-premium-value {
    font-size: 1.8rem; /* Reduced from 2.4rem to prevent overflow */
    font-weight: 800;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, #fff, #e0e0e0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dashboard-header-premium {
    align-items: flex-end;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--surface-stroke);
}

.greeting-text {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin: 0;
    background: linear-gradient(to right, #ffffff, #c5d6b4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions .btn {
    backdrop-filter: blur(10px);
    border: 1px solid var(--surface-stroke);
}

.connected-user-chip {
    background: rgba(163, 214, 94, 0.05);
    border: 1px solid rgba(163, 214, 94, 0.15);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
}

/* Sidebar Nav Overflow strict fix */
.sidebar-nav {
    flex: 1;
    min-height: 0 !important;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--surface-stroke-strong);
    border-radius: 4px;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--surface-stroke);
    background: rgba(6, 8, 5, 0.95);
}

@media (max-width: 768px) {
    .dashboard-header-premium {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    .greeting-text { font-size: 2.2rem; }
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .connected-user-chip { width: 100%; }
}

/* KPI Strip 2026 */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: linear-gradient(135deg, rgba(20, 26, 17, 0.8), rgba(12, 18, 10, 0.95));
    border: 1px solid var(--surface-stroke-strong);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), var(--shadow-premium-soft);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, #a3d65e, transparent);
    opacity: 0.5;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--pistachio-glow);
}

.kpi-card.kpi-balance { border-color: rgba(163, 214, 94, 0.3); }
.kpi-card.kpi-balance::before { background: linear-gradient(90deg, transparent, #a3d65e, transparent); }
.kpi-card.kpi-balance .kpi-value { color: #a3d65e; }

.kpi-card.kpi-cost { border-color: rgba(255, 152, 0, 0.3); }
.kpi-card.kpi-cost::before { background: linear-gradient(90deg, transparent, #ff9800, transparent); }
.kpi-card.kpi-cost .kpi-value { color: #ff9800; }

.kpi-card.kpi-income { border-color: rgba(33, 150, 243, 0.3); }
.kpi-card.kpi-income::before { background: linear-gradient(90deg, transparent, #2196f3, transparent); }
.kpi-card.kpi-income .kpi-value { color: #2196f3; }

.kpi-card.kpi-margin { border-color: rgba(255, 215, 0, 0.3); }
.kpi-card.kpi-margin::before { background: linear-gradient(90deg, transparent, #ffd700, transparent); }
.kpi-card.kpi-margin .kpi-value { color: #ffd700; }

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.forecast-3day-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.forecast-3day-item {
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    text-align: center;
    border: 1px solid var(--surface-stroke-soft);
}

.forecast-3day-day {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.forecast-3day-icon {
    font-size: 1.25rem;
    margin: 0.25rem 0;
}

.forecast-3day-temps {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.forecast-3day-temps span:first-child {
    color: #ef5350;
    font-weight: 600;
}

.forecast-3day-temps span:last-child {
    color: #64b5f6;
}

.forecast-3day-precip {
    font-size: 0.65rem;
    color: #64b5f6;
    margin-top: 0.25rem;
}

#parcelas-kpi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

#parcelas-kpi-table th {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid var(--surface-stroke-strong);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}

#parcelas-kpi-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--surface-stroke-soft);
}

#parcelas-kpi-table td.positive { color: #a3d65e; }
#parcelas-kpi-table td.negative { color: #ef5350; }
#parcelas-kpi-table td.neutral { color: var(--text-muted); }

/* ---- Help Accordion ---- */
.help-accordion details summary {
    cursor: pointer;
    list-style: none;
    outline: none;
    position: relative;
    padding-right: 20px;
}

.help-accordion details summary::-webkit-details-marker {
    display: none;
}

.help-accordion details summary::after {
    content: "▼";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pistachio-400);
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.help-accordion details[open] summary::after {
    transform: translateY(-50%) rotate(180deg);
}

.help-accordion summary h3 {
    margin: 0;
    display: inline-block;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.help-accordion .help-content {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    animation: fadeIn 0.4s ease-out;
}

.help-accordion .help-content ul {
    margin-top: 0.8rem;
    padding-left: 1.5rem;
}

.help-accordion .help-content li {
    margin-bottom: 0.6rem;
}

.help-accordion .help-content li strong {
    color: var(--pistachio-300);
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

/* User Management Badges & Icons */
.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-secondary { background: var(--glass-bg); color: var(--text-secondary); box-shadow: 0 0 0 1px var(--glass-border); }

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 99px;
    background: var(--error);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: auto;
}

.recordatorios-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    line-height: 1;
}
.btn-icon:hover { background: var(--glass-hover); }

/* User Management Modal Refinements */
#modal-usuario-form .modal-content {
    border: 1px solid rgba(122, 182, 72, 0.4);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 15px rgba(122, 182, 72, 0.2);
}

#usuarios-table-body tr td {
    vertical-align: middle;
}

/* ==========================================================================
   RESPONSIVE FIXES: PARCELAS (MOBILE OPTIMIZATION)
   ========================================================================== */
@media (max-width: 768px) {
    #parcelas-list .list-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
        padding: 1.25rem !important;
        background: rgba(255,255,255,0.05) !important;
        border: 1px solid var(--glass-border) !important;
    }
    
    #parcelas-list .list-item-info {
        width: 100% !important;
        display: flex !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }
    
    #parcelas-list .list-item-icon {
        flex-shrink: 0;
        margin-top: 0.2rem;
    }
    
    #parcelas-list .list-item-name {
        white-space: normal !important;
        font-size: 1.1rem !important;
        color: var(--pistachio-300) !important;
        font-weight: 700 !important;
        margin-bottom: 0.4rem;
        line-height: 1.3;
    }
    
    #parcelas-list .list-item-meta {
        white-space: normal !important;
        line-height: 1.6 !important;
        font-size: 0.85rem !important;
        color: var(--text-secondary) !important;
        display: block !important;
    }
    
    #parcelas-list .list-item-actions {
        width: 100% !important;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-top: 1.2rem !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
        margin-top: 0.5rem;
    }
    
    #parcelas-list .list-item-actions .btn, 
    #parcelas-list .list-item-actions .btn-tree-map {
        margin: 0 !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0.75rem 0.5rem !important;
        font-size: 0.85rem !important;
        border-radius: 10px !important;
    }
    
    /* El badge de "N registros" ocupando toda la fila superior de las acciones */
    #parcelas-list .click-to-consultar {
        grid-column: span 2 !important;
        text-align: center !important;
        padding: 0.6rem !important;
        background: rgba(163, 214, 94, 0.15) !important;
        border-radius: 8px !important;
        margin-bottom: 0.25rem !important;
    }

    /* Ajuste de botones específicos */
    #parcelas-list .btn-mapa-parcela {
        grid-column: span 2 !important; /* Mapa de árboles prioridad */
        background: var(--primary) !important;
        color: #000 !important;
        font-weight: 600 !important;
    }
}

/* ==================================================
   PHASE 2: INTELLIGENCE & AUTOMATION
   ================================================== */

/* Pest Alert Cards */
.pest-alert-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pest-alert-card {
    background: linear-gradient(135deg, rgba(239, 83, 80, 0.15), rgba(239, 83, 80, 0.05));
    border: 1px solid rgba(239, 83, 80, 0.3);
    border-left: 5px solid #ef5350;
    border-radius: 16px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    backdrop-filter: blur(10px);
    animation: slideInDown 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 10px 40px rgba(239, 83, 80, 0.15);
}

.pest-alert-icon {
    font-size: 2rem;
    background: rgba(239, 83, 80, 0.2);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
}

.pest-alert-content h4 {
    margin: 0;
    color: #ef5350;
    font-size: 1.1rem;
}

.pest-alert-content p {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pest-alert-action {
    margin-left: auto;
    background: #ef5350;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pest-alert-action:hover {
    transform: scale(1.05);
    background: #d32f2f;
}

/* Scanner Button */
.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: var(--pistachio-400);
    color: var(--bg-deep);
}

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

/* Pest Modal Enhancements */
#modal-pest-detail .modal-content {
    background: var(--bg-deep);
    border: 1px solid #ef5350;
    box-shadow: 0 0 30px rgba(239, 83, 80, 0.2);
}

#pest-modal-treatments ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}

#pest-modal-treatments li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

#pest-modal-treatments li:last-child {
    border-bottom: none;
}

#pest-modal-treatments b {
    color: var(--text-primary);
}

/* ==================================================
   PHASE 3: ADVANCED INTELLIGENCE & MARKET
   ================================================== */

.highlight-market {
    border: 1px solid var(--primary) !important;
    background: linear-gradient(135deg, rgba(163, 214, 94, 0.1), transparent) !important;
    box-shadow: 0 0 20px rgba(163, 214, 94, 0.15) !important;
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

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

.market-price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.market-price-item:last-child {
    border-bottom: none;
}

.market-price-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.price-name {
    font-weight: 600;
    color: var(--text-primary);
}

.price-value {
    color: var(--pistachio-400);
    font-weight: 700;
    font-size: 1.2rem;
}

.price-trend {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 100px;
    margin-left: 10px;
}

.trend-up { background: rgba(76, 175, 80, 0.1); color: #4caf50; }
.trend-down { background: rgba(244, 67, 54, 0.1); color: #f44336; }

#market-trend-chart {
    min-height: 300px !important;
    max-height: 400px;
    width: 100% !important;
}

#market-advice {
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.6;
}

.historical-insight-card {
    background: linear-gradient(135deg, rgba(163, 214, 94, 0.08), rgba(163, 214, 94, 0.02));
    border: 1px dashed var(--primary);
    border-radius: 12px;
    padding: 1.2rem;
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.insight-icon {
    font-size: 1.5rem;
}

.insight-content h4 {
    margin: 0;
    color: var(--primary);
    font-size: 1rem;
}

.insight-content p {
    margin: 5px 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Gallery Comparison Mode */
.comparison-grid {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    min-height: 250px;
    margin-top: 1rem;
}

.comparison-slot {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.comparison-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comparison-slot p {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 20px;
    text-align: center;
}

.comparison-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--primary);
    background: var(--bg-deep);
    border: 2px solid var(--primary);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin: auto 0;
    box-shadow: 0 0 15px rgba(163, 214, 94, 0.3);
    z-index: 2;
}

.photo-item.selecting {
    cursor: copy;
    border: 2px solid var(--primary);
    transform: scale(0.95);
    opacity: 0.7;
}

.photo-item.selecting:hover {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 20px var(--primary);
}

.comparison-label {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    backdrop-filter: blur(4px);
}

/* Record Detail Modal */
.record-detail-modal {
    max-width: 900px !important;
    width: 95% !important;
    max-height: 90vh !important;
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.record-detail-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    padding: 0; /* Let inner scroll handle padding */
}

.modal-body-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

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

@media (max-width: 800px) {
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.detail-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.detail-section h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--primary);
    border-bottom: 1px solid rgba(163, 214, 94, 0.2);
    padding-bottom: 0.5rem;
}

.det-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.det-photo-thumb {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.det-photo-thumb:hover {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 0 10px var(--primary);
}

.det-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Clickable rows in records table */
#records-tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

#records-tbody tr:hover {
    background: rgba(163, 214, 94, 0.05) !important;
}

#records-tbody td:last-child {
    cursor: default; /* Except actions */
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.form-group-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

/* Premium Modal Header */
.modal-header-premium {
    background: linear-gradient(135deg, rgba(163, 214, 94, 0.1), rgba(0, 0, 0, 0.4));
    padding: 1.5rem;
    border-bottom: 1px solid rgba(163, 214, 94, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.header-main-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.header-tag {
    background: var(--primary);
    color: var(--bg-deep);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    width: fit-content;
}

.modal-header-premium h2 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.btn-close-premium {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    box-shadow: 0 0 15px rgba(0,0,0,0.6);
}

.btn-close-premium:hover {
    background: #ef5350;
    border-color: #ff8a80;
    transform: rotate(90deg);
    box-shadow: 0 0 20px rgba(239, 83, 80, 0.6);
}

.record-detail-modal .modal-footer {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 1rem;
}

.record-detail-modal .btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.8rem 1.5rem;
    background: var(--primary);
    color: var(--bg-deep);
    border: none;
    box-shadow: 0 0 15px rgba(163, 214, 94, 0.3);
}

.record-detail-modal .btn-secondary {
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    transition: all 0.2s;
    font-weight: 600;
}

.record-detail-modal .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Dashboard Action Layer (Alerts + Insights) */
.dashboard-action-layer {
    padding: 0 1.5rem;
    margin-bottom: 2.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.pest-alerts-wrapper {
    background: rgba(239, 83, 80, 0.05);
    border: 1px solid rgba(239, 83, 80, 0.2);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (max-width: 992px) {
    .dashboard-action-layer {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        padding: 0 1rem;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.8rem;
    }
}

/* Mercado Items */
.market-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.95rem;
}

.market-card {
    min-height: 350px;
    display: flex;
    flex-direction: column;
}

.market-card canvas {
    flex: 1;
    width: 100% !important;
    height: 100% !important;
    min-height: 200px;
}

.market-price.up { color: #81c784; font-weight: bold; }
.market-price.down { color: #ef5350; font-weight: bold; }
.market-price.stable { color: var(--text-secondary); }

.historical-insight-card {
    grid-column: span 1 !important;
    margin-top: 0 !important;
    min-height: 120px;
}

#pest-alerts-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Pest Alert Cards */
.pest-alert-card {
    background: var(--glass-bg);
    border: 1px solid rgba(239, 83, 80, 0.3);
    border-left: 4px solid #ef5350;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.pest-alert-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pest-alert-icon {
    font-size: 2rem;
    min-width: 50px;
    height: 50px;
    background: rgba(239, 83, 80, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pest-alert-content {
    flex: 1;
}

.pest-alert-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: #ef5350;
}

.pest-alert-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.pest-alert-action {
    background: #ef5350;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.pest-alert-action:hover {
    background: #d32f2f;
}

@media (max-width: 480px) {
    .pest-alert-card {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .pest-alert-action {
        width: 100%;
        margin-top: 0.5rem;
    }
}


/* ==================================================
   SECTION: PERFIL Y CONFIGURACIÓN
   ================================================== */
#section-perfil .detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    margin-bottom: 2rem;
}

#section-perfil .detail-col h3 {
    font-size: 1.1rem;
    color: var(--pistachio-300);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

#section-perfil .form-group {
    margin-bottom: 1.5rem;
}

#section-perfil .form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

#section-perfil input,
#section-perfil textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all var(--transition-base);
}

#section-perfil input:focus,
#section-perfil textarea:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--pistachio-400);
    outline: none;
    box-shadow: 0 0 15px rgba(163, 214, 94, 0.2);
}

#signature-pad {
    width: 100% !important;
    height: 200px;
    background: #fff !important;
    border-radius: var(--radius-sm);
    cursor: crosshair;
}

.detail-section h3 {
    font-size: 1.1rem;
    color: var(--pistachio-300);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 992px) {
    #section-perfil .detail-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ==================================================
   CLIENTS SaaS - Usage Stats & Status
   ================================================== */
.client-card {
    transition: box-shadow 0.2s ease;
}

.client-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.plan-badge {
    background: var(--primary-light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.status-indicator {
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.status-indicator.status-green {
    background: rgba(76, 175, 80, 0.15);
}

.status-indicator.status-yellow {
    background: rgba(255, 193, 7, 0.15);
}

.status-indicator.status-red {
    background: rgba(244, 67, 54, 0.15);
}

.client-usage-stats strong {
    color: var(--primary);
}

.client-detail {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 1rem;
}

/* ==================================================
   PAGINATION STYLES
   ================================================== */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.pagination button {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--glass-border);
    background: var(--surface);
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-light);
}

.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0 0.5rem;
}

/* ==================================================
   GLOBAL SEARCH
   ================================================== */
.global-search {
    position: relative;
}

.global-search input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 0.4rem 1rem;
    color: white;
    width: 200px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.global-search input:focus {
    outline: none;
    border-color: var(--primary);
    width: 280px;
    background: rgba(255, 255, 255, 0.12);
}

.global-search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-results-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    margin-top: 0.5rem;
}

.search-results-dropdown.show {
    display: block;
}

.search-result-group {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.search-result-group:last-child {
    border-bottom: none;
}

.search-result-group-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.25rem 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.search-result-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background: var(--hover);
}

.search-result-item-icon {
    font-size: 1.1rem;
}

.search-result-item-text {
    flex: 1;
    font-size: 0.9rem;
}

.search-result-item-text strong {
    display: block;
    color: var(--text-primary);
}

.search-result-item-text small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.search-no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

/* Mobile responsive for global search */
@media (max-width: 768px) {
    .global-search {
        order: 10;
        width: 100%;
        padding: 0.5rem;
    }
    
    .global-search input {
        width: 100%;
    }
    
    .global-search input:focus {
        width: 100%;
    }
    
    .search-results-dropdown {
        max-height: 300px;
    }
}

/* Toggle Switch */
.toggle-switch { position: relative; width: 48px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 24px; transition: 0.3s; }
.toggle-slider:before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.3s; }
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(24px); }

/* Pest Alert Banner */
.pest-alert-banner {
    color: #ef5350;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(239, 83, 80, 0.2);
    margin-bottom: 0.5rem;
}

@keyframes pulse-warning {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,83,80,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239,83,80,0); }
}

/* Notification Card */
#notificaciones-card {
    border-left: 4px solid var(--primary);
}

/* Blending fix */
.login-logo-img img, 
.mobile-title img {
    mix-blend-mode: screen;
}

/* Definitve UI Polish for FincaDev Agro */
.login-card {
    text-align: center;
}
.form-group {
    text-align: left;
}

/* ==================================================
   FINAL MOBILE RESPONSIVENESS OVERRIDES (v24.6.3)
   ================================================== */
@media (max-width: 768px) {
    /* Layout & Sidebar */
    .app-container {
        flex-direction: column;
        padding-left: 0 !important;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        z-index: 2000;
        transition: transform var(--transition-base);
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        padding: 1rem !important;
        margin-top: 60px; /* Space for mobile header */
        width: 100% !important;
    }

    /* Login Screen */
    .login-container {
        padding: 1rem;
    }

    .login-card {
        padding: 2rem 1.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto;
    }

    .login-logo-img {
        width: 100px !important;
        height: 100px !important;
        margin-bottom: 1rem !important;
    }

    /* Dashboard & Grids */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .dashboard-tabs-container {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem !important;
        white-space: nowrap;
        display: flex !important;
        gap: 0.5rem !important;
        border-radius: var(--radius-md) !important;
    }

    .dashboard-tab {
        padding: 0.6rem 1rem !important;
        font-size: 0.85rem !important;
        flex: 0 0 auto;
    }

    /* Modals */
    .modal-content {
        width: 95% !important;
        margin: 10% auto !important;
        padding: 1.5rem !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Cards */
    .card {
        padding: 1.25rem !important;
    }

    /* Hide desktop-only elements */
    .desktop-only {
        display: none !important;
    }
}

/* ==================================================
   ONBOARDING / TUTORIAL STYLES (v24.6.3)
   ================================================== */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 500000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.onboarding-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.onboarding-popover {
    position: fixed;
    width: 340px;
    max-width: 92vw;
    z-index: 500001;
    padding: 1.5rem;
    background: var(--glass-bg-elevated);
    border: 1px solid var(--primary);
    box-shadow: 0 15px 50px rgba(0,0,0,0.7);
    border-radius: var(--radius-lg);
    display: flex; /* Cambiado de none a flex para control via JS */
    flex-direction: column;
    gap: 1.25rem;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.onboarding-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.onboarding-popover h3 {
    margin: 0;
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    line-height: 1.3;
}

.onboarding-skip {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0 0 1rem;
    transition: color 0.2s;
}
.onboarding-skip:hover { color: var(--error); }

.onboarding-text {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 0.98rem;
}

.onboarding-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.onboarding-progress {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.onboarding-actions {
    display: flex;
    gap: 0.75rem;
}

.onboarding-spotlight {
    position: fixed;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.8);
    z-index: 499999;
    pointer-events: none;
    transition: all 0.4s ease;
    display: none;
}

@media (max-width: 480px) {
    .onboarding-popover {
        width: 94vw !important;
        left: 3vw !important;
        padding: 1.25rem !important;
    }
}

/* Patch for Onboarding Height on Mobile */
@media (max-width: 768px) {
    .onboarding-popover {
        max-height: 75vh !important;
        overflow-y: auto !important;
        bottom: 20px !important;
        margin-bottom: 0 !important;
    }
}

/* ==================================================
   ULTIMATE MOBILE FIX (v24.6.4) - Zentrado & Blur
   ================================================== */
@media (max-width: 768px) {
    /* Centrado horizontal garantizado */
    .onboarding-popover {
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 90vw !important;
        max-width: 360px !important;
    }

    /* ULTIMATE Safe Mode: No desenfoque en móviles para nitidez absoluta */
    .sidebar, .sidebar * {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        filter: none !important;
        will-change: auto !important;
    }
    .sidebar {
        width: 260px !important;
        background: #080b06 !important; /* Totalmente opaco para máxima claridad */
        z-index: 2000 !important;
    }

    .onboarding-overlay {
        backdrop-filter: blur(2px) !important;
        -webkit-backdrop-filter: blur(2px) !important;
    }
}
