/* ============================================================
   Mes Actions — Lot 2 : reskin navy/beige/ambre + mode sombre
   ============================================================
   Ce fichier remplace intégralement assets/style.css.
   Les anciennes règles structurelles sont conservées, seules
   les couleurs ont été refondues avec le nouveau thème.
*/

/* ===== MODE CLAIR (par défaut) ===== */
:root {
    /* Couleurs de la marque */
    --navy:           #0c2264;
    --navy-hover:     #1a2d6b;
    --navy-soft:      #DCE3F0;

    --amber:          #B45309;
    --amber-hover:    #92400E;
    --amber-soft:     #FCF1D8;

    --beige:          #EDE8D0;
    --beige-soft:     #F5F1E0;
    --beige-strong:   #D5CDB0;

    /* Surfaces */
    --bg:             #EDE8D0;
    --surface:        #ffffff;
    --surface-2:      #FAF7E8;
    --border:         #D5CDB0;
    --border-soft:    #E5DFC9;

    /* Texte */
    --text:           #1F2937;
    --text-strong:    #0c2264;
    --text-muted:     #6B7280;
    --text-soft:      #9CA3AF;

    /* Couleurs sémantiques */
    --primary:        #0c2264;
    --primary-hover:  #1a2d6b;
    --primary-soft:   #DCE3F0;

    --success:        #059669;
    --success-soft:   #D1FAE5;
    --warning:        #D97706;
    --warning-soft:   #FEF3C7;
    --danger:         #DC2626;
    --danger-soft:    #FEE2E2;
    --info:           #2563EB;
    --info-soft:      #DBEAFE;

    /* Statuts */
    --status-not:        #9CA3AF;
    --status-progress:   #2563EB;
    --status-done:       #059669;

    /* Urgences */
    --urgency-low:    #059669;
    --urgency-medium: #D97706;
    --urgency-high:   #DC2626;

    /* Catégories */
    --cat-pro:        #0c2264;
    --cat-pro-bg:     #DCE3F0;
    --cat-perso:      #B45309;
    --cat-perso-bg:   #FCF1D8;

    /* Effets */
    --shadow-sm: 0 1px 2px rgba(12, 34, 100, 0.04);
    --shadow:    0 1px 3px rgba(12, 34, 100, 0.08), 0 1px 2px rgba(12, 34, 100, 0.04);
    --shadow-md: 0 4px 12px rgba(12, 34, 100, 0.10);

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;

    color-scheme: light;
}

/* ===== MODE SOMBRE ===== */
:root[data-theme="dark"] {
    --bg:             #0c1632;
    --surface:        #16224A;
    --surface-2:      #1E2D5C;
    --border:         #283867;
    --border-soft:    #1E2D5C;

    --text:           #EDE8D0;
    --text-strong:    #FFFFFF;
    --text-muted:     #C0BAA0;
    --text-soft:      #8C8773;

    --primary:        #93C5FD;
    --primary-hover:  #BFDBFE;
    --primary-soft:   #2A3D7C;

    --success:        #34D399;
    --success-soft:   #064E3B;
    --warning:        #FBBF24;
    --warning-soft:   #44340F;
    --danger:         #F87171;
    --danger-soft:    #4B1818;
    --info:           #60A5FA;
    --info-soft:      #1E3A8A;

    --status-not:        #6B7280;
    --status-progress:   #60A5FA;
    --status-done:       #34D399;

    --urgency-low:    #34D399;
    --urgency-medium: #FBBF24;
    --urgency-high:   #F87171;

    --cat-pro:        #93C5FD;
    --cat-pro-bg:     #2A3D7C;
    --cat-perso:      #FBBF24;
    --cat-perso-bg:   #44340F;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow:    0 1px 3px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.20);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);

    color-scheme: dark;
}

/* Auto-détection des préférences système si l'utilisateur n'a pas fait de choix */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg:             #0c1632;
        --surface:        #16224A;
        --surface-2:      #1E2D5C;
        --border:         #283867;
        --border-soft:    #1E2D5C;
        --text:           #EDE8D0;
        --text-strong:    #FFFFFF;
        --text-muted:     #C0BAA0;
        --text-soft:      #8C8773;
        --primary:        #93C5FD;
        --primary-hover:  #BFDBFE;
        --primary-soft:   #2A3D7C;
        --success:        #34D399;
        --warning:        #FBBF24;
        --danger:         #F87171;
        --info:           #60A5FA;
        --status-not:     #6B7280;
        --status-progress:#60A5FA;
        --status-done:    #34D399;
        --urgency-low:    #34D399;
        --urgency-medium: #FBBF24;
        --urgency-high:   #F87171;
        --cat-pro:        #93C5FD;
        --cat-pro-bg:     #2A3D7C;
        --cat-perso:      #FBBF24;
        --cat-perso-bg:   #44340F;
        color-scheme: dark;
    }
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3 { margin: 0 0 12px; font-weight: 600; letter-spacing: -0.01em; color: var(--text-strong); }
h1 { font-size: 1.25rem; }
h2 { font-size: 1.05rem; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Boutons ===== */
.btn, button {
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 9px 14px;
    border-radius: var(--radius);
    transition: all 0.15s ease;
    font-weight: 500;
}
.btn:hover, button:hover {
    background: var(--surface-2);
    border-color: var(--text-soft);
}
.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
:root[data-theme="dark"] .btn-primary { color: var(--bg); }
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: white;
}
:root[data-theme="dark"] .btn-primary:hover { color: var(--bg); }

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 5px 10px; font-size: 0.85rem; }
.btn-icon {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border-radius: var(--radius);
    font-size: 1.1rem;
}
.btn-link {
    background: none; border: none; padding: 0;
    color: var(--text-muted); font-size: 0.9rem;
}
.btn-link:hover { color: var(--text-strong); text-decoration: underline; background: none; }

/* ===== Auth ===== */
.auth-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 20px;
    background: linear-gradient(135deg, var(--beige) 0%, var(--beige-strong) 100%);
}
:root[data-theme="dark"] .auth-page {
    background: linear-gradient(135deg, #0c1632 0%, #16224A 100%);
}
.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-soft);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 4px; }
.auth-card p.muted { margin: 0 0 24px; }

