:root {
    --bg-color: #0b0f17;         /* Noir profond / Carbone technique */
    --card-bg: #141a24;          /* Gris foncé Premium pour les blocs */
    --text-color: #ffffff;       /* Blanc pur pour une lisibilité maximale */
    --text-muted: #7ee7ff;       /* Bleu clair/cyan atténué pour les notes */
    --primary: #00d2ff;          /* Bleu Cyan Électrique FX-CCR (Identité iqsub) */
    --primary-hover: #00a8cc;    /* Bleu Cyan plus sombre au survol */
    --accent: #ff3b30;           /* Rouge alerte de sécurité */
    --success: #00e676;          /* Vert éclatant pour les validations */
    --border: #222f44;           /* Bordures bleutées sombres discrètes */
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background-color: var(--bg-color); color: var(--text-color); padding-bottom: 50px; }
.container { max-width: 1100px; margin: 0 auto; padding: 20px; }
header { background-color: var(--card-bg); border-bottom: 1px solid var(--border); padding: 15px 0; }
.header-container { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; }
select { background: var(--bg-color); color: var(--text-color); border: 1px solid var(--border); padding: 8px 12px; border-radius: 6px; cursor: pointer; font-weight: bold; }
.pwa-banner { display: none; background-color: var(--primary); color: #000; padding: 12px; text-align: center; font-weight: bold; cursor: pointer; }
.tabs { display: flex; justify-content: center; background: var(--card-bg); border-bottom: 1px solid var(--border); }
.tab-btn { background: none; border: none; color: var(--text-muted); padding: 15px 25px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: 0.2s; }
.tab-btn.active { color: var(--primary); border-bottom: 3px solid var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; margin-top: 20px; }
.list-management-bar { background: var(--card-bg); border: 1px solid var(--border); padding: 15px; border-radius: 8px; margin-bottom: 20px; display: flex; align-items: center; gap: 15px; }
.list-management-bar select { font-size: 1rem; padding: 10px; width: 350px; border-color: var(--primary); }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.checklist-container { display: flex; flex-direction: column; gap: 12px; }
.checklist-item { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);  background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; transition: border 0.2s; }
.checklist-item.checked { border-color: var(--success); opacity: 0.6; }
.item-main { display: flex; align-items: center; padding: 16px; cursor: pointer; user-select: none; }
.item-checkbox { width: 22px; height: 22px; margin-right: 15px; cursor: pointer; accent-color: var(--success); }
.item-title { flex-grow: 1; font-size: 1.05rem; font-weight: 500; }
.checklist-item.checked .item-title { text-decoration: line-through; color: var(--text-muted); }
.item-toggle-icon { color: var(--text-muted); font-size: 0.8rem; transition: transform 0.2s; margin-left: 10px; }
.checklist-item.expanded .item-toggle-icon { transform: rotate(180deg); }
.item-details { display: none; padding: 14px 16px 16px 53px; color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; border-top: 1px solid rgba(255,255,255,0.05); background: rgba(0,0,0,0.15); text-align: justify; }
.checklist-item.expanded .item-details { display: block; }
.custom-layout { display: grid; grid-template-columns: 1fr 1.5fr; gap: 30px; }
@media (max-width: 768px) { .custom-layout { grid-template-columns: 1fr; } .list-management-bar select { width: 100%; } }
.custom-form-box { background: var(--card-bg); border: 1px solid var(--border); padding: 20px; border-radius: 8px; height: fit-content; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: 0.9rem; }
.form-group input, .form-group textarea { width: 100%; background: var(--bg-color); border: 1px solid var(--border); color: var(--text-color); padding: 10px; border-radius: 6px; font-size: 0.95rem; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }
.btn-primary { background: var(--primary); color: #000; border: none; padding: 12px 20px; border-radius: 6px; font-weight: bold; cursor: pointer; width: 100%; font-size: 1rem; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 0.9rem; font-weight: 500; }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.modal { display: flex; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 1000; justify-content: center; align-items: center; padding: 20px; }
.modal-content { background: var(--card-bg); border: 2px solid var(--accent); padding: 30px; border-radius: 12px; max-width: 600px; text-align: center; }
.modal-content h2 { color: var(--accent); margin-bottom: 15px; font-size: 1.4rem; }
.modal-content p { color: var(--text-color); margin-bottom: 25px; line-height: 1.6; text-align: justify; font-size: 0.95rem; }
.modal-content button { background: var(--accent); color: white; border: none; padding: 12px 30px; font-size: 1rem; font-weight: bold; border-radius: 6px; cursor: pointer; }

/* Styles pour la gestion de la liste perso (Monter, Descendre, Supprimer) */
.item-controls { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.btn-icon { background: none; border: none; font-size: 1.1rem; cursor: pointer; opacity: 0.6; padding: 4px; transition: opacity 0.2s, transform 0.1s; }
.btn-icon:hover { opacity: 1; transform: scale(1.1); }
.btn-icon:active { transform: scale(0.9); }
.btn-icon:disabled { opacity: 0.15; cursor: not-allowed; transform: none; }
.item-toggle-icon { margin-right: 15px; } /* Espacement avec les contrôles */

/* Style pour le disclaimer en bas de page */

/* Style pour le disclaimer en bas de page */

/* Style pour le disclaimer en bas de page */

.app-footer a {
    color: var(--primary);
    text-decoration: none;
}

/* Style pour le disclaimer en bas de page */

/* Style pour le disclaimer en bas de page */
.app-footer {
    text-align: center;
    padding: 20px 0;            /* Plus de padding horizontal bloquant, on s'aligne sur le parent */
    margin: 40px 0 20px 0;      /* Marges haut/bas uniquement */
    width: 100%;                /* Prend automatiquement 100% de la largeur de la liste */
    box-sizing: border-box;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: #566f93;             /* Teinte discrète iQsub */
    line-height: 1.5;
    clear: both;                /* Évite les conflits d'éléments flottants */
}
.app-footer p {
    margin: 0;
    padding: 0;
}
.app-footer a {
    color: var(--primary);
    text-decoration: none;
}

/* ==========================================
   OPTIMISATION ET FIX DES COMPTEURS DYNAMIQUES
   ========================================== */

/* Force le sous-titre de la phase officielle à passer proprement sous le sélecteur */
#tab-official h2, 
#txt-official-subtitle, 
#official-subtitle {
    display: block;
    clear: both;
    width: 100%;
    margin-top: 15px;
}

/* Style et couleur bleu/cyan d'origine pour l'ensemble des compteurs */
.counter-badge {
    margin-left: 8px;
    font-weight: bold;
    color: #00d1b2; /* Couleur cyan/turquoise emblématique de votre PWA */
    font-size: 0.9em;
}


/* =======================================================
   ALIGNEMENT ET DESIGN BLEU/CYAN DU COMPTEUR DE CHECKLIST
   ======================================================= */

/* Aligne proprement les sous-titres sous les éléments de sélection */
#tab-official h2, 
#txt-official-subtitle, 
#official-subtitle {
    display: block;
    clear: both;
    width: 100%;
    margin-top: 15px;
}

