/* =========================================================
   SAILLOT APP - THEME iOS / FROSTED GLASS
   Design mobile-first, style Apple (SF / translucide)
   ========================================================= */

/* ---------------------------------------------------------
   1. Variables globales & thèmes
   --------------------------------------------------------- */

:root {
    /* Typographie */
    --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
                   system-ui, -system-ui, "Segoe UI", sans-serif;

    /* Couleurs de base (MODE CLAIR PAR DEFAUT) */
    --color-bg: #f5f5f7;
    --color-bg-soft: #e5e7f0;
    --color-bg-elevated: rgba(255, 255, 255, 0.96);

    --color-border-soft: rgba(120, 120, 128, 0.16);
    --color-border-strong: rgba(0, 0, 0, 0.12);

    /* Couleurs système façon iOS */
    --color-primary: #0a84ff;          /* iOS Blue */
    --color-primary-soft: rgba(10, 132, 255, 0.18);
    --color-primary-alt: #64d2ff;

    --color-success: #34c759;
    --color-warning: #ffcc00;
    --color-danger: #ff3b30;
    --color-info: #5e5ce6;

    /* Texte */
    --text-main: #111827;
    --text-muted: #6b7280;
    --text-soft: #9ca3af;
    --text-inverse: #ffffff;

    /* Statuts intervention */
    --type-depannage: #ff9f0a;
    --type-devis: #0a84ff;
    --type-chantier: #ff375f;
    --type-vacances: #bf5af2;

    /* Rayons */
    --radius-xxl: 32px;
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-pill: 999px;

    /* Ombres douces */
    --shadow-soft: 0 14px 30px rgba(15, 23, 42, 0.18);
    --shadow-card: 0 10px 24px rgba(15, 23, 42, 0.16);
    --shadow-light: 0 6px 18px rgba(15, 23, 42, 0.12);

    /* Verre dépoli (frosted glass) */
    --glass-bg: rgba(255, 255, 255, 0.94);
    --glass-border: rgba(255, 255, 255, 0.9);
    --glass-blur: 18px;

    /* Transitions (courbe iOS) */
    --transition-fast: 150ms cubic-bezier(0.22, 0.61, 0.36, 1);
    --transition-normal: 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* MODE SOMBRE MANUEL : html[data-theme="dark"] */
html[data-theme="dark"] {
    --color-bg: #050509;
    --color-bg-soft: #101016;
    --color-bg-elevated: rgba(22, 22, 26, 0.96);

    --color-border-soft: rgba(255, 255, 255, 0.10);
    --color-border-strong: rgba(255, 255, 255, 0.25);

    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-soft: #6b7280;

    --glass-bg: rgba(24, 24, 28, 0.96);
    --glass-border: rgba(255, 255, 255, 0.09);
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.85);
    --shadow-card: 0 14px 32px rgba(0, 0, 0, 0.82);
}

/* ---------------------------------------------------------
   2. Reset & base typographique
   --------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    color: var(--text-main);
    background: radial-gradient(circle at top, #ffffff 0, var(--color-bg) 40%, var(--color-bg-soft) 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

/* Fond global adapté au mode sombre (plus de halo blanc) */
html[data-theme="dark"] body {
    background: radial-gradient(circle at top, #020617 0, var(--color-bg) 40%, #020617 100%);
}

body {
    font-size: 16px;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

a:hover {
    text-decoration: underline;
}

/* Titres & textes */
h1,
h2,
h3,
h4 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.01em;
}

h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

h3 {
    font-size: 18px;
    margin-bottom: 6px;
}

p {
    margin: 4px 0;
    line-height: 1.35;
}

/* ---------------------------------------------------------
   3. Utilitaires & layout génériques
   --------------------------------------------------------- */

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-card);
}

/* Animation de slide-in */
@keyframes ios-screen-slide-in {
    from {
        opacity: 0;
        transform: translate3d(0, 18px, 0) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

.screen-slide-in {
    animation: ios-screen-slide-in 320ms var(--transition-normal);
}

/* ---------------------------------------------------------
   4. HEADER / NAVIGATION
   --------------------------------------------------------- */

.app-header {
    max-width: 1180px;
    margin: 16px auto 0 auto;
    padding: 0 14px;
}

/* Carte header principale */
.app-header-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius-xxl);
    background: linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.98),
            rgba(246, 248, 255, 0.96)
        );
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-soft);
}

/* Header en mode sombre : plus de "gros bloc blanc" */
html[data-theme="dark"] .app-header-card {
    background: linear-gradient(
            135deg,
            rgba(15, 15, 24, 0.97),
            rgba(5, 5, 12, 0.98)
        );
    border-color: var(--glass-border);
}

/* Bloc marque (logo + texte) */
.app-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-header-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    /* Flat bleu simple */
    background: #0a84ff;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Ombre très légère, optionnelle */
    box-shadow: 0 6px 14px rgba(0, 122, 255, 0.35);
}

.app-header-logo span {
    display: block;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;  /* évite le décalage vertical */
}



.app-header-texts {
    display: flex;
    flex-direction: column;
}

.app-header-title {
    font-size: 20px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-main);
}

.app-header-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* Bloc méta droite */
.app-header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.app-header-date {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--color-border-soft);
    box-shadow: var(--shadow-light);
    color: var(--text-muted);
}

/* Date header en sombre : pastille foncée lisible */
html[data-theme="dark"] .app-header-date {
    background: rgba(17, 24, 39, 0.96);
    border-color: var(--color-border-soft);
    color: var(--text-muted);
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Avatar utilisateur */
.app-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-pill);
    background: rgba(0, 0, 0, 0.80);
    border: 2px solid rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.55);
}

.app-header-avatar-initial {
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
}

/* BOUTON THEME CLAIR / SOMBRE */
.theme-toggle {
    border-radius: var(--radius-pill);
    padding: 6px 12px;
    border: 1px solid var(--color-border-soft);
    background: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition:
        background var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        opacity var(--transition-fast);
    color: var(--text-main);
}

.theme-toggle-icon {
    font-size: 14px;
}

html[data-theme="dark"] .theme-toggle {
    background: rgba(24, 24, 28, 0.95);
    color: #e5e7eb;
}

/* Navigation principale */
.app-nav {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.app-nav a {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--color-border-soft);
    box-shadow: var(--shadow-light);
    color: var(--text-main);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

html[data-theme="dark"] .app-nav a {
    background: rgba(30, 30, 36, 0.96);
    border-color: rgba(255, 255, 255, 0.06);
}

.app-nav a:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
    background: rgba(255, 255, 255, 1);
}