/* ===== Marque ===== */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
    width: 28px; height: 28px;
    background: linear-gradient(135deg, var(--navy) 0%, #1d4ed8 100%);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(12, 34, 100, 0.35);
    flex-shrink: 0;
}
:root[data-theme="dark"] .brand-mark {
    background: linear-gradient(135deg, #EDE8D0 0%, #D5CDB0 100%);
}

/* ===== Formulaires ===== */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; }
.form label > span { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.form input[type="text"],
.form input[type="password"],
.form input[type="email"],
.form input[type="date"],
.form input[type="search"],
.form select,
input[type="text"], input[type="password"], input[type="search"], input[type="date"], select {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(12, 34, 100, 0.18);
}
:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] textarea:focus {
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.20);
}
.form-inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.form-inline label { flex: 1 1 160px; }
.form-inline .check { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 6px; padding-bottom: 10px; }
.form-inline button { align-self: flex-end; }

/* ===== Alertes ===== */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}
.alert-error   { background: var(--danger-soft);  color: #991B1B; border-color: rgba(220, 38, 38, 0.3); }
.alert-success { background: var(--success-soft); color: #065F46; border-color: rgba(5, 150, 105, 0.3); }
.alert-warning { background: var(--warning-soft); color: #92400E; border-color: rgba(217, 119, 6, 0.3); }
:root[data-theme="dark"] .alert-error   { color: #FCA5A5; }
:root[data-theme="dark"] .alert-success { color: #6EE7B7; }
:root[data-theme="dark"] .alert-warning { color: #FCD34D; }
.alert code { background: rgba(0, 0, 0, 0.05); padding: 2px 6px; border-radius: 4px; }

/* ===== Topbar ===== */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border-soft);
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(10px);
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex; align-items: center; gap: 24px;
}
.topbar h1 { font-size: 1.05rem; margin: 0; color: var(--text-strong); }
.topbar-nav { display: flex; gap: 4px; flex: 1; }
.tab-btn {
    background: transparent; border: 1px solid transparent;
    padding: 7px 14px;
    border-radius: 999px;
    color: var(--text-muted);
    font-weight: 500; font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    text-decoration: none;
}
.tab-btn:hover { background: var(--surface-2); color: var(--text-strong); }
.tab-btn.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); }
.tab-icon { font-size: 0.7rem; }
.user-menu { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.user-name { color: var(--text-muted); font-weight: 500; }

/* ===== Bouton bascule thème ===== */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    width: 36px; height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.theme-toggle:hover {
    background: var(--surface-2);
    border-color: var(--text-soft);
}

/* ===== Container ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 24px 80px;
}
.view { display: none; }
.view.active { display: block; }

/* ===== Barre de mois ===== */
.month-bar {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.month-bar h2 {
    margin: 0 12px; font-size: 1.25rem; font-weight: 600;
    text-transform: capitalize;
    min-width: 180px;
    color: var(--text-strong);
}
.month-bar .btn-icon { width: 34px; height: 34px; font-size: 1.4rem; line-height: 1; padding: 0; }
.month-bar #today-btn { margin-left: auto; }

/* ===== Onglets pro/perso ===== */
.tab-icon-pro   { color: var(--cat-pro); }
.tab-icon-perso { color: var(--cat-perso); }
.tab-btn[data-category="pro"].active   {
    background: var(--cat-pro-bg);
    color: var(--cat-pro);
    border-color: var(--cat-pro-bg);
}
.tab-btn[data-category="perso"].active {
    background: var(--cat-perso-bg);
    color: var(--cat-perso);
    border-color: var(--cat-perso-bg);
}

.category-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    margin-left: 4px;
}
.category-badge.category-pro {
    background: var(--cat-pro-bg);
    color: var(--cat-pro);
}
.category-badge.category-perso {
    background: var(--cat-perso-bg);
    color: var(--cat-perso);
}

/* ===== Formulaire de création ===== */
.create-form {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 12px;
    display: flex; gap: 8px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}
.create-form input[type="text"] { flex: 1 1 240px; }
.create-form input[type="date"] { flex: 0 0 150px; }
.create-form select#new-category { flex: 0 0 120px; }
.create-form select#new-urgency  { flex: 0 0 140px; }
.voice-btn { flex-shrink: 0; }
.voice-btn.listening {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger);
    animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
    50%      { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}
.voice-feedback {
    background: var(--info-soft);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 16px;
    color: var(--info);
    font-size: 0.9rem;
}
:root[data-theme="dark"] .voice-feedback {
    color: #BFDBFE;
}

/* ===== Liste des jours ===== */
.month-list { display: flex; flex-direction: column; gap: 14px; }
.day-block {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.day-block.today {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}
.day-block.weekend { background: var(--surface-2); }
.day-block.empty .day-actions { display: none; }
.day-block.empty .day-header { color: var(--text-soft); }

.day-header {
    display: flex; align-items: baseline; gap: 10px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--surface);
    font-size: 0.92rem;
}
.day-block.empty .day-header { border-bottom: none; background: transparent; }
.day-name { font-weight: 600; text-transform: capitalize; min-width: 70px; color: var(--text-strong); }
.day-num { font-weight: 700; font-size: 1.05rem; color: var(--text-strong); }
.day-month { text-transform: capitalize; color: var(--text-muted); }
.day-count { margin-left: auto; color: var(--text-muted); }
.day-block.today .day-name,
.day-block.today .day-num { color: var(--primary); }

.day-actions { display: flex; flex-direction: column; }

/* ===== Ligne d'action ===== */
.action-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-soft);
    transition: background 0.1s;
    border-left: 3px solid transparent;
    padding-left: 13px;
}
.action-row:last-child { border-bottom: none; }
.action-row:hover { background: var(--surface-2); }

.action-row[data-category="pro"]   { border-left-color: var(--cat-pro); }
.action-row[data-category="perso"] { border-left-color: var(--cat-perso); }

/* Titre coloré selon la catégorie */
.action-row[data-category="pro"]   .action-title {
    color: var(--cat-pro);
    font-weight: 500;
}
.action-row[data-category="perso"] .action-title {
    color: var(--cat-perso);
    font-weight: 500;
}

.action-row[data-status="done"] .action-title {
    text-decoration: line-through;
    color: var(--text-soft) !important;
    font-weight: 400;
}

.status-toggle {
    width: 28px; height: 28px;
    padding: 0;
    border: none; background: transparent;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; border-radius: 50%;
    flex-shrink: 0;
}
.status-toggle:hover { background: var(--surface-2); }
.status-dot {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid var(--status-not);
    display: inline-block;
    background: transparent;
    transition: all 0.15s;
}
[data-status="not_started"] .status-dot { border-color: var(--status-not); background: transparent; }
[data-status="in_progress"] .status-dot {
    border-color: var(--status-progress);
    background: conic-gradient(var(--status-progress) 50%, transparent 50%);
}
[data-status="done"] .status-dot {
    border-color: var(--status-done);
    background: var(--status-done);
    position: relative;
}
[data-status="done"] .status-dot::after {
    content: '';
    position: absolute;
    left: 4px; top: 1px;
    width: 4px; height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
:root[data-theme="dark"] [data-status="done"] .status-dot::after {
    border-color: var(--bg);
}

.action-content { flex: 1; min-width: 0; }
.action-title {
    display: block;
    overflow-wrap: anywhere;
    cursor: text;
    font-size: 0.97rem;
}
.action-edit {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
}

.action-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.urgency-toggle {
    width: 28px; height: 28px;
    padding: 0; border: none; background: transparent;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; border-radius: 50%;
}
.urgency-toggle:hover { background: var(--surface-2); }
.urgency-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    display: inline-block;
}
[data-urgency="low"]    .urgency-dot { background: var(--urgency-low); }
[data-urgency="medium"] .urgency-dot { background: var(--urgency-medium); }
[data-urgency="high"]   .urgency-dot {
    background: var(--urgency-high);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
    animation: pulse-urgent 2s ease-in-out infinite;
}
@keyframes pulse-urgent {
    0%, 100% { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18); }
    50%      { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.05); }
}

