/* ==========================================================================
   🎨 DESIGN SYSTEM: LIQUID DESIGN & ORGANIC POTAGER (DARK THEME)
   ========================================================================== */

/* 1. Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* 2. Root Custom Properties (Palette Organique) */
:root {
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    /* Palette Organique Fluide */
    --bg-dark-deep: #080c10;
    --bg-dark-green: #0b1512;
    --bg-dark-radial: radial-gradient(circle at 10% 20%, #0c1814 0%, #060a0f 100%);

    /* Leaf / Green Gradients */
    --grad-green-primary: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --grad-green-liquid: linear-gradient(135deg, #34d399 0%, #10b981 50%, #047857 100%);
    --grad-green-soft: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.05) 100%);

    /* Earth / Soil Gradients */
    --grad-earth-primary: linear-gradient(135deg, #854d0e 0%, #451a03 100%);
    --grad-earth-liquid: linear-gradient(135deg, #d97706 0%, #92400e 50%, #451a03 100%);
    --grad-earth-soft: linear-gradient(135deg, rgba(133, 77, 14, 0.15) 0%, rgba(69, 26, 3) 0.05%);

    /* Water / Cyan Gradients */
    --grad-water-primary: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
    --grad-water-liquid: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 50%, #0369a1 100%);
    --grad-water-soft: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(3, 105, 161, 0.05) 100%);

    /* Warning & Glows */
    --grad-fire: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
    --grad-sun: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
    
    /* Card Glassmorphism */
    --glass-bg: rgba(12, 22, 19, 0.7);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-border-hover: rgba(52, 211, 153, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Text colors */
    --text-white: #f8fafc;
    --text-muted: #94a3b8;
    --text-green: #34d399;
    --text-dark: #0f172a;

    /* Liquid Border Radius */
    --radius-liquid-lg: 2rem;
    --radius-liquid-md: 1.5rem;
    --radius-liquid-sm: 1rem;
    
    /* Organic Animation Transition */
    --transition-organic: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --transition-smooth: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 3. Global Resets & Scrollbars */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-dark-radial);
    color: var(--text-white);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(52, 211, 153, 0.3);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 211, 153, 0.6);
}

/* ==========================================================================
   🌊 ANIMATIONS & BLOBS (ORGANIC FEEL)
   ========================================================================== */
@keyframes float-blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

@keyframes liquid-pulse {
    0% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 40% 60% 70% 30% / 50% 60% 30% 70%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

@keyframes text-shine {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes lasagna-wave {
    0% { transform: translateY(0) scaleY(1); }
    50% { transform: translateY(-3px) scaleY(1.02); }
    100% { transform: translateY(0) scaleY(1); }
}

.organic-blob {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}
.blob-green {
    background: var(--blob-color-1, #10b981);
    top: -100px;
    left: -100px;
    animation: float-blob 20s infinite alternate;
}
.blob-blue {
    background: var(--blob-color-2, #0ea5e9);
    bottom: -150px;
    right: -100px;
    animation: float-blob 25s infinite alternate-reverse;
}
.blob-brown {
    background: var(--blob-color-3, #854d0e);
    top: 50%;
    left: 45%;
    animation: float-blob 22s infinite alternate;
}

/* ==========================================================================
   📐 MAIN LAYOUT (SPA RESPONSIVE)
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Sidebar Organique */
.sidebar {
    width: 280px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition-smooth), z-index 0.1s ease;
}

.sidebar:hover {
    z-index: 10001; /* Elevates above #weatherOverlay at 9999 to clear weather frost/fog overlays */
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}


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

.brand-icon {
    width: 48px;
    height: 48px;
    background: var(--grad-green-primary);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    animation: liquid-pulse 6s infinite alternate;
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(120deg, #34d399, #10b981, #0ea5e9);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-shine 6s linear infinite;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-liquid-md);
    font-weight: 500;
    transition: var(--transition-organic);
}

.nav-item.active a, .nav-item a:hover {
    color: var(--text-white);
    background: var(--grad-green-soft);
    border: 1px solid var(--glass-border-hover);
    transform: translateX(5px);
}

.nav-item.active a i {
    color: var(--text-green);
}

.nav-item a i {
    font-size: 1.25rem;
    transition: var(--transition-organic);
}

/* Contenu Principal */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2.5rem;
    min-height: 100vh;
    transition: var(--transition-smooth);
    width: calc(100% - 280px);
}

.page-section {
    display: none;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

/* Header de Page */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.page-title h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ==========================================================================
   🧊 GLASSMORPHISM PREMIUM CARDS & BUTTONS
   ========================================================================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-liquid-lg);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: var(--glass-border-hover);
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(16, 185, 129, 0.08);
}

.glass-card.glow-green:hover::before { background: var(--grad-green-primary); }
.glass-card.glow-brown:hover::before { background: var(--grad-earth-primary); }
.glass-card.glow-blue:hover::before { background: var(--grad-water-primary); }

/* Liquid Buttons */
.btn-liquid {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-white);
    border: none;
    outline: none;
    cursor: pointer;
    padding: 0.8rem 1.8rem;
    border-radius: 40% 60% 70% 30% / 60% 40% 60% 40%;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    transition: var(--transition-organic);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-green { background: var(--grad-green-liquid); }
.btn-green:hover {
    border-radius: 60% 40% 30% 70% / 40% 60% 40% 60%;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.45);
    transform: scale(1.05);
}

.btn-brown { background: var(--grad-earth-liquid); }
.btn-brown:hover {
    border-radius: 60% 40% 30% 70% / 40% 60% 40% 60%;
    box-shadow: 0 8px 25px rgba(133, 77, 14, 0.45);
    transform: scale(1.05);
}

.btn-blue { background: var(--grad-water-liquid); }
.btn-blue:hover {
    border-radius: 60% 40% 30% 70% / 40% 60% 40% 60%;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.45);
    transform: scale(1.05);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-liquid-md);
}
.btn-outline:hover {
    border-color: var(--text-green);
    background: var(--grad-green-soft);
    color: var(--text-green);
}

.btn-danger { background: var(--grad-fire); }
.btn-danger:hover {
    box-shadow: 0 8px 25px rgba(244, 63, 94, 0.4);
    transform: scale(1.05);
}

