/* --- GOOGLE FONTS ICONS --- */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  font-size: inherit;
  line-height: 1;
  display: inline-block;
}

/* --- 1. VARIABLES & THÈMES (Lumineux par défaut) --- */
:root {
    --primary: #2ecc71;
    --primary-light: #eafff1;
    --primary-dark: #27ae60;
    --bg-app: #f4f7f6;
    --bg-card: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --danger: #e74c3c;
    --warning: #f39c12;
    --accent: #3498db;
    --border: #edf2f7;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    
    /* Couleurs spécifiques Arrosage (Mode Clair) */
    --water-bg: #e0f2fe;
    --nutrient-bg: #eafff1;
}

/* --- 2b. MODE SOMBRE MANUEL (Classe .dark-mode) --- */
body.dark-mode {
    --bg-app: #121212;
    --bg-card: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --border: #333333;
    --shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    --primary-light: #1b2e22;
    
    --water-bg: #0c4a6e;
    --nutrient-bg: #064e3b;
}

/* --- 3. BASE & RESET --- */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.4;
    transition: background 0.3s, color 0.3s;
}

.container { max-width: 900px; margin: 0 auto; padding: 15px; }
a { text-decoration: none; transition: 0.3s; }
.subtitle { color: var(--text-muted); font-size: 0.95rem; margin-top: 5px; margin-bottom: 20px; }

/* --- 4. NAVIGATION --- */
.nav-bar {
    background: var(--bg-card);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.nav-left, .nav-right { display: flex; align-items: center; gap: 15px; }
.nav-header-title { font-weight: bold; color: var(--text-muted); font-size: 0.9rem; }
.nav-link-secondary { color: var(--text-muted); font-weight: 500; }
.nav-link-danger { color: var(--danger); font-weight: 600; }

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-right: 10px;
    font-size: 0.8rem;
    font-weight: bold;
}
.lang-switcher a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 4px;
}
.lang-switcher a.active {
    color: var(--primary);
}
.lang-switcher span { color: var(--border); }

/* --- 5. COMPOSANTS : CARTES & GRILLES --- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 15px;
}

/* Grille de capteurs compacte (Index) */
.sensor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.sensor-card {
    background: var(--bg-card);
    padding: 12px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.sensor-card .label { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); font-weight: bold; }
.sensor-card .value { font-size: 1.4rem; font-weight: bold; color: var(--primary); margin-top: 4px; }

/* Grille des prises (Index) */
.grid-switches { 
    display: grid; 
    gap: 10px; 
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
}
.led-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.led { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e0; transition: 0.3s; }
.led-on { background: var(--primary); box-shadow: 0 0 8px var(--primary); }

/* --- 6. ÉDITEUR DE PRESETS (Compact & Flex) --- */
.cycle-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.cycle-card .form-group { margin: 0; flex: 1; min-width: 120px; }
.cycle-card label { font-size: 0.7rem; margin-bottom: 2px; font-weight: bold; color: var(--text-muted); }

/* --- 7. BOUTONS & ACTIONS --- */
.btn {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
}
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 6px; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--primary-dark); color: white; }
.btn-secondary { background: #e2e8f0; color: #4a5568; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-xl { padding: 14px; font-size: 1rem; width: 100%; }

/* Bouton Icône (Thème, etc.) */
.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}
.btn-icon:hover { background: rgba(0,0,0,0.05); }
body.dark-mode .btn-icon:hover { background: rgba(255,255,255,0.1); }

/* Icone thème en gris (comme les langues) quand on est en mode sombre */
body.dark-mode #theme-toggle { color: var(--text-muted); }

#menu-toggle {
    display: none; /* Caché par défaut sur desktop */
}