.action-menu-btn {
    width: 28px; height: 28px; padding: 0;
    border: none; background: transparent;
    border-radius: 50%; color: var(--text-soft);
    font-size: 1.1rem; line-height: 1;
}
.action-menu-btn:hover { background: var(--surface-2); color: var(--text); }

/* ===== État vide ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* ===== Archives ===== */
.archive-bar {
    background: var(--surface);
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.archive-bar input[type="search"] { font-size: 1rem; }
.archive-bar p { margin: 8px 0 0; }
.archive-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}
.archive-controls input[type="search"] { flex: 1; }
.archive-controls select#archive-category-filter { flex: 0 0 200px; }

.archive-list { display: flex; flex-direction: column; gap: 8px; }
.archive-row {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 10px 16px;
    display: flex; align-items: center; gap: 10px;
    border-left: 3px solid transparent;
    padding-left: 13px;
}
.archive-row[data-category="pro"]   { border-left-color: var(--cat-pro); }
.archive-row[data-category="perso"] { border-left-color: var(--cat-perso); }
.archive-row .urgency-dot { flex-shrink: 0; }
.archive-row .archive-cat { flex-shrink: 0; font-size: 1rem; }
.archive-row .archive-title {
    flex: 1; min-width: 0; overflow-wrap: anywhere;
    font-weight: 500;
}
.archive-row[data-category="pro"]   .archive-title { color: var(--cat-pro); }
.archive-row[data-category="perso"] .archive-title { color: var(--cat-perso); }
.archive-row .archive-date { color: var(--text-muted); font-size: 0.85rem; flex-shrink: 0; }
.archive-row .archive-actions { display: flex; gap: 4px; flex-shrink: 0; }

mark {
    background: var(--warning-soft);
    color: var(--warning);
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* ===== Admin ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.user-table { display: flex; flex-direction: column; }
.user-row {
    display: grid;
    grid-template-columns: 1.2fr 1.4fr 0.8fr 1fr 1fr 1.5fr;
    gap: 12px;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-soft);
    align-items: center;
    font-size: 0.92rem;
}
.user-row-head {
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border);
}
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline-flex; gap: 4px; align-items: center; margin: 0; }
.inline-form input[type="text"] { width: 130px; padding: 5px 8px; font-size: 0.85rem; }
.badge {
    display: inline-block; padding: 2px 8px;
    border-radius: 999px; font-size: 0.75rem;
    background: var(--surface-2); color: var(--text-muted);
    border: 1px solid var(--border);
}
.badge-admin {
    background: var(--cat-pro-bg);
    color: var(--cat-pro);
    border-color: var(--cat-pro-bg);
}
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .topbar-inner { flex-wrap: wrap; padding: 12px 16px; gap: 12px; }
    .topbar-nav { order: 3; flex-basis: 100%; overflow-x: auto; }
    .container { padding: 18px 12px 60px; }
    .create-form { padding: 10px; }
    .create-form input[type="text"] { flex: 1 1 100%; }
    .create-form input[type="date"] { flex: 1 1 calc(50% - 4px); }
    .create-form select#new-category { flex: 1 1 calc(50% - 4px); }
    .create-form select#new-urgency  { flex: 1 1 calc(50% - 4px); }
    .month-bar h2 { font-size: 1.1rem; min-width: auto; }
    .archive-controls { flex-direction: column; align-items: stretch; }
    .archive-controls select#archive-category-filter { flex: 1 1 100%; }
    .user-row { grid-template-columns: 1fr; gap: 4px; padding: 12px 0; }
    .user-row-head { display: none; }
    .user-row > span:first-child { font-size: 1rem; }
    .action-row { padding: 12px; gap: 10px; padding-left: 13px; }
    .day-header { padding: 10px 12px; }
}
/* === Mes Actions — additions Lot 3 (vue calendrier mensuel) ===
   À AJOUTER à la fin du fichier assets/style.css existant.
   Ne pas remplacer le fichier — juste copier ces règles à la fin.
*/

/* === Bascule Liste / Calendrier === */
.view-mode-toggle {
    display: inline-flex;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 999px;
    padding: 2px;
    margin-left: 8px;
    gap: 0;
}
.view-mode-toggle .vm-btn {
    background: transparent;
    border: none;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}
.view-mode-toggle .vm-btn:hover {
    color: var(--text-strong);
    background: var(--surface-2);
}
.view-mode-toggle .vm-btn.active {
    background: var(--primary);
    color: white;
}
:root[data-theme="dark"] .view-mode-toggle .vm-btn.active {
    color: var(--bg);
}
.vm-icon { font-size: 0.9rem; }

/* === Vue Calendrier === */
.calendar-view {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-sm);
}
.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 6px;
}
.cal-day-name {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.cal-day-name.cal-day-name-we {
    color: var(--text-soft);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(110px, auto);
    gap: 4px;
}

.cal-cell {
    background: var(--surface);
    border: 0.5px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 5px 5px 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: background 0.1s, border-color 0.1s;
    cursor: pointer;
    min-height: 110px;
}
.cal-cell:hover {
    background: var(--surface-2);
    border-color: var(--border);
}
.cal-cell.other-month {
    background: var(--bg);
    opacity: 0.55;
    cursor: default;
}
.cal-cell.other-month:hover {
    background: var(--bg);
    border-color: var(--border-soft);
}
.cal-cell.weekend {
    background: var(--surface-2);
}
.cal-cell.today {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.cal-cell-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}
.cal-day-num {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-strong);
    line-height: 1;
}
.cal-cell.other-month .cal-day-num {
    color: var(--text-soft);
    font-weight: 500;
}
.cal-cell.today .cal-day-num {
    color: var(--primary);
    font-weight: 700;
}

