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

/* ==========================================================================
   DESIGN SYSTEM: VARIABLES Y TEMA MODO OSCURO
   ========================================================================== */
:root {
    --font-primary: 'Outfit', sans-serif;

    /* Palette: Modo Oscuro Botánico-Profesional */
    --color-bg-darkest: #0c0f0d;         /* Negro botánico pizarra */
    --color-bg-dark: #111613;            /* Antracita / Fondo de sección */
    --color-card-bg: rgba(15, 23, 20, 0.95); /* Cristal esmerilado oscuro de alta opacidad */
    --color-card-border: rgba(255, 255, 255, 0.06);
    --color-card-border-active: rgba(82, 183, 136, 0.4);

    /* Acentos */
    --color-forest-dark: #1f2c23;
    --color-forest: #3a5040;             /* Verde Bosque Silenciado */
    --color-forest-hover: #4e6b57;
    --color-mint: #52b788;               /* Verde vivo para relieve */
    
    --color-earth: #8c5e3c;
    --color-terracotta: #c86b51;         /* Terracota Mate */
    --color-terracotta-hover: #df7d62;
    --color-sand: #e6ccb2;

    /* Textos */
    --color-text-main: #e2e8f0;          /* Blanco pizarra de alta lectura */
    --color-text-muted: #94a3b8;         /* Gris azulado secundario */
    --color-text-dark: #1e293b;

    /* Semantic Colors (Semáforo de Prioridades) */
    --priority-urgente: #d84b4b;         /* Rojo Carmesí */
    --priority-urgente-bg: rgba(216, 75, 75, 0.15);
    --priority-importante: #efa035;      /* Ámbar Cálido */
    --priority-importante-bg: rgba(239, 160, 53, 0.15);
    --priority-mantenimiento: #4e8b67;   /* Verde Bosque Claro */
    --priority-mantenimiento-bg: rgba(78, 139, 103, 0.15);
    
    /* Efectos */
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --hover-shadow: 0 12px 40px 0 rgba(82, 183, 136, 0.12);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-primary);
    background-color: #1c4b43;
    color: var(--color-text-main);
    line-height: 1.6;
    padding-bottom: 60px;
    background-attachment: fixed;
}

/* ==========================================================================
   LAYOUT Y ESTRUCTURA
   ========================================================================== */
header {
    background-color: rgba(12, 15, 13, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    padding: 14px 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--color-card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand svg {
    width: 28px;
    height: 28px;
}

.brand h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.brand span {
    color: var(--color-mint);
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 12px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: var(--color-mint);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--color-mint);
    animation: pulse 2s infinite;
}

main {
    max-width: 1200px;
    margin: 25px auto 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   COMPONENTE: BARRA CLIMATOLÓGICA COMPACTA (FASE 3.5)
   ========================================================================== */
.climate-compact-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    padding: 4px 14px;
    font-size: 12px;
}

.climate-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.climate-item .label {
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.climate-item .value {
    color: #ffffff;
    font-weight: 700;
}

.climate-item .subtext {
    color: var(--color-mint);
    font-weight: 500;
    font-size: 11px;
}

.climate-item.separator {
    color: rgba(255, 255, 255, 0.12);
    font-weight: 300;
}

.climate-item.inercia .value {
    color: var(--color-mint);
}

.climate-item.inercia .subtext {
    color: var(--color-text-muted);
    font-size: 10px;
}

/* Responsividad para la barra de clima en el header */
@media (max-width: 768px) {
    .header-container {
        justify-content: space-between;
    }
    .climate-compact-bar {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 5px;
    }
}

/* ==========================================================================
   COMPONENTE: CUADRÍCULA DE ZONAS
   ========================================================================== */
.section-title {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.08);
}

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

.zone-card {
    background-color: var(--color-card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--border-radius);
    padding: 18px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid #22ffd7;
    position: relative;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.zone-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #22ffd7;
    transition: var(--transition);
}

.zone-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
    border-color: #22ffd7;
}

.zone-card.active {
    border-color: #22ffd7;
    box-shadow: 0 0 15px rgba(34, 255, 215, 0.25);
}

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

.zone-icon {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(34, 255, 215, 0.12); /* Cyan translúcido */
    color: #22ffd7;                             /* Cyan unificado */
}