html[data-theme="dark"] .app-nav a:hover {
    background: rgba(39, 39, 49, 1);
}

.app-nav a.app-nav-active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-info));
    color: var(--text-inverse);
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow:
        0 12px 28px rgba(10, 132, 255, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.85);
    transform: translateY(-1px);
}

.app-nav-user {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 12px;
}

/* ---------------------------------------------------------
   5. MAIN / SECTIONS
   --------------------------------------------------------- */

.app-main {
    max-width: 1180px;
    margin: 14px auto 36px auto;
    padding: 0 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Sections principales */
section {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    border-radius: var(--radius-xl);
    padding: 16px 18px 18px 18px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-card);
    animation: ios-screen-slide-in 260ms var(--transition-normal);
}

section hr {
    border: none;
    border-top: 1px solid rgba(120, 120, 128, 0.18);
    margin: 12px 0;
}

/* ---------------------------------------------------------
   6. FORMULAIRES & CHAMPS
   --------------------------------------------------------- */

form p {
    margin: 8px 0 12px;
}

label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    max-width: 520px;
    padding: 10px 13px;
    border-radius: 14px;
    border: 1px solid rgba(120, 120, 128, 0.18);
    background: rgba(255, 255, 255, 0.98);
    font-size: 14px;
    color: var(--text-main);
    outline: none;
    transition:
        border-color var(--transition-normal),
        box-shadow var(--transition-normal),
        background var(--transition-normal),
        transform var(--transition-fast);
}

html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    background: rgba(15, 23, 42, 0.98);
    color: var(--text-main);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary-soft);
    background: #ffffff;
    transform: translateY(-1px);
}

/* en sombre, garder un fond foncé au focus */
html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
    background: rgba(15, 23, 42, 0.98);
}

span.field-error {
    font-size: 12px;
    color: var(--color-danger);
}

/* ---------------------------------------------------------
   7. BOUTONS
   --------------------------------------------------------- */

button,
input[type="submit"],
.btn {
    border-radius: var(--radius-pill);
    padding: 9px 18px;
    border: none;
    background: linear-gradient(135deg, #ff9f0a, #ff375f);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.20);
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        opacity var(--transition-fast),
        background var(--transition-normal);
    -webkit-tap-highlight-color: transparent;
}

button:hover,
input[type="submit"]:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.24);
    opacity: 0.98;
}

button:active,
input[type="submit"]:active,
.btn:active {
    transform: translateY(0);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
    opacity: 0.96;
}

.btn-primary-pill {
    padding: 9px 22px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-alt));
    color: var(--text-inverse);
    font-weight: 600;
    font-size: 14px;
    border: none;
    box-shadow:
        0 14px 30px rgba(10, 132, 255, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.70);
    text-decoration: none;
}

.btn-secondary-pill {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-main);
    border: 1px solid var(--color-border-soft);
    font-size: 12px;
    font-weight: 500;
    box-shadow: var(--shadow-light);
    text-decoration: none;
}

html[data-theme="dark"] .btn-secondary-pill {
    background: rgba(15, 23, 42, 0.98);
    color: var(--text-main);
}

.btn-danger-pill {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--color-danger), #ff6b5a);
    color: var(--text-inverse);
    border: none;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 12px 28px rgba(255, 59, 48, 0.40);
}

a.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    border: 1px solid var(--color-border-soft);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-main);
    font-size: 13px;
    box-shadow: var(--shadow-light);
    transition:
        background var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

html[data-theme="dark"] a.btn-secondary {
    background: rgba(15, 23, 42, 0.98);
}

a.btn-secondary:hover {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

/* ---------------------------------------------------------
   8. MESSAGES FLASH
   --------------------------------------------------------- */

.flash-message {
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 13px;
}

.flash-message-success,
.flash-message {
    background: rgba(52, 199, 89, 0.10);
    border-left: 4px solid var(--color-success);
    color: #14532d;
}

.flash-message-error {
    background: rgba(255, 59, 48, 0.08);
    border-left: 4px solid var(--color-danger);
    color: #7f1d1d;
}

.flash-message.fade-out {
    opacity: 0;
    transition: opacity 400ms ease-out;
}

/* ---------------------------------------------------------
   9. TABLES
   --------------------------------------------------------- */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: transparent;
}

table thead {
    background: rgba(242, 244, 255, 0.96);
}

html[data-theme="dark"] table thead {
    background: rgba(36, 36, 48, 0.98);
}

table th,
table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(209, 213, 219, 0.9);
    text-align: left;
}

html[data-theme="dark"] table th,
html[data-theme="dark"] table td {
    border-bottom-color: rgba(55, 65, 81, 0.9);
}

table tbody tr:last-child td {
    border-bottom: none;
}

table tbody tr:hover {
    background: rgba(249, 250, 255, 0.9);
}

html[data-theme="dark"] table tbody tr:hover {
    background: rgba(31, 41, 55, 0.85);
}

/* ---------------------------------------------------------
   10. DETAILS INTERVENTIONS
   --------------------------------------------------------- */

details {
    background: rgba(255, 255, 255, 0.96);
    border-radius: var(--radius-lg);
    padding: 6px 10px;
    margin-bottom: 6px;
    border: 1px solid var(--color-border-soft);
    transition:
        box-shadow var(--transition-normal),
        transform var(--transition-fast),
        background var(--transition-fast);
}

html[data-theme="dark"] details {
    background: rgba(26, 26, 34, 0.96);
}

details summary {
    cursor: pointer;
    list-style: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

details summary::-webkit-details-marker {
    display: none;
}

details[open] {
    background: rgba(242, 244, 255, 0.98);
    box-shadow: var(--shadow-light);
    transform: translateY(-1px);
}

html[data-theme="dark"] details[open] {
    background: rgba(37, 37, 48, 0.98);
}

/* ---------------------------------------------------------
   11. CARTES LEAFLET
   --------------------------------------------------------- */

#map-interventions,
#map-prospects {
    width: 100%;
    height: 360px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-top: 8px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--glass-border);
}

.prospection-carte {
    margin-top: 8px;
}

.map-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.btn-pill {
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border-soft);
    background: rgba(255, 255, 255, 0.96);
    font-size: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast);
}

.btn-pill.active {
    background: var(--color-primary);
    color: var(--text-inverse);
    border-color: transparent;
}

/* ---------------------------------------------------------
   12. CALENDRIER MENSUEL
   --------------------------------------------------------- */

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
    font-size: 15px;
}

.calendar-nav a {
    color: var(--color-primary);
    font-weight: 600;
}

.calendar-month-label {
    font-weight: 700;
}