/* Pastille d'action dans une cellule */
.cal-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    line-height: 1.2;
    cursor: pointer;
    overflow: hidden;
    background: var(--cat-pro-bg);
    color: var(--cat-pro);
    font-weight: 500;
    transition: filter 0.1s;
}
.cal-pill:hover {
    filter: brightness(0.95);
}
:root[data-theme="dark"] .cal-pill:hover {
    filter: brightness(1.15);
}
.cal-pill[data-category="pro"] {
    background: var(--cat-pro-bg);
    color: var(--cat-pro);
}
.cal-pill[data-category="perso"] {
    background: var(--cat-perso-bg);
    color: var(--cat-perso);
}
.cal-pill[data-status="done"] {
    text-decoration: line-through;
    opacity: 0.55;
}
.cal-pill .pill-urgency {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cal-pill[data-urgency="low"]    .pill-urgency { background: var(--urgency-low); }
.cal-pill[data-urgency="medium"] .pill-urgency { background: var(--urgency-medium); }
.cal-pill[data-urgency="high"]   .pill-urgency {
    background: var(--urgency-high);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}
.cal-pill .pill-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.cal-more {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: center;
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    margin-top: auto;
}
.cal-more:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.cal-hint {
    text-align: center;
    margin: 10px 0 0;
}

/* === Mobile : calendrier compact === */
@media (max-width: 768px) {
    .view-mode-toggle {
        margin-left: 0;
        margin-top: 6px;
    }
    .view-mode-toggle .vm-btn {
        padding: 4px 10px;
        font-size: 0.78rem;
    }
    .calendar-view {
        padding: 6px;
    }
    .cal-day-name {
        font-size: 0.65rem;
        padding: 4px 0;
    }
    .calendar-grid {
        gap: 2px;
        grid-auto-rows: minmax(75px, auto);
    }
    .cal-cell {
        min-height: 75px;
        padding: 3px;
        border-radius: 4px;
    }
    .cal-day-num {
        font-size: 0.72rem;
    }
    .cal-pill {
        font-size: 0.62rem;
        padding: 2px 4px;
        gap: 3px;
    }
    .cal-pill .pill-urgency {
        width: 4px;
        height: 4px;
    }
    .cal-more {
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    /* Sur écran très étroit, afficher uniquement le numéro + un compteur de pastilles */
    .cal-pill .pill-title {
        display: none;
    }
    .cal-pill {
        padding: 3px;
        justify-content: center;
    }
}
/* === Mes Actions — additions Lot 4 (pilotage + menu déroulant + vue urgence) ===
   À AJOUTER à la fin du fichier assets/style.css existant.
*/

/* === Menu déroulant des actions === */
.action-menu {
    position: fixed;
    z-index: 1000;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    box-shadow: var(--shadow-md);
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    animation: menu-pop 0.12s ease-out;
}
@keyframes menu-pop {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.action-menu button {
    background: transparent;
    border: none;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    transition: background 0.1s;
    font-family: inherit;
    font-weight: 500;
}
.action-menu button:hover {
    background: var(--surface-2);
    color: var(--text-strong);
}
.action-menu button.danger { color: var(--danger); }
.action-menu button.danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}
.action-menu .menu-icon {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.action-menu .menu-sep {
    height: 0.5px;
    background: var(--border-soft);
    margin: 3px 6px;
}
.action-menu-btn {
    cursor: pointer;
}

/* Date inline pour vue urgence */
.action-row .action-date-inline {
    flex-shrink: 0;
    margin-right: 4px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

/* === Vue Par urgence === */
.urgency-view {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.urgency-group {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.urgency-group-header {
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
}
.urgency-group-high   .urgency-group-header { color: var(--urgency-high); }
.urgency-group-medium .urgency-group-header { color: var(--urgency-medium); }
.urgency-group-low    .urgency-group-header { color: var(--urgency-low); }
.urgency-group-label  { letter-spacing: -0.005em; }
.urgency-group-count  { font-weight: 400; color: var(--text-muted); }
.urgency-group-actions {
    display: flex;
    flex-direction: column;
}

/* === Tableau de bord === */
.dashboard-title {
    font-size: 1.4rem;
    margin: 4px 0 18px;
    color: var(--text-strong);
}

.dash-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}
.dash-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.1s, box-shadow 0.1s;
}
.dash-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.dash-card-label {
    font-size: 0.74rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 6px;
}
.dash-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-strong);
    line-height: 1.05;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}
.dash-card-success { color: var(--success); }
.dash-card-danger  { color: var(--danger); }
.dash-card-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.dash-section {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
}
.dash-section-label {
    font-size: 0.74rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 12px;
}
.dash-chart-wrap {
    height: 220px;
    width: 100%;
    position: relative;
}

.dash-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 14px;
}
.dash-row .dash-section { margin-bottom: 0; }

/* Barre Pro/Perso */
.dash-bar {
    display: flex;
    height: 16px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    background: var(--surface-2);
}
.dash-bar-pro   { background: var(--cat-pro); }
.dash-bar-perso { background: var(--cat-perso); }
.dash-bar-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 8px;
}
.legend-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

/* Top 5 */
.dash-top {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dash-top-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    padding: 4px 0;
}
.dash-top-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dash-top-title {
    flex: 1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.dash-top-age {
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* === Mobile === */
@media (max-width: 768px) {
    .action-menu { min-width: 180px; }
    .dash-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .dash-card-value { font-size: 1.7rem; }
    .dash-row { grid-template-columns: 1fr; }
    .dash-section { padding: 14px; }
    .dash-chart-wrap { height: 180px; }
    .urgency-group-header { padding: 9px 12px; font-size: 0.9rem; }
}
/* === Mes Actions — additions Patch Partage perso ===
   À AJOUTER à la fin du fichier assets/style.css existant.
*/

/* Bandeau d'information sur le partage perso */
.share-banner {
    background: var(--cat-perso-bg);
    color: var(--cat-perso);
    border: 0.5px solid var(--cat-perso);
    border-radius: var(--radius);
    padding: 9px 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
}
.share-banner-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}
.share-banner strong { font-weight: 600; }

/* Petit pictogramme partagé dans l'onglet Perso */
.shared-icon {
    font-size: 0.85em;
    margin-left: 2px;
    opacity: 0.7;
}

/* Mention du créateur sur les actions perso */
.action-creator {
    display: inline-block;
    margin-left: 6px;
    font-style: italic;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text-muted);
}
.action-creator.is-me {
    color: var(--text-soft);
    opacity: 0.8;
}