.zone-icon i {
    font-size: 26px;
}

.zone-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95), 0 0 8px rgba(34, 255, 215, 0.4);
}

.zone-desc {
    font-size: 12px;
    color: #ffffff; /* Blanco puro */
    margin-bottom: 12px;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.zone-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--color-text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

.zone-footer span:first-child {
    font-style: italic;
    color: #3fae9a;
}

.crop-badge {
    background-color: #22ffd7;
    color: #1b5248;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    box-shadow: none;
    text-shadow: none;
    border: none;
}

/* ==========================================================================
   SECCIÓN: CATÁLOGO DINÁMICO DE PLANTAS
   ========================================================================== */
.catalog-section {
    background-color: var(--color-bg-dark);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 30px;
    border: 1px solid var(--color-card-border);
    animation: fadeIn 0.4s ease;
}

.catalog-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.section-title-clean {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.btn-action {
    background-color: var(--color-forest);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 6px;
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-action:hover {
    background-color: var(--color-forest-hover);
    border-color: var(--color-mint);
}

.plants-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

/* Tarjeta Mini de Cultivo */
.plant-mini-card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.plant-mini-card:hover {
    border-color: var(--color-mint);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(82, 183, 136, 0.1);
}

.plant-mini-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.plant-mini-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.plant-mini-scientific {
    font-size: 11px;
    color: var(--color-text-muted);
    font-style: italic;
}

.plant-mini-lote {
    font-size: 10px;
    background-color: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--color-sand);
}

.plant-mini-body {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.plant-mini-body div {
    margin-bottom: 4px;
}

.plant-mini-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
    font-size: 11px;
}

.state-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 0.5px;
}

/* Estados */
.state-germinar { background-color: rgba(82, 183, 136, 0.15); color: var(--color-mint); }
.state-crecer { background-color: rgba(58, 80, 64, 0.3); color: #8cd8ad; }
.state-flor { background-color: rgba(239, 160, 53, 0.15); color: var(--priority-importante); }
.state-cosecha { background-color: rgba(200, 107, 81, 0.15); color: var(--color-terracotta); }
.state-enferma { background-color: rgba(216, 75, 75, 0.15); color: var(--priority-urgente); }

/* ==========================================================================
   DIARIO Y REGISTRO CLIMA
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

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

.card-panel {
    background-color: var(--color-card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: 2px solid #22ffd7;
}

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

.panel-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

/* Filtros */
.filter-tabs {
    display: flex;
    gap: 6px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: 20px;
    font-family: var(--font-primary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: var(--color-text-muted);
}

.filter-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.filter-btn.active {
    background-color: var(--color-mint);
    color: var(--color-bg-darkest);
    border-color: var(--color-mint);
    font-weight: 600;
}
/* Listado de Diario - Rejilla Mosaico Compacta (v5.1) */
#diario-prioridades {
    background-color: rgba(15, 23, 20, 0.95) !important;
    border: 2px solid #22ffd7 !important;
    margin-bottom: 24px;
}

.tasks-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Scrollbar elegante para la bitácora */
.tasks-list::-webkit-scrollbar {
    width: 6px;
}
.tasks-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}
.tasks-list::-webkit-scrollbar-thumb {
    background: rgba(34, 255, 215, 0.3);
    border-radius: 3px;
}
.tasks-list::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 255, 215, 0.6);
}

.task-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px 14px 16px 14px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-left: 4px solid var(--color-text-muted);
    transition: var(--transition);
    gap: 12px;
}

.task-item:hover {
    transform: translateY(-2px);
    border-color: rgba(34, 255, 215, 0.3);
    box-shadow: 0 4px 15px rgba(34, 255, 215, 0.05);
}

.task-item.priority-urgente {
    border-left-color: var(--priority-urgente);
    background-color: rgba(216, 75, 75, 0.03);
}
.task-item.priority-urgente .priority-tag {
    background-color: var(--priority-urgente-bg);
    color: #ff8080;
}

.task-item.priority-importante {
    border-left-color: var(--priority-importante);
    background-color: rgba(239, 160, 53, 0.03);
}
.task-item.priority-importante .priority-tag {
    background-color: var(--priority-importante-bg);
    color: #ffd080;
}