.calendar-grid-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 8px;
}

.calendar-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 14px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-card);
}

html[data-theme="dark"] .calendar-table {
    background: rgba(23, 23, 32, 0.98);
}

.calendar-table thead {
    background: rgba(242, 244, 255, 0.98);
}

html[data-theme="dark"] .calendar-table thead {
    background: rgba(33, 33, 44, 0.98);
}

.calendar-table th {
    padding: 8px 0;
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(209, 213, 219, 0.9);
}

.calendar-table td {
    border: 1px solid rgba(229, 231, 235, 0.9);
}

html[data-theme="dark"] .calendar-table td {
    border-color: rgba(55, 65, 81, 0.9);
}

.calendar-cell {
    height: 96px;
    padding: 0;
    vertical-align: top;
    background: #ffffff;
    position: relative;
}

html[data-theme="dark"] .calendar-cell {
    background: #111827;
}

.calendar-empty {
    background: #f5f6fb;
}

html[data-theme="dark"] .calendar-empty {
    background: #020617;
}

/* Numéro de jour */
.calendar-day-number {
    padding: 4px 6px 0 6px;
}

.calendar-day-number span {
    display: inline-block;
    min-width: 24px;
    min-height: 24px;
    line-height: 24px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    text-align: center;
    color: var(--text-main);
}

.calendar-has-events .calendar-day-number span {
    font-weight: 600;
}

/* Jour actuel */
.calendar-today {
    background: rgba(10, 132, 255, 0.05);
}

html[data-theme="dark"] .calendar-today {
    background: rgba(37, 99, 235, 0.28);
}

.calendar-today .calendar-day-number span {
    background: #000000;
    color: #ffffff;
}

.calendar-events {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 64px;
    overflow: hidden;
}

.calendar-event-pill {
    font-size: 11px;
    border-radius: var(--radius-pill);
    padding: 2px 8px;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

/* Couleurs types */
.badge-depannage { background: var(--type-depannage); }
.badge-devis { background: var(--type-devis); }
.badge-chantier { background: var(--type-chantier); }
.badge-vacances { background: var(--type-vacances); }

.calendar-event-title {
    font-weight: 500;
}

.badge-type {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    color: #ffffff;
    margin-right: 4px;
}

/* Popup calendrier */
.calendar-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.calendar-popup {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border-radius: var(--radius-xl);
    padding: 14px 16px 16px 16px;
    max-width: 340px;
    width: calc(100% - 32px);
    box-shadow: var(--shadow-soft);
    font-size: 14px;
    border: 1px solid var(--glass-border);
}

.calendar-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.calendar-popup-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.calendar-popup-close {
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.calendar-popup-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ---------------------------------------------------------
   13. AGENDA INTERVENTIONS (vue liste)
   --------------------------------------------------------- */

.agenda-section {
    margin-top: 10px;
}

.agenda-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: -4px;
    margin-bottom: 8px;
}

.agenda-filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    margin-bottom: 8px;
}

.agenda-filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border-soft);
    background: rgba(255, 255, 255, 0.96);
    font-size: 12px;
    color: #4b5563;
    white-space: nowrap;
    box-shadow: var(--shadow-light);
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast);
}

.agenda-filter-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
}

.agenda-filter-pill.active {
    background: var(--color-primary);
    color: var(--text-inverse);
    border-color: transparent;
}

.agenda-days {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agenda-day-block {
    background: transparent;
    border-radius: 0;
    padding: 0 0 8px 0;
    box-shadow: none;
    border: none;
}

html[data-theme="dark"] .agenda-day-block {
    background: linear-gradient(145deg, #020617, #020617);
}

.agenda-day-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.agenda-day-icon {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-pill);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-light);
}

html[data-theme="dark"] .agenda-day-icon {
    background: #020617;
}

.agenda-day-icon svg {
    width: 15px;
    height: 15px;
    fill: var(--color-primary);
}

.agenda-day-date {
    font-size: 13px;
    font-weight: 600;
}

.agenda-interventions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* === Carte d'intervention style iOS / screenshot === */

.agenda-intervention-card {
    border-radius: var(--radius-xl);
    padding: 0;
    margin-bottom: 8px;
    background: transparent;
    box-shadow: none;
}

/* “Vraie” carte interne */
.agenda-card-inner {
    border-radius: 24px;
    padding: 12px 14px 10px;
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.98),
        rgba(240, 246, 255, 0.97)
    );
    box-shadow: var(--shadow-card);
    border: 1px solid var(--glass-border);
}

html[data-theme="dark"] .agenda-card-inner {
    background: linear-gradient(
        145deg,
        rgba(15, 23, 42, 0.98),
        rgba(30, 64, 175, 0.96)
    );
}

/* HEADER DE CARTE */

.agenda-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.agenda-card-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agenda-card-icon-circle {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, #60a5fa, #0ea5e9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.45);
    flex-shrink: 0;
}

.agenda-card-icon-circle svg {
    width: 15px;
    height: 15px;
    fill: #ffffff;
}

.agenda-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

html[data-theme="dark"] .agenda-card-title {
    color: #e5e7eb;
}

/* Pastille statut dans le header */

.agenda-card-status-pill {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 500;
    background: rgba(253, 230, 138, 0.95);
    color: #92400e;
}

.agenda-card-status-pill-a_venir {
    background: rgba(253, 230, 138, 0.95);
    color: #92400e;
}

.agenda-card-status-pill-faite {
    background: rgba(187, 247, 208, 0.95);
    color: #166534;
}

.agenda-card-status-pill-annulee {
    background: rgba(254, 226, 226, 0.95);
    color: #b91c1c;
}

/* CLIENT + HORAIRE */

.agenda-card-body {
    margin-top: 2px;
}

.agenda-card-client-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.agenda-card-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, #f97316, #fb7185);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 8px 18px rgba(248, 113, 113, 0.45);
    flex-shrink: 0;
}

.agenda-card-client-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.agenda-card-client-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

html[data-theme="dark"] .agenda-card-client-name {
    color: #f9fafb;
}

.agenda-card-time {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
}

html[data-theme="dark"] .agenda-card-time {
    color: #e5e7eb;
}

.agenda-card-daterange {
    font-size: 12px;
    color: var(--text-muted);
}

/* BLOCS D'INFO (description, adresse, montant) */

