@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

:root {
    /* PALETA CYBER GARDEN (DARK) */
    --bg-color: #0f172a;      /* Azul noche muy oscuro */
    --bg-dashboard: #0f172a;  /* Mismo fondo */
    --card-bg: #1e293b;       /* Gris azulado (Tarjetas) */
    
    --primary-btn: #10b981;   /* Verde Neón */
    --primary-hover: #059669;
    
    --text-color: #e2e8f0;    /* Blanco grisaceo */
    --text-muted: #94a3b8;    /* Gris medio */
    
    --error-color: #f43f5e;   /* Rojo neón */
    --success-bg: rgba(16, 185, 129, 0.2);
    --success-text: #34d399;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }

body {
    background-color: var(--bg-color); color: var(--text-color);
    height: 100vh; display: flex; justify-content: center; align-items: center;
}

.login-container {
    background: var(--card-bg); padding: 2.5rem; border-radius: 16px;
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.1); width: 400px; text-align: center; border: 1px solid #334155;
}

.logo-area { margin-bottom: 20px; color: var(--primary-btn); }
.logo-area i { font-size: 3.5rem; text-shadow: 0 0 15px rgba(16, 185, 129, 0.5); }
.logo-area h1 { font-size: 1.8rem; color: white; font-weight: 700; letter-spacing: 1px; }

h2 { color: white; margin-bottom: 5px; font-size: 1.4rem; }
p.subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 25px; }

.input-group { margin-bottom: 15px; text-align: left; }
.input-group input {
    width: 100%; padding: 12px; border: 1px solid #334155; background-color: #0f172a; color: white;
    border-radius: 8px; font-size: 1rem; outline: none; transition: 0.3s;
}
.input-group input:focus { border-color: var(--primary-btn); box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2); }

