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

:root {
    --bg: #1a1a2e;
    --bg-tile: #16213e;
    --bg-tile-hover: #1a2744;
    --text: #e8e8e8;
    --text-muted: #8892a4;
    --accent: #4fc3f7;
    --accent2: #81c784;
    --danger: #ef5350;
    --warning: #ffa726;
    --green: #4caf50;
    --yellow: #ffeb3b;
    --orange: #ff9800;
    --red: #f44336;
    --radius: 12px;
    --gap: 10px;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* DASHBOARD */
.dashboard {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: var(--gap);
    gap: var(--gap);
}

.grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: var(--gap);
    min-height: 0;
}

.tile {
    background: var(--bg-tile);
    border-radius: var(--radius);
    padding: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tile h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
    flex-shrink: 0;
}

/* CLOCK */
.tile-clock {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.clock {
    font-size: 4rem;
    font-weight: 200;
    letter-spacing: -2px;
    line-height: 1;
    color: var(--accent);
}
.date {
    font-size: 1.1rem;
    margin-top: 6px;
    color: var(--text-muted);
}
.fete {
    font-size: 0.9rem;
    margin-top: 4px;
    color: var(--accent2);
}
.sun-times {
    font-size: 0.8rem;
    margin-top: 8px;
    color: var(--text-muted);
}
.air-quality {
    font-size: 0.8rem;
    margin-top: 4px;
}

/* WEATHER TODAY */
.weather-current {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.weather-icon-big { font-size: 2.8rem; }
.weather-temp-big { font-size: 2.8rem; font-weight: 300; }
.weather-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.advice {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.advice-item {
    font-size: 0.8rem;
    background: rgba(255,255,255,0.05);
    padding: 3px 8px;
    border-radius: 6px;
}

/* DRIVING */
.driving-info {
    background: rgba(79,195,247,0.1);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 8px;
}
.driving-detail { font-size: 0.7rem; color: var(--text-muted); }

/* RER A */
.departures { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.departure-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.dep-dest { font-size: 0.85rem; }
.dep-time {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 60px;
    text-align: right;
}
.dep-imminent { color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }
.disruptions { margin-top: 6px; }
.disruption {
    font-size: 0.75rem;
    color: var(--warning);
    padding: 2px 0;
}
.tile-footer {
    margin-top: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
}

/* FORECAST */
.forecast-grid {
    display: flex;
    gap: 4px;
    flex: 1;
    align-items: stretch;
}
.forecast-day {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    border-radius: 8px;
}
.forecast-today { background: rgba(79,195,247,0.1); }
.forecast-name { font-size: 0.75rem; font-weight: 600; }
.forecast-icon { font-size: 1.4rem; }
.forecast-temps { display: flex; flex-direction: column; align-items: center; font-size: 0.8rem; }
.temp-max { color: var(--text); font-weight: 600; }
.temp-min { color: var(--text-muted); font-size: 0.7rem; }
.forecast-precip { font-size: 0.65rem; color: var(--accent); }

/* TRASH */
.trash-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
}
.trash-today { color: var(--danger); font-weight: 600; }
.trash-tomorrow { color: var(--warning); }

/* GARDEN */
.garden-alert {
    background: rgba(255,152,0,0.15);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: var(--warning);
}
.garden-tips {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.garden-tips li {
    font-size: 0.8rem;
    padding: 3px 0;
    padding-left: 12px;
    position: relative;
}
.garden-tips li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent2);
}

/* MAINTENANCE */
.maintenance-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
}
.maintenance-overdue, .maintenance-today { color: var(--danger); font-weight: 600; }
.maintenance-soon, .maintenance-week { color: var(--warning); }
.maintenance-two_weeks, .maintenance-upcoming { color: var(--accent); }
.maintenance-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    padding: 4px 0;
}
.maintenance-detail {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0 0 4px 24px;
}

/* ALERT BANNER */
.alert-banner {
    padding: 6px 16px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}
.alert-jaune { background: rgba(255,235,59,0.15); color: var(--yellow); }
.alert-orange { background: rgba(255,152,0,0.2); color: var(--orange); }
.alert-rouge { background: rgba(244,67,54,0.2); color: var(--red); }
.alert-scroll { white-space: nowrap; animation: scroll 20s linear infinite; }
@keyframes scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* BOTTOM BAR */
.bottom-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 6px 12px;
    background: var(--bg-tile);
    border-radius: var(--radius);
    font-size: 0.75rem;
    flex-shrink: 0;
}
.alert-item { display: flex; align-items: center; gap: 6px; }
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.dot-vert { background: var(--green); }
.dot-jaune { background: var(--yellow); }
.dot-orange { background: var(--orange); }
.dot-rouge { background: var(--red); }
.admin-link {
    margin-left: auto;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1rem;
}

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

/* LOGIN */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-box {
    background: var(--bg-tile);
    padding: 40px;
    border-radius: var(--radius);
    text-align: center;
    width: 320px;
}
.login-box h1 {
    font-size: 2rem;
    margin-bottom: 24px;
}
.login-box input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 16px;
}
.login-box input:focus {
    outline: none;
    border-color: var(--accent);
}
.login-box button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #000;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

/* ADMIN */
.admin-container {
    max-width: 700px;
    margin: 20px auto;
    padding: 20px;
    overflow-y: auto;
    height: 100vh;
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
fieldset {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
legend {
    font-weight: 600;
    padding: 0 8px;
    color: var(--accent);
}
label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 8px 0 4px;
}
.admin-container input[type="text"],
.admin-container input[type="email"],
.admin-container input[type="number"],
.admin-container input[type="password"],
.admin-container input[type="date"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    color: var(--text);
    font-size: 0.9rem;
}
.admin-container input:focus {
    outline: none;
    border-color: var(--accent);
}
small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
}
small a { color: var(--accent); }
code {
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    word-break: break-all;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-secondary { background: rgba(255,255,255,0.1); color: var(--text); }
.btn-back { background: rgba(255,255,255,0.1); color: var(--text); font-size: 0.85rem; padding: 6px 14px; }

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.85rem;
}
.alert-success { background: rgba(76,175,80,0.15); color: var(--green); }
.alert-error { background: rgba(244,67,54,0.15); color: var(--danger); }

/* Responsive - portrait tablet */
@media (max-width: 900px) {
    .grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }
    .clock { font-size: 3rem; }
}
@media (max-width: 600px) {
    .grid {
        grid-template-columns: 1fr;
    }
    .dashboard { overflow-y: auto; height: auto; }
}