.agenda-info-list {
    margin-top: 4px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.agenda-info-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.agenda-info-icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(239, 246, 255, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

html[data-theme="dark"] .agenda-info-icon {
    background: rgba(30, 64, 175, 0.85);
}

.agenda-info-icon svg {
    width: 13px;
    height: 13px;
    fill: var(--color-primary);
}

.agenda-info-content {
    flex: 1;
}

.agenda-info-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.agenda-info-text {
    font-size: 13px;
    color: var(--text-main);
}

html[data-theme="dark"] .agenda-info-text {
    color: #e5e7eb;
}

.agenda-info-amount {
    font-weight: 600;
}

.agenda-info-link a {
    font-size: 12px;
    color: var(--color-primary);
    text-decoration: underline;
}

/* CTA PRINCIPAL */

.agenda-primary-cta {
    margin-top: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
}

.agenda-primary-button {
    border: none;
    border-radius: var(--radius-pill);
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-alt));
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.48);
    cursor: pointer;
    width: 100%;
}

/* FOOTER : modifier + statut + supprimer */

.agenda-card-footer {
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agenda-footer-link {
    font-size: 12px;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
}

.agenda-footer-link:hover {
    text-decoration: underline;
}

/* Segment de statut (3 boutons) */
.agenda-status-segment {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 3px;
    border-radius: var(--radius-pill);
    background: rgba(243, 244, 246, 0.96);
}

html[data-theme="dark"] .agenda-status-segment {
    background: rgba(15, 23, 42, 0.96);
}

.agenda-status-segment button {
    border: none;
    background: transparent;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
}

.agenda-status-segment button.active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 4px 10px rgba(148, 163, 184, 0.6);
}

html[data-theme="dark"] .agenda-status-segment button.active {
    background: #1f2937;
    color: #e5e7eb;
}

/* Bouton supprimer rond */
.agenda-intervention-panel {
    margin-top: 4px;
    transition: max-height 0.25s ease;
}
.agenda-delete-pill {
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(254, 202, 202, 0.96);
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.45);
    cursor: pointer;
    font-size: 16px;          /* taille de l’emoji */
    line-height: 1;
    color: #b91c1c;           /* couleur de l’emoji */
}

.agenda-delete-pill:hover {
    background: rgba(254, 202, 202, 1);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.55);
}


/* Mobile : ajuster légèrement les paddings */

@media (max-width: 480px) {
    .agenda-card-inner {
        padding: 10px 10px 8px;
    }
    .agenda-card-title {
        font-size: 12px;
    }
    .agenda-card-client-name {
        font-size: 13px;
    }
}

/* ===== Footer d'intervention (actions) ===== */

.agenda-intervention-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

/* Action principale large */
.agenda-footer-main {
    margin: 0;
}

.btn-wide {
    width: 100%;
    justify-content: center;
    font-size: 13px;
    padding: 9px 14px;
}

/* Ligne du bas : modifier / statuts / supprimer */
.agenda-footer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

/* Lien "Modifier" */
.agenda-footer-link {
    font-size: 12px;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
}

.agenda-footer-link:hover {
    text-decoration: underline;
}

/* Toggle de statut (3 chips) */
.agenda-footer-status-toggle {
    margin: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--color-border-soft);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .agenda-footer-status-toggle {
    background: rgba(15, 23, 42, 0.96);
}

/* Petites pastilles de statut */
.status-chip {
    border: none;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 500;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition:
        background var(--transition-fast),
        color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
}

.status-chip:hover {
    transform: translateY(-1px);
}

/* États actifs avec couleurs pastel cohérentes */
.status-chip-av.active {
    background: rgba(59, 130, 246, 0.14); /* bleu doux */
    color: #1d4ed8;
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.25);
}

.status-chip-faite.active {
    background: rgba(52, 199, 89, 0.16);
    color: #166534;
    box-shadow: 0 6px 12px rgba(34, 197, 94, 0.30);
}

.status-chip-annulee.active {
    background: rgba(251, 191, 36, 0.16);
    color: #92400e;
    box-shadow: 0 6px 12px rgba(245, 158, 11, 0.30);
}




/* Responsive : sur petits écrans, on empile un peu mieux */
@media (max-width: 480px) {
    .agenda-footer-row {
        gap: 6px;
    }
    .agenda-footer-status-toggle {
        padding: 3px;
    }
    .status-chip {
        padding: 2px 7px;
        font-size: 10px;
    }
}


/* ---------------------------------------------------------
   14. PROSPECTION
   --------------------------------------------------------- */

.stats-prospection {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stats-prospection-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stat-card {
    flex: 1;
    min-width: 150px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: var(--radius-lg);
    padding: 10px 14px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--glass-border);
}

html[data-theme="dark"] .stat-card {
    background: rgba(17, 24, 39, 0.98);
}

.dashboard-stats {
    margin-bottom: 10px;
}

.dashboard-stats-grid {
    margin-top: 4px;
}

.dashboard-stat-card {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-stat-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--color-primary), var(--color-info));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(10, 132, 255, 0.45);
    flex-shrink: 0;
}

.dashboard-stat-icon svg {
    width: 18px;
    height: 18px;
    fill: #ffffff;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
}

.prospection-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prospection-form {
    margin-top: 4px;
}

.prospection-form .form-inline {
    display: flex;
    gap: 10px;
}

.prospection-form .form-inline span {
    flex: 1;
}

.prospects-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prospect-card {
    background: rgba(248, 250, 255, 0.98);
    border-radius: var(--radius-lg);
    padding: 6px 10px;
    border: 1px solid var(--glass-border);
}

html[data-theme="dark"] .prospect-card {
    background: rgba(15, 23, 42, 0.98);
}

.prospect-card summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.prospect-nom {
    font-weight: 600;
}

.prospect-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
}

.prospect-details {
    margin-top: 6px;
    font-size: 13px;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 500;
}

.pill-info {
    background: rgba(94, 92, 230, 0.20);
    color: #3730a3;
}

.pill-success {
    background: rgba(52, 199, 89, 0.16);
    color: #166534;
}

.pill-outline {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--color-border-soft);
}

/* ---------------------------------------------------------
   15. PAGE CLIENTS
   --------------------------------------------------------- */

.clients-page {
    margin-top: 14px;
}

.clients-page h2 {
    margin-bottom: 8px;
}

.clients-search-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    border-radius: 22px;
    padding: 12px 12px 10px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--glass-border);
    margin-bottom: 12px;
}

.clients-search-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.clients-search-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.clients-search-row input[type="text"] {
    flex: 1;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border-soft);
    padding: 8px 12px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.98);
}

.clients-search-row input[type="text"]:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary-soft);
    background: #ffffff;
}

.clients-search-btn {
    padding-inline: 18px;
    font-size: 13px;
}

.clients-new-link {
    margin-top: 8px;
}