.btn-primary {
    width: 100%; padding: 12px; background-color: var(--primary-btn);
    color: #0f172a; border: none; border-radius: 8px; /* Texto oscuro en botón neón */
    font-size: 1rem; font-weight: 700; cursor: pointer; transition: 0.3s; margin-top: 10px;
}
.btn-primary:hover { background-color: #34d399; box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }

.switch-auth { margin-top: 20px; font-size: 0.9rem; color: var(--text-muted); }
.switch-auth a { color: var(--primary-btn); text-decoration: none; font-weight: 600; cursor: pointer; }

.hidden { display: none !important; }
.error-msg { color: #f43f5e; font-size: 0.9rem; margin-top: 10px; display: none; border: 1px solid #881337; padding: 8px; border-radius: 8px; background: #4c0519; }

/* DASHBOARD */
.dashboard-container { display: flex; width: 100%; height: 100vh; background-color: var(--bg-dashboard); }

.sidebar { width: 260px; background: #1e293b; padding: 20px; display: flex; flex-direction: column; border-right: 1px solid #334155; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; color: var(--primary-btn); margin-bottom: 40px; padding-left: 10px; }
.menu a {
    display: flex; align-items: center; gap: 12px; padding: 15px; color: var(--text-muted);
    text-decoration: none; border-radius: 8px; margin-bottom: 8px; transition: 0.3s; font-weight: 500;
}
.menu a:hover, .menu a.active { background-color: rgba(16, 185, 129, 0.1); color: var(--primary-btn); }
.menu a.logout { margin-top: auto; color: var(--error-color); }

.main-content { flex: 1; padding: 30px; overflow-y: auto; }

header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
header h1 { color: white; font-size: 1.8rem; font-weight: 700; }

.status-badge {
    background: rgba(16, 185, 129, 0.15); color: #34d399; padding: 8px 15px;
    border-radius: 20px; font-size: 0.9rem; display: flex; align-items: center; gap: 5px; font-weight: 600; border: 1px solid rgba(16, 185, 129, 0.3);
}

.card {
    background: var(--card-bg); border-radius: 16px; padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2); border: 1px solid #334155;
}

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 20px; }
.stat-card { display: flex; align-items: center; gap: 20px; }

.icon-box { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; background: #334155; }
.icon-box.water { color: #38bdf8; }
.icon-box.temp { color: #fbbf24; }
.icon-box.leaf { color: #4ade80; }

.info h3 { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; margin-bottom: 5px;}
.info h2 { font-size: 2.2rem; color: white; font-weight: 700; line-height: 1; }
.info p { font-size: 0.85rem; color: var(--text-muted); margin-top: 5px;}

.alert-card { border: 1px solid var(--error-color); background-color: rgba(244, 63, 94, 0.1); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(244, 63, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); } }

.bottom-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; min-height: 400px; }
.chart-wrapper { position: relative; height: 300px; width: 100%; }

.config-section input {
    width: 100%; padding: 10px; margin: 8px 0 15px 0;
    border: 1px solid #475569; border-radius: 8px; outline: none; background: #0f172a; color: white;
}
.config-section input:focus { border-color: var(--primary-btn); }
.config-section .row { display: flex; gap: 10px; }
.btn-save { width: 100%; background: var(--primary-btn); color: #0f172a; border: none; padding: 12px; border-radius: 8px; cursor: pointer; font-weight: 700; }

/* DROPDOWN */
.subtitle-container { display: flex; align-items: center; gap: 10px; color: var(--text-muted); margin-top: 5px; }
.custom-dropdown { position: relative; display: inline-block; font-family: 'Poppins', sans-serif; }
.dropdown-trigger {
    background-color: #334155; color: white; padding: 8px 15px; border-radius: 12px; cursor: pointer;
    font-weight: 600; display: flex; align-items: center; gap: 8px; transition: all 0.3s ease; border: 1px solid #475569;
}
.dropdown-trigger:hover { border-color: var(--primary-btn); }
.dropdown-trigger.active { border-color: var(--primary-btn); background-color: #1e293b; box-shadow: 0 0 10px rgba(16, 185, 129, 0.2); }
.dropdown-trigger i { transition: transform 0.3s ease; }
.dropdown-trigger.active i { transform: rotate(180deg); }

.dropdown-menu {
    position: absolute; top: 120%; left: 0; background: #1e293b; min-width: 220px; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); padding: 8px; list-style: none; z-index: 100;
    opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.2s ease; border: 1px solid #475569;
}
.dropdown-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu li {
    padding: 10px 12px; border-radius: 8px; color: #cbd5e1; cursor: pointer; transition: background 0.2s; display: flex; align-items: center; gap: 8px; font-size: 0.95rem;
}
.dropdown-menu li:hover { background-color: #334155; color: var(--primary-btn); }
.dropdown-menu li.selected { background-color: rgba(16, 185, 129, 0.1); color: var(--primary-btn); font-weight: 700; }

/* TABLAS y GRID */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 15px; border-bottom: 1px solid #334155; color: var(--text-muted); font-weight: 600; font-size: 0.9rem; text-align: left; background: var(--card-bg);}
.data-table td { padding: 15px; border-bottom: 1px solid #334155; color: #e2e8f0; font-size: 0.95rem; }
.action-btn { background: none; border: none; cursor: pointer; font-size: 1.2rem; margin-right: 10px; color: var(--text-muted); }
.action-btn:hover { color: white; }

.all-plants-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 20px; }
.plant-summary-card { background: var(--card-bg); padding: 20px; border-radius: 16px; border: 1px solid #334155; box-shadow: 0 4px 6px rgba(0,0,0,0.2); transition: all 0.3s ease; cursor: pointer; }
.plant-summary-card:hover { transform: translateY(-5px); border-color: var(--primary-btn); box-shadow: 0 0 20px rgba(16, 185, 129, 0.15); }
.plant-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid #334155; padding-bottom: 10px; }
.plant-title { font-size: 1.1rem; font-weight: 700; color: white; }
.plant-stats { display: flex; justify-content: space-between; }
.p-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.p-value { font-size: 1.2rem; font-weight: 700; color: white; }