.task-item.priority-mantenimiento {
    border-left-color: var(--priority-mantenimiento);
    background-color: rgba(78, 139, 103, 0.03);
}
.task-item.priority-mantenimiento .priority-tag {
    background-color: var(--priority-mantenimiento-bg);
    color: #9bebba;
}

/* Widget de Calendario Agrícola */
.task-calendar-widget {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 2px solid #22ffd7;
    border-radius: 6px;
    background-color: rgba(12, 18, 15, 0.95);
    font-family: var(--font-primary), sans-serif;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    overflow: hidden;
}
.task-calendar-widget .cal-month {
    width: 100%;
    background-color: #22ffd7;
    color: #1c4b43;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    padding: 1px 0;
    line-height: 1.2;
    letter-spacing: 0.5px;
}
.task-calendar-widget .cal-day {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
    text-align: center;
    margin-bottom: 2px;
}

/* Sello Estacional Compacto (v5.2) */
.task-calendar-widget.seasonal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px;
}
.task-calendar-widget.seasonal i {
    font-size: 14px;
    color: #22ffd7;
    margin-bottom: 1px;
}
.task-calendar-widget.seasonal .cal-month {
    background: none !important;
    color: #ffffff !important;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    padding: 0;
    line-height: 1;
    letter-spacing: 0.5px;
}

.task-check {
    margin-top: 0;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--color-bg-darkest);
    font-weight: bold;
    font-size: 11px;
    flex-shrink: 0;
}

.task-check:hover {
    border-color: var(--color-mint);
}

.task-body {
    flex-grow: 1;
    padding-right: 70px; /* Evitar solape con el badge de prioridad absoluto */
}

.task-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 2px;
    transition: opacity 0.4s ease, text-decoration 0.4s ease;
}

.crop-highlight {
    color: #22ffd7;
    font-weight: 700;
    text-shadow: 0 0 4px rgba(34, 255, 215, 0.2);
}

.task-desc {
    font-size: 12px;
    color: var(--color-text-main);
    margin-bottom: 4px;
    line-height: 1.35;
    transition: opacity 0.4s ease, text-decoration 0.4s ease;
}

.task-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 10px;
    color: var(--color-text-muted);
}

.task-item .priority-tag {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 8px;
    letter-spacing: 0.5px;
    line-height: 1;
}

/* Transiciones interactivas de chequeado (v5.1) */
.task-item.checked-completing .task-title,
.task-item.checked-completing .task-desc {
    text-decoration: line-through;
    text-decoration-color: #22ffd7;
    opacity: 0.5;
}
/* ==========================================================================
   FORMULARIOS
   ========================================================================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.input-style {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 14px;
    transition: var(--transition);
    color: #ffffff;
    background-color: rgba(0, 0, 0, 0.25);
}

.input-style:focus {
    outline: none;
    border-color: var(--color-mint);
    box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
    background-color: rgba(0, 0, 0, 0.4);
}

select.input-style option {
    background-color: var(--color-bg-dark);
    color: #ffffff;
}

textarea.input-style {
    resize: vertical;
}

.btn-submit {
    width: 100%;
    background-color: var(--color-terracotta);
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.btn-submit:hover {
    background-color: var(--color-terracotta-hover);
    box-shadow: 0 4px 15px rgba(200, 107, 81, 0.25);
}

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

.alert {
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.alert-success {
    background-color: rgba(82, 183, 136, 0.15);
    color: #a7f3d0;
    border: 1px solid rgba(82, 183, 136, 0.25);
}

.alert-error {
    background-color: rgba(216, 75, 75, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(216, 75, 75, 0.25);
}

/* ==========================================================================
   MODALES (ESTILO CRISTAL ESMERILADO OSCURO)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(6, 8, 7, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.modal-card {
    background-color: var(--color-bg-dark);
    border: 1px solid var(--color-card-border);
    border-radius: 16px;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: scale(0.95);
    opacity: 0;
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    max-height: 95vh;
    overflow-y: auto;
    padding: 0; /* Permite imágenes full bleed en cabecera */
}

.modal-large {
    max-width: 720px;
    padding: 28px; /* El formulario conserva padding normal */
}