/* Ligne d'archive : créateur en mention */
.archive-creator {
    margin-left: 6px;
    font-style: italic;
    font-weight: 400;
}

/* Bandeau d'info en haut du menu déroulant */
.action-menu .menu-info {
    padding: 7px 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
}
.action-menu .menu-info-icon {
    font-size: 0.95rem;
}
.action-menu .menu-info strong {
    color: var(--text-strong);
    font-weight: 600;
}

/* Top 5 dashboard : créateur */
.dash-top-creator {
    font-style: italic;
    font-weight: 400;
    margin-left: 4px;
}

/* Mobile */
@media (max-width: 768px) {
    .share-banner {
        font-size: 0.82rem;
        padding: 8px 12px;
    }
    .action-creator {
        display: block;
        margin-left: 0;
        margin-top: 2px;
    }
}
/* === Mes Actions — additions Lot 5 (PWA + mobile + à qualifier) ===
   À AJOUTER à la fin du fichier assets/style.css existant.
*/

/* === Onglet À qualifier (badge) === */
.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--amber);
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 4px;
}
:root[data-theme="dark"] .tab-badge { color: var(--bg); }

/* === Vue À qualifier === */
.qualify-row {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--amber);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}
.qualify-row-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-strong);
}
.qualify-icon { font-size: 1.1rem; }
.qualify-creator { font-style: italic; }
.qualify-row-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.qualify-row-form input[type="date"] { flex: 0 0 150px; }
.qualify-row-form select { flex: 0 0 140px; }
.qualify-row-form .qf-validate { flex: 0 0 auto; }
.qualify-row-form .qf-delete   { flex: 0 0 auto; margin-left: auto; }

/* === Toast === */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-strong);
    color: var(--bg);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    z-index: 2000;
    pointer-events: none;
    animation: toast-slide 0.25s ease;
}
@keyframes toast-slide {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* === Bouton install PWA === */
.install-pwa-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 100;
}
.install-pwa-btn:hover { background: var(--primary-hover); }
:root[data-theme="dark"] .install-pwa-btn { color: var(--bg); }

/* ====================================================================
   ÉCRAN MOBILE
   ==================================================================== */
.mobile-only { display: none; }
.desktop-only { display: block; }

.mobile-home {
    padding-bottom: 100px;
}
.mh-section {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.mh-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 12px 16px 8px;
    gap: 8px;
}
.mh-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
    text-transform: capitalize;
}
.mh-section-title.urgent { color: var(--urgency-high); text-transform: none; }
.mh-section-title.qualify { color: var(--text-muted); text-transform: none; }
.mh-section-meta { font-size: 0.78rem; color: var(--text-muted); }
.mh-section-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--amber);
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
}
:root[data-theme="dark"] .mh-section-badge { color: var(--bg); }
.mh-list {
    display: flex;
    flex-direction: column;
}
.mh-list-qualify {
    background: var(--cat-perso-bg);
}
.mh-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 6px 16px 12px;
    margin: 0;
    font-style: italic;
}

.mh-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 0.5px solid var(--border-soft);
    background: var(--surface);
    border-left: 3px solid transparent;
    touch-action: pan-y;
    position: relative;
}
.mh-section .mh-list .mh-action:first-child { border-top: none; }
.mh-action[data-category="pro"]   { border-left-color: var(--cat-pro); }
.mh-action[data-category="perso"] { border-left-color: var(--cat-perso); }
.mh-action.swiping-done {
    background: var(--success-soft);
}
.mh-action.mh-qualify-item {
    background: var(--cat-perso-bg);
    border-left-color: var(--amber);
}
.mh-action[data-status="done"] .mh-action-title {
    text-decoration: line-through;
    color: var(--text-soft);
}

.mh-status-btn {
    width: 32px; height: 32px;
    padding: 0; border: none; background: transparent;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; border-radius: 50%;
}
.mh-status-btn .status-dot {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid var(--status-not);
    background: transparent;
    display: inline-block;
}
.mh-action[data-status="not_started"] .status-dot { border-color: var(--status-not); }
.mh-action[data-status="in_progress"] .status-dot {
    border-color: var(--status-progress);
    background: conic-gradient(var(--status-progress) 50%, transparent 50%);
}
.mh-action[data-status="done"] .status-dot {
    background: var(--status-done);
    border-color: var(--status-done);
    position: relative;
}
.mh-action[data-status="done"] .status-dot::after {
    content: ''; position: absolute;
    left: 5px; top: 2px;
    width: 4px; height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.mh-action-content {
    flex: 1;
    min-width: 0;
}
.mh-action-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}
.mh-action[data-category="pro"]   .mh-action-title { color: var(--cat-pro); }
.mh-action[data-category="perso"] .mh-action-title { color: var(--cat-perso); }
.mh-action-meta {
    display: block;
    font-size: 0.78rem;
    margin-top: 2px;
}

.mh-urgency-dot {
    flex-shrink: 0;
    width: 10px; height: 10px;
}

/* === Barre mobile flottante === */
.mobile-bar {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    background: rgba(237, 232, 208, 0.95);
    backdrop-filter: blur(12px);
    border-top: 0.5px solid var(--border);
    padding: 10px 18px calc(10px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 100;
}
:root[data-theme="dark"] .mobile-bar {
    background: rgba(12, 22, 50, 0.95);
}
.mb-side-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 0.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
}
.mb-side-btn:active { transform: scale(0.94); }

.mb-mic-btn {
    width: 70px; height: 70px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(12, 34, 100, 0.40);
    transform: translateY(-12px);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s ease;
}
:root[data-theme="dark"] .mb-mic-btn {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
}
.mb-mic-btn:active {
    transform: translateY(-12px) scale(0.94);
}

/* === Menu mobile === */
.mobile-menu {
    position: fixed;
    bottom: 92px;
    left: 12px;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    box-shadow: var(--shadow-md);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 220px;
}
.mm-item {
    background: transparent;
    border: none;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
    color: var(--text);
    text-decoration: none;
    font-family: inherit;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mm-item:hover { background: var(--surface-2); }

/* === Modales mobile === */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
}
.modal-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom, 0px));
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    animation: modal-slide-up 0.2s ease;
}
@keyframes modal-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.modal-card h3 {
    font-size: 1.1rem;
    margin-bottom: 14px;
    color: var(--text-strong);
}
.modal-card form { display: flex; flex-direction: column; gap: 10px; }
.modal-card input, .modal-card select { width: 100%; }
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