.clients-add-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--color-primary);
    text-decoration: none;
}

.clients-add-link:hover {
    text-decoration: underline;
}

.clients-add-icon {
    font-size: 16px;
}

.client-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.client-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 8px 10px 6px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--glass-border);
    transition:
        box-shadow var(--transition-normal),
        transform var(--transition-normal),
        background var(--transition-fast);
}

html[data-theme="dark"] .client-card {
    background: #020617;
}

.client-card.expanded {
    transform: translateY(-1px);
    box-shadow:
        0 20px 40px rgba(10, 132, 255, 0.24),
        0 0 0 1px rgba(255, 255, 255, 1);
}

.client-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
}

.client-card-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.client-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

html[data-theme="dark"] .client-card-name {
    color: #e5e7eb;
}

.client-card-sub {
    font-size: 12px;
    color: #4b5563;
}

html[data-theme="dark"] .client-card-sub {
    color: #cbd5f5;
}

.client-card-caret {
    font-size: 12px;
    color: var(--text-soft);
}

.client-card-panel {
    margin-top: 6px;
    transition: max-height 0.25s ease;
}

.client-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 6px;
}

.client-row {
    font-size: 12px;
    color: #4b5563;
}

html[data-theme="dark"] .client-row {
    color: #e5e7eb;
}

.client-row-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 1px;
}

html[data-theme="dark"] .client-row-label {
    color: #cbd5f5;
}

.client-row-text {
    line-height: 1.4;
}

.client-row-empty {
    color: #9ca3af;
}

.client-interventions {
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.client-intervention-item {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    font-size: 11px;
    background: rgba(249, 250, 251, 0.98);
    border-radius: var(--radius-pill);
    padding: 4px 8px;
}

html[data-theme="dark"] .client-intervention-item {
    background: rgba(15, 23, 42, 0.98);
}

.client-int-date {
    font-weight: 500;
    margin-right: 4px;
}

.client-int-amount {
    margin-left: auto;
    font-weight: 600;
    color: #111827;
}

html[data-theme="dark"] .client-int-amount {
    color: #f97316;
}

.client-int-link {
    font-size: 11px;
    color: var(--color-primary);
    text-decoration: underline;
}

.chip-small {
    background: #e5e7eb;
    color: #374151;
}

html[data-theme="dark"] .chip-small {
    background: #020617;
}

.client-card-footer {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.client-footer-btn {
    padding: 6px 10px;
    font-size: 11px;
}

.client-delete-form {
    margin: 0;
}

/* ---------------------------------------------------------
   16. PAGINATION CLIENTS
   --------------------------------------------------------- */

.clients-pagination {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.clients-page-link {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--color-border-soft);
    color: #4b5563;
    text-decoration: none;
    box-shadow: var(--shadow-light);
}

.clients-page-link.disabled {
    opacity: 0.45;
    cursor: default;
    box-shadow: none;
}

.clients-page-pill {
    padding: 4px 9px;
    border-radius: var(--radius-pill);
    background: rgba(239, 246, 255, 0.96);
    color: #4b5563;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(129, 140, 248, 0.28);
}

.clients-page-pill.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-info));
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.5);
}
/* Suggestions client (autocomplétion interventions) */
.client-suggestions {
    margin-top: 4px;
    border-radius: 16px;
    border: 1px solid var(--color-border-soft);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-light);
    max-height: 220px;
    overflow-y: auto;
    display: none;
}

html[data-theme="dark"] .client-suggestions {
    background: rgba(15, 23, 42, 0.98);
}

.client-suggestion-item {
    padding: 8px 10px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}

html[data-theme="dark"] .client-suggestion-item {
    border-bottom-color: rgba(55, 65, 81, 0.9);
}

.client-suggestion-item:last-child {
    border-bottom: none;
}

.client-suggestion-item:hover {
    background: rgba(242, 244, 255, 0.96);
}

html[data-theme="dark"] .client-suggestion-item:hover {
    background: rgba(31, 41, 55, 0.96);
}

.client-suggestion-new {
    font-weight: 500;
    color: var(--color-primary);
}

/* ---------------------------------------------------------
   17. LOGIN PAGE
   --------------------------------------------------------- */

body.login-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px 16px;
    font-family: var(--font-family);
    color: var(--text-main);
    overflow: hidden;
    position: relative;
}

.login-background-orbit {
    position: fixed;
    inset: -40px;
    pointer-events: none;
    background:
        radial-gradient(circle at 0% 0%, rgba(94, 92, 230, 0.35), transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(10, 132, 255, 0.35), transparent 60%),
        radial-gradient(circle at 0% 100%, rgba(255, 69, 145, 0.25), transparent 55%);
    animation: login-orbit 14s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes login-orbit {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(0, 12px, 0) scale(1.02); }
    100% { transform: translate3d(0, -10px, 0) scale(1.01); }
}

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

.login-card {
    position: relative;
    background: var(--glass-bg);
    border-radius: 26px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    animation: login-card-in 0.6s ease-out;
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
}

@keyframes login-card-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-accent-strip {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0a84ff, #5e5ce6, #34c759, #64d2ff, #ff375f);
    background-size: 200% 100%;
    animation: login-strip-move 8s linear infinite;
}

@keyframes login-strip-move {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-card-inner {
    position: relative;
    padding: 20px 20px 18px;
    z-index: 1;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.login-logo-badge {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, #0a84ff, #34c759);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 10px 22px rgba(10, 132, 255, 0.5);
}

.login-logo-text {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #4b5563;
}

.login-title {
    margin: 4px 0 2px;
    font-size: 24px;
    font-weight: 700;
}

.login-subtitle {
    margin: 0 0 18px;
    font-size: 13px;
    color: var(--text-muted);
}

.login-error {
    margin-bottom: 14px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 59, 48, 0.10);
    color: #b91c1c;
    font-size: 13px;
    border: 1px solid rgba(252, 165, 165, 0.9);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.login-field {
    width: 100%;
}

.login-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #4b5563;
}

.login-input-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 46px;
    border-radius: var(--radius-pill);
    background: rgba(243, 244, 255, 0.98);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 10px 22px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(209, 213, 219, 0.8);
    transition:
        box-shadow var(--transition-normal),
        transform var(--transition-normal),
        border-color var(--transition-normal),
        background var(--transition-fast);
}

.login-input-wrapper:focus-within {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 16px 30px rgba(10, 132, 255, 0.30);
    border-color: rgba(129, 140, 248, 0.9);
    transform: translateY(-1px);
}

.login-input-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.login-input-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--color-primary);
}

.login-input-wrapper input {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-main);
}