/* Bouton Supprimer Moderne (Remplacement croix moche) */
.btn-remove {
    background: #ff4757;
    color: white;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: 0.2s;
}
.btn-remove:hover { background: #ff6b81; transform: scale(1.1); text-decoration: none; }

/* --- 8. TABLEAUX & SYNC --- */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th { text-align: left; padding: 12px 10px; color: var(--text-muted); border-bottom: 2px solid var(--border); }
.data-table td { padding: 10px; border-bottom: 1px solid var(--border); }

/* Alignement icônes dans sidebar */
.sidebar-link { display: flex; align-items: center; gap: 10px; }
.sidebar-link .material-symbols-outlined { font-size: 1.3rem; }

.button-group { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.size-tag { background: var(--border); padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 0.8rem; }

/* --- 9. FORMULAIRES --- */
.input-main, .select-main {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-app);
    color: var(--text-main);
    font-size: 0.9rem;
}
.input-main:focus { border-color: var(--primary); outline: none; background: var(--bg-card); }
.form-group { margin-bottom: 15px; }

/* --- Checkbox Group (Profil/Config) --- */
.checkbox-group { 
    display: flex; 
    align-items: center; 
    background: var(--bg-app); 
    padding: 12px; 
    border-radius: var(--radius-sm); 
    border: 1px solid var(--border); 
    margin-bottom: 10px; 
}
.checkbox-group input { margin-right: 12px; width: 20px; height: 20px; accent-color: var(--primary); }
.checkbox-group label { margin: 0; cursor: pointer; flex: 1; font-weight: 500; color: var(--text-main); }
.checkbox-group small { display: block; color: var(--text-muted); font-weight: normal; margin-top: 2px; font-size: 0.85em; }

/* --- 10. AUTH & ALERTES --- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-app) 0%, #e0f2fe 100%);
}
body.dark-mode .auth-page { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); }

.auth-container { width: 100%; max-width: 400px; padding: 20px; }
.auth-form { padding: 40px; border-radius: 24px; box-shadow: 0 20px 40px rgba(0,0,0,0.08); border: none; }

.auth-header { text-align: center; margin-bottom: 30px; }
.logo-placeholder { 
    font-size: 3.5rem; margin-bottom: 15px; display: flex; align-items: center; justify-content: center;
    background: var(--primary-light); width: 90px; height: 90px; 
    line-height: 90px; border-radius: 50%; 
    box-shadow: 0 10px 20px rgba(46, 204, 113, 0.2);
}

.auth-footer { text-align: center; margin-top: 25px; font-size: 0.9rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 700; transition: color 0.2s; }
.auth-footer a:hover { color: var(--primary-dark); text-decoration: underline; }
.auth-footer .material-symbols-outlined { font-size: 1.2rem; vertical-align: middle; }

.alert { padding: 12px; border-radius: var(--radius-sm); margin-bottom: 15px; text-align: center; font-size: 0.85rem; font-weight: 500; }
.alert-success { background: var(--primary-light); color: var(--primary-dark); }
.alert-error { background: #fff5f5; color: var(--danger); }

.badge { padding: 4px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: bold; }
.badge-success { background: var(--primary-light); color: var(--primary-dark); border: 1px solid var(--primary); }

/* --- 11. RESPONSIVE --- */
@media (max-width: 600px) {
    .nav-bar { flex-direction: column; padding: 15px; gap: 10px; }
    .cycle-card { flex-direction: column; align-items: stretch; }
    .sensor-grid { grid-template-columns: 1fr 1fr; }
}

.hidden { display: none; }
.full-width { width: 100%; }
.mt-10 { margin-top: 10px; }
/* --- PAGE SELECT BOX SPECIFIC --- */
.box-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 120px;
    justify-content: space-between;
    transition: transform 0.2s, border-color 0.2s;
    text-decoration: none;
}

.box-card-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Force la visibilité du texte en mode sombre sur les cartes */
.box-nickname {
    margin: 0;
    color: var(--primary); /* Utilise le vert pour le nom */
    font-size: 1.2rem;
}

.box-id {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-start;
}