@keyframes modalIn {
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 20px;
    color: #ffffff;
    cursor: pointer;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-close:hover {
    background-color: var(--color-terracotta);
    color: #ffffff;
}

.modal-header {
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-top: 4px;
}

.modal-header-padded {
    padding: 28px 28px 0 28px;
}

.modal-body-padded {
    padding: 20px 28px 28px 28px;
}

/* ==========================================================================
   CABECERA DE FOTO DE CULTIVO (FASE 3.5)
   ========================================================================== */
.dni-photo-header {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-bottom: 2px solid var(--color-mint);
    position: relative;
    background-size: cover;
    background-position: center;
    background-image: linear-gradient(135deg, var(--color-forest-dark) 0%, var(--color-forest) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dni-photo-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Icono decorativo de hoja cuando no hay fotografía cargada */
.dni-photo-header::after {
    content: '';
    position: absolute;
    opacity: 0.15;
    width: 80px;
    height: 80px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='M17 8C17 12.5 13.5 16.5 9 17C9 17 8 13.5 8 9C8 4.5 12.5 3 17 3C17 3 17 6.5 17 8Z'/%3E%3Cpath d='M21 21L12.5 12.5'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 1;
}

.dni-photo-header.has-image::after {
    display: none; /* Ocultar icono si hay imagen cargada */
}

/* ==========================================================================
   FICHA TÉCNICA (DNI DETALLE) Y CONTROL DE STOCK
   ========================================================================== */
.dni-badge {
    font-size: 10px;
    background-color: var(--color-terracotta);
    color: #ffffff;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 1px;
    display: inline-block;
}

.dni-scientific {
    display: block;
    font-size: 13px;
    color: var(--color-mint);
    font-style: italic;
    margin-top: 2px;
}

.dni-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

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

.dni-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
}

.dni-meta-item strong {
    color: var(--color-text-muted);
    font-weight: 500;
}

.dni-meta-item span {
    color: #ffffff;
}

/* Control e Incremento de Stock */
.dni-stock-editor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.stock-controls {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 2px;
    margin-left: 8px;
}

.btn-stock-adjust {
    background-color: var(--color-forest);
    color: #ffffff;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-stock-adjust:hover {
    background-color: var(--color-forest-hover);
    color: var(--color-mint);
}

.btn-stock-adjust:active {
    transform: scale(0.9);
}

.stock-val {
    font-size: 14px;
    font-weight: 700;
    min-width: 32px;
    text-align: center;
    color: #ffffff;
    display: inline-block;
}

.dni-stage-tag {
    font-size: 9px;
    background-color: var(--color-forest);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 6px;
}

.dni-right {
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding-left: 20px;
}

@media (max-width: 480px) {
    .dni-right {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding-left: 0;
        padding-top: 15px;
    }
}

.dni-title-sub {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.dni-param {
    margin-bottom: 10px;
    font-size: 13px;
}

.dni-param span {
    display: block;
    color: var(--color-text-muted);
    font-size: 11px;
}

.dni-param strong {
    color: #ffffff;
    font-size: 15px;
}

.dni-block {
    margin-bottom: 20px;
}

.dni-block p {
    font-size: 13px;
    color: var(--color-text-main);
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.02);
    padding: 10px 14px;
    border-radius: 6px;
}

.dni-weather-alert {
    border-radius: 8px;
    padding: 14px;
    margin-top: 10px;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.05);
    background-color: rgba(255, 255, 255, 0.02);
}

.dni-weather-alert.climate-ok {
    border-color: rgba(82, 183, 136, 0.2);
    background-color: rgba(82, 183, 136, 0.04);
}

.dni-weather-alert.climate-warn {
    border-color: rgba(239, 160, 53, 0.2);
    background-color: rgba(239, 160, 53, 0.04);
}

.dni-weather-alert.climate-danger {
    border-color: rgba(216, 75, 75, 0.2);
    background-color: rgba(216, 75, 75, 0.04);
}

.dni-weather-alert .alert-title {
    font-weight: 600;
    margin-bottom: 4px;
}

/* ==========================================================================
   FORMULARIO: PANEL DINÁMICO NUEVA ESPECIE
   ========================================================================== */
.new-species-panel {
    background-color: rgba(200, 107, 81, 0.03);
    border: 1px dashed rgba(200, 107, 81, 0.2);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

.panel-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-terracotta);
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(200, 107, 81, 0.1);
    padding-bottom: 4px;
}