/* ==========================================================================
   🏡 DASHBOARD & WEATHER WIDGETS
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.5rem;
}

.metric-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 50% 40% 60% 40% / 40% 50% 40% 60%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    animation: liquid-pulse 5s infinite alternate;
}
.metric-card.green .metric-icon-wrapper { background: var(--grad-green-primary); box-shadow: 0 0 15px rgba(16, 185, 129, 0.2); }
.metric-card.brown .metric-icon-wrapper { background: var(--grad-earth-primary); box-shadow: 0 0 15px rgba(133, 77, 14, 0.2); }
.metric-card.blue .metric-icon-wrapper { background: var(--grad-water-primary); box-shadow: 0 0 15px rgba(14, 165, 233, 0.2); }

.metric-info h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
}
.metric-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Weather Dashboard Widget */
.weather-widget {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.weather-today {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem;
    border-radius: var(--radius-liquid-md);
    background: rgba(255, 255, 255, 0.02);
}

.weather-today-icon {
    font-size: 3.5rem;
    color: #eab308;
    animation: float-blob 4s infinite alternate;
}

.weather-today-temp {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.weather-today-desc {
    font-weight: 600;
    color: var(--text-green);
}

.weather-7day {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.weather-day-col {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-liquid-sm);
    padding: 0.8rem 0.4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}
.weather-day-col:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.weather-day-name {
    font-weight: 600;
    color: var(--text-muted);
}

.weather-day-icon {
    font-size: 1.3rem;
    color: #38bdf8;
    margin: 0.2rem 0;
}

.weather-day-temps {
    font-family: var(--font-heading);
    font-weight: 700;
}
.weather-day-temps span {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.75rem;
}

.weather-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1rem;
}

.weather-alert-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-liquid-md);
    background: rgba(244, 63, 94, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.15);
}
.weather-alert-item.frost {
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.15);
}
.weather-alert-item.drought {
    background: rgba(234, 179, 8, 0.08);
    border-color: rgba(234, 179, 8, 0.15);
}

.weather-alert-item i {
    font-size: 1.5rem;
    margin-top: 0.1rem;
}
.weather-alert-item i.frost { color: #38bdf8; }
.weather-alert-item i.heat { color: #f43f5e; }
.weather-alert-item i.drought { color: #eab308; }

.weather-alert-info h5 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.weather-alert-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================================================
   🥕 MODULE 1 & 2 : CONTAINERS & MULTI-LAYER LASAGNA SOIL
   ========================================================================== */
.containers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 2rem;
}

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

.container-card-title h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
}
.container-card-title p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Visual Lasagna Soil Profile */
.lasagna-profile-wrapper {
    margin: 1.5rem 0;
    border-radius: var(--radius-liquid-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    background: #090e0c;
}

.lasagna-layers-container {
    display: flex;
    flex-direction: column-reverse; /* Bottom layer position 0 starts at the bottom! */
    width: 100%;
}

.lasagna-layer-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.2rem;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.85rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    animation: lasagna-wave 6s infinite ease-in-out;
}

.lasagna-layer-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, transparent 100%);
    pointer-events: none;
}

.lasagna-layer-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 2;
}

.lasagna-layer-thickness {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-family: var(--font-heading);
    z-index: 2;
}