.login-input-wrapper input::placeholder {
    color: rgba(148, 163, 184, 0.9);
}

.login-submit {
    width: 100%;
    margin-top: 4px;
    font-size: 14px;
    justify-content: center;
}

.login-footer-text {
    margin-top: 16px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

/* ---------------------------------------------------------
   18. FOOTER
   --------------------------------------------------------- */

footer {
    max-width: 1180px;
    margin: 0 auto 20px auto;
    padding: 10px 14px 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-soft);
}

/* ---------------------------------------------------------
   19. RESPONSIVE iPHONE
   --------------------------------------------------------- */

@media (max-width: 768px) {
    html,
    body {
        overflow-x: hidden;
    }

    .app-header {
        margin-top: 10px;
        padding: 0 10px;
    }

    .app-header-card {
        border-radius: 0 0 var(--radius-xxl) var(--radius-xxl);
        padding: 14px 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .app-header-meta {
        align-items: stretch;
    }

    .app-header-actions {
        justify-content: space-between;
    }

    .btn-primary-pill {
        flex: 1;
        justify-content: center;
        font-size: 14px;
        padding: 9px 16px;
    }

    .app-main {
        margin-top: 10px;
        padding: 0 10px;
        gap: 12px;
    }

    section {
        padding: 14px 14px 16px 14px;
    }

    table,
    .calendar-table {
        font-size: 13px;
    }

    .calendar-table th {
        padding: 6px 0;
        font-size: 12px;
    }

    .calendar-cell {
        height: 110px;
    }

    .calendar-day-number span {
        min-width: 26px;
        min-height: 26px;
        line-height: 26px;
        font-size: 13px;
    }

    .calendar-events {
        max-height: 76px;
        gap: 4px;
    }

    #map-interventions,
    #map-prospects {
        height: 260px;
    }
}

@media (max-width: 480px) {
    .calendar-cell {
        height: 120px;
    }

    .clients-search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .clients-search-btn {
        width: 100%;
        justify-content: center;
    }

    .client-card-footer {
        justify-content: stretch;
    }

    .client-footer-btn {
        flex: 1;
        text-align: center;
    }

    body.login-page {
        padding-top: 20px;
    }

    .login-wrapper {
        max-width: 360px;
    }

    .login-card-inner {
        padding: 18px 18px 16px;
    }

    .login-title {
        font-size: 22px;
    }
}

/* ---------------------------------------------------------
   20. TO-DO / LISTES & TÂCHES (NOUVEAU MODULE)
   --------------------------------------------------------- */

.todo-page {
    padding: 12px 12px calc(env(safe-area-inset-bottom, 16px) + 80px);
}

.todo-lists-wrapper,
.todo-list-wrapper {
    max-width: 760px;
    margin: 0 auto;
}

/* Cartes de listes */
.todo-list-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(18px);
}

[data-theme="dark"] .todo-list-card {
    background: rgba(22, 22, 24, 0.96);
}

.todo-list-main {
    flex: 1;
    text-decoration: none;
    color: inherit;
}

.todo-list-title {
    font-size: 15px;
    font-weight: 600;
}

.todo-list-sub {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

[data-theme="dark"] .todo-list-sub {
    color: #9ca3af;
}

.todo-list-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.todo-list-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    color: #fff;
    white-space: nowrap;
}

.todo-list-delete-form {
    margin: 0;
}

.todo-list-delete-btn {
    border: none;
    outline: none;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.todo-list-delete-btn:hover {
    background: rgba(148, 163, 184, 0.35);
}

/* Bouton flottant + */
.todo-fab {
    position: fixed;
    right: 18px;
    bottom: calc(env(safe-area-inset-bottom, 16px) + 18px);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    text-decoration: none;
    background: linear-gradient(135deg, #3b82f6, #0ea5e9);
    color: #fff;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.6);
    z-index: 50;
}

/* Feuille d'ajout de liste (bottom sheet) */
.todo-newlist-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px;
    border-radius: 20px 20px 0 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    z-index: 60;
    max-width: 760px;
    margin: 0 auto;
}

[data-theme="dark"] .todo-newlist-sheet {
    background: rgba(18, 18, 18, 0.98);
}

.todo-newlist-hidden {
    display: none;
}

.todo-newlist-header {
    text-align: center;
    font-weight: 600;
    margin-bottom: 8px;
}

.todo-newlist-field {
    margin-bottom: 10px;
}

.todo-newlist-field label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.todo-newlist-field input,
.todo-newlist-field select {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(120, 120, 128, 0.18);
    padding: 8px 10px;
    font-size: 14px;
    background: rgba(249, 250, 251, 0.9);
}

[data-theme="dark"] .todo-newlist-field input,
[data-theme="dark"] .todo-newlist-field select {
    background: rgba(30, 30, 32, 0.9);
    color: #f9fafb;
}

.todo-newlist-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Header liste détail */
.todo-list-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.todo-back-btn {
    padding: 4px 10px;
    font-size: 13px;
}

.todo-list-header-texts {
    flex: 1;
}

.todo-list-header-title {
    font-weight: 600;
}

.todo-list-header-sub {
    font-size: 11px;
    color: #6b7280;
}

[data-theme="dark"] .todo-list-header-sub {
    color: #9ca3af;
}

/* Tâches */
.todo-task-card {
    border-radius: 18px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(18px);
    margin-bottom: 8px;
}

[data-theme="dark"] .todo-task-card {
    background: rgba(24, 24, 27, 0.95);
}

.todo-task-card-done {
    opacity: 0.85;
}

.todo-task-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.todo-task-check-btn {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.todo-task-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.todo-task-check.done {
    border-color: #22c55e;
    background: #22c55e;
    color: #fff;
}

.todo-task-label {
    flex: 1;
    font-size: 14px;
}

.todo-task-label.done {
    text-decoration: line-through;
    opacity: 0.6;
}

.todo-task-delete {
    font-size: 16px;
    text-decoration: none;
    color: #9ca3af;
    padding: 4px 4px;
}

.todo-task-delete:hover {
    color: #ef4444;
}

/* Ajout rapide tâche */
.todo-task-add-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.todo-task-add-form input[type="text"] {
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(120, 120, 128, 0.18);
    padding: 8px 12px;
    font-size: 14px;
    background: rgba(249, 250, 251, 0.95);
}

[data-theme="dark"] .todo-task-add-form input[type="text"] {
    background: rgba(24, 24, 27, 0.95);
    color: #e5e7eb;
}

.todo-task-add-btn {
    white-space: nowrap;
    padding-inline: 14px;
}

.todo-tasks-done summary {
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
}

[data-theme="dark"] .todo-tasks-done summary {
    color: #9ca3af;
}

/* Adaptation petits écrans (iPhone SE / mini) */
@media (max-width: 380px) {
    .todo-list-badge {
        font-size: 11px;
        padding-inline: 8px;
    }
    .todo-task-card {
        padding: 8px 10px;
    }
}

/* Fin du thème iOS & To-Do */
/* =========================================================
   SAILLOT APP — UX V2 (Overrides non-destructifs)
   Objectif: hiérarchie + mobile-first + vitesse d’usage terrain
   NOTE: cette section est volontairement placée EN FIN de fichier
         pour surcharger l’existant sans casser tes pages.
   ========================================================= */

/* ---------- 1) Rythme vertical + zone safe mobile ---------- */
:root{
  --content-max: 1180px;
  --gutter: 14px;
  --stack-1: 10px;
  --stack-2: 14px;
  --stack-3: 18px;

  /* Navigation basse */
  --bottom-nav-h: 64px;
  --bottom-nav-bg: rgba(255,255,255,.88);
  --bottom-nav-border: rgba(120,120,128,.18);

  /* Cartes */
  --card-pad: 14px;
  --card-gap: 12px;

  /* Text sizes (plus lisible mobile) */
  --text-xxs: 11px;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 15px;
  --text-lg: 18px;

  /* Surfaces */
  --surface-0: rgba(255,255,255,.72);
  --surface-1: rgba(255,255,255,.88);
  --surface-2: rgba(255,255,255,.96);
}

/* Mode sombre : nav plus “solide” et lisible */
html[data-theme="dark"]{
  --bottom-nav-bg: rgba(18,18,22,.92);
  --bottom-nav-border: rgba(255,255,255,.10);
  --surface-0: rgba(20,20,24,.62);
  --surface-1: rgba(20,20,24,.82);
  --surface-2: rgba(20,20,24,.94);
}

/* Zone main: réserve un “plancher” pour la nav basse */
.app-main{
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 18px);
}

/* Rythme global: sections un peu plus compactes */
section{
  padding: 14px 14px 16px 14px;
}
@media (min-width: 769px){
  section{
    padding: 16px 18px 18px 18px;
  }
}

/* Titres: hiérarchie plus nette */
h2{
  font-size: 20px;
  margin-bottom: 6px;
}
h3{
  font-size: 16px;
}

/* ---------- 2) “Aujourd’hui” / Dashboard: structure ---------- */

/* Optionnel (si tu ajoutes un wrapper) */
.dashboard-wrap{
  display:flex;
  flex-direction:column;
  gap: var(--stack-2);
}

/* Grille widgets: stable, lisible */
.dashboard-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: var(--card-gap);
}
@media (min-width: 560px){
  .dashboard-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 980px){
  .dashboard-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Cartes widgets génériques */
.widget-card{
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, var(--surface-2), rgba(240,246,255,.92));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-light);
  padding: var(--card-pad);
}
html[data-theme="dark"] .widget-card{
  background: linear-gradient(145deg, var(--surface-2), rgba(2,6,23,.92));
}