/* === Modale vocale === */
.voice-card { text-align: center; }
.voice-pulse {
    width: 90px; height: 90px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
}
.voice-pulse.pulsing {
    animation: voice-pulsing 1.4s ease-in-out infinite;
}
@keyframes voice-pulsing {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55); }
    50%      { box-shadow: 0 0 0 14px rgba(220, 38, 38, 0); }
}
.voice-status {
    font-size: 1rem;
    color: var(--text-strong);
    margin: 0 0 6px;
    font-weight: 500;
}
.voice-transcript {
    font-size: 0.95rem;
    color: var(--text);
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 14px;
    min-height: 60px;
    margin: 6px 0 12px;
    font-style: italic;
}
.voice-hint {
    margin-top: 10px;
    font-style: italic;
}

/* ====================================================================
   Responsive : bascule mobile
   ==================================================================== */
@media (max-width: 768px) {
    body.mobile-mode .desktop-only { display: none !important; }
    body.mobile-mode .mobile-only { display: block !important; }
    body.mobile-mode .topbar { display: none; }
    body.mobile-mode .container { padding: 14px 12px 24px; }
    body.mobile-mode .install-pwa-btn { bottom: 100px; }

    /* Si on n'a pas activé "mode mobile", l'écran d'accueil mobile reste caché */
    body:not(.mobile-mode) .mobile-only { display: none; }
}

/* Sur écrans larges, jamais le mode mobile */
@media (min-width: 769px) {
    .mobile-only { display: none !important; }
}

/* Mode standalone (PWA installée) */
@media all and (display-mode: standalone) {
    body { padding-top: env(safe-area-inset-top, 0); }
}
/* === HOTFIX Lot 5 — Corrections critiques d'affichage =========================
   À AJOUTER tout à la fin de assets/style.css (après le bloc Lot 5 déjà collé).
   Ne pas remplacer le style.css en entier — juste ajouter ce bloc.
   Faire ensuite Ctrl+F5 pour forcer le rechargement.
================================================================================ */

/* ---- BUG 1 : la modale de dictée vocale et le menu mobile s'ouvrent tout seuls
   Cause : le CSS Lot 5 met "display: flex" sur .modal-overlay et .mobile-menu,
   ce qui écrase la règle navigateur "[hidden] { display: none }".
   Fix : forcer le respect de l'attribut HTML "hidden" sur tous les éléments. */

[hidden] {
    display: none !important;
}

/* ---- BUG 2 : toutes les sections de vue (Pilotage, Archives, À qualifier, etc.)
   s'affichaient simultanément en arrière-plan, à cause de .desktop-only qui
   forçait "display: block" et écrasait ".view { display: none }".
   Fix : un .view non-actif reste impérativement masqué. */

.view:not(.active) {
    display: none !important;
}

/* ---- Préservation du comportement mobile : toutes les vues desktop masquées,
   l'écran d'accueil mobile devient seul visible. */

@media (max-width: 768px) {
    body.mobile-mode .view {
        display: none !important;
    }
    body.mobile-mode #mobile-home {
        display: block !important;
    }
    body.mobile-mode .mobile-bar {
        display: flex !important;
    }
}
/* === HOTFIX Lot 5 — Corrections critiques d'affichage =========================
   À AJOUTER tout à la fin de assets/style.css (après le bloc Lot 5 déjà collé).
   Ne pas remplacer le style.css en entier — juste ajouter ce bloc.
   Faire ensuite Ctrl+F5 pour forcer le rechargement.
================================================================================ */

/* ---- BUG 1 : la modale de dictée vocale et le menu mobile s'ouvrent tout seuls
   Cause : le CSS Lot 5 met "display: flex" sur .modal-overlay et .mobile-menu,
   ce qui écrase la règle navigateur "[hidden] { display: none }".
   Fix : forcer le respect de l'attribut HTML "hidden" sur tous les éléments. */

[hidden] {
    display: none !important;
}

/* ---- BUG 2 : toutes les sections de vue (Pilotage, Archives, À qualifier, etc.)
   s'affichaient simultanément en arrière-plan, à cause de .desktop-only qui
   forçait "display: block" et écrasait ".view { display: none }".
   Fix : un .view non-actif reste impérativement masqué. */

.view:not(.active) {
    display: none !important;
}

/* ---- Préservation du comportement mobile : toutes les vues desktop masquées,
   l'écran d'accueil mobile devient seul visible. */

@media (max-width: 768px) {
    body.mobile-mode .view {
        display: none !important;
    }
    body.mobile-mode #mobile-home {
        display: block !important;
    }
    body.mobile-mode .mobile-bar {
        display: flex !important;
    }
}
/* === Mes Actions — additions Lot Récurrences ============================
   À AJOUTER à la fin de assets/style.css.
========================================================================== */

/* En-tête onglet Récurrences */
.recurrences-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

/* Liste des récurrences */
.recurrence-row {
    background: var(--surface);
    border: 0.5px solid var(--border-soft);
    border-left: 3px solid var(--cat-pro);
    border-radius: var(--radius);
    padding: 11px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
}
.recurrence-row[data-category="perso"] { border-left-color: var(--cat-perso); }
.recurrence-row.paused {
    opacity: 0.6;
    background: var(--surface-2);
    border-left-color: var(--text-soft);
}
.rec-row-icon { font-size: 1.1rem; flex-shrink: 0; }
.rec-row-content { flex: 1; min-width: 0; }
.rec-row-title {
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--text-strong);
}
.recurrence-row[data-category="pro"]   .rec-row-title { color: var(--cat-pro); }
.recurrence-row[data-category="perso"] .rec-row-title { color: var(--cat-perso); }
.rec-row-sub {
    font-size: 0.8rem;
    margin-top: 2px;
}
.rec-row-status {
    flex-shrink: 0;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.rec-row-status.active {
    background: var(--success-soft);
    color: var(--success);
}
.rec-row-status.paused {
    background: var(--surface-2);
    color: var(--text-muted);
    border: 0.5px solid var(--border);
}
.rec-row-menu-btn {
    width: 28px; height: 28px;
    padding: 0;
    border: none; background: transparent;
    border-radius: 50%;
    color: var(--text-soft);
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
}
.rec-row-menu-btn:hover { background: var(--surface-2); color: var(--text); }

/* Icône récurrence sur action */
.action-rec-icon {
    flex-shrink: 0;
    font-size: 0.9rem;
    margin-right: 4px;
    opacity: 0.75;
}

/* Modale de récurrence */
.recurrence-card {
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
}
.rec-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}
.rec-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.rec-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.rec-row .rec-field { margin-bottom: 0; }