/* Layer Material Colors (Liquid & Organic Theme) */
.layer-material-carton { background: linear-gradient(180deg, #78350f 0%, #451a03 100%); }
.layer-material-bois { background: linear-gradient(180deg, #6b21a8 0%, #4c1d95 100%); }
.layer-material-feuilles { background: linear-gradient(180deg, #b45309 0%, #78350f 100%); }
.layer-material-pelouse { background: linear-gradient(180deg, #065f46 0%, #064e3b 100%); }
.layer-material-compost { background: linear-gradient(180deg, #3f220f 0%, #1a0a03 100%); }
.layer-material-terreau { background: linear-gradient(180deg, #1c1917 0%, #0c0a09 100%); }
.layer-material-paillage { background: linear-gradient(180deg, #ca8a04 0%, #854d0e 100%); }
.layer-material-default { background: linear-gradient(180deg, #334155 0%, #1e293b 100%); }

/* Lasagna Interactive Editor Modals */
.layers-editor-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.editor-layer-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-liquid-md);
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: 3fr 1.5fr auto;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 600px) {
    .editor-layer-row {
        grid-template-columns: 1fr auto;
        gap: 0.75rem;
        padding: 0.8rem;
    }
    .editor-layer-row > :nth-child(1) {
        grid-column: 1 / -1; /* Materia select takes full width */
    }
    .editor-layer-row > :nth-child(2) {
        grid-column: 1;      /* Thickness input */
    }
    .editor-layer-row > :nth-child(4) {
        grid-column: 2;      /* Delete trash button */
    }
}

/* Form Styles Organique */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.form-group label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-liquid-sm);
    padding: 0.8rem 1rem;
    color: var(--text-white);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}
.form-input:focus {
    border-color: var(--text-green);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.15);
}

/* Custom premium DD/MM/YYYY display overlay for date inputs */
input[type="date"] {
    position: relative;
}
input[type="date"][data-date]::before {
    content: attr(data-date);
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-white);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: transparent;
    pointer-events: none;
    z-index: 2;
}
body.mode-light input[type="date"][data-date]::before {
    color: var(--text-dark-rich) !important;
}
input[type="date"][data-date]::-webkit-datetime-edit {
    color: transparent !important;
}


.form-select {
    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='%2334d399'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
    padding-right: 2.5rem;
}

.form-select option {
    background-color: var(--bg-dark-deep);
    color: var(--text-white);
    padding: 0.5rem;
}

/* ==========================================================================
   🍼 MODULE 3 : NURSERY & SEEDLINGS CARDS
   ========================================================================== */
.nursery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

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

.badge-organic {
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}
.badge-green { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.25); color: #34d399; }
.badge-blue { background: rgba(14, 165, 233, 0.12); border-color: rgba(14, 165, 233, 0.25); color: #38bdf8; }
.badge-amber { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.25); color: #fbbf24; }
.badge-red { background: rgba(244, 63, 94, 0.12); border-color: rgba(244, 63, 94, 0.25); color: #fb7185; }

.seedling-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.seedling-body span { color: var(--text-white); font-weight: 500; }

.heating-pad-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-liquid-sm);
    background: rgba(244, 63, 94, 0.05);
    border: 1px solid rgba(244, 63, 94, 0.1);
    color: #fb7185;
    margin-top: 0.8rem;
}
.heating-pad-status.active {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* --- 🍼 LINEAR PROGRESS TIMELINE & GROWTH CHECKPOINTS --- */
.nursery-timeline-wrapper {
    position: relative;
    margin: 2.2rem 0 2.5rem 0;
    padding: 0 0.8rem;
}

.nursery-timeline-container {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    width: 100%;
}

.nursery-timeline-progress {
    position: absolute;
    height: 100%;
    left: 0;
    top: 0;
    background: linear-gradient(90deg, #fbbf24 0%, #38bdf8 50%, #34d399 100%);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
    transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.nursery-checkpoint {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
    z-index: 10;
}

.checkpoint-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1e293b;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    transition: var(--transition-organic);
}

/* Completed Dot state: glows with state color */
.nursery-checkpoint.completed .checkpoint-dot {
    background: var(--bg-dark-deep);
    border-color: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
    transform: scale(1.15);
}

/* Active Dot state: pulses with growth indicator */
.nursery-checkpoint.active .checkpoint-dot {
    background: var(--bg-dark-deep);
    border-color: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.25);
    animation: dot-pulse 2s infinite;
    transform: scale(1.15);
}

@keyframes dot-pulse {
    0% { box-shadow: 0 0 0 0px rgba(56, 189, 248, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
    100% { box-shadow: 0 0 0 0px rgba(56, 189, 248, 0); }
}

.checkpoint-label {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 0.6rem;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.nursery-checkpoint.completed .checkpoint-label {
    color: var(--text-white);
}

.nursery-checkpoint.active .checkpoint-label {
    color: #38bdf8;
}

.checkpoint-date {
    font-size: 0.6rem;
    color: rgba(148, 163, 184, 0.5);
    margin-top: 0.1rem;
    white-space: nowrap;
}

/* --- 📋 GROWTH PHASE DYNAMIC ALERT CARD --- */
.nursery-countdown-alert {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-liquid-md);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-top: 1rem;
    border: 1px solid transparent;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
}

.nursery-countdown-alert .alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.nursery-countdown-alert .alert-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.nursery-countdown-alert .alert-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
}

.nursery-countdown-alert .alert-desc {
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* Incubation Alert (Yellow/Amber glow) */
.nursery-countdown-alert.alert-incubation {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}
.nursery-countdown-alert.alert-incubation .alert-title {
    color: #fef08a;
}

/* Growth Alert (Blue/Cyan glow) */
.nursery-countdown-alert.alert-growth {
    background: rgba(14, 165, 233, 0.05);
    border-color: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
}
.nursery-countdown-alert.alert-growth .alert-title {
    color: #bae6fd;
}

/* Info Alert (e.g. for general status) */
.nursery-countdown-alert.alert-info {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}
.nursery-countdown-alert.alert-info .alert-title {
    color: #c7d2fe;
}

/* Success Alert (Green glow) */
.nursery-countdown-alert.alert-success {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
.nursery-countdown-alert.alert-success .alert-title {
    color: #a7f3d0;
}
.nursery-countdown-alert.alert-success .alert-icon-glow {
    filter: drop-shadow(0 0 4px rgba(52, 211, 153, 0.5));
}

/* Warning Alert (Red/Pink alert) */
.nursery-countdown-alert.alert-warning {
    background: rgba(244, 63, 94, 0.05);
    border-color: rgba(244, 63, 94, 0.15);
    color: #fb7185;
}
.nursery-countdown-alert.alert-warning .alert-title {
    color: #fecdd3;
}

/* Spinning animation for incubation icon */
.animate-spin-slow {
    animation: spin-slow 4s linear infinite;
}
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

/* ==========================================================================
   🌿 MODULE 4 : BOTANICAL ENCYCLOPEDIA & COMPANION NETWORKS
   ========================================================================== */
.botanic-controls {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-liquid-md);
}

.search-wrapper {
    flex: 2;
    position: relative;
}
.search-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.search-input {
    width: 100%;
    padding-left: 2.8rem !important;
}

.filter-wrapper {
    flex: 1;
}

.plants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.plant-card {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    cursor: pointer;
}

.plant-card-title h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
}
.plant-card-title p {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.plant-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.plant-info-grid i { color: var(--text-green); margin-right: 0.3rem; }

/* Interactive Companions network highlights */
.companions-indicator {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.companions-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.companion-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}
.companion-good { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); color: #34d399; }
.companion-bad { background: rgba(244, 63, 94, 0.1); border: 1px solid rgba(244, 63, 94, 0.2); color: #fb7185; }

/* When a plant is hovered or selected, highlight companions in the grid */
.plant-card.companion-highlight-good {
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
    transform: scale(1.02);
}
.plant-card.companion-highlight-bad {
    border-color: rgba(244, 63, 94, 0.6);
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.2);
    transform: scale(1.02);
}
.plant-card.companion-dimmed {
    opacity: 0.3;
    transform: scale(0.98);
}

/* ==========================================================================
   🚜 MODULE 5 : ACTIVE CROPS TRACKER
   ========================================================================== */
.crops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.crop-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin: 1rem 0;
    overflow: hidden;
}

.crop-progress-fill {
    height: 100%;
    background: var(--grad-green-primary);
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

.crop-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   📝 MODULE 7 : DYNAMIC TO-DO LIST STYLE
   ========================================================================== */
.todo-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.todo-filters {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.todo-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 1.2rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-liquid-md);
    transition: var(--transition-smooth);
}
.todo-item:hover {
    border-color: var(--glass-border-hover);
    background: rgba(255, 255, 255, 0.04);
}
.todo-item.completed {
    opacity: 0.55;
    background: rgba(255, 255, 255, 0.005);
    border-color: rgba(255, 255, 255, 0.02);
}

.todo-item-left {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex: 1;
}

/* Organic Custom Checkbox */
.checkbox-organic {
    width: 26px;
    height: 26px;
    border: 2px solid var(--text-green);
    border-radius: 40% 60% 60% 40% / 50% 50% 50% 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: var(--transition-organic);
}
.checkbox-organic:hover {
    border-radius: 50% 50% 50% 50%;
    background: rgba(52, 211, 153, 0.15);
}
.todo-item.completed .checkbox-organic {
    background: var(--text-green);
    border-color: var(--text-green);
    color: var(--bg-dark-deep);
}

.todo-item-info h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}
.todo-item.completed .todo-item-info h4 {
    text-decoration: line-through;
}

.todo-item-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.todo-item-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ==========================================================================
   🧩 SIMULATOR & HA CONTROL PANEL
   ========================================================================== */
.simulator-panel {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(12, 22, 19, 0.7) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
}
.simulator-panel:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 12px 40px 0 rgba(99, 102, 241, 0.1);
}

.simulator-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    color: #818cf8;
    margin-bottom: 1.2rem;
}

.simulator-slider {
    width: 100%;
    accent-color: #6366f1;
    height: 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    outline: none;
    margin: 0.8rem 0;
    cursor: pointer;
}

/* ==========================================================================
   🖥️ DIALOG / MODAL ORGANIC MODERNE
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-liquid-lg);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

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

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.modal-close:hover {
    color: var(--text-white);
}

/* ==========================================================================
   📱 MOBILE RESPONSIVENESS & TOUCH CONTROLS
   ========================================================================== */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1.2rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }
    
    .nav-links {
        display: none; /* Hide standard side-menu on mobile, handle via hamburger or bottom-nav */
    }
    
    /* We can create a bottom tab bar for mobile or toggle a hamburger */
    .mobile-nav-toggle {
        display: block !important;
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
        width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .metrics-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .weather-7day {
        grid-template-columns: repeat(4, 1fr);
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
}

.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-green);
    font-size: 1.8rem;
    cursor: pointer;
}

/* Slide Out Navigation Drawer for Mobile */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-dark-green);
    border-right: 1px solid var(--glass-border);
    z-index: 1001;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-drawer.active {
    left: 0;
}.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    display: none;
}
.drawer-overlay.active {
    display: block;
}

/* ==========================================================================
   ⚙️ CONFIGURATION MODULE LAYOUTS
   ========================================================================== */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    align-items: start;
}

.config-items-list {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-liquid-sm);
    padding-right: 0.3rem;
}

.config-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-liquid-sm);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    margin-bottom: 0.6rem;
    transition: var(--transition-smooth);
}
.config-item-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.config-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.config-item-info strong {
    font-size: 0.95rem;
    color: var(--text-white);
}

.config-item-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   🏷️ ADVANCED AGRONOMIC FILTER CHIPS
   ========================================================================== */
.botanic-chips-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 0 0.2rem;
}

.botanic-chip {
    padding: 0.5rem 1.1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    user-select: none;
}