/* Header widget */
.widget-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.widget-title{
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.widget-sub{
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Valeurs KPI */
.kpi-value{
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.kpi-label{
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ---------- 3) Actions rapides (CTA) ---------- */

.quick-actions{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
}

.btn-cta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,.70);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-alt));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-decoration:none;
  box-shadow: 0 14px 28px rgba(10,132,255,.35);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}
.btn-cta:hover{ transform: translateY(-1px); opacity:.98; }
.btn-cta:active{ transform: translateY(0); opacity:.96; box-shadow: 0 10px 20px rgba(10,132,255,.28); }

.btn-ghost{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-1);
  color: var(--text-main);
  border: 1px solid var(--color-border-soft);
  font-weight: 600;
  font-size: 13px;
  text-decoration:none;
  box-shadow: var(--shadow-light);
}
html[data-theme="dark"] .btn-ghost{
  background: rgba(15,23,42,.88);
}

/* ---------- 4) Navigation basse (mobile-first) ---------- */
/* Tu pourras l’activer via header.php (phase 2) */
.bottom-nav{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(var(--content-max), 100%);
  padding: 10px var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: var(--bottom-nav-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-top: 1px solid var(--bottom-nav-border);
  z-index: 999;
}
.bottom-nav-inner{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items:center;
}
.bottom-nav a{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 4px;
  padding: 8px 8px;
  border-radius: 18px;
  color: var(--text-muted);
  text-decoration:none;
  font-size: 11px;
  font-weight: 600;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.bottom-nav a:hover{ transform: translateY(-1px); }
.bottom-nav a.active{
  background: rgba(10,132,255,.14);
  color: var(--color-primary);
}
.bottom-nav .nav-ico{
  width: 22px;
  height: 22px;
  display:block;
}

/* Sur desktop, on peut masquer la nav basse si tu veux */
@media (min-width: 900px){
  .bottom-nav{
    max-width: 860px;
    border-radius: 18px 18px 0 0;
  }
}

/* ---------- 5) Floating Action Button (optionnel) ---------- */
/* Pour une action + globale (nouvelle intervention) */
.fab{
  position: fixed;
  right: 18px;
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 18px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-alt));
  color: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 18px 34px rgba(10,132,255,.42);
  z-index: 998;
}

/* ---------- 6) Micro-feedback / états ---------- */
.is-muted{ color: var(--text-muted); }
.is-soft{ color: var(--text-soft); }

.pill{
  border: 1px solid var(--color-border-soft);
}
.pill.primary{
  background: rgba(10,132,255,.14);
  border-color: rgba(10,132,255,.22);
  color: var(--color-primary);
}

/* ---------- 7) Densité mobile (réduction scroll) ---------- */
@media (max-width: 480px){
  :root{
    --gutter: 10px;
    --card-pad: 12px;
  }
  .app-main{ padding-left: var(--gutter); padding-right: var(--gutter); }
  section{ padding: 12px 12px 14px 12px; }
  .app-nav{ gap: 6px; }
  .app-nav a{ padding: 6px 12px; }
}



/* =========================================================
   UX V2 — Étape 9 : Navigation desktop propre + mobile clean
   ========================================================= */

