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

/* Bloquear scroll cuando hay modal abierto */
body.modal-open {
    overflow: hidden;
    height: 100vh;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
    --gradient-start: #4CAF50;
    --gradient-end: #8D6E63;
}

/* Modo Oscuro */
body.dark-mode {
    --bg-primary: #2d3748;
    --bg-secondary: #1a202c;
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --border-color: #4a5568;
    --shadow: rgba(0, 0, 0, 0.3);
    --gradient-start: #2d5016;
    --gradient-end: #4a342e;
}

body.dark-mode .navbar {
    background: #2d3748 !important;
}

body.dark-mode .sidebar {
    background: #2d3748;
}

body.dark-mode .plant-item {
    background: #4a5568;
    border-color: #718096;
}

body.dark-mode .plant-item:hover,
body.dark-mode .plant-item.selected {
    background: #2d5016;
    border-color: #4CAF50;
}

body.dark-mode .modal-content {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #4a5568;
    color: #e2e8f0;
    border-color: #718096;
}

body.dark-mode .btn-primary {
    background: #2d5016;
}

body.dark-mode .btn-primary:hover {
    background: #3d6b20;
}

body.dark-mode .control-panel,
body.dark-mode .plants-list,
body.dark-mode .canvas-area {
    background: #2d3748;
}

body.dark-mode .control-panel h3,
body.dark-mode .plants-list h3 {
    color: #e2e8f0;
}

body.dark-mode .canvas-wrapper {
    background: #1a202c;
    border-color: #4a5568;
}

body.dark-mode #huertoCanvas {
    background: #2d3748;
}

body.dark-mode .stat-box {
    background: #4a5568;
}

body.dark-mode .bancal-card {
    background: #4a5568;
}

body.dark-mode .bancal-card:hover {
    background: #5a6678;
}

body {
    font-family: "Outfit","Outfit Fallback";
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    min-height: 100vh;
    transition: all 0.3s ease;
    padding-top: 70px; /* Espacio para navbar */
    display: flex;
    flex-direction: column;
}

#mainInterface {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 210px); /* 70px navbar + 140px control-bar rows */
    margin-top: 50px; /* Espacio para news-ticker (50px) */
}

/* App Loader */
.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(76, 175, 80, 0.85) 0%, rgba(141, 110, 99, 0.75) 100%),
        url('../assets/images/vegetables-1.jpg') center/cover no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.app-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-spinner {
    font-size: 64px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

.loader-content p {
    margin-top: 20px;
    font-size: 18px;
    font-weight: 500;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    pointer-events: all;
}

.modal.hidden {
    display: none;
}

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

.modal-content {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 50px var(--shadow);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    animation: slideDown 0.3s ease;
    pointer-events: auto;
}

.modal-content.modal-wide {
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding-right: 5px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Huertos Selection Grid */
.huertos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.huerto-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.huerto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

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

.huerto-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 600;
}

.huerto-dimensions {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.huerto-card-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.huerto-card-footer small {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.modal-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid var(--border-color);
    text-align: center;
}

/* Estilos para el modal de distribución de plantas */
#distribucionModal .form-group {
    margin-bottom: 25px;
}

.form-group-horizontal {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.form-group-horizontal .form-group {
    flex: 1;
    margin-bottom: 0;
}

#distribucionModal input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    margin-top: 10px;
}

#distribucionModal input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
}

#distribucionModal input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--secondary-color);
}

#distribucionModal input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

#distribucionModal input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    background: var(--secondary-color);
}

/* Estilos específicos para el modal de distribución */
#distribucionModal .modal-content {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#distribucionModal h2 {
    margin-bottom: 20px;
}

#distribucionInfo {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
}

#distribucionInfo p {
    margin: 8px 0;
    color: var(--text-primary);
}

.plantas-existentes {
    color: #757575;
    font-style: italic;
}

.plantas-existentes.hidden {
    display: none;
}

.distribucion-preview {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .distribucion-preview {
        flex-direction: column;
        align-items: center;
    }
    
    #distribucionPreview {
        width: 100% !important;
        height: auto !important;
        max-width: 300px;
    }
}

.preview-info {
    flex: 1;
}

.preview-info p {
    margin: 8px 0;
    font-size: 15px;
}

.preview-legend {
    margin: 15px 0;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.preview-legend p {
    margin: 5px 0;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid white;
}

.legend-gris {
    background: #9E9E9E;
}

.legend-verde {
    background: #4CAF50;
}

.legend-naranja {
    background: #FF9800;
}

.legend-rojo {
    background: #f44336;
}

.advertencia {
    color: #f44336;
    font-weight: 600;
    margin-top: 15px !important;
}

.advertencia.hidden {
    display: none;
}

#distribucionPreview {
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    flex-shrink: 0;
}

/* Asegurar que los botones del modal de distribución sean accesibles */
#distribucionModal button {
    margin: 5px 5px;
    min-width: 120px;
}

#distribucionModal .btn-primary,
#distribucionModal .btn-secondary {
    padding: 12px 24px;
    font-size: 15px;
}

@media (max-width: 768px) {
    #distribucionModal .modal-content {
        padding: 20px;
        width: 95%;
    }
    
    #distribucionModal button {
        width: 100%;
        margin: 5px 0;
    }
    
    /* Mejoras generales para todos los modales en móvil */
    .modal-content {
        padding: 12px;
        width: 96%;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .modal-content.modal-wide {
        width: 98%;
        padding: 12px;
    }
    
    .modal-content.modal-large {
        width: 96%;
        padding: 12px;
    }
    
    .modal-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-footer {
        position: sticky;
        bottom: 0;
        background: var(--bg-primary);
        padding: 15px 0 0;
        margin: 15px -20px 0;
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .modal-footer-right {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .modal-footer button,
    .modal-footer .btn-primary,
    .modal-footer .btn-secondary,
    .modal-footer .btn-danger {
        width: 100%;
        margin: 0;
    }
    
    /* Formularios en modales */
    .form-group-horizontal {
        flex-direction: column;
        gap: 15px;
    }
    
    /* Grid de huertos */
    .huertos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .huerto-card {
        padding: 1rem;
    }
    
    /* Bancales grid */
    .bancales-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .bancal-card {
        padding: 1rem;
    }
}

/* Tamaños táctiles mínimos */
@media (max-width: 768px) {
    .btn-primary,
    .btn-secondary,
    .btn-danger,
    button {
        min-height: 48px;
        font-size: 16px;
        padding: 12px 20px;
    }
    
    .btn-close {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
}

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

.modal-content h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 28px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
}

.field-check {
    display: inline-block;
    color: #4CAF50;
    font-weight: bold;
    margin-left: 8px;
    font-size: 1.1em;
    animation: checkPulse 0.4s ease-in-out;
}

.field-check.hidden {
    display: none;
}

@keyframes checkPulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-group input:focus {
    outline: none;
    border-color: #4CAF50;
}

/* Botones */
.btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #8D6E63 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    margin-left: 10px;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    background: #5a6268;
}

.btn-action {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-bottom: 15px;
    transition: transform 0.2s;
}

.btn-action:hover {
    transform: translateY(-2px);
}

.btn-icon {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    margin-left: 5px;
    transition: all 0.2s;
}

.btn-icon:hover {
    border-color: #4CAF50;
    transform: translateY(-2px);
}

/* Interfaz principal */
#mainInterface {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#mainInterface.hidden {
    display: none;
}

}

/* ============================================
   NEWS TICKER - CINTA DE NOTICIAS HORIZONTAL
   ============================================ */

/* ============================================
   SVG BANCAL CONTROLS - BOTONES BANCALES
   ============================================ */

/* Contenedor de botones del bancal - Oculto por defecto vía atributo SVG */
.buttons-container {
    /* Los botones se controlan vía setAttribute('display', 'none'/'block') en JavaScript */
}

/* ============================================
   FAB CONTAINER - FLOATING ACTION BUTTON
   ============================================ */

.fab-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 98;
}

/* FAB Principal */
.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--primary-green);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.fab-icon-img {
    width: 32px;
    height: 32px;
    pointer-events: none;
}
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 101;
}

.fab--primary {
    background: #ffe031;
}

.fab:hover:not(.pulse) {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.fab:active {
    transform: scale(0.95);
}

/* Pulse Animation */
.pulse {
    animation: fabPulse 2s infinite;
}

@keyframes fabPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(56, 142, 60, 0.2), 
                    0 0 0 0 rgba(56, 142, 60, 0.4);
    }
    50% {
        box-shadow: 0 4px 12px rgba(56, 142, 60, 0.3),
                    0 0 0 8px rgba(56, 142, 60, 0);
    }
}

/* FAB Menu (expandible) */
.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    min-width: 220px;
    max-height: 0;
    overflow-y: hidden;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s ease;
    z-index: 100;
    border: 1px solid var(--border-color, #e0e0e0);
}