/* ==========================================================================
   ANIMACIONES
   ========================================================================== */
@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(82, 183, 136, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(82, 183, 136, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(82, 183, 136, 0);
    }
}

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

/* ==========================================================================
   BOTONERA DE ACCIONES (ELIMINACIÓN - FASE 3.5.1)
   ========================================================================== */
.dni-actions-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: flex-end;
}

.btn-delete-planta {
    background-color: transparent;
    border: 1px solid var(--priority-urgente);
    color: var(--priority-urgente);
    padding: 10px 18px;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.btn-delete-planta:hover {
    background-color: var(--priority-urgente);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(216, 75, 75, 0.25);
}

.btn-delete-planta:active {
    transform: scale(0.98);
}

/* ==========================================================================
   ADMINISTRACIÓN Y CRUD (FASE 4.0)
   ========================================================================== */
.admin-tabs .filter-btn {
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
}

.admin-tabs .filter-btn.active {
    background-color: var(--color-mint);
    color: var(--color-bg-darkest);
    font-weight: 600;
}

.admin-tab-content {
    animation: fadeIn 0.3s ease;
}

#admin-zones-list, #admin-species-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

#admin-zones-list::-webkit-scrollbar, #admin-species-list::-webkit-scrollbar {
    width: 6px;
}

#admin-zones-list::-webkit-scrollbar-thumb, #admin-species-list::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Translucent warning pill/card stylings for DNI Weather Warning */
.dni-weather-alert.climate-warn {
    border: 1px solid rgba(200, 107, 81, 0.45) !important;
    background-color: rgba(200, 107, 81, 0.08) !important;
    color: #ffbca8 !important;
}

.dni-weather-alert.climate-danger {
    border: 1px solid rgba(216, 75, 75, 0.45) !important;
    background-color: rgba(216, 75, 75, 0.08) !important;
    color: #ffb5b5 !important;
}

/* Estilos para v4.7: Animaciones e iconos del DNI */
.dni-weather-alert i {
    display: inline-block;
    margin-right: 6px;
    animation: pulse-alert 2s infinite ease-in-out;
}

@keyframes pulse-alert {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.18);
        opacity: 0.65;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.dni-param i {
    color: #22ffd7;
    margin-right: 6px;
    font-size: 13px;
}

/* Estilos para v4.8: Soles decorativos del Catálogo */
.species-sun {
    color: #ffca3a !important;
    text-shadow: 0 0 5px rgba(255, 202, 58, 0.4);
    font-size: 11px;
}

/* Estilos para v4.9: Riego (Gotas) y Rediseño de Mini Fichas */
.species-droplet {
    color: #38bdf8 !important;
    text-shadow: 0 0 5px rgba(56, 189, 248, 0.4);
    font-size: 11px;
}

.plant-mini-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.plant-mini-icons {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sun-icons i {
    color: #ffca3a;
    text-shadow: 0 0 4px rgba(255, 202, 58, 0.4);
    font-size: 11px;
}

.droplet-icons i {
    color: #38bdf8;
    text-shadow: 0 0 4px rgba(56, 189, 248, 0.4);
    font-size: 11px;
}

.plant-mini-age-row {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.plant-mini-warning-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: rgba(216, 75, 75, 0.12);
    color: #ffb5b5;
    border: 1px solid rgba(216, 75, 75, 0.3);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-top: 6px;
    width: fit-content;
}

.plant-mini-warning-badge i {
    animation: pulse-alert 2s infinite ease-in-out;
    color: #d84b4b;
}

/* Estilos para v5.0: Central de Alertas Globales */
.pulse-alert-icon {
    display: inline-block;
    animation: pulse-bell 2s infinite ease-in-out;
}

@keyframes pulse-bell {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 2px rgba(34, 255, 215, 0.4));
    }
    50% {
        transform: scale(1.2);
        filter: drop-shadow(0 0 10px rgba(34, 255, 215, 0.8));
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 2px rgba(34, 255, 215, 0.4));
    }
}