/* Style et couleur bleu/cyan identique aux titres de l'application / onglets actifs */
.counter-badge {
    margin-left: 8px;
    font-weight: bold;
    color: var(--primary, #00d1b2); /* S'adapte à la couleur primaire Bulma, ou utilise le cyan #00d1b2 en fallback */
    font-size: 0.9em;
}


/* ========================================================
   ALIGNEMENT ET ESSENCE VISUELLE BLEU/CYAN POUR COMPTEURS
   ======================================================== */

/* Force le sous-titre de la phase à se positionner sous le sélecteur */
#tab-official h2, 
#txt-official-subtitle, 
#official-subtitle {
    display: block;
    clear: both;
    width: 100%;
    margin-top: 15px;
}

/* Style et couleur bleu/cyan identique aux titres de l'application / onglets actifs */
.counter-badge {
    margin-left: 8px;
    font-weight: bold;
    color: var(--primary, #00d1b2); /* Exploite la couleur bleu/cyan native de l'application */
    font-size: 0.9em;
}


/* ========================================================
   STYLES COMPLÉMENTAIRES POUR COMPOSANTS ET DRAG-AND-DROP
   ======================================================== */

.item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.delete-item-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    padding: 2px;
    transition: transform 0.1s ease;
}

.delete-item-btn:hover {
    transform: scale(1.2);
}

.checklist-item[draggable="true"] {
    cursor: grab;
}

.checklist-item[draggable="true"]:active {
    cursor: grabbing;
}