/* Sélecteur de pattern (pilule) */
.rec-pattern-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: var(--surface-2);
    border-radius: 999px;
    padding: 3px;
    border: 0.5px solid var(--border);
}
.rp-btn {
    background: transparent;
    border: none;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
}
.rp-btn:hover:not(:disabled) {
    color: var(--text-strong);
    background: var(--surface);
}
.rp-btn.active {
    background: var(--primary);
    color: white;
}
:root[data-theme="dark"] .rp-btn.active { color: var(--bg); }
.rp-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Options par pattern */
.rec-options {
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 10px;
}
.rec-options .rec-label { margin-bottom: 8px; display: block; }
.rec-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.92rem;
}

/* Sélecteur de jours de la semaine */
.rec-weekday-picker {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.wd-btn {
    width: 36px; height: 36px;
    padding: 0;
    border-radius: 50%;
    border: 0.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
}
.wd-btn:hover { border-color: var(--text-soft); }
.wd-btn.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
:root[data-theme="dark"] .wd-btn.selected { color: var(--bg); }
.wd-btn.weekend { color: var(--text-soft); }
.wd-btn.weekend.selected { color: white; }

.rec-shortcuts {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.rec-shortcut {
    background: transparent;
    border: 0.5px solid var(--border);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
}
.rec-shortcut:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Aperçu */
.rec-preview {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    margin: 10px 0 4px;
    line-height: 1.5;
}

/* Mobile */
@media (max-width: 768px) {
    .recurrences-header {
        flex-direction: column;
        align-items: stretch;
    }
    .recurrences-header button { align-self: stretch; }
    .recurrence-row {
        flex-wrap: wrap;
    }
    .rec-pattern-toggle { gap: 2px; padding: 2px; }
    .rp-btn { padding: 4px 8px; font-size: 0.74rem; }
    .rec-row { grid-template-columns: 1fr; }
    .recurrence-card { max-height: 95vh; }
}
/* === Mes Actions — additions Patch Pense-bête =========================
   À AJOUTER à la fin de assets/style.css.
========================================================================= */

/* En-tête pense-bête */
.pb-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

/* Sous-toggle pro/perso */
.pb-cat-toggle {
    display: inline-flex;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 999px;
    padding: 3px;
}
.pb-cat-btn {
    background: transparent;
    border: none;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s ease;
}
.pb-cat-btn:hover { color: var(--text-strong); background: var(--surface-2); }
.pb-cat-btn.active { background: var(--primary); color: white; }
:root[data-theme="dark"] .pb-cat-btn.active { color: var(--bg); }

/* Layout 2-panneaux */
.pb-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
}

.pb-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pb-new-btn {
    text-align: left;
    padding: 8px 12px;
    font-size: 0.85rem;
}
.pb-rubriques-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pb-rubrique-item {
    background: var(--surface);
    border: 0.5px solid var(--border-soft);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 0.88rem;
}
.pb-rubrique-item:hover { background: var(--surface-2); }
.pb-rubrique-item.active {
    background: var(--primary-soft);
    border-color: var(--primary);
    border-left-width: 3px;
    font-weight: 600;
}
.pb-rubrique-color {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: none; /* On utilise plutôt le border-left */
}
.pb-rubrique-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-strong);
}
.pb-rubrique-count {
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 0.72rem;
    padding: 1px 7px;
    border-radius: 999px;
    font-weight: 600;
    flex-shrink: 0;
}
.pb-rubrique-item.active .pb-rubrique-count {
    background: var(--primary);
    color: white;
}
:root[data-theme="dark"] .pb-rubrique-item.active .pb-rubrique-count { color: var(--bg); }

/* Panneau principal pense-bête */
.pb-main {
    background: var(--surface);
    border: 0.5px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    min-height: 400px;
}

.pb-rubrique-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}
.pb-rubrique-title {
    flex: 1;
    min-width: 0;
}
#pb-rubrique-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-strong);
}
.pb-rubrique-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
#pb-rubrique-meta {
    margin: 0 0 14px;
    font-size: 0.78rem;
}

/* Barre d'ajout memo */
.pb-add-memo {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    border: 0.5px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 6px 8px;
    margin-bottom: 14px;
}
.pb-add-memo input[type="text"] {
    flex: 1;
    border: none;
    background: transparent;
    padding: 6px 8px;
    font-size: 0.93rem;
    color: var(--text);
}
.pb-add-memo input[type="text"]:focus {
    outline: none;
    box-shadow: none;
}
.pb-add-memo .btn-icon {
    width: 32px; height: 32px;
    background: transparent;
    border: none;
    color: var(--text-muted);
}
.pb-add-memo .btn-icon.listening {
    background: var(--danger-soft);
    color: var(--danger);
    animation: pulse 1.2s ease-in-out infinite;
}
.pb-add-memo button[type="submit"] {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 0.85rem;
}

/* Liste des memos */
.pb-memos-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pb-memo {
    background: var(--surface);
    border: 0.5px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 10px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: background 0.1s;
}
.pb-memo:hover { background: var(--surface-2); }
.pb-memo-body { flex: 1; min-width: 0; }
.pb-memo-content {
    font-size: 0.93rem;
    line-height: 1.45;
    color: var(--text);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
.pb-memo-edit {
    width: 100%;
    min-height: 60px;
    padding: 6px 8px;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.93rem;
    resize: vertical;
}
.pb-memo-meta {
    font-size: 0.74rem;
    margin-top: 4px;
}
.pb-memo-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}
.pb-memo:hover .pb-memo-actions { opacity: 1; }
.pb-memo-actions button {
    width: 28px; height: 28px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    color: var(--text-soft);
}
.pb-memo-actions button:hover { background: var(--surface-2); }
.pb-memo-actions .pb-memo-toqualify-btn:hover { color: var(--amber); background: var(--amber-soft); }
.pb-memo-actions .pb-memo-delete-btn:hover { color: var(--danger); background: var(--danger-soft); }

/* Palette de couleurs (modale rubrique) */
.pb-color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.pb-color {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s;
}
.pb-color:hover { transform: scale(1.1); }
.pb-color.selected {
    border-color: var(--text-strong);
    box-shadow: 0 0 0 2px var(--surface);
}

/* Mobile */
@media (max-width: 768px) {
    .pb-layout {
        grid-template-columns: 1fr;
    }
    .pb-sidebar {
        order: 1;
    }
    .pb-main {
        order: 2;
        min-height: 200px;
    }
    .pb-rubrique-actions { flex-wrap: wrap; }
    .pb-memo-actions { opacity: 1; }
    .pb-add-memo { flex-wrap: wrap; }
    .pb-add-memo input[type="text"] { flex: 1 1 100%; padding: 8px; }
    .pb-cat-toggle { flex: 1 1 auto; }
    .pb-cat-btn { flex: 1; }
}
/* === HOTFIX — Pense-bête optimisé mobile =====================================
   À AJOUTER tout à la fin de assets/style.css.
   Apporte :
     1. Une section « 💭 Pense-bête » sur l'écran d'accueil mobile, avec
        rubriques accessibles en pastilles cliquables pour dictée vocale rapide
     2. Une refonte de la vue pense-bête complète sur mobile en mode
        maître-détail (rubriques d'abord, puis memos avec bouton retour)
================================================================================ */