/* Sur mobile : on privilégie la bottom-nav, donc on compacte la nav du header */
@media (max-width: 720px){
  .app-nav{
    gap: 6px;
    padding: 8px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .app-nav::-webkit-scrollbar{ display:none; }
  .app-nav a{
    white-space: nowrap;
    padding: 7px 12px;
    font-size: 12px;
  }
  .app-nav-user{
    display:none;
  }
}

/* Sur très petit écran : on peut carrément masquer la nav desktop si bottom-nav présente */
@media (max-width: 420px){
  .app-nav{
    display:none;
  }
}

/* Desktop : nav plus “premium” */
@media (min-width: 721px){
  .app-nav{
    max-width: var(--content-max);
    margin: 8px auto 0 auto;
  }
}

/* Header: éviter que les actions cassent la ligne */
.app-header-actions{
  flex-wrap: wrap;
  justify-content: flex-end;
}
.btn-primary-pill{
  white-space: nowrap;
}

/* =========================================================
   FIN Étape 9
   ========================================================= */

/* =========================================================
   FIN — UX V2 Overrides
   ========================================================= */



/* =========================================================
   UX V2 — Étape 18 : Navigation TOP only (no bottom-nav)
   ========================================================= */

/* Si ton ancien layout réservait de l’espace en bas pour une bottom-nav */
body{ padding-bottom: 0 !important; }
.app-main{ padding-bottom: 12px; }

/* Top nav : meilleure ergonomie mobile */
@media (max-width: 720px){
  .app-nav{
    display:flex;
    gap: 6px;
    padding: 10px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .app-nav::-webkit-scrollbar{ display:none; }
  .app-nav a{
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* Menu actions rapides (bouton +) */
.top-actions{ position: relative; }
.top-actions > summary{
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.top-actions > summary::-webkit-details-marker{ display:none; }

.top-actions-menu{
  position: absolute;
  right: 0;
  top: 44px;
  min-width: 180px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(0,0,0,.18);
  padding: 8px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.top-actions-menu a{
  display:block;
  padding: 10px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: rgba(2,132,199,.06);
  border: 1px solid rgba(2,132,199,.12);
  font-weight: 700;
}

.top-actions-menu a:hover{
  background: rgba(2,132,199,.10);
}

details.top-actions:not([open]) .top-actions-menu{ display:none; }

/* =========================================================
   FIN Étape 18
   ========================================================= */


/* =========================================================
   UX V2 — Étape 18b : suppression FAB (bouton flottant)
   ========================================================= */
.fab{ display:none !important; }
/* ========================================================= */



/* =========================================================
   UX V2 — Étape 20 : Header clean + User dropdown + Draggable FAB
   ========================================================= */

/* User chip (header) */
.user-menu{ position: relative; display: flex; align-items: center; }
.user-chip{
  display:flex; align-items:center; gap:10px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor:pointer;
}
.user-avatar{
  width: 30px; height: 30px; border-radius: 999px;
  display:flex; align-items:center; justify-content:center;
  font-weight: 800;
  background: rgba(2,132,199,.16);
  border: 1px solid rgba(2,132,199,.22);
}
.user-name{ font-weight: 800; font-size: 13px; }
@media (max-width: 520px){
  .user-name{ display:none; }
}

.user-dropdown{
  position:absolute;
  right: 0;
  top: 44px;
  min-width: 220px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(0,0,0,.18);
  padding: 10px;
  z-index: 60;
  display:none;
}
.user-dropdown.open{ display:block; }

.user-dropdown-head{ padding: 6px 6px 10px 6px; border-bottom: 1px solid rgba(15,23,42,.08); margin-bottom: 8px; }
.user-dropdown-name{ font-weight: 900; }
.user-dropdown-sub{ font-size: 12px; color: rgba(15,23,42,.55); margin-top:2px; }

.user-dropdown-item{
  display:block;
  padding: 10px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: rgba(2,132,199,.06);
  border: 1px solid rgba(2,132,199,.12);
  font-weight: 800;
}
.user-dropdown-item:hover{ background: rgba(2,132,199,.10); }

/* Draggable FAB */
.fab{
  width: 56px; height:56px;
  border-radius: 999px;
  border: 1px solid rgba(2,132,199,.22);
  background: rgba(2,132,199,.92);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  box-shadow: 0 18px 46px rgba(0,0,0,.22);
  cursor: grab;
}
.fab-wrap.dragging .fab{ cursor: grabbing; transform: scale(1.02); }

.fab-menu.open{ display:flex; flex-direction:column; gap:6px; }
.fab-menu a:hover{ background: rgba(2,132,199,.10); }

/* ========================================================= */


/* =========================================================
   HOTFIX FAB — forcer l’affichage de la bulle et cacher le menu par défaut
   (utile si une ancienne version de style.css avait .fab{display:none!important})
   ========================================================= */
.fab{ display: inline-flex !important; align-items:center !important; justify-content:center !important; }
.fab-menu.open{ display:flex !important; }
/* ========================================================= */

/* ===== UX PATCH V3 (fab menu anchored + dark) ===== */
.fab-wrap{position: fixed; right: 18px; bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 18px); z-index: 999;}
.fab-menu{
  position:absolute;
  right: 0;
  bottom: 64px;
  min-width: 210px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(0,0,0,.18);
  padding: 8px;
  display:none;
}
[data-theme="dark"] .fab-menu{
  background: rgba(10, 14, 22, .92);
  border-color: rgba(255,255,255,.10);
  box-shadow: 0 18px 46px rgba(0,0,0,.55);
}
.fab-menu::after{
  content:"";
  position:absolute;
  right: 18px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  background: inherit;
  border-right: 1px solid rgba(15,23,42,.12);
  border-bottom: 1px solid rgba(15,23,42,.12);
}
[data-theme="dark"] .fab-menu::after{
  border-right-color: rgba(255,255,255,.10);
  border-bottom-color: rgba(255,255,255,.10);
}
.fab-menu a{
  display:block;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration:none;
  color: inherit;
  font-weight: 800;
}
.fab-menu a:hover{ background: rgba(10,132,255,.10); }


/* User menu dropdown (header) */
.user-menu{ position: relative; }
.user-menu summary{ list-style:none; cursor:pointer; }
.user-menu summary::-webkit-details-marker{ display:none; }
.user-dropdown{
  position:absolute;
  right:0;
  top: 46px;
  min-width: 220px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(0,0,0,.18);
  padding: 10px;
  z-index: 500;
}
[data-theme="dark"] .user-dropdown{
  background: rgba(10, 14, 22, .92);
  border-color: rgba(255,255,255,.10);
  box-shadow: 0 18px 46px rgba(0,0,0,.55);
}
.user-line{ font-size: 12px; opacity: .85; margin-bottom: 10px; }
.user-logout{
  display:block;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration:none;
  font-weight: 900;
}
.user-logout:hover{ background: rgba(10,132,255,.10); }