/* Structure de la pastille (La fameuse pastille manquante) */
.box-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.status-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Pastille de couleur */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online {
    background-color: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

.status-dot.paused {
    background-color: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

.status-dot.offline {
    background-color: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}
.select-main, select {
    appearance: none;
    background-color: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 10px 35px 10px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237f8c8d' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all 0.2s;
}

.select-main:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
/* --- LAYOUT SIDEBAR --- */
.layout-with-sidebar {
    display: flex;
    flex-wrap: wrap; /* Permet au header de prendre 100% */
    min-height: 100vh; /* Assure que le footer reste en bas si contenu court */
    padding-top: 0; /* Le header est maintenant dans le flux */
}

.sidebar {
    width: 240px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px;
    /* Ajustement pour coller sous le header si besoin, ou rester en flux normal */
    min-height: calc(100vh - 80px); /* Hauteur totale moins hauteur approx header */
}

.sidebar-brand { font-size: 1.3rem; font-weight: 800; color: var(--primary); margin-bottom: 30px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.sidebar-link { padding: 12px; border-radius: 10px; color: var(--text-main); font-weight: 600; }
.sidebar-link:hover { background: var(--bg-app); color: var(--primary); }
.admin-link { color: var(--accent); border: 1px dashed var(--accent); }
.sidebar-spacer { flex: 1; }

.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    width: calc(100% - 240px); /* Largeur restante */
}

/* Sidebar Mobile spécifique (cachée sur desktop) */
.mobile-sidebar { display: none; }

.close-sidebar-btn {
    position: absolute; top: 15px; right: 15px;
    background: none; border: none; font-size: 2rem;
    color: var(--text-muted); cursor: pointer;
    z-index: 2001;
}

/* --- RESPONSIVE LAYOUT --- */
@media (max-width: 850px) {
    .layout-with-sidebar {
        flex-direction: column;
    }
    .desktop-sidebar {
        display: none; 
    }
    .mobile-sidebar {
        display: flex; /* On affiche la sidebar mobile */
        position: fixed;
        left: -280px; /* Cachée par défaut (marge de sécurité) */
        top: 0;
        height: 100%;
        z-index: 2000; /* Au-dessus de tout (Chart.js, Modales...) */
        transition: left 0.3s ease-in-out, visibility 0.3s;
        box-shadow: 5px 0 15px rgba(0,0,0,0.2);
        visibility: hidden; /* Pour éviter les clics fantômes */
    }
    body.sidebar-open .sidebar {
        left: 0;
        visibility: visible;
    }
    .main-content {
        width: 100%;
        padding: 15px;
    }
    #menu-toggle {
        display: flex !important; /* Afficher le bouton burger (force) */
    }
    .nav-bar .brand, .nav-bar .nav-link-secondary {
        display: none; /* Cacher le logo/lien retour sur mobile */
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1999; /* Juste sous la sidebar */
    }
    body.sidebar-open .sidebar-overlay {
        display: block;
    }
    
    /* Réduction hauteur Preset Card sur mobile */
    .preset-selection-card { 
        padding: 8px 12px !important; 
        min-height: auto !important; 
        flex: 0 0 auto !important; /* Ne pas s'étendre inutilement */
    }
    .preset-selection-card .label-mini { margin-bottom: 4px; font-size: 0.7rem; }
    .preset-selection-card .form-compact { margin-bottom: 0; }
}

/* --- RESPONSIVE INDEX.PHP --- */
@media (max-width: 600px) {
    .chart-container-large {
        display: none;
    }
    .inactive-switch {
        display: none;
    }
    .sensor-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- TOP NAV DANS LE CONTENU --- */
.top-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

/* --- ACTION ROW (ARROSAGE LUDIQUE) --- */
.action-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}
.preset-card { flex: 2; margin-bottom: 0; }

.btn-water-playful {
    flex: 1;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    border-radius: 18px;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-water-playful:hover { transform: scale(1.03); background: var(--accent); }
.btn-water-playful:active { transform: scale(0.95); }
.water-icon { font-size: 2rem; margin-bottom: 5px; display: block; }
.water-text { font-weight: bold; font-size: 0.9rem; }

/* Responsive */
@media (max-width: 850px) {
    .layout-with-sidebar { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
    .action-row { flex-direction: column; }
}
/* --- ACTION ROW HARMONISÉE --- */
.action-row {
    display: flex;
    gap: 15px;
    align-items: stretch; /* Pour que les deux blocs aient la même hauteur */
    margin-bottom: 20px;
}

/* Le bloc preset devient compact */
.preset-card-compact {
    flex: 0 1 auto; /* Ne prend que la place nécessaire */
    min-width: 250px;
    margin-bottom: 0;
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.label-mini {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: bold;
    margin-bottom: 4px;
}

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

.select-main-sm {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-app);
    color: var(--text-main);
    font-size: 0.9rem;
    flex: 1;
}

.btn-sm-square {
    padding: 6px 12px;
    min-width: 45px;
}

/* Le bloc arrosage reste ludique mais s'aligne */
.watering-action {
    flex: 1; /* Prend le reste de l'espace de manière élégante */
}

.btn-water-playful {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    border-radius: var(--radius);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center; /* Alignement horizontal pour gagner de la place en hauteur */
    justify-content: center;
    gap: 15px;
    padding: 10px 20px;
    transition: 0.3s ease;
}

.water-icon {
    font-size: 1.8rem; display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.water-text-main {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

/* Responsive : On empile sur mobile */
@media (max-width: 600px) {
    .action-row {
        flex-direction: column;
    }
    .preset-card-compact {
        width: 100%;
    }
}
/* --- TOP BAR --- */
.dashboard-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.active-preset-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- ACTION ROW COMPACTE --- */
.action-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: stretch;
}

.preset-selection-card {
    flex: 0 0 300px; /* Largeur fixe pour le sélecteur */
    padding: 10px 15px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.flex-spacer { flex-grow: 1; }

/* --- NOUVEAUX MODULES ARROSAGE (PILLS) --- */
.watering-action-group {
    flex: 1;
    min-width: 280px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.water-pill {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 54px;
    color: white;
    border: 1px solid rgba(0,0,0,0.05);
    max-width: 280px; /* Limite la largeur quand le bouton est seul */
}

.water-pill:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.15); }

.water-blue { background: linear-gradient(135deg, #3498db, #2980b9); }
.water-purple { background: linear-gradient(135deg, #9b59b6, #8e44ad); }

.water-btn-content {
    background: transparent; border: none; color: white;
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; padding: 0 15px; flex-grow: 1;
    text-align: left; font-family: inherit; transition: background 0.2s;
    min-width: 0; /* Permet au texte de rétrécir si manque de place */
}
.water-btn-content:hover { background: rgba(255,255,255,0.1); }

.water-icon { font-size: 1.3rem; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1)); display: inline-block; }
.water-label { font-weight: 700; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.water-input-group {
    background: rgba(0, 0, 0, 0.2); padding: 0 12px;
    display: flex; align-items: center; justify-content: center;
    min-width: 70px; border-left: 1px solid rgba(255,255,255,0.1);
}

.water-input {
    width: 100%; background: transparent; border: none; color: white;
    font-weight: 800; font-size: 1.1rem; text-align: right;
    padding: 0; outline: none; -moz-appearance: textfield;
}
.water-input::-webkit-outer-spin-button, .water-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.unit {
    color: rgba(255,255,255,0.8); font-size: 0.75rem;
    margin-left: 4px; font-weight: 600; margin-top: 2px;
}

/* --- FOOTER ACTIONS ADMIN RF --- */
.admin-actions-group {
    display: flex;
    justify-content: space-between;
}

/* On force les boutons à ne pas prendre toute la largeur */
.admin-actions-group .btn {
    width: auto;               /* Annule le full-width */
    min-width: 180px;          /* Garde une taille minimale pour le clic */
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* Style spécifique pour le bouton d'ajout pour le différencier de la sauvegarde */
.btn-add-secondary {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-add-secondary:hover {
    background: var(--bg-app);
    border-color: var(--text-muted);
}

/* --- 12. ÉDITEUR DE PRESET & MODAL --- */

/* --- Conteneurs généraux de l'éditeur --- */
.global-settings { 
    background: var(--bg-app); 
    padding: 20px; 
    border-radius: var(--radius); 
    margin-bottom: 25px; 
    border: 1px solid var(--border); 
}
.global-settings h3 { 
    margin-top: 0; 
    color: var(--text-muted); 
    font-size: 0.9rem; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
}

.rule-card {
    background: var(--bg-card); 
    border: 1px solid var(--border); 
    padding: 20px; 
    margin-bottom: 15px; 
    border-radius: var(--radius);
    box-shadow: var(--shadow); 
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
.rule-card:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 15px rgba(0,0,0,0.07); 
}

.add-btn-dashed {
    width: 100%; 
    border: 2px dashed var(--border); 
    background: transparent;
    color: var(--text-muted); 
    padding: 15px; 
    border-radius: var(--radius);
    font-weight: 600; 
    cursor: pointer; 
    transition: 0.2s;
}
.add-btn-dashed:hover { 
    border-color: var(--primary); 
    color: var(--primary); 
    background: var(--primary-light); 
}

/* --- Interface "Phrases à trous" --- */
.sentence-container { 
    font-size: 1.1rem; 
    line-height: 2.4rem; 
    color: var(--text-main); 
}

.hole {
    display: inline-block; 
    border: 1px solid var(--border); 
    border-radius: 8px;
    background: var(--bg-app); 
    color: var(--text-main); 
    font-weight: 600;
    padding: 4px 12px; 
    margin: 0 4px; 
    font-size: 0.9rem;
    transition: all 0.2s; 
    cursor: pointer;
    vertical-align: middle; 
    height: 38px; 
    line-height: 1.5;
    box-sizing: border-box;
}
.hole:focus, .hole:hover { 
    border-color: var(--primary); 
    background: var(--bg-card); 
    outline: none; 
    box-shadow: 0 0 0 3px var(--primary-light); 
}

select.hole { 
    padding-right: 30px; 
}

.delete-btn { 
    position: absolute; 
    top: 15px; 
    right: 15px;
    width: 28px; 
    height: 28px; 
    border-radius: 50%;
    background: var(--bg-app); 
    color: var(--danger); 
    border: none;
    display: flex; 
    align-items: center; 
    justify-content: center;
    cursor: pointer; 
    font-weight: bold; 
    transition: 0.2s;
}
.delete-btn:hover { 
    background: var(--danger); 
    color: white; 
    transform: scale(1.1);
}

/* --- MODAL & ACTION BUTTONS --- */
.btn-icon-action { background: none; border: none; cursor: pointer; padding: 0; transition: transform 0.2s; }
.btn-icon-action:hover { transform: scale(1.2); }
.text-danger { color: var(--danger); }
.text-success { color: var(--primary); }

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-content {
    background: var(--bg-card); width: 90%; max-width: 450px;
    border-radius: var(--radius); padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center; transform: translateY(20px); transition: 0.3s;
}
.modal-overlay.active .modal-content { transform: translateY(0); }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.modal-header h3 { margin: 0; display: flex; align-items: center; gap: 10px; }
.close-modal { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }
.modal-footer { margin-top: 25px; display: flex; justify-content: flex-end; gap: 10px; }

/* --- TOGGLE SWITCH (Bouton à bascule) --- */
.toggle-switch {
    position: relative; display: inline-block; width: 50px; height: 26px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc; transition: .4s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: "";
    height: 18px; width: 18px; left: 4px; bottom: 4px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary); }
input:focus + .slider { box-shadow: 0 0 1px var(--primary); }
input:checked + .slider:before { transform: translateX(24px); }

/* --- FIX CHART HEIGHT --- */
.chart-container-large {
    position: relative;
    height: 300px;
    width: 100%;
}

/* --- AUTOCOMPLETE SUGGESTIONS --- */
.autocomplete-container { position: relative; }
.suggestions-list {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 0 0 8px 8px; z-index: 1000;
    max-height: 200px; overflow-y: auto; box-shadow: var(--shadow);
}
.suggestion-item {
    padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
    font-size: 0.9rem; color: var(--text-main);
}
.suggestion-item:hover { background: var(--bg-app); color: var(--primary); }
.suggestion-item:last-child { border-bottom: none; }