/* --- Section pense-bête sur l'écran d'accueil mobile --- */
.mh-pb-rubriques {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px 4px;
}
.mh-pb-rubrique {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 0.5px solid var(--border-soft);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text);
    font-family: inherit;
    transition: background 0.1s, transform 0.1s;
    flex: 0 0 auto;
    max-width: 100%;
    text-align: left;
}
.mh-pb-rubrique:active {
    transform: scale(0.97);
    background: var(--surface-2);
}
.mh-pb-rubrique .mh-pb-icon { font-size: 0.95rem; flex-shrink: 0; }
.mh-pb-rubrique .mh-pb-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}
.mh-pb-rubrique .mh-pb-count {
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 999px;
    font-weight: 600;
    flex-shrink: 0;
}

/* --- Refonte vue pense-bête complète sur mobile (maître-détail) --- */
@media (max-width: 768px) {
    body.mobile-mode .pb-layout {
        display: block;
    }
    body.mobile-mode .pb-sidebar {
        display: block;
    }
    body.mobile-mode .pb-main {
        display: none;
        margin-top: 12px;
    }
    body.mobile-mode .pb-layout.pb-mobile-detail .pb-sidebar {
        display: none;
    }
    body.mobile-mode .pb-layout.pb-mobile-detail .pb-main {
        display: block;
    }

    /* Bouton retour visible en mode détail mobile */
    body.mobile-mode .pb-mobile-back-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: var(--surface-2);
        border: 0.5px solid var(--border);
        color: var(--text);
        font-size: 0.88rem;
        font-weight: 500;
        padding: 8px 14px;
        border-radius: 999px;
        cursor: pointer;
        margin-bottom: 12px;
        font-family: inherit;
    }
    body.mobile-mode .pb-mobile-back-btn:active {
        background: var(--primary-soft);
    }

    /* En vue rubrique seule, agrandir les zones tactiles */
    body.mobile-mode .pb-rubrique-item {
        padding: 14px 14px;
        font-size: 0.95rem;
    }

    /* Cacher la zone vide (« sélectionnez… ») sur mobile */
    body.mobile-mode #pb-empty { display: none; }

    /* La barre d'ajout de memo s'agrandit pour le pouce */
    body.mobile-mode .pb-add-memo {
        padding: 8px;
        flex-wrap: wrap;
        gap: 6px;
    }
    body.mobile-mode .pb-add-memo input[type="text"] {
        flex: 1 1 100%;
        padding: 10px;
        font-size: 1rem;
    }
    body.mobile-mode .pb-add-memo .btn-icon {
        width: 40px; height: 40px;
    }
    body.mobile-mode .pb-add-memo button[type="submit"] {
        flex: 1 1 auto;
        padding: 10px 16px;
    }

    /* Memos : actions toujours visibles sur mobile (pas de survol) */
    body.mobile-mode .pb-memo-actions { opacity: 1; }
    body.mobile-mode .pb-memo-actions button {
        width: 36px; height: 36px;
        font-size: 1rem;
    }
    body.mobile-mode .pb-memo {
        padding: 12px;
    }

    /* En-tête rubrique : actions empilées */
    body.mobile-mode .pb-rubrique-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    body.mobile-mode .pb-rubrique-actions {
        flex-wrap: wrap;
    }
    body.mobile-mode .pb-rubrique-actions button {
        flex: 1 1 auto;
        font-size: 0.82rem;
    }

    /* Sous-toggle pro/perso pleine largeur sur mobile */
    body.mobile-mode .pb-cat-toggle {
        width: 100%;
    }
    body.mobile-mode .pb-cat-btn {
        flex: 1;
        padding: 10px 12px;
    }
}

/* Cacher le bouton retour par défaut hors mobile */
.pb-mobile-back-btn { display: none; }
/* === Mes Actions — additions Patch MFA =================================
   À AJOUTER à la fin de assets/style.css.
========================================================================== */

/* Carte modale MFA — plus large que les autres modales */
.mfa-card {
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    padding: 28px 24px 22px;
}
.mfa-card h3 {
    margin: 0 0 18px;
    font-size: 1.2rem;
    color: var(--text-strong);
}
.mfa-card h4 {
    margin: 0 0 8px;
    font-size: 0.98rem;
    color: var(--text-strong);
    font-weight: 600;
}
.mfa-close {
    position: absolute;
    top: 8px; right: 12px;
    width: 32px; height: 32px;
    background: transparent;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 50%;
    padding: 0;
}
.mfa-close:hover { background: var(--surface-2); color: var(--text); }

/* Sections internes de la modale */
.mfa-section {
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 14px;
}
.mfa-section:last-child { margin-bottom: 0; }

.mfa-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mfa-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}
.mfa-pill.on {
    background: var(--success-soft);
    color: var(--success);
}
.mfa-pill.off {
    background: var(--surface);
    color: var(--text-muted);
    border: 0.5px solid var(--border);
}

.mfa-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 12px;
    justify-content: flex-end;
}
.mfa-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Wizard de configuration */
.mfa-wizard h4 {
    margin-top: 0;
}

/* QR code */
.mfa-qr-wrapper {
    background: white;
    padding: 12px;
    border-radius: var(--radius);
    margin: 12px auto;
    width: fit-content;
    text-align: center;
}

/* Secret manuel */
.mfa-secret-block {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-top: 8px;
    word-break: break-all;
    text-align: center;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

/* Codes de récupération */
.mfa-recovery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 12px 0;
}
.mfa-recovery-code {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    text-align: center;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    color: var(--text-strong);
    font-weight: 600;
    user-select: all;
}

/* Appareils approuvés */
.mfa-device {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 6px;
}
.mfa-device-info { flex: 1; min-width: 0; }
.mfa-device-info > .small { word-break: break-word; }

/* Mobile */
@media (max-width: 768px) {
    .mfa-card {
        max-width: 100%;
        padding: 22px 16px 16px;
    }
    .mfa-recovery-grid {
        grid-template-columns: 1fr;
    }
    .mfa-status-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .mfa-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .mfa-actions button { width: 100%; }
}

/* Page MFA dédiée (mfa.php) */
.auth-alt-actions {
    text-align: left;
}
.auth-alt-actions button:hover,
.auth-alt-actions a:hover { text-decoration: underline; }