.botanic-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.botanic-chip.active {
    background: var(--grad-green-soft);
    color: var(--text-white);
    border-color: var(--text-green);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.25);
}

/* ==========================================================================
   🌾 GRAINOTHÈQUE CRITICAL ALERT & PULSING EFFECT
   ========================================================================== */
.seeds-card-alert {
    animation: card-alert-pulse 2s infinite alternate;
    border-color: rgba(245, 158, 11, 0.35) !important;
}

@keyframes card-alert-pulse {
    100% { 
        box-shadow: 0 0 22px rgba(245, 158, 11, 0.25); 
        border-color: rgba(245, 158, 11, 0.7); 
    }
}

/* ==========================================================================
   🎨 THEME ENGINE: 7 FRENCH REGIONAL LANDSCAPES & CONTINUOUS SOLAR GRADATION
   ========================================================================== */

/* 1. Base Solar Mode-Light Overrides (Clair / Jour) */
body.mode-light {
    --text-white: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-border-hover: var(--text-green);
    --bg-dark-deep: #f8fafc;
    --bg-dark-green: #f1f5f9;
    background: radial-gradient(circle at 10% 20%, #f1f5f9 0%, #e2e8f0 100%) !important;
    color: #1e293b !important;
}

body.mode-light .glass-card {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}
body.mode-light .glass-card:hover {
    border-color: rgba(0, 0, 0, 0.15);
}
body.mode-light .modal-content {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.1) !important;
    color: #1e293b !important;
}
body.mode-light .modal-content h3, 
body.mode-light .modal-content label {
    color: #1e293b !important;
}
body.mode-light .sidebar-organic {
    background: rgba(255, 255, 255, 0.85);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}
body.mode-light .nav-item {
    color: #475569;
}
body.mode-light .nav-item:hover, body.mode-light .nav-item.active {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-green);
}
body.mode-light .mobile-top-bar {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
body.mode-light .form-input {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #1e293b !important;
}
body.mode-light .form-input:focus {
    background: #ffffff !important;
    border-color: var(--text-green) !important;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.15) !important;
}
body.mode-light .form-select option {
    background-color: #ffffff;
    color: #1e293b;
}

/* 2. Terroir CSS Declarations */