.fab-menu.active {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.fab-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.fab-item:hover {
    background: var(--bg-light, #f5f5f5);
    padding-left: 20px;
    color: var(--primary-green);
}

.fab-item:active {
    background: #e8f5e9;
}

.fab-icon {
    font-size: 18px;
    min-width: 20px;
}

.fab-label {
    font-weight: 500;
}

/* Guardar en FAB Menu (destacado) */
.fab-item--guardar {
    background: #fff3e0;
    border-top: 1px solid var(--border-color, #e0e0e0);
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    color: #e65100;
    font-weight: 600;
}

.fab-item--guardar:hover {
    background: #ffe0b2;
    color: #bf360c;
}

/* Colabora en FAB Menu (destacado) */
.fab-item--colabora {
    background: #fce4ec;
    color: #c2185b;
    font-weight: 600;
}

.fab-item--colabora:hover {
    background: #f8bbd0;
    color: #880e4f;
}

/* Divider en FAB Menu */
.fab-divider {
    height: 1px;
    background: var(--border-color, #e0e0e0);
    margin: 4px 0;
}

/* Overlay para cerrar FAB Menu */
.fab-overlay {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: transparent;
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.fab-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .news-ticker-container {
        height: 45px;
    }

    .news-ticker-label {
        font-size: 16px;
        padding: 0 8px;
    }

    .news-ticker-item {
        font-size: 12px;
        padding: 6px 12px;
    }

    .news-ticker-content {
        gap: 30px;
        padding: 0 15px;
    }

    .fab-menu.active {
        max-height: calc(100vh - 110px);
    }

    .fab-menu {
        min-width: 200px;
        bottom: 65px;
    }

    .fab-item {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .news-ticker-container {
        height: 40px;
    }

    .news-ticker-label {
        font-size: 14px;
        padding: 0 6px;
    }

    .news-ticker-item {
        font-size: 11px;
        padding: 4px 10px;
    }

    .news-ticker-content {
        gap: 20px;
        padding: 0 10px;
    }

    .fab-container {
        bottom: 15px;
        right: 15px;
    }

    .fab {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }

    .fab-menu {
        min-width: 180px;
        bottom: 60px;
    }

    .fab-menu.active {
        max-height: calc(100vh - 100px);
    }

    .fab-item {
        padding: 8px 10px;
        gap: 8px;
    }

    .fab-icon {
        font-size: 16px;
    }

    .fab-label {
        font-size: 12px;
    }
}

/* Container principal */
.container {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 15px;
    gap: 10px;
    align-items: stretch;
    position: relative;
    overflow-x: hidden;
    width: 100%;
    min-height: 0;
    max-height: calc(65vh);
}

/* Sidebar */
.sidebar {
    display: none !important;
    position: fixed;
    left: 0;
    top: 210px;
    width: 280px;
    height: calc(100vh - 210px);
    flex-direction: column;
    gap: 0;
    background: transparent;
    z-index: 99;
    overflow: visible;
    padding: 0;
    max-height: none;
    box-shadow: none;
    border-radius: 0;
    transition: transform 0.3s ease;
}

.sidebar[data-collapsed="true"] {
    transform: translateX(-100%);
}

/* FABs removidos - ahora en control bar */
.sidebar-fab {
    display: none;
}

.fab-control-panel-button,
.fab-plants-button,
.fab-control-panel-message,
.fab-plants-message {
    display: none;
}

/* Overlay para cerrar sidebar en móvil */
.sidebar-overlay {
    position: fixed;
    left: 0;
    top: 210px;
    width: 100%;
    height: calc(100vh - 210px);
    background: rgba(0, 0, 0, 0.4);
    z-index: 98;
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay {
    display: none !important;
}

.sidebar-overlay.show {
    display: none !important;
}

.control-panel, .plants-list {
    display: none !important;
    position: fixed;
    left: 0;
    top: 210px;
    width: 280px;
    max-height: calc(100vh - 210px);
    background: white;
    padding: 18px;
    border-radius: 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 14;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-100%);
    transition: all 0.3s ease;
}

.control-panel[data-visible="true"],
.plants-list[data-visible="true"] {
    display: none !important;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-100%);
}

.huerto-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.huerto-selector label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.huerto-select {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.huerto-select:hover {
    border-color: var(--primary-color);
}

.huerto-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

.huerto-header {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background: linear-gradient(135deg, #4CAF50, #8D6E63);
    border-radius: 10px;
}

.huerto-header #huertoInfo {
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.btn-small {
    font-size: 13px;
    padding: 8px 12px;
}

.control-panel h3, .plants-list h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
}

.info-box {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.info-box p {
    margin-bottom: 8px;
    color: #555;
    font-size: 15px;
}

/* Lista de plantas */
.search-box {
    margin-bottom: 15px;
}

.search-box input {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.search-box input:focus {
    outline: none;
    border-color: #4CAF50;
}

.plants-container {
    max-height: 350px;
    overflow-y: auto;
    padding-right: 5px;
}

.plant-item {
    background: #f8f9fa;
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.plant-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.plant-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.plant-item.selected {
    background: #d4edda;
    border-color: #28a745;
}

.plant-item.has-benefits {
    border-left: 4px solid #28a745;
}

.benefit-badge {
    display: inline-block;
    margin-left: 5px;
    font-size: 14px;
    animation: pulse 2s infinite;
}

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

.plant-item .benefits {
    color: #28a745;
    font-size: 10px;
    margin-top: 2px;
    padding: 3px 4px;
    background: #d4edda;
    border-radius: 4px;
    font-weight: 500;
}

.plant-item h4 {
    color: #333;
    margin-bottom: 2px;
    font-size: 14px;
}

.plant-item p {
    color: #666;
    font-size: 11px;
    margin: 2px 0;
}

.plant-item .distance {
    color: #4CAF50;
    font-weight: 600;
}

.plant-item .riego {
    color: #3498db;
    font-size: 11px;
    font-weight: 600;
    margin: 2px 0;
}

/* Canvas */
.canvas-area {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 5;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

/* Removed: canvas-header and canvas-controls - now using control-bar instead */

.canvas-wrapper {
    flex: 1;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    min-width: 0;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

#huertoCanvas {
    background: white;
    border-radius: 5px;
    display: block;
    max-width: none;
    transition: transform 0.3s ease;
    cursor: grab;
    touch-action: none;
    pointer-events: auto;
    /* Asegurar que el canvas recibe eventos del usuario (drag, etc.) */
}

/* Bancales SVG - Mejoras visuales */
.bancal-group rect,
.bancal-rect {
    transition: all 0.2s ease;
    filter: drop-shadow(1px 2px 4px rgba(0, 0, 0, 0.12));
}

.bancal-group:hover rect,
.bancal-group:hover .bancal-rect {
    filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.2));
    stroke-width: 0.8px;
}

.bancal-label {
    transition: font-size 0.2s ease;
}

/* ============================================
   STATS BAR - Estadísticas del Huerto
   ============================================ */
/* ── Stats Bar ─────────────────────────────────────── */
/* Mobile-first: 4 columns × 2 rows */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 10px;
    margin: 0 10px 8px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.04) 0%, rgba(76, 175, 80, 0.02) 100%);
    border: 1px solid rgba(76, 175, 80, 0.12);
    border-radius: 10px;
    flex-shrink: 0;
}

/* Desktop: single row of 8 */
@media (min-width: 769px) {
    .stats-bar {
        grid-template-columns: repeat(8, 1fr);
        gap: 8px;
        padding: 10px 12px;
    }
}

.stats-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 6px;
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(76, 175, 80, 0.15);
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.stats-card:hover {
    background: rgba(76, 175, 80, 0.05);
    border-color: rgba(76, 175, 80, 0.3);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.12);
}

.stat-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.stat-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-green);
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
}

.stat-subtext {
    font-size: 10px;
    color: var(--text-light);
    font-weight: 500;
    line-height: 1;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Progress bar inside space card */
.stat-progress-track {
    width: 90%;
    height: 4px;
    background: rgba(76, 175, 80, 0.15);
    border-radius: 3px;
    margin-top: 1px;
    overflow: hidden;
}

.stat-progress-fill {
    height: 100%;
    background: var(--primary-green);
    border-radius: 3px;
    transition: width 0.6s ease;
}

.stat-progress-fill.warn   { background: #FF9800; }
.stat-progress-fill.danger { background: #F44336; }

/* Riego chip row */
.stat-riego-row {
    display: flex;
    gap: 4px;
    align-items: center;
}

.stat-riego-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    padding: 0 5px;
    line-height: 1;
}

.stat-riego-bajo {
    background: rgba(33, 150, 243, 0.12);
    color: #1565C0;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.stat-riego-medio {
    background: rgba(33, 150, 243, 0.25);
    color: #1565C0;
    border: 1px solid rgba(33, 150, 243, 0.45);
}

.stat-riego-alto {
    background: rgba(33, 150, 243, 0.42);
    color: #0D47A1;
    border: 1px solid rgba(33, 150, 243, 0.6);
}

/* Water card — wider to accommodate multi-line content */
.stats-card--agua {
    min-width: 160px;
    flex: 0 0 auto;
}

.stats-card--agua .stat-value {
    white-space: normal;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.3;
}

/* Harvest card — turns green when > 0 */
.stats-card--harvest.has-harvests {
    border-color: rgba(76, 175, 80, 0.5);
    background: rgba(76, 175, 80, 0.07);
}

.stats-card--harvest.has-harvests .stat-value {
    color: #2E7D32;
}

/* Alert card — turns amber when > 0 */
.stats-card--alert.has-alerts {
    border-color: rgba(255, 152, 0, 0.5);
    background: rgba(255, 152, 0, 0.07);
}

.stats-card--alert.has-alerts .stat-value {
    color: #E65100;
}

/* Dark mode */
body.dark-mode .stats-bar {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.06) 0%, rgba(76, 175, 80, 0.03) 100%);
    border-color: rgba(76, 175, 80, 0.15);
}

body.dark-mode .stats-card {
    background: #1e1e1e;
    border-color: rgba(76, 175, 80, 0.18);
}

body.dark-mode .stats-card:hover {
    background: rgba(76, 175, 80, 0.09);
    border-color: rgba(76, 175, 80, 0.35);
}

body.dark-mode .stat-progress-track {
    background: rgba(76, 175, 80, 0.18);
}

body.dark-mode .stat-riego-bajo  { background: rgba(33,150,243,0.18); color: #90CAF9; border-color: rgba(33,150,243,0.35); }
body.dark-mode .stat-riego-medio { background: rgba(33,150,243,0.30); color: #90CAF9; border-color: rgba(33,150,243,0.48); }
body.dark-mode .stat-riego-alto  { background: rgba(33,150,243,0.45); color: #BBDEFB; border-color: rgba(33,150,243,0.65); }

body.dark-mode .stats-card--agua .stat-value { white-space: normal; word-wrap: break-word; }

body.dark-mode .stats-card--harvest.has-harvests { background: rgba(76,175,80,0.10); border-color: rgba(76,175,80,0.42); }
body.dark-mode .stats-card--alert.has-alerts     { background: rgba(255,152,0,0.10); border-color: rgba(255,152,0,0.42); }

/* Tighten slightly on very small phones */
@media (max-width: 380px) {
    .stats-bar {
        gap: 5px;
        padding: 8px;
    }

    .stats-card {
        padding: 8px 4px;
    }

    .stat-label {
        font-size: 9px;
    }

    .stat-value {
        font-size: 14px;
    }

    .stat-subtext {
        font-size: 9px;
    }

    .stat-riego-chip {
        min-width: 19px;
        height: 17px;
        font-size: 11px;
    }
}

/* ── Plant Report Panel ──────────────────────────────────────────── */
.plant-report {
    margin: 0 10px 10px;
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.plant-report-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    background: rgba(76, 175, 80, 0.06);
    border: none;
    border-bottom: 1px solid rgba(76, 175, 80, 0.12);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    color: var(--text-dark);
}

.plant-report-toggle:hover {
    background: rgba(76, 175, 80, 0.11);
}

.plant-report-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
}

.plant-report-count {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
    flex: 1;
    padding-left: 6px;
}

.plant-report-chevron {
    color: var(--text-light);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.plant-report.open .plant-report-chevron {
    transform: rotate(180deg);
}

/* Collapsible body */
.plant-report-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.plant-report.open .plant-report-body {
    max-height: 800px;
    overflow-y: auto;
}

/* Column header */
.pr-header {
    display: grid;
    grid-template-columns: 36px 1fr 38px 46px 72px auto;
    gap: 8px;
    align-items: center;
    padding: 5px 14px;
    background: rgba(76, 175, 80, 0.04);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.pr-header-cell {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Plant rows */
.pr-row {
    display: grid;
    /* grid-template-columns: 36px 1fr 38px 46px 72px auto; */
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    transition: background 0.15s;
}

.pr-row:last-child { border-bottom: none; }
.pr-row:hover { background: rgba(76,175,80,0.03); }

/* Icon circle */
.pr-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(34, 139, 34, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.pr-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Name + bancal meta */
.pr-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.pr-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pr-meta {
    font-size: 10px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Count badge */
.pr-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 24px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-green);
    background: rgba(76,175,80,0.1);
    padding: 0 6px;
}

/* Riego chip */
.pr-riego {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.pr-riego-bajo  { background: rgba(33,150,243,0.10); color: #1565C0; }
.pr-riego-medio { background: rgba(33,150,243,0.22); color: #1565C0; }
.pr-riego-alto  { background: rgba(33,150,243,0.40); color: #0D47A1; }

/* Production */
.pr-prod {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

/* Season + harvest badges — stacked vertically, compact */
.pr-badges {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-end;
}

.pr-season, .pr-harvest {
    display: inline-block;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    white-space: nowrap;
    line-height: 1.3;
    letter-spacing: 0.2px;
}

.pr-season-ok   { background: rgba(76,175,80,0.12);  color: #2E7D32; }
.pr-season-soon { background: rgba(255,152,0,0.14);  color: #BF360C; }
.pr-season-off  { background: rgba(0,0,0,0.06);      color: var(--text-light); }

/* ============================================
   NOTIFICATION AREA - Gestión de Notificaciones
   ============================================ */
.notification-area {
    position: fixed;
    top: 120px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 350px;
    pointer-events: none;
}

.notification-item {
    background: white;
    border-radius: 8px;
    padding: 14px 16px;
    min-width: 280px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
}

.notification-item.info {
    border-left: 4px solid #3b82f6;
    background: #eff6ff;
}

.notification-item.success {
    border-left: 4px solid #10b981;
    background: #f0fdf4;
}

.notification-item.warning {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}

.notification-item.error {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
}

.notification-item > div:first-child {
    flex-shrink: 0;
    font-size: 20px;
}

.notification-item > div:last-child {
    flex: 1;
    font-size: 14px;
    color: #375a7f;
    line-height: 1.4;
}

.notification-item.info > div:last-child { color: #1e40af; }
.notification-item.success > div:last-child { color: #166534; }
.notification-item.warning > div:last-child { color: #92400e; }
.notification-item.error > div:last-child { color: #991b1b; }

body.dark-mode .notification-item {
    background: #2d3748;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

body.dark-mode .notification-item.info {
    background: #1e3a5f;
    border-left-color: #60a5fa;
}

body.dark-mode .notification-item.success {
    background: #1b2e1a;
    border-left-color: #34d399;
}

body.dark-mode .notification-item.warning {
    background: #3a2f1b;
    border-left-color: #fbbf24;
}

body.dark-mode .notification-item.error {
    background: #3a1f1f;
    border-left-color: #f87171;
}

body.dark-mode .notification-item > div:last-child {
    color: #e2e8f0;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.notification-item.removing {
    animation: slideOutRight 0.3s ease-out;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .notification-area {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .notification-item {
        min-width: auto;
        font-size: 13px;
        padding: 12px 14px;
    }
}

.pr-harvest-urgent { background: rgba(244,67,54,0.12); color: #C62828; }
.pr-harvest-soon   { background: rgba(76,175,80,0.12); color: #2E7D32; }
.pr-harvest-later  { background: rgba(33,150,243,0.10); color: #1565C0; }

/* Empty state */
.pr-empty {
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    padding: 24px 16px;
    margin: 0;
}

/* Dark mode */
body.dark-mode .plant-report {
    background: #1e1e1e;
    border-color: rgba(76,175,80,0.2);
    box-shadow: none;
}

body.dark-mode .plant-report-toggle {
    background: rgba(76,175,80,0.08);
    border-color: rgba(76,175,80,0.15);
}

body.dark-mode .plant-report-toggle:hover { background: rgba(76,175,80,0.13); }

body.dark-mode .pr-header {
    background: rgba(76,175,80,0.05);
    border-color: rgba(255,255,255,0.06);
}

body.dark-mode .pr-row         { border-color: rgba(255,255,255,0.05); }
body.dark-mode .pr-row:hover   { background: rgba(76,175,80,0.06); }
body.dark-mode .pr-icon        { background: rgba(34,139,34,0.22); }

body.dark-mode .pr-riego-bajo  { background: rgba(33,150,243,0.18); color: #90CAF9; }
body.dark-mode .pr-riego-medio { background: rgba(33,150,243,0.28); color: #90CAF9; }
body.dark-mode .pr-riego-alto  { background: rgba(33,150,243,0.44); color: #BBDEFB; }

body.dark-mode .pr-season-ok   { background: rgba(76,175,80,0.15);   color: #81C784; }
body.dark-mode .pr-season-soon { background: rgba(255,152,0,0.15);   color: #FFAB40; }
body.dark-mode .pr-season-off  { background: rgba(255,255,255,0.07); color: var(--text-light); }

/* Mobile: hide production column */
@media (max-width: 600px) {
    .pr-header { display: none; }

    .pr-row {
        grid-template-columns: 1fr 1fr 1fr 1fr auto;
        padding: 7px 10px;
    }

    .pr-prod { display: none; }
    .pr-name { font-size: 12px; }
    .pr-meta { font-size: 9px; }
}

@media (max-width: 380px) {
    .pr-row {
        grid-template-columns: 1fr 1fr 1fr auto;
    }

    .pr-riego { display: none; }
    .pr-icon  { width: 32px; height: 32px; }
    .pr-icon img { width: 20px; height: 20px; }
}

.legend {
    margin-top: 15px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.legend p {
    color: #856404;
    font-size: 14px;
    line-height: 1.6;
}

/* Scrollbar personalizado */
.plants-container::-webkit-scrollbar {
    width: 8px;
}

.plants-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.plants-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.plants-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: white;
    border: 2px solid #4CAF50;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 999;
    pointer-events: auto;
    max-width: 350px;
    max-height: 80vh;
    font-size: 14px;
    cursor: default;
    overflow-y: auto;
    overflow-x: hidden;
}

.tooltip.hidden {
    display: none;
}

/* Estilos para el scrollbar del tooltip */
.tooltip::-webkit-scrollbar {
    width: 6px;
}

.tooltip::-webkit-scrollbar-track {
    background: transparent;
}

.tooltip::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 3px;
}

.tooltip::-webkit-scrollbar-thumb:hover {
    background: #2E7D32;
}

.tooltip-content h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 16px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 5px;
}

.tooltip-content .tooltip-section {
    margin: 10px 0;
}

.tooltip-content .tooltip-section strong {
    color: #4CAF50;
    display: block;
    margin-bottom: 5px;
}

.tooltip-content .plant-info {
    background: #f8f9fa;
    padding: 8px;
    margin: 5px 0;
    border-radius: 5px;
    border-left: 3px solid #28a745;
}

.tooltip-content .plant-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
}

.tooltip-content .plant-details {
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

.tooltip-content .empty-bancal {
    color: #999;
    font-style: italic;
    padding: 10px;
    text-align: center;
}

/* Botón toggle para móvil */
.btn-toggle-mobile {
    display: none;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4CAF50 0%, #8D6E63 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

/* Responsive */
/* Sidebar is hidden with display:none, so canvas-area should always use full width */
@media (max-width: 1400px) {
    .canvas-area {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

@media (max-width: 1200px) {
    .container {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .canvas-area {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

@media (max-width: 1024px) {
    .canvas-area {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    /* Header */
    header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    header h1 {
        font-size: 24px;
        text-align: center;
    }
    
    .header-info {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    #huertoInfo {
        font-size: 16px;
    }
    
    /* Container */
    .container {
        padding: 10px;
        gap: 10px;
        flex-direction: column;
    }
    
    /* Sidebar is completely hidden with display:none - no mobile drawer needed */
    .sidebar {
        display: none !important;
    }
    
    .canvas-area {
        margin-left: 0;
        width: 100%;
    }
    
    /* Lista de plantas */
    .plants-container {
        max-height: 50vh;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding-right: 5px;
    }
    
    .plant-item {
        padding: 8px;
        margin-bottom: 0;
    }
    
    .plant-item h4 {
        font-size: 14px;
    }
    
    .plant-item p {
        font-size: 11px;
    }
    
    .plant-item .benefits {
        font-size: 10px;
    }
    
    /* Canvas */
    .canvas-area {
        padding: 10px;
        min-height: 50vh;
    }
    
    .canvas-wrapper {
        min-height: 400px;
        padding: 10px;
    }
    
    #huertoCanvas {
        max-width: 100%;
        height: auto !important;
        width: 100% !important;
    }
    
    /* Botones */
    .btn-icon {
        min-width: 48px;
        min-height: 48px;
        padding: 12px 16px;
        font-size: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .btn-icon:active {
        transform: scale(0.95);
    }
    
    .canvas-wrapper {
        padding: 10px;
        touch-action: pan-x pan-y;
        overflow-x: auto;
        overflow-y: auto;
    }
    
    .btn-action,
    .btn-primary {
        padding: 15px 20px;
        font-size: 16px;
        touch-action: manipulation;
    }
    
    .btn-secondary {
        padding: 12px 18px;
        font-size: 14px;
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        padding: 25px 20px;
        margin: 10px;
    }
    
    .modal-content h2 {
        font-size: 22px;
    }
    
    .form-group input {
        font-size: 16px;
        padding: 12px;
    }
    
    /* Tooltip */
    .tooltip {
        max-width: 90vw;
        font-size: 12px;
    }
    
    .tooltip-content h4 {
        font-size: 14px;
    }
    
    .tooltip-content .plant-details {
        font-size: 11px;
    }
    
    /* Legend */
    .legend {
        padding: 10px;
    }
    
    .legend p {
        font-size: 12px;
    }
    
    /* Info box */
    .info-box {
        padding: 10px;
    }
    
    .info-box p {
        font-size: 14px;
    }
    
    /* Control panel */
    .control-panel,
    .plants-list {
        padding: 15px;
    }
    
    .control-panel h3,
    .plants-list h3 {
        font-size: 18px;
    }
    
    /* Control bar responsive (768px) */
    .control-bar.modern {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .control-group {
        border-right: none;
        padding-right: 0;
        gap: 0.25rem;
    }
    
    .btn .label {
        display: inline;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 13px;
    }
    
    .dropdown-menu {
        position: fixed;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        bottom: 60px;
        width: 90vw;
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    /* Ajustes para pantallas muy pequeñas */
    body {
        padding-top: 70px;
    }
    
    #mainInterface {
        height: calc(100vh - 210px);
        margin-top: 40px; /* Ajustado para ticker en mobile */
    }
    
    /* Control bar responsive (480px) */
    .control-bar.modern {
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0.5rem;
    }
    
    .control-group {
        border-right: none;
        padding-right: 0;
        gap: 0.2rem;
    }
    
    .control-group--visualization {
        border-right: none;
        padding-right: 0;
    }
    
    .btn .label {
        display: none;
    }
    
    .btn {
        padding: 0.4rem 0.5rem;
        font-size: 11px;
        min-width: 36px;
    }
    
    .btn--icon,
    .btn--icon-secondary {
        padding: 0.4rem 0.5rem;
        min-width: 36px;
        font-size: 16px;
    }
    
    .zoom-label {
        padding: 0.25rem 0.25rem;
        font-size: 11px;
        min-width: 35px;
    }
    
    .dropdown-menu {
        position: fixed;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        bottom: 50px;
        width: 95vw;
        max-width: none;
    }
    
    .dropdown-item {
        padding: 0.7rem 0.8rem;
        font-size: 13px;
    }
    
    .dropdown-item .icon {
        font-size: 16px;
    }
    
    .sidebar {
        top: 210px;
        height: calc(100vh - 210px);
        width: 240px;
    }
    
    .sidebar-overlay {
        top: 210px;
        height: calc(100vh - 210px);
    }
    
    .control-panel, .plants-list {
        top: 126px;
        max-height: calc(100vh - 126px);
        width: 240px;
    }
    
    .canvas-area {
        padding: 10px;
    }
    
    .canvas-wrapper {
        min-height: 300px;
    }
    
    header h1 {
        font-size: 20px;
    }
    
    .modal-content {
        padding: 20px 15px;
    }
    
    .modal-content h2 {
        font-size: 18px;
    }
    
    .btn-primary,
    .btn-action {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    /* Lista de plantas para muy pequeños */
    .plants-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .plant-item {
        padding: 6px;
    }
}

/* Calendario */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 10px;
    overflow-y: auto;
    max-height: calc(90vh - 200px);
}

.calendar-month {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 15px;
    border: 2px solid var(--border-color);
}

.calendar-month.current {
    border-color: var(--gradient-start);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
}

.calendar-month h4 {
    color: var(--gradient-start);
    margin-bottom: 10px;
    font-size: 16px;
}

.calendar-plants {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-plant-item {
    background: var(--bg-primary);
    padding: 8px;
    border-radius: 6px;
    font-size: 13px;
    border-left: 3px solid transparent;
}

.calendar-plant-item.siembra {
    border-left-color: #48bb78;
}

.calendar-plant-item.cosecha {
    border-left-color: #ed8936;
}

.calendar-plant-item.hidden {
    display: none;
}

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

.btn-expand {
    background: transparent;
    border: none;
    color: var(--gradient-start);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 0;
    margin-top: 5px;
    text-align: left;
    transition: all 0.2s;
    width: 100%;
}

.btn-expand:hover {
    color: var(--gradient-end);
    transform: translateX(3px);
}

/* Estadísticas */
.stats-content {
    overflow-y: auto;
    max-height: calc(90vh - 200px);
    padding: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 2px solid var(--border-color);
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--gradient-start);
    margin: 10px 0;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.stats-chart {
    margin: 20px 0;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.chart-bar {
    display: flex;
    align-items: center;
    margin: 10px 0;
    gap: 10px;
}

.chart-label {
    min-width: 100px;
    font-size: 14px;
}

.chart-fill {
    height: 25px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    border-radius: 5px;
    transition: width 0.3s ease;
}

.chart-value {
    font-weight: bold;
    min-width: 50px;
}

/* Producción detallada */
.production-item {
    background: var(--bg-primary);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--gradient-start);
}

.production-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.production-name {
    font-weight: 600;
    font-size: 15px;
}

.production-count {
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.production-details {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.production-per-plant {
    font-style: italic;
}

.production-total {
    color: var(--gradient-start);
}

.production-total strong {
    color: var(--text-primary);
}

/* Edición de bancales */
.edit-instructions-box {
    background: linear-gradient(135deg, #4CAF50 0%, #8D6E63 100%);
    color: white;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
}

.edit-instructions-box p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

/* Edit Sections */
.edit-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.edit-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.edit-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Accordion Styles */
.edit-accordion {
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.accordion-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    background: var(--bg-secondary);
    border: none;
    width: 100%;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s ease;
    user-select: none;
}

.accordion-header:hover {
    background: var(--bg-tertiary);
}

.accordion-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.accordion-toggle {
    display: inline-block;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    min-width: 16px;
    text-align: center;
}

.accordion-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.accordion-content.collapsed {
    max-height: 0;
    padding: 0;
    border-top: none;
    overflow: hidden;
}

.accordion-content.expanded {
    padding: 12px;
}

/* Dimension Inputs */
.edit-dimensions-inputs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.edit-dimensions-inputs .input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-dimensions-inputs label {
    font-size: 0.85rem;
    font-weight: 600;
    flex: 0.6;
    color: var(--text-primary);
}

.edit-dimensions-inputs input {
    width: 70px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.validation-check {
    font-size: 1rem;
    color: #4CAF50;
    display: none;
    flex: 0.4;
    text-align: center;
}

.validation-check.visible {
    display: block;
}

.edit-bancal-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    height: 70vh;
    max-height: 850px;
    min-height: 500px;
    overflow: hidden;
}

.edit-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    overflow-y: auto;
    padding-right: 8px;
}

.edit-search input {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.edit-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.edit-stat {
    font-size: 14px;
    color: var(--text-primary);
}

.btn-grid-add {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: linear-gradient(135deg, #4CAF50 0%, #8D6E63 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

.btn-grid-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.btn-grid-add:active {
    transform: translateY(0);
}

.edit-plants-palette {
    max-height: 480px;
    overflow-y: auto;
    padding: 8px;
    background: transparent;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-plant-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.edit-plant-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: var(--gradient-start);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.05) 0%, rgba(56, 142, 60, 0.05) 100%);
}

.edit-plant-card:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.edit-plant-icon {
    font-size: 28px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.edit-plant-details {
    flex: 1;
}

.edit-plant-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 2px;
    pointer-events: none;
}

.edit-plant-spacing {
    font-size: 11px;
    color: var(--text-secondary);
    pointer-events: none;
}

.edit-canvas-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    height: 100%;
    min-height: 450px;
    position: relative;
    overflow: auto;
}

.edit-canvas {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    /* Asegurar que el canvas acepte drops */
    pointer-events: all;
}

/* Asegurar que los elementos hijos del SVG no interfieran con drag & drop */
.edit-canvas > * {
    pointer-events: none;
}

/* Excepto los elementos de planta que necesitan click para eliminar */
.edit-plant-svg {
    pointer-events: auto;
}

.edit-plant-svg:hover circle {
    stroke-width: 3;
}

.btn-danger {
    background: #f44336;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

.modal-footer-right {
    display: flex;
    gap: 10px;
}

/* Placeholders para posicionar el canvas dinámicamente */
.canvas-placeholder {
    margin-top: 15px;
}

@media (max-width: 768px) {
    .edit-bancal-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: unset;
    }
    
    .edit-sidebar {
        max-height: none;
        min-height: unset;
    }
    
    /* En móviles, el canvas está dentro de los acordeones */
    .edit-bancal-layout > .edit-canvas-container {
        display: none !important;
    }
    
    /* Canvas dentro del placeholder en móviles */
    .canvas-placeholder .edit-canvas-container {
        display: flex !important;
        min-height: 220px;
        margin-top: 15px;
        padding: 15px;
    }
}

/* En desktop, mantener canvas a la derecha */
@media (min-width: 769px) {
    .canvas-placeholder {
        display: none;
    }
}

.btn-tooltip {
    background: var(--gradient-start);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
    width: 100%;
    transition: all 0.2s;
}

.btn-tooltip:hover {
    background: var(--gradient-end);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .edit-bancal-container {
        grid-template-columns: 1fr;
    }
    
    .edit-canvas-wrapper {
        min-height: 250px;
    }
}

/* Tareas */
.tasks-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
}

.task-item {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 3px solid var(--gradient-start);
}

.task-item.completed {
    opacity: 0.6;
    text-decoration: line-through;
}

.task-text {
    flex: 1;
    margin: 0 10px;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.task-delete {
    background: #f56565;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

/* Alert box */
.alert-box {
    background: #fed7d7;
    color: #c53030;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #f56565;
}

.alert-box.warning {
    background: #feebc8;
    color: #c05621;
    border-left-color: #ed8936;
}

.alert-box.info {
    background: #bee3f8;
    color: #2c5282;
    border-left-color: #4299e1;
}

body.dark-mode .alert-box {
    background: rgba(254, 215, 215, 0.2);
}

body.dark-mode .alert-box.warning {
    background: rgba(254, 235, 200, 0.2);
}

body.dark-mode .alert-box.info {
    background: rgba(190, 227, 248, 0.2);
}

/* Header buttons */
.header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Textarea */
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Modo impresión */
@media print {
    body {
        background: white;
    }
    
    header, .sidebar, .legend, button {
        display: none !important;
    }
    
    .container {
        display: block;
    }
    
    .canvas-area {
        width: 100%;
        max-width: 100%;
    }
    
    .canvas-wrapper {
        border: 1px solid #000;
    }
    
    #huertoCanvas {
        max-width: 100%;
    }
}

/* ========================================
   PLANT INFO MODAL & TOOLTIPS
   ======================================== */

.plant-info-content {
    padding: 20px;
}

.plant-info-section {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.plant-info-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.plant-info-section h3 {
    color: var(--text-primary);
    margin: 0;
    font-size: 24px;
}

.plant-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.plant-info-item {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.plant-info-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 600;
}

.plant-info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.plant-info-benefits,
.plant-info-compatibility,
.plant-info-growth {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.plant-info-benefits h4,
.plant-info-compatibility h4,
.plant-info-growth h4 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 16px;
}

.plant-info-benefits p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-secondary);
}

.compatibility-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.compatibility-good,
.compatibility-bad {
    padding: 10px;
    border-radius: 6px;
    background: var(--bg-primary);
}

.compatibility-good {
    border-left: 3px solid #4CAF50;
}

.compatibility-bad {
    border-left: 3px solid #f44336;
}

.compatibility-good strong,
.compatibility-bad strong {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
}

.compatibility-good p,
.compatibility-bad p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.growth-bar {
    position: relative;
    width: 100%;
    height: 24px;
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.growth-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 12px 0 0 12px;
}

.growth-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 12px;
    color: var(--text-primary);
    text-shadow: 0 0 3px white;
}

.plant-info-button {
    transition: opacity 0.2s ease;
}

.plant-info-button:hover circle {
    fill: #1976D2;
}

@media (max-width: 768px) {
    .plant-info-grid {
        grid-template-columns: 1fr;
    }
    
    .plant-info-icon {
        font-size: 36px;
    }
    
    .plant-info-section h3 {
        font-size: 20px;
    }
}

/* ============================================
   BANCALES PREDEFINIDOS
   ============================================ */

.modal-large {
    max-width: 900px !important;
    width: 95%;
}

.bancales-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.bancal-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bancal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(76, 175, 80, 0.1), transparent);
    transition: left 0.5s ease;
}

.bancal-card:hover {
    border-color: var(--gradient-start);
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.2);
    transform: translateY(-4px);
}

.bancal-card:hover::before {
    left: 100%;
}

.bancal-card.bancal-custom {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-style: dashed;
}

.bancal-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 12px;
}

.bancal-info h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bancal-info p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.bancal-size {
    display: inline-block;
    background: rgba(76, 175, 80, 0.1);
    color: var(--gradient-start);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.bancal-plantas-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.bancal-planta-tag {
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.bancal-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bancal-fit-options {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.bancal-fit-options label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.bancal-fit-options select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
}

@media (max-width: 768px) {
    .modal-large {
        width: 98%;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .bancales-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .bancal-card {
        padding: 15px;
    }
}


/* ============================================
   TIMELINE DE PRODUCCIÓN
   ============================================ */

.modal-timeline {
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
}

.timeline-info {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-green);
}

.timeline-info p {
    margin: 0;
    color: var(--text-primary);
}

.timeline-filters {
    margin-bottom: 20px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.timeline-filters label {
    cursor: pointer;
    user-select: none;
}

.timeline-container {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    max-height: 60vh;
    overflow-y: auto;
}

.timeline-header {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
}

.timeline-label {
    min-width: 200px;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-months {
    display: flex;
    flex: 1;
    min-width: 800px;
}

.timeline-month {
    flex: 1;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 5px;
    border-right: 1px solid var(--border-color);
}

.timeline-month:last-child {
    border-right: none;
}

.timeline-group {
    margin-bottom: 25px;
}

.timeline-group-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--primary-green);
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 6px;
    border-left: 4px solid var(--primary-green);
}

.timeline-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.timeline-row:hover {
    background: rgba(76, 175, 80, 0.05);
    border-radius: 6px;
}

.timeline-plant-name {
    min-width: 200px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-plant-icon {
    font-size: 18px;
}

.timeline-bars {
    display: flex;
    flex: 1;
    position: relative;
    min-width: 800px;
    height: 40px;
}

.timeline-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
}

.timeline-grid-cell {
    flex: 1;
    border-right: 1px dashed rgba(0, 0, 0, 0.1);
}

.timeline-grid-cell:last-child {
    border-right: none;
}

.timeline-bar {
    position: absolute;
    height: 32px;
    top: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timeline-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.timeline-bar-siembra {
    background: linear-gradient(135deg, #81C784 0%, #66BB6A 100%);
}

.timeline-bar-crecimiento {
    background: linear-gradient(135deg, #FDD835 0%, #FBC02D 100%);
}

.timeline-bar-cosecha {
    background: linear-gradient(135deg, #FF7043 0%, #F4511E 100%);
}

.timeline-bar-full {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
}

.timeline-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.timeline-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.timeline-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.timeline-legend {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    flex-wrap: wrap;
}

.timeline-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.timeline-legend-color {
    width: 30px;
    height: 18px;
    border-radius: 4px;
}

/* Dark mode timeline */
body.dark-mode .timeline-info {
    background: linear-gradient(135deg, #1e4620 0%, #2d4a2e 100%);
}

body.dark-mode .timeline-header,
body.dark-mode .timeline-container {
    background: #1a202c;
}

body.dark-mode .timeline-tooltip {
    background: rgba(255, 255, 255, 0.95);
    color: #1a202c;
}

@media (max-width: 768px) {
    .modal-timeline {
        width: 98%;
    }
    
    .timeline-label,
    .timeline-plant-name {
        min-width: 120px;
        font-size: 13px;
    }
    
    .timeline-months,
    .timeline-bars {
        min-width: 600px;
    }
    
    .timeline-month {
        font-size: 10px;
    }
}

/* ============================================
   PLANTAS PERSONALIZADAS
   ============================================ */

/* Tabs para plantas */
.plants-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    background: #f5f5f5;
    padding: 8px;
    border-radius: 8px;
    border-bottom: none;
}

.plants-tab {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.plants-tab:hover {
    color: white;
    background: rgba(76, 175, 80, 0.3);
}

.plants-tab.active {
    color: white;
    background: var(--primary-green);
    border-color: var(--primary-green);
    text-shadow: none;
}

.plants-tab-content {
    display: none;
}

.plants-tab-content.active {
    display: block;
}

/* Botón personalizar en plant-item */
.btn-customize {
    margin-top: 4px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-customize:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Modal de personalización */
.customize-info {
    background: linear-gradient(135deg, #e8f5e9 0%, #f3e5f5 100%);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.customize-info p {
    margin: 0;
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-green);
}

.form-group small {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 4px;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

/* Plantas personalizadas item */
.custom-plant-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.community-plant-item {
    border-left: 4px solid #9b59b6;
    background: linear-gradient(135deg, #f9f3fc 0%, #fff 100%);
}

.community-plant-item:hover {
    border-left-color: #8e44ad;
}

.custom-plant-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-green);
}

.custom-plant-item.selected {
    border-color: var(--primary-green);
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.difficulty-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.difficulty-fácil {
    background: #d4edda;
    color: #155724;
}

.difficulty-medio {
    background: #fff3cd;
    color: #856404;
}

.difficulty-difícil {
    background: #f8d7da;
    color: #721c24;
}

.like-button {
    background: #f0f0f0 !important;
    color: var(--text-secondary) !important;
}

.like-button:hover {
    background: #e0e0e0 !important;
    transform: scale(1.05);
}

.like-button.liked {
    background: #ffe0e6 !important;
    color: #e91e63 !important;
}

.like-button.liked:hover {
    background: #ffccd5 !important;
}

.custom-plant-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}

.custom-plant-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.custom-plant-actions button {
    flex: 1;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-edit-custom {
    background: #3498db;
    color: white;
}

.btn-edit-custom:hover {
    background: #2980b9;
}

.btn-delete-custom {
    background: #e74c3c;
    color: white;
}

.btn-delete-custom:hover {
    background: #c0392b;
}

.btn-share-custom {
    background: #9b59b6;
    color: white;
}

.btn-share-custom:hover {
    background: #8e44ad;
}

/* Dark mode para plantas personalizadas */
body.dark-mode .custom-plant-item {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-color: #4a5568;
}

body.dark-mode .community-plant-item {
    border-left-color: #9b59b6;
    background: linear-gradient(135deg, #2a1f3d 0%, #1a202c 100%);
}

body.dark-mode .custom-plant-item:hover {
    border-color: var(--primary-green);
}

body.dark-mode .custom-plant-item.selected {
    background: linear-gradient(135deg, #1e4620 0%, #2d4a2e 100%);
}

body.dark-mode .difficulty-fácil {
    background: #1e4620;
    color: #a3d9a5;
}

body.dark-mode .difficulty-medio {
    background: #5a4a1a;
    color: #ffd966;
}

body.dark-mode .difficulty-difícil {
    background: #5a1a1a;
    color: #ff9999;
}

body.dark-mode .like-button {
    background: #4a5568 !important;
    color: #e2e8f0 !important;
}

body.dark-mode .like-button:hover {
    background: #5a6678 !important;
}

body.dark-mode .like-button.liked {
    background: #5a1a3a !important;
    color: #ff6b9d !important;
}

body.dark-mode .like-button.liked:hover {
    background: #6a2a4a !important;
}

body.dark-mode .customize-info {
    background: linear-gradient(135deg, #1e4620 0%, #2a1f3d 100%);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .plants-tabs {
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-bottom: 20px;
        padding-bottom: 5px;
    }
    
    .plants-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .plants-tab {
        flex: 0 0 auto;
        min-width: 140px;
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 8px 8px 0 0;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }
    
    .plants-tab.active {
        background: rgba(76, 175, 80, 0.1);
        border-bottom-color: var(--primary-green);
    }
    
    .plants-tab:active {
        transform: scale(0.98);
    }
}

/* Mejorar tamaños touch para muy pequeñas pantallas */
@media (max-width: 480px) {
    .plants-tab {
        min-width: 120px;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .plants-list h3 {
        font-size: 1.1rem;
    }
}
/* ============================================
   PLAGAS Y REMEDIOS
   ============================================ */

.plagas-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.plaga-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plaga-card:hover {
    background: rgba(76, 175, 80, 0.05);
    border-color: #4CAF50;
    transform: translateY(-2px);
}

.plaga-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.plaga-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.plaga-icon {
    font-size: 24px;
    min-width: 30px;
    text-align: center;
}

.plaga-card-title strong {
    font-size: 14px;
    color: var(--text-primary);
}

.plaga-card-title small {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.plaga-badge {
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.plaga-card-body {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.plaga-card-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.plaga-card-actions .btn-icon {
    padding: 4px 8px;
    font-size: 12px;
    height: 28px;
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plaga-card-actions .btn-icon:hover {
    background: #e0e0e0;
}

.plaga-card-actions .btn-success {
    background: #10b981;
    color: white;
}

.plaga-card-actions .btn-danger {
    background: #ef4444;
    color: white;
}

.plagas-controls {
    margin-bottom: 15px;
}

.btn-primary.btn-small {
    padding: 8px 12px;
    font-size: 13px;
    width: 100%;
}

/* Plagas Details Modal */
.plagas-details-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.plagas-details-left,
.plagas-details-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.plagas-detail-section {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.plagas-detail-section h4 {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 14px;
}

.plagas-detail-section p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.remedio-item {
    background: var(--bg-primary) !important;
    border-left-color: #3b82f6 !important;
    padding: 12px !important;
    margin-bottom: 10px !important;
}

.remedio-item strong {
    color: var(--text-primary);
    font-size: 13px;
}

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

/* ============================================ */
/* ESTILOS PARA TABS DE PLANTAS Y PLAGAS        */
/* ============================================ */

.plants-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    padding-bottom: 10px;
}

.plants-tab {
    background: transparent;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.plants-tab:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
    border-bottom-color: #4CAF50;
}

.plants-tab.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
    font-weight: 600;
}

.plants-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.plants-tab-content.active {
    display: block;
}

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

.plants-tab-content h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.plants-tab-content h4 {
    color: var(--text-primary);
    margin: 20px 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

/* Estilos para contenedores de plagas */
.plagas-container {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

.plaga-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.plaga-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.plaga-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.plaga-card-title {
    display: flex;
    gap: 10px;
    flex: 1;
}

.plaga-icon {
    font-size: 20px;
    min-width: 20px;
}

.plaga-card-title div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.plaga-card-title strong {
    color: var(--text-primary);
    font-size: 14px;
}

.plaga-card-title small {
    color: var(--text-secondary);
    font-size: 12px;
}

.plaga-badge {
    padding: 4px 12px;
    border-radius: 20px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.plaga-card-body {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.plaga-card-body p {
    margin: 5px 0;
}

.plaga-card-body small {
    color: #999;
}

.plaga-card-actions {
    display: flex;
    gap: 5px;
}

.plaga-card-actions .btn-icon {
    padding: 6px 10px;
    font-size: 12px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.plaga-card-actions .btn-icon:hover {
    background: #4CAF50;
    color: white;
    transform: scale(1.05);
}

.plaga-card-actions .btn-success {
    background: #10b981;
    color: white;
}

.plaga-card-actions .btn-danger {
    background: #ef4444;
    color: white;
}

/* Animación para plantas con plagas */
@keyframes pestPulse {
    0% {
        filter: drop-shadow(0 0 0 rgba(255, 165, 0, 0.7));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(255, 165, 0, 0.9));
    }
    100% {
        filter: drop-shadow(0 0 0 rgba(255, 165, 0, 0.7));
    }
}

circle.has-pest {
    animation: pestPulse 2s ease-in-out infinite;
}

/* Estilos para filtros mejorados */
.plants-filters {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: none;
    border: 1px solid #e0e0e0;
}

.plants-filters.show {
    display: block;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.filter-btn {
    padding: 6px 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: #2196F3;
    background: #f0f8ff;
}

.filter-btn.active {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}

.btn-filter-action {
    padding: 6px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    flex: 1;
}

.btn-filter-action:hover {
    background: #f5f5f5;
    border-color: #999;
}

.btn-filter-action:active {
    transform: scale(0.98);
}

.btn-toggle-filters {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 2px solid #2196F3;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #2196F3;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.btn-toggle-filters:hover {
    background: linear-gradient(135deg, #bbdefb, #90caf9);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
    transform: translateY(-2px);
}

/* Media queries para responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        gap: 10px;
    }

    /* Sidebar is hidden with display:none !important - these rules are ignored */
    .sidebar {
        display: none !important;
    }

    .canvas-area {
        margin-left: 0 !important;
        width: 100% !important;
        border-radius: 0;
    }
    
    .plants-tabs {
        padding: 8px;
        gap: 6px;
    }
    
    .plants-tab {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .plagas-container {
        max-height: 400px;
    }

    .filter-btn {
        font-size: 0.75rem;
        padding: 5px 8px;
    }
}

/* ============================================
   BANCAL MODAL - ASISTENTE CON PASOS
   ============================================ */

.bancal-step {
    display: none !important;
    animation: slideIn 0.3s ease-in-out;
}

.bancal-step.active {
    display: block !important;
}

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

.bancal-step h3 {
    color: var(--primary-green);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.step-info {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.bancal-area-info {
    background: var(--bg-light);
    border-left: 4px solid var(--primary-green);
    padding: 1rem;
    border-radius: 6px;
    margin: 1.5rem 0;
}

.bancal-area-info p {
    margin: 0;
    color: var(--text-dark);
    font-weight: 500;
}

.bancal-area-info strong {
    color: var(--primary-green);
    font-size: 1.2rem;
}

/* Grid de plantas para seleccionar */
.bancal-plantas-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.planta-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.planta-selector:hover {
    border-color: var(--primary-green);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.planta-selector-icon {
    font-size: 2.5rem;
    min-width: 50px;
    text-align: center;
}

.planta-selector-nombre {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
    min-width: 150px;
}

.planta-selector-cantidad {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--bg-light);
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    margin-left: auto;
}

.cantidad-input {
    width: 40px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.4rem 0.2rem;
    font-weight: 600;
    font-size: 0.95rem;
    flex: 0 0 auto;
}

.cantidad-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--primary-green);
    color: white;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    flex: 0 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cantidad-btn:first-of-type {
    order: -1;
}

.cantidad-btn:last-of-type {
    order: 1;
}

.cantidad-btn:hover {
    background: var(--dark-green);
    transform: scale(1.15);
}

.cantidad-btn:active {
    transform: scale(0.9);
}
    color: var(--text-dark);
    background: var(--bg-white);
}

/* Previsualización de bancal */
.preview-bancal-container {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}

.preview-bancal-canvas {
    width: 100%;
    max-width: 500px;
    height: auto;
    border: 2px solid var(--primary-green);
    border-radius: 6px;
    background: white;
    margin: 1rem auto;
    display: block;
}

body.dark-mode .preview-bancal-canvas {
    background: #1a202c;
}

/* Resumen de plantas */
.resumen-plantas {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.resumen-plantas h4 {
    color: var(--primary-green);
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.resumen-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem;
    margin: 0.4rem 0;
    background: var(--bg-white);
    border-radius: 4px;
    border-left: 3px solid var(--primary-green);
}

.resumen-item-icon {
    font-size: 1.5rem;
    margin-right: 0.8rem;
}

.resumen-item-nombre {
    flex: 1;
    font-weight: 500;
    color: var(--text-dark);
}

.resumen-item-cantidad {
    background: var(--primary-green);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.validacion-mensaje {
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.validacion-ok {
    background: rgba(76, 175, 80, 0.1);
    border-left: 4px solid #4CAF50;
    color: #2d5016;
}

.validacion-error {
    background: rgba(255, 77, 77, 0.1);
    border-left: 4px solid #ff4d4d;
    color: #8b1e1e;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

.modal-buttons .btn-primary,
.modal-buttons .btn-secondary {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modal-buttons .btn-primary {
    background: var(--primary-green);
    color: white;
}

.modal-buttons .btn-primary:hover {
    background: var(--dark-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.modal-buttons .btn-secondary {
    background: var(--border-color);
    color: var(--text-dark);
}

.modal-buttons .btn-secondary:hover {
    background: var(--text-secondary);
    color: white;
}

/* Disposición de plantas - Toggle buttons */
.disposicion-toggle {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.disposicion-btn {
    padding: 10px 20px;
    border: 2px solid #4CAF50;
    background: transparent;
    color: #4CAF50;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.disposicion-btn:hover {
    background: #f0f8f0;
    transform: translateY(-2px);
}

.disposicion-btn.active {
    background: #4CAF50;
    color: white;
}

body.dark-mode .disposicion-btn {
    border-color: #4CAF50;
    color: #4CAF50;
}

body.dark-mode .disposicion-btn:hover {
    background: rgba(76, 175, 80, 0.1);
}

body.dark-mode .disposicion-btn.active {
    background: #4CAF50;
    color: #1a202c;
}

/* Responsive */
@media (max-width: 768px) {
    .bancal-plantas-grid {
        max-height: 350px;
        padding: 0.3rem;
        gap: 0.5rem;
    }

    .planta-selector {
        padding: 0.4rem 0.6rem;
        flex-direction: row;
        text-align: left;
        gap: 0.6rem;
        min-height: 50px;
    }

    .planta-selector-icon {
        font-size: 1.8rem;
        min-width: 40px;
        text-align: center;
    }

    .planta-selector-nombre {
        font-size: 0.85rem;
        min-width: auto;
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .planta-selector-cantidad {
        gap: 0.3rem;
        padding: 0.3rem 0.5rem;
        flex-shrink: 0;
    }

    .cantidad-btn {
        width: 24px;
        height: 24px;
        font-size: 0.9rem;
        padding: 0;
    }

    .cantidad-input {
        width: 36px;
        font-size: 0.85rem;
        padding: 0.2rem 0.1rem;
    }
    
    .disposicion-toggle {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .disposicion-btn {
        width: 100%;
    }
    
    .modal-buttons {
        flex-direction: column-reverse;
    }
    
    .modal-buttons button {
        width: 100%;
    }
}

/* Animaciones para FABs */
@keyframes shake-pulse {
    0% {
        transform: scale(1) translateX(0);
    }
    25% {
        transform: scale(1.08) translateX(-4px);
    }
    50% {
        transform: scale(1.15) translateX(4px);
    }
    75% {
        transform: scale(1.08) translateX(-2px);
    }
    100% {
        transform: scale(1) translateX(0);
    }
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.15);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.15);
    }
    70% {
        transform: scale(1);
    }
}

/* Clases para activar animaciones */
.fab-plants-button.pulse-animation {
    animation: heartbeat 0.8s ease-in-out infinite;
}

.fab-control-panel-button.pulse-animation {
    animation: shake-pulse 0.8s ease-in-out infinite;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: white;
    border-left: 4px solid #4CAF50;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 220px;
    max-width: 320px;
    animation: slideInRight 0.3s ease-out;
    pointer-events: auto;
    font-size: 0.9rem;
    color: #333;
}

.toast.success {
    border-left-color: #4CAF50;
}

.toast.error {
    border-left-color: #f44336;
}

.toast.warning {
    border-left-color: #ff9800;
}

.toast.info {
    border-left-color: #2196F3;
}

.toast-icon {
    font-size: 1.3rem;
    min-width: 24px;
    text-align: center;
}

.toast-message {
    flex: 1;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #333;
}

body.dark-mode .toast {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .toast-close:hover {
    color: #e2e8f0;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.removing {
    animation: slideOutRight 0.3s ease-out forwards;
}

/* ========================================
   RIPPLE EFFECT
   ======================================== */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ========================================
   IMPROVED BUTTONS FEEDBACK
   ======================================== */
button, a.btn-primary, a.btn-secondary {
    position: relative;
}

button:not(.hamburger-menu):not(.btn-close):not(.fab-control-panel-button):not(.fab-plants-button) {
    transition: all 0.2s ease;
}

button:not(.hamburger-menu):not(.btn-close):not(.fab-control-panel-button):not(.fab-plants-button):active {
    transform: scale(0.98);
}

/* ========================================
   IMPROVED DARK MODE CONTRAST
   ======================================== */
body.dark-mode {
    --shadow: rgba(0, 0, 0, 0.5);
}

body.dark-mode .fab-control-panel-message,
body.dark-mode .fab-plants-message {
    background: #1a202c;
    color: #e2e8f0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

body.dark-mode .fab-control-panel-button,
body.dark-mode .fab-plants-button {
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
}

body.dark-mode .fab-control-panel-button:hover,
body.dark-mode .fab-plants-button:hover {
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

body.dark-mode .modal-content {
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

/* ========================================
   HELP ICON STYLING
   ======================================== */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: help;
    margin-left: 6px;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.help-icon:hover {
    background: #4CAF50;
    color: white;
    transform: scale(1.15);
}

body.dark-mode .help-icon {
    background: #4a5568;
    color: #a0aec0;
}

body.dark-mode .help-icon:hover {
    background: #4CAF50;
    color: white;
}

.help-tooltip {
    visibility: hidden;
    position: absolute;
    z-index: 1;
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.help-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.help-icon:hover .help-tooltip {
    visibility: visible;
    opacity: 1;
}

body.dark-mode .help-tooltip {
    background-color: #1a202c;
}

body.dark-mode .help-tooltip::after {
    border-color: #1a202c transparent transparent transparent;
}

/* ========================================
   BOTTOM SHEET FOR MOBILE
   ======================================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 100px;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        max-height: 60vh;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 2000;
        background: var(--bg-primary);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .sidebar[data-collapsed="false"] {
        transform: translateY(0);
    }
    
    /* Override desktop styles para móvil - Control panel y plants list dentro del sidebar */
    .control-panel,
    .plants-list {
        position: static !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        max-height: none !important;
        background: transparent !important;
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        z-index: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        transition: none !important;
    }
    
    .control-panel[data-visible="false"],
    .plants-list[data-visible="false"] {
        display: none !important;
    }
    
    /* Handle visual para arrastrar */
    .sidebar::before {
        content: "";
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        display: block;
        width: 40px;
        height: 4px;
        background: #e0e0e0;
        border-radius: 2px;
        margin: 12px auto;
        z-index: 10;
    }
    
    body.dark-mode .sidebar::before {
        background: #4a5568;
    }
    
    /* Mejorar visibilidad del sidebar */
    .sidebar .control-panel,
    .sidebar .plants-list {
        width: 100%;
    }
    
    /* Reducir padding excesivo en panel y lista de plantas para móvil */
    .sidebar .control-panel,
    .sidebar .plants-list {
        padding: 8px 12px 16px;
    }
    
    /* Hacer el handle más compacto */
    .sidebar::before {
        margin: 6px auto 8px;
        height: 3px;
        width: 32px;
    }
    
    /* Pestañas más compactas */
    .plants-tabs {
        margin-bottom: 8px;
        padding: 6px;
        gap: 4px;
    }
    
    .plants-tab {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    /* Reducir margen en títulos */
    .plants-list h3 {
        margin: 6px 0 8px 0;
        font-size: 16px;
    }
    
    /* Reducir espaciado en search box */
    .search-box {
        margin-bottom: 8px;
    }
    
    .search-box input {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    /* Botón de filtros más compacto */
    .btn-toggle-filters {
        padding: 6px 10px;
        margin-bottom: 8px;
        font-size: 12px;
    }
    
    /* Items de plantas más compactos */
    .plant-item {
        padding: 8px;
        gap: 4px;
    }
    
    .plant-item h4 {
        margin: 0 0 3px 0;
        font-size: 13px;
    }
    
    .plant-item p {
        margin: 2px 0;
        font-size: 11px;
    }
    
    /* Reducir altura general del contenedor */
    .plants-container {
        gap: 8px;
    }
    
    /* Asegurar que el contenido del canvas es visible */
    .canvas-area {
        width: 100%;
        height: 100%;
        z-index: 10;
    }
    
    /* FABs más visibles en móvil con bottom sheet */
    .sidebar-fab {
        bottom: 20px;
        left: 15px;
    }
    
    .sidebar-fab.fab-second {
        bottom: 90px;
    }
    
    /* Mejorar overlay en móvil */
    .sidebar-overlay {
        top: 70px;
        display: block;
    }
    
    .sidebar-overlay.show {
        z-index: 1999;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    /* Optimizar control panel para móvil */
    .control-panel .huerto-selector {
        margin-bottom: 8px;
        gap: 4px;
    }
    
    .huerto-selector label {
        font-size: 12px;
    }
    
    .huerto-selector select,
    .huerto-selector button {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .control-panel .action-buttons {
        gap: 4px;
        margin-bottom: 8px;
    }
    
    .control-panel .btn-icon {
        padding: 6px;
        font-size: 14px;
    }
    
    .control-panel .btn-action {
        padding: 8px 12px;
        margin-bottom: 8px;
        font-size: 13px;
    }
    
    .control-panel .info-box {
        padding: 8px;
        gap: 4px;
        margin-top: 8px;
    }
    
    .control-panel .info-box p {
        margin: 2px 0;
        font-size: 11px;
    }
}

/* ========================================
   ENHANCED INPUTS WITH FOCUS STATE
   ======================================== */
input, select, textarea {
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    border-color: #4CAF50 !important;
}

/* ========================================
   BUTTON STATE INDICATORS
   ======================================== */
.btn-saving {
    opacity: 0.7;
    pointer-events: none;
}

.btn-saved {
    background: #4CAF50 !important;
    color: white !important;
}

/* Animación de pulso para indicador de cambios sin guardar */
@keyframes unsaved-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.has-unsaved-changes {
    animation: unsaved-pulse 2s ease-in-out infinite;
}

/* ========================================
   SMOOTH PAGE TRANSITIONS & ANIMATIONS
   ======================================== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.sidebar {
    animation: fadeInUp 0.3s ease-out;
}

.modal-content {
    animation: fadeInDown 0.3s ease-out;
}

/* ========================================
   IMPROVED FORM ANIMATIONS
   ======================================== */
.form-group {
    transition: all 0.2s ease;
}

.form-group:hover {
    transform: translateX(4px);
}

/* ========================================
   BUTTON FEEDBACK IMPROVEMENTS
   ======================================== */
.btn-primary, .btn-secondary {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:active, .btn-secondary:active {
    transform: scale(0.98);
}

.btn-primary:focus, .btn-secondary:focus {
    outline: 2px solid rgba(76, 175, 80, 0.3);
    outline-offset: 2px;
}

/* ========================================
   IMPROVED PLANT ITEM ANIMATIONS
   ======================================== */
.plant-item {
    transition: all 0.2s ease;
}

.plant-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.plant-item.selected {
    animation: pulse-select 0.4s ease-out;
}

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

/* ========================================
   IMPROVED CANVAS FEEDBACK
   ======================================== */
.canvas-wrapper {
    transition: all 0.2s ease;
}

.canvas-wrapper:hover {
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.2);
}

/* ========================================
   DISABLED STATE STYLING
   ======================================== */
button:disabled, input:disabled, select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================
   LOADING STATE ANIMATIONS
   ======================================== */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

/* ========================================
   ERROR STATE STYLING
   ======================================== */
input.error, select.error, textarea.error {
    border-color: #f44336 !important;
    background-color: rgba(244, 67, 54, 0.05);
}

/* ========================================
   SUCCESS STATE STYLING
   ======================================== */
@keyframes checkmark-animation {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.success-check {
    animation: checkmark-animation 0.4s ease-out;
}

/* ========================================
   KEYBOARD SHORTCUTS & HELP BUTTON
   ======================================== */
.nav-help-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-help-btn:hover {
    background: #45a049;
    transform: scale(1.1);
}

.nav-help-btn:active {
    transform: scale(0.95);
}

body.dark-mode .nav-help-btn {
    background: #2d5016;
}

body.dark-mode .nav-help-btn:hover {
    background: #3d6b20;
}

.shortcuts-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.shortcut-item kbd {
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: monospace;
    white-space: nowrap;
}

body.dark-mode .shortcut-item kbd {
    background: #4a5568;
    color: #e2e8f0;
}

.shortcut-item span {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.modal-medium {
    max-width: 600px;
}

/* ============================================
   ESTILOS AMAZON AFFILIATES
   ============================================ */

.amazon-products-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.amazon-category {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.amazon-category:hover {
    box-shadow: 0 4px 12px var(--shadow);
    transform: translateY(-2px);
}

.amazon-category h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.amazon-category-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.amazon-products {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.amazon-product-link {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.amazon-product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.amazon-product-item:hover {
    border-color: var(--gradient-start);
    background: rgba(76, 175, 80, 0.05);
    transform: translateX(4px);
}

.amazon-product-item .product-name {
    font-weight: 500;
    color: var(--text-primary);
}

.amazon-product-item .amazon-badge {
    font-size: 0.75rem;
    background: #FF9900;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Widget de upgrade con Amazon */
.amazon-upgrade-widget {
    background: linear-gradient(135deg, rgba(255, 153, 0, 0.1), rgba(76, 175, 80, 0.1));
    border: 2px solid #FF9900;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.amazon-upgrade-widget h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.amazon-quick-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.amazon-quick-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #FF9900;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: center;
}

.amazon-quick-link:hover {
    background: #FF8C00;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(255, 153, 0, 0.3);
}

.amazon-upgrade-widget small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .amazon-products-container {
        grid-template-columns: 1fr;
    }
    
    .amazon-quick-links {
        flex-direction: column;
    }
    
    .amazon-quick-link {
        width: 100%;
    }
}
/* ============================================
   GLOBAL LOADING STATE (network-utils.js)
   ============================================ */

#global-loading {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    background: var(--bg-primary, #ffffff);
    padding: 2rem 2.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.loading-spinner .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-secondary, #f0f0f0);
    border-top: 4px solid var(--primary-green, #10b981);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading-spinner p {
    margin: 0;
    color: var(--text-dark, #333);
    font-weight: 500;
    font-size: 0.95rem;
}

/* Cursor de espera y bloqueo de interacciones durante carga */
body.app-loading {
    cursor: wait;
}

body.app-loading > *:not(#global-loading) {
    pointer-events: none;
}

/* ============================================
   PLANT ICON SYSTEM
   ============================================ */

.plant-icon-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 4px;
    flex-shrink: 0;
    overflow: hidden;
}

.plant-icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    flex-shrink: 0;
}

.plant-icon-inline svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.plant-icon-inline img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Fallback emoji styling */
.plant-icon-inline.fallback {
    font-size: inherit;
}

/* Dark mode adjustments */
body.dark-mode .plant-icon-container {
    background: rgba(255, 255, 255, 0.05);
}

/* Responsive sizing */
@media (max-width: 768px) {
    .plant-icon-container {
        width: 18px;
        height: 18px;
    }
    
    .plant-icon-inline {
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   SECCIÓN EDICIÓN DE CLIMA - LLUVIA MENSUAL
   ============================================ */

#climaSectionContainer {
    display: none;
}

.clima-input {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.clima-input:focus {
    outline: none;
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.02);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.clima-input::placeholder {
    color: var(--text-secondary);
}

/* Input con error de validación */
.clima-input-error {
    border-color: #f44336 !important;
    background: rgba(244, 67, 54, 0.05) !important;
}

.clima-input-error:focus {
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1) !important;
}

/* Dark mode para clima inputs */
body.dark-mode .clima-input {
    background: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .clima-input:focus {
    background: rgba(76, 175, 80, 0.08);
    border-color: #4CAF50;
}

body.dark-mode .clima-input-error {
    background: rgba(244, 67, 54, 0.12) !important;
    border-color: #f44336 !important;
}