/* --- A. LUBÉRON (Ocre & Lavande) --- */
body.theme-luberon {
    --text-green: #f59e0b; /* Ocre */
    --blob-color-1: #d97706; /* Ocre profond */
    --blob-color-2: #8b5cf6; /* Lavande */
    --blob-color-3: #15803d; /* Pin sylvestre */
    --bg-dark-radial: radial-gradient(circle at 10% 20%, #1e1310 0%, #0a0605 100%);
    --bg-dark-deep: #0e0705;
}
body.theme-luberon.mode-light {
    --text-green: #d97706;
    --bg-dark-radial: radial-gradient(circle at 10% 20%, #faf3ee 0%, #f0decb 100%);
    background: radial-gradient(circle at 10% 20%, #faf3ee 0%, #f0decb 100%) !important;
}

/* --- B. CÉVENNES (Schiste & Châtaigne) --- */
body.theme-cevennes {
    --text-green: #10b981; /* Vert sauvage */
    --blob-color-1: #047857; /* Vert émeraude */
    --blob-color-2: #92400e; /* Châtaigne */
    --blob-color-3: #4b5563; /* Schiste */
    --bg-dark-radial: radial-gradient(circle at 10% 20%, #0a110f 0%, #030605 100%);
    --bg-dark-deep: #050a09;
}
body.theme-cevennes.mode-light {
    --text-green: #047857;
    --bg-dark-radial: radial-gradient(circle at 10% 20%, #f3f7f5 0%, #dae5df 100%);
    background: radial-gradient(circle at 10% 20%, #f3f7f5 0%, #dae5df 100%) !important;
}

/* --- C. CAMARGUE (Sel & Flamant) --- */
body.theme-camargue {
    --text-green: #f472b6; /* Rose flamant */
    --blob-color-1: #f472b6;
    --blob-color-2: #38bdf8; /* Bleu sel */
    --blob-color-3: #fef08a; /* Sable fin */
    --bg-dark-radial: radial-gradient(circle at 10% 20%, #0d1520 0%, #04070a 100%);
    --bg-dark-deep: #05090f;
}
body.theme-camargue.mode-light {
    --text-green: #db2777;
    --bg-dark-radial: radial-gradient(circle at 10% 20%, #faf5f5 0%, #e0eff6 100%);
    background: radial-gradient(circle at 10% 20%, #faf5f5 0%, #e0eff6 100%) !important;
}

/* --- D. DAUPHINÉ (Sapin & Glacier) --- */
body.theme-dauphine {
    --text-green: #06b6d4; /* Glacier */
    --blob-color-1: #0891b2;
    --blob-color-2: #eab308; /* Alpin */
    --blob-color-3: #065f46; /* Sapin */
    --bg-dark-radial: radial-gradient(circle at 10% 20%, #071413 0%, #020606 100%);
    --bg-dark-deep: #030a09;
}
body.theme-dauphine.mode-light {
    --text-green: #0891b2;
    --bg-dark-radial: radial-gradient(circle at 10% 20%, #f0f7f7 0%, #d4e8e8 100%);
    background: radial-gradient(circle at 10% 20%, #f0f7f7 0%, #d4e8e8 100%) !important;
}

/* --- E. HAUTE SAVOIE (Neige & Mélèze) --- */
body.theme-hautesavoie {
    --text-green: #38bdf8; /* Bleu givré */
    --blob-color-1: #7dd3fc;
    --blob-color-2: #fbbf24; /* Mélèze */
    --blob-color-3: #64748b; /* Ardoise */
    --bg-dark-radial: radial-gradient(circle at 10% 20%, #0f1622 0%, #05080c 100%);
    --bg-dark-deep: #060b12;
}
body.theme-hautesavoie.mode-light {
    --text-green: #0284c7;
    --bg-dark-radial: radial-gradient(circle at 10% 20%, #f5f8fa 0%, #dbe7f2 100%);
    background: radial-gradient(circle at 10% 20%, #f5f8fa 0%, #dbe7f2 100%) !important;
}

/* --- F. PROVENCE (Lavande & Olivier) --- */
body.theme-provence {
    --text-green: #8b5cf6; /* Lavande */
    --blob-color-1: #a78bfa;
    --blob-color-2: #10b981; /* Olivier */
    --blob-color-3: #eab308; /* Soleil provençal */
    --bg-dark-radial: radial-gradient(circle at 10% 20%, #130d22 0%, #06040b 100%);
    --bg-dark-deep: #090512;
}
body.theme-provence.mode-light {
    --text-green: #6d28d9;
    --bg-dark-radial: radial-gradient(circle at 10% 20%, #f8f6fb 0%, #eadff7 100%);
    background: radial-gradient(circle at 10% 20%, #f8f6fb 0%, #eadff7 100%) !important;
}

/* --- G. BRETAGNE (Océan & Ajoncs) --- */
body.theme-bretagne {
    --text-green: #0ea5e9; /* Océan */
    --blob-color-1: #0284c7;
    --blob-color-2: #fbbf24; /* Ajoncs */
    --blob-color-3: #4b5563; /* Granit */
    --bg-dark-radial: radial-gradient(circle at 10% 20%, #0b141d 0%, #030609 100%);
    --bg-dark-deep: #050a0f;
}
body.theme-bretagne.mode-light {
    --text-green: #0284c7;
    --bg-dark-radial: radial-gradient(circle at 10% 20%, #f2f6f9 0%, #cfdee7 100%);
    background: radial-gradient(circle at 10% 20%, #f2f6f9 0%, #cfdee7 100%) !important;
}

/* ==========================================================================
   ❄️ WEATHER DYNAMIC VISUAL EFFECT OVERLAYS (DISCRETE & PREMIUM)
   ========================================================================== */
#weatherOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    pointer-events: none;
    transition: all 1s ease-in-out;
}

/* 1. Froid Extrême (Givre cristallin bleu glacier très évocateur) */
#weatherOverlay.weather-frost {
    box-shadow: inset 0 0 65px rgba(186, 230, 253, 0.45), 
                inset 0 0 140px rgba(14, 165, 233, 0.35),
                inset 0 0 220px rgba(3, 105, 161, 0.18);
    border: 8px solid rgba(186, 230, 253, 0.1);
    background-image: radial-gradient(circle, transparent 50%, rgba(14, 165, 233, 0.1) 100%);
    /* Removed global blur to apply progressive radial vignette */
}

/* Frosted progressive blur vignette (sharp text at center, foggy edges) */
.frost-blur-vignette {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    backdrop-filter: blur(4.5px);
    -webkit-backdrop-filter: blur(4.5px);
    mask-image: radial-gradient(circle, transparent 38%, black 78%);
    -webkit-mask-image: radial-gradient(circle, transparent 38%, black 78%);
    pointer-events: none;
    z-index: 1;
}

#weatherOverlay.weather-frost::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath d='M10 0 L0 10 M30 0 L0 30 M50 0 L0 50 M70 0 L0 70 M80 10 L10 80 M80 30 L30 80 M80 50 L50 80 M80 70 L70 80' stroke='%230ea5e9' stroke-width='0.25' opacity='0.25'/%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
    z-index: 2;
}

/* Cristaux de glace bleu givré */
.frost-crystal {
    position: absolute;
    background: radial-gradient(circle, #bae6fd 0%, rgba(14, 165, 233, 0.95) 40%, rgba(3, 105, 161, 0) 75%);
    clip-path: polygon(50% 0%, 53% 38%, 90% 30%, 56% 47%, 100% 50%, 56% 53%, 90% 70%, 53% 62%, 50% 100%, 47% 62%, 10% 70%, 44% 53%, 0% 50%, 44% 47%, 10% 30%, 47% 38%);
    pointer-events: none;
    opacity: 0.8;
    animation: crystal-scintillate 5s infinite alternate ease-in-out;
    filter: drop-shadow(0 0 8px rgba(186, 230, 253, 0.7));
    z-index: 3;
}
@keyframes crystal-scintillate {
    0% { opacity: 0.55; transform: scale(0.9) rotate(0deg); }
    100% { opacity: 0.95; transform: scale(1.1) rotate(6deg); }
}

/* 2. Chaud Extrême (Canicule pulsante orange vif très prononcée) */
#weatherOverlay.weather-heat {
    box-shadow: inset 0 0 95px rgba(249, 115, 22, 0.38), 
                inset 0 0 180px rgba(234, 88, 12, 0.28);
    background-image: radial-gradient(circle, rgba(249, 115, 22, 0.1) 0%, rgba(234, 88, 12, 0.05) 55%, transparent 100%);
    animation: weather-heat-pulse 5s infinite alternate ease-in-out;
}
@keyframes weather-heat-pulse {
    0% { opacity: 0.8; backdrop-filter: saturate(1.0); }
    100% { opacity: 1.0; backdrop-filter: saturate(1.28) contrast(1.05); }
}

/* Étincelles/micro-bulles de chaleur montantes */
.heat-spark {
    position: absolute;
    background: radial-gradient(circle, #fef08a 10%, rgba(249, 115, 22, 0.85) 40%, rgba(234, 88, 12, 0) 80%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.6;
    animation: heat-spark-float 8s infinite ease-in-out;
    filter: blur(1px) drop-shadow(0 0 5px #f97316);
}
@keyframes heat-spark-float {
    0% { transform: translateY(105vh) scale(0.3) translateX(0px); opacity: 0; }
    10% { opacity: 0.65; }
    50% { transform: translateY(50vh) scale(1.15) translateX(30px); }
    90% { opacity: 0.65; }
    100% { transform: translateY(-5vh) scale(0.5) translateX(-20px); opacity: 0; }
}

/* 3. Risque de Pluie (Effet vitre mouillée et gouttes d'eau physiques) */
#weatherOverlay.weather-rain {
    background-color: rgba(15, 23, 42, 0.08);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.28);
}

/* High contrast rain drops (visible on light backgrounds) */
.rain-drop {
    position: absolute;
    background: linear-gradient(transparent, rgba(14, 165, 233, 0.45), rgba(15, 23, 42, 0.4));
    width: 1px;
    height: 20px;
    opacity: 0.35;
    animation: rain-fall 1.2s linear infinite;
    pointer-events: none;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}
@keyframes rain-fall {
    0% { transform: translateY(-50px); }
    100% { transform: translateY(105vh); }
}

/* Gouttes d'eau perlantes haut-contraste */
.glass-droplet {
    position: absolute;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    width: 3px;
    height: 4px;
    /* Box-shadow with prominent dark border outline + drop-shadow for daylight visibility */
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.5), 
                inset 0 1px 1px rgba(255, 255, 255, 0.95),
                0 0 1px rgba(15, 23, 42, 0.8);
    opacity: 0.75;
    pointer-events: none;
}

/* Suspended droplets awaiting to slide down randomly */
.glass-droplet.suspended {
    top: 2px;
    width: 4px;
    height: 6px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    transition: transform 0.5s ease-in;
}

/* Active sliding animation for crawling drops */
.glass-droplet.falling {
    animation: droplet-slide-fall 8s forwards cubic-bezier(0.25, 0.1, 0.25, 1);
}
@keyframes droplet-slide-fall {
    0% { transform: translateY(0px) scale(1); opacity: 0.85; }
    5% { opacity: 0.85; }
    92% { transform: translateY(102vh) scale(0.8); opacity: 0.85; }
    100% { transform: translateY(102vh) scale(0.4); opacity: 0; }
}

/* ==========================================================================
   🌿 BOTANICAL ENCYCLOPEDIA SPECIES & VARIETIES GROUPING
   ========================================================================== */
.species-group {
    margin-bottom: 2.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-liquid-md);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

body.mode-light .species-group {
    background: rgba(0, 0, 0, 0.015);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.species-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(16, 185, 129, 0.25); /* Elegant light-green border line */
}

.species-group-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-green);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.species-group-badge {
    background: var(--grad-green-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-liquid-full);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

/* ==========================================
   🌿 PREMIUM COMPACT SPECIES CARDS GRID
   ========================================== */
.species-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.species-card {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-liquid-md);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: transform var(--transition-bounce), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    position: relative;
    overflow: hidden;
}

.species-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--grad-green-primary);
    opacity: 0;
    transition: opacity var(--transition-smooth);
    z-index: 0;
}

.species-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.15), 0 0 1px rgba(16, 185, 129, 0.3);
}

.species-card:hover::before {
    opacity: 0.03;
}

.species-card-emoji-wrap {
    width: 68px;
    height: 68px;
    border-radius: 50% 40% 60% 40% / 40% 50% 40% 60%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin-bottom: 0.2rem;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1.5px solid rgba(16, 185, 129, 0.15);
    box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.05);
}

.species-card:hover .species-card-emoji-wrap {
    transform: scale(1.15) rotate(5deg);
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
}

.species-card-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: #f8fafc;
    z-index: 1;
    margin: 0;
}

.species-card-count {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--text-green);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-liquid-full);
    z-index: 1;
    transition: background var(--transition-smooth), color var(--transition-smooth);
}

.species-card:hover .species-card-count {
    background: var(--grad-green-primary);
    color: white;
}

.species-card-family {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    z-index: 1;
}

body.mode-light .species-card {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
body.mode-light .species-card-title {
    color: var(--text-dark);
}
body.mode-light .species-card-emoji-wrap {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Promesse de Fleurs Filter select styles */
.filters-grid .form-group select.form-select {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: #f1f5f9;
}
body.mode-light .filters-grid .form-group select.form-select {
    background-color: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-dark);
}

/* ==========================================================================
   🚨 CONTRAST & VISIBILITY OVERRIDES (LIGHT MODE & SOIL LAYERS)
   ========================================================================== */

/* Premium Light Theme Glassmorphism Overlay (removes the light grised veil, makes modal pop) */
body.mode-light .modal-overlay {
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Force solid white, high contrast modal content in light mode */
body.mode-light .modal-content {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    --text-white: #1e293b !important;
    --text-muted: #64748b !important;
}

/* Force dark text for readability inside glass cards in light mode */
body.mode-light .glass-card {
    --text-white: #1e293b !important;
    --text-muted: #64748b !important;
}

/* Bulletproof Lasagna Soil Layers Text Color (Always White on dark colorful gradients) */
.lasagna-layer-item,
.lasagna-layer-item *,
.lasagna-layer-item span,
.lasagna-layer-item div,
.lasagna-layer-item i {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
}

/* ==========================================================================
   🔒 GLOBAL SECURE ACCESS (READ-ONLY BY DEFAULT)
   ========================================================================== */
body.app-readonly #addSeedBtn,
body.app-readonly #addCropBtn,
body.app-readonly #addContainerBtn,
body.app-readonly #addPlantBtn,
body.app-readonly #emptySeedsBtn,
body.app-readonly .btn-danger,
body.app-readonly button[id*="Add"],
body.app-readonly button[id*="add"],
body.app-readonly button[id*="delete"],
body.app-readonly button[id*="edit"],
body.app-readonly #btnGenSeedPrompt,
body.app-readonly #btnImportSeedJson,
body.app-readonly .seed-packet-card .btn-outline,
body.app-readonly .seed-packet-card .btn-danger,
body.app-readonly .todo-item .btn-liquid,
body.app-readonly .todo-item-left .checkbox-organic,
body.app-readonly .lasagna-layer-item .btn-danger,
body.app-readonly .container-card-actions,
body.app-readonly button[onclick*="delete"],
body.app-readonly button[onclick*="edit"],
body.app-readonly button[onclick*="deleteSeedPacket"],
body.app-readonly button[onclick*="editSeedPacket"],
body.app-readonly #btnSavePlanner,
body.app-readonly #planner-left-sidebar,
body.app-readonly #kraft-btn-edit,
body.app-readonly #kraft-btn-delete {
    display: none !important;
}


/* ==========================================================================
   🗳️ UX REDESIGN: CONCEPT 3 - MINIMALIST TILE GRID & ORGANIC KRAFT PACKET
   ========================================================================== */

/* 1. Minimalist Grid Layout */
.seeds-minimal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1.25rem;
    padding: 0.5rem 0;
}

/* 2. Compact Seed Tile */
.seed-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.2rem 1rem;
    cursor: pointer;
    border-radius: var(--radius-liquid-md);
    background: rgba(12, 22, 19, 0.45);
    border: 1px solid var(--glass-border);
    transition: var(--transition-organic);
    position: relative;
    overflow: hidden;
    min-height: 155px;
    box-shadow: var(--glass-shadow);
}

.seed-tile:hover {
    transform: translateY(-4px) scale(1.03);
    border-color: var(--glass-border-hover);
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(52, 211, 153, 0.15);
}

/* Status Dot with pulse */
.seed-tile-status-dot {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    z-index: 5;
    animation: status-pulse 2s infinite alternate;
}

.status-dot-green {
    background: #10b981;
    box-shadow: 0 0 8px #10b981, 0 0 15px rgba(16,185,129,0.5);
}

.status-dot-orange {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b, 0 0 15px rgba(245,158,11,0.5);
}

.status-dot-red {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444, 0 0 15px rgba(239,68,68,0.5);
}

@keyframes status-pulse {
    0% { transform: scale(1); opacity: 0.85; }
    100% { transform: scale(1.35); opacity: 1; }
}

/* Avatar / Emoji in tile */
.seed-tile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.6rem;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    transition: var(--transition-smooth);
}

.seed-tile:hover .seed-tile-avatar {
    border-color: var(--text-green);
    transform: scale(1.05);
}

.seed-tile-emoji {
    font-size: 2.4rem;
    margin-bottom: 0.6rem;
    line-height: 1;
    transition: var(--transition-smooth);
}

.seed-tile:hover .seed-tile-emoji {
    transform: scale(1.1);
}

/* Typography in tile */
.seed-tile-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-white);
    margin-bottom: 0.25rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 0 0.2rem;
}

.seed-tile-qty {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.seed-tile:hover .seed-tile-qty {
    color: var(--text-green);
}


/* 3. The Organic Kraft Seed Packet Modal */
.kraft-packet-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(5, 10, 8, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.kraft-packet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.kraft-packet {
    background: radial-gradient(circle at 50% 40%, #edd3a2 0%, #dbb878 100%);
    color: #2b2317;
    width: 100%;
    max-width: 440px;
    border-radius: 4px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(219, 184, 120, 0.15);
    border: 1px solid #c5a160;
    position: relative;
    overflow: hidden;
    padding: 1.8rem 1.6rem 1.6rem 1.6rem;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.kraft-packet-overlay.active .kraft-packet {
    transform: scale(1);
}

/* Stitched bag top stitching simulator */
.kraft-packet::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 10px;
    background: repeating-linear-gradient(90deg, transparent, transparent 4px, #4c3f2d 4px, #4c3f2d 9px);
    opacity: 0.35;
}

.kraft-packet-stitch-bottom {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 10px;
    background: repeating-linear-gradient(90deg, transparent, transparent 4px, #4c3f2d 4px, #4c3f2d 9px);
    opacity: 0.35;
}

/* Double border stitched box */
.kraft-packet-stitch-box {
    border: 2px dashed rgba(76, 63, 45, 0.28);
    border-radius: 2px;
    padding: 1.2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Close button on Kraft */
.kraft-close {
    position: absolute;
    top: 1.4rem;
    right: 1.4rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: rgba(76, 63, 45, 0.6);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
    z-index: 10;
}

.kraft-close:hover {
    color: #4c3f2d;
}

/* Header style stamp */
.kraft-brand {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(76, 63, 45, 0.75);
    text-align: center;
    margin-bottom: 0.6rem;
    border-bottom: 1px double rgba(76, 63, 45, 0.25);
    padding-bottom: 0.3rem;
}

/* Stamp illustration frame */
.kraft-stamp-frame {
    display: flex;
    justify-content: center;
    margin-bottom: 0.8rem;
}

.kraft-stamp {
    border: 4px double #4c3f2d;
    background: #fcf9f2;
    padding: 0.4rem;
    border-radius: 2px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kraft-stamp img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 2px;
    filter: sepia(0.2) contrast(1.05);
}

.kraft-stamp-emoji {
    font-size: 3.5rem;
    line-height: 1.1;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Packet title */
.kraft-title {
    font-family: Georgia, serif;
    font-weight: 800;
    font-size: 1.35rem;
    color: #1e1710;
    text-align: center;
    margin-bottom: 0.15rem;
    line-height: 1.2;
}

.kraft-latin {
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 0.78rem;
    color: rgba(76, 63, 45, 0.8);
    text-align: center;
    margin-bottom: 1rem;
}

/* Divider dots */
.kraft-divider {
    border: none;
    border-top: 1px dotted rgba(76, 63, 45, 0.35);
    margin: 0.8rem 0;
}

/* Sowing / Seed details */
.kraft-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: #3e3323;
    margin-bottom: 0.8rem;
}

.kraft-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

.kraft-meta-item i {
    color: #4c3f2d;
    flex-shrink: 0;
}

.kraft-meta-value {
    color: #1e1710;
    font-weight: 800;
}

/* Sowing parameters section */
.kraft-sowing-box {
    background: rgba(76, 63, 45, 0.05);
    border: 1px dashed rgba(76, 63, 45, 0.2);
    border-radius: 2px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
}

.kraft-sowing-title {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 800;
    color: #4c3f2d;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.kraft-sowing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: #4a3d2c;
    margin-bottom: 0.4rem;
}

.kraft-sowing-grid span strong {
    color: #1e1710;
    font-weight: 800;
}

.kraft-sowing-advice {
    font-size: 0.76rem;
    color: #4a3d2c;
    line-height: 1.35;
    border-top: 1px dotted rgba(76, 63, 45, 0.15);
    padding-top: 0.4rem;
    margin-top: 0.4rem;
    font-style: italic;
}

/* Notes section */
.kraft-notes {
    font-size: 0.78rem;
    color: #4a3d2c;
    font-style: italic;
    text-align: center;
    margin-top: 0.2rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem;
    border-radius: 2px;
    border: 1px solid rgba(76, 63, 45, 0.1);
    line-height: 1.35;
}

/* Sachet Action Buttons Row */
.kraft-actions-row {
    display: flex;
    gap: 0.6rem;
    margin-top: 1.2rem;
}

.kraft-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

.kraft-btn-edit {
    background: #4c3f2d;
    color: #edd3a2;
    border: 1px solid #4c3f2d;
}

.kraft-btn-edit:hover {
    background: #362d20;
    border-color: #362d20;
    transform: translateY(-1px);
}

.kraft-btn-delete {
    background: transparent;
    color: #8c251e;
    border: 1px solid rgba(140, 37, 30, 0.4);
}

.kraft-btn-delete:hover {
    background: rgba(140, 37, 30, 0.08);
    border-color: #8c251e;
    transform: translateY(-1px);
}

/* ==========================================================================
   🚜 UX REDESIGN: ACTIVE CROPS TRACKER - GROUPED CONTAINER VIEW & LOGBOOK
   ========================================================================== */

/* 1. Crops Minimal Grid */
.crops-minimal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

/* 2. Sleek Compact Crop Tile */
.crop-tile {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    border-radius: var(--radius-liquid-md);
    background: rgba(12, 22, 19, 0.45);
    border: 1px solid var(--glass-border);
    transition: var(--transition-organic);
    position: relative;
    overflow: hidden;
    min-height: 110px;
    box-shadow: var(--glass-shadow);
}

.crop-tile:hover {
    transform: translateY(-2px) scale(1.015);
    border-color: var(--glass-border-hover);
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(52, 211, 153, 0.15);
}

.crop-tile-img-wrap {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.crop-tile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crop-tile-emoji {
    font-size: 2.2rem;
    line-height: 1;
}

.crop-tile-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.crop-tile-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crop-tile-qty {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 700;
}

.crop-tile-info-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.crop-tile-info-row i {
    flex-shrink: 0;
}

.crop-tile-info-value {
    color: var(--text-white);
    font-weight: 600;
}

/* 3. Gardener's Logbook Crop Details Modal */
.logbook-packet-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(5, 10, 8, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10003;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.logbook-packet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.logbook-packet {
    background: #fdfaf4;
    color: #2b2317;
    width: 100%;
    max-width: 480px;
    border-radius: 6px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(139, 92, 26, 0.15);
    border: 3px double #8c6e4a;
    position: relative;
    overflow: hidden;
    padding: 1.8rem;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.logbook-packet-overlay.active .logbook-packet {
    transform: scale(1);
}

.logbook-close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: rgba(76, 63, 45, 0.6);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
    z-index: 10;
}

.logbook-close:hover {
    color: #4c3f2d;
}

.logbook-header {
    border-bottom: 2px dashed rgba(140, 110, 74, 0.3);
    padding-bottom: 0.8rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.logbook-title {
    font-family: Georgia, serif;
    font-weight: 800;
    font-size: 1.4rem;
    color: #1e1710;
    line-height: 1.2;
    margin: 0;
}

.logbook-subtitle {
    font-size: 0.8rem;
    color: #6d5b45;
    margin-top: 0.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.logbook-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.2rem;
    margin-bottom: 0.5rem;
}

.logbook-body::-webkit-scrollbar {
    width: 6px;
}
.logbook-body::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.02);
}
.logbook-body::-webkit-scrollbar-thumb {
    background: rgba(140, 110, 74, 0.2);
    border-radius: 3px;
}

.logbook-photo-frame {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.logbook-stamp {
    border: 3px solid #8c6e4a;
    padding: 0.3rem;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-1deg);
    transition: transform 0.3s ease;
}

.logbook-stamp:hover {
    transform: rotate(1deg);
}

.logbook-stamp img {
    width: 140px;
    height: 100px;
    object-fit: cover;
}

.logbook-stamp-emoji {
    font-size: 4rem;
    line-height: 1;
    width: 140px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logbook-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: #4a3c2a;
    margin-bottom: 1rem;
    border-bottom: 1px dotted rgba(140, 110, 74, 0.25);
    padding-bottom: 0.8rem;
}

.logbook-item {
    display: flex;
    flex-direction: column;
}

.logbook-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8c6e4a;
    font-weight: 700;
}

.logbook-value {
    font-weight: 700;
    color: #1e1710;
}

.logbook-progress-section {
    background: rgba(140, 110, 74, 0.04);
    border: 1px solid rgba(140, 110, 74, 0.12);
    border-radius: 4px;
    padding: 0.8rem;
    margin-bottom: 1rem;
}

.logbook-progress-bar {
    height: 6px;
    background: rgba(140, 110, 74, 0.15);
    border-radius: 3px;
    overflow: hidden;
    margin: 0.4rem 0;
}

.logbook-progress-fill {
    height: 100%;
    background: #8c6e4a;
    border-radius: 3px;
}

.logbook-quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.logbook-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

.logbook-btn-blue {
    background: #3e6d8c;
    color: #fff;
    border: 1px solid #3e6d8c;
}
.logbook-btn-blue:hover {
    background: #2e536c;
}

.logbook-btn-green {
    background: #4c6d3e;
    color: #fff;
    border: 1px solid #4c6d3e;
}
.logbook-btn-green:hover {
    background: #39532e;
}

.logbook-btn-outline {
    background: transparent;
    color: #5c4c3b;
    border: 1px solid #8c6e4a;
}
.logbook-btn-outline:hover {
    background: rgba(140, 110, 74, 0.08);
}

.logbook-btn-danger {
    background: transparent;
    color: #8c251e;
    border: 1px solid rgba(140, 37, 30, 0.4);
}
.logbook-btn-danger:hover {
    background: rgba(140, 37, 30, 0.08);
    border-color: #8c251e;
}

.logbook-gallery-section {
    margin-bottom: 1rem;
}

.logbook-gallery-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #8c6e4a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
    display: block;
}

.logbook-gallery-row {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.3rem;
}

.logbook-gallery-row::-webkit-scrollbar {
    height: 4px;
}
.logbook-gallery-row::-webkit-scrollbar-thumb {
    background: rgba(140, 110, 74, 0.2);
    border-radius: 2px;
}

.logbook-gallery-thumb {
    flex-shrink: 0;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.logbook-gallery-thumb:hover {
    transform: scale(1.05);
}

.logbook-gallery-thumb img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #8c6e4a;
}

.logbook-gallery-date {
    font-size: 0.6rem;
    color: #6d5b45;
    display: block;
    margin-top: 0.1rem;
    font-weight: 600;
}

.logbook-notes {
    font-family: Georgia, serif;
    font-size: 0.82rem;
    color: #4a3c2a;
    font-style: italic;
    background: #fdfaf4;
    padding: 0.6rem;
    border-radius: 4px;
    border-left: 3px solid #8c6e4a;
    line-height: 1.35;
    margin-top: 0.5rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}

.logbook-footer-actions {
    border-top: 1px dashed rgba(140, 110, 74, 0.3);
    padding-top: 0.8rem;
    margin-top: 0.8rem;
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

body.app-readonly #logbook-btn-edit,
body.app-readonly #logbook-btn-delete,
body.app-readonly #logbook-btn-split {
    display: none !important;
}

/* ==========================================================================
   📸 VIEW 8: PHOTO SORTER COMPONENT (BACS & CROPS TRI)
   ========================================================================== */

.photos-sorter-layout {
    width: 100%;
    margin-top: 1rem;
}

/* Desktop Split Layout */
.photos-desktop-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    height: auto;
}

.photos-left-col, .photos-right-col {
    display: flex;
    flex-direction: column;
}

/* Unassigned grid */
.unassigned-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    align-items: start;
    gap: 1rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(100vh - 340px);
    padding-right: 0.5rem;
}

/* Glass photo item */
.photo-sorter-card {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    border-radius: var(--radius-liquid-sm);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: grab;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.photo-sorter-card:active {
    cursor: grabbing;
}

.photo-sorter-card:hover {
    transform: scale(1.04) translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

.photo-sorter-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    cursor: grabbing;
}

.photo-sorter-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-sorter-card-delete {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: rgba(239, 68, 68, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
    z-index: 2;
}

.photo-sorter-card:hover .photo-sorter-card-delete {
    opacity: 1;
}

.photo-sorter-card-delete:hover {
    background: rgb(220, 38, 38);
    transform: scale(1.1);
}

/* Container drop target cards */
.containers-drop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.2rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(100vh - 340px);
    padding-right: 0.5rem;
}

.container-dropzone {
    border-radius: var(--radius-liquid-md);
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

.container-dropzone::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.container-dropzone:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}

.container-dropzone.drag-over {
    border-color: var(--theme-green);
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
    transform: scale(1.02);
}

.container-dropzone.drag-over::before {
    opacity: 1;
}

.container-dropzone-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-white);
    margin-bottom: 0.5rem;
}

.container-dropzone-count {
    align-self: flex-end;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.container-dropzone.drag-over .container-dropzone-count {
    color: var(--theme-green);
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.2);
}

/* Mobile swipe/card-deck layout */
.photos-mobile-view {
    display: none;
    width: 100%;
}

.mobile-sorter-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.mobile-card-deck-wrapper {
    width: 100%;
    height: 320px;
    position: relative;
    perspective: 1000px;
}

.mobile-card-deck {
    width: 100%;
    height: 100%;
    position: relative;
}

.mobile-photo-card {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-liquid-md);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transform-origin: 50% 100%;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
    user-select: none;
    cursor: grab;
}

.mobile-photo-card:active {
    cursor: grabbing;
}

.mobile-photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* Actions */
.mobile-actions-wrapper {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.btn-mobile-action {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--glass-shadow);
}

.btn-mobile-action:active {
    transform: scale(0.9);
}

.btn-mobile-delete {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.05);
}

.btn-mobile-delete:active {
    background: rgba(239, 68, 68, 0.2);
}

.btn-mobile-skip {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.2);
    background: rgba(96, 165, 250, 0.05);
}

.btn-mobile-skip:active {
    background: rgba(96, 165, 250, 0.2);
}

/* Selector buttons for mobile */
.mobile-containers-selector {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-selector-header {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.mobile-containers-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    max-height: 150px;
    overflow-y: auto;
}

.btn-mobile-container {
    padding: 0.8rem;
    border-radius: var(--radius-liquid-sm);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-white);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-mobile-container:active {
    background: var(--theme-green);
    border-color: var(--theme-green);
    color: white;
    transform: scale(0.98);
}

/* Crop item inside crop list in modal */
.sorter-crop-item {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-liquid-sm);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-white);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sorter-crop-item:hover {
    background: rgba(168, 85, 247, 0.08);
    border-color: rgba(168, 85, 247, 0.3);
}

.sorter-crop-item.selected {
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--theme-purple);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.25);
}

/* Crop info inside item */
.sorter-crop-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.sorter-crop-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sorter-crop-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.sorter-crop-icon {
    font-size: 1.5rem;
    margin-right: 0.8rem;
}

/* Media Query for Mobile layout switch */
@media (max-width: 768px) {
    .photos-desktop-view {
        display: none;
    }
    .photos-mobile-view {
        display: flex;
    }
}





