/* =========================================================
   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: linear-gradient(
        145deg,
        rgba(245, 245, 255, 0.98),
        rgba(237, 245, 255, 0.96)
    );
    border-radius: 24px;
    padding: 10px 10px 8px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--glass-border);
}

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;
}

.agenda-intervention-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 9px 10px;
    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"] .agenda-intervention-card {
    background: #020617;
}

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

/* Header cliquable */
.agenda-intervention-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
}

.agenda-intervention-main {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

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

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

.agenda-intervention-time-sep {
    margin: 0 2px;
    opacity: 0.7;
}

.agenda-intervention-client {
    font-size: 13px;
    color: #4b5563;
}
.agenda-intervention-dates {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 2px;
}

html[data-theme="dark"] .agenda-intervention-dates {
    color: #9ca3af;
}


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

.agenda-intervention-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
    align-items: center;
}

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

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

.chip-type {
    background: rgba(10, 132, 255, 0.10);
    color: #0b64c2;
}

.chip-statut-a_venir {
    background: rgba(255, 204, 0, 0.14);
    color: #854d0e;
}

.chip-statut-faite {
    background: rgba(52, 199, 89, 0.12);
    color: #166534;
}

.chip-statut-annulee {
    background: rgba(255, 59, 48, 0.12);
    color: #b91c1c;
}

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

.agenda-intervention-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.agenda-row {
    display: flex;
    gap: 8px;
}

.agenda-row-icon {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-pill);
    background: rgba(243, 244, 255, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

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

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

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

.agenda-row-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
}

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

.agenda-row-text {
    margin-top: 1px;
}

.agenda-row-amount {
    font-weight: 600;
    color: #111827;
}

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

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

/* Footer de fiche */
.agenda-intervention-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.agenda-footer-actions {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.agenda-footer-actions button {
    flex: 1;
    justify-content: center;
}

/* Boutons actions iOS */
.agenda-footer-actions .btn-primary-pill {
    background: rgba(52, 199, 89, 0.18);
    color: #166534;
    border: 1px solid rgba(52, 199, 89, 0.55);
    box-shadow: 0 6px 14px rgba(22, 101, 52, 0.22);
}

.agenda-footer-actions .btn-secondary-pill {
    background: rgba(10, 132, 255, 0.14);
    color: #0b64c2;
    border: 1px solid rgba(10, 132, 255, 0.45);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.20);
}

.agenda-footer-actions .btn-warning-pill {
    background: rgba(255, 204, 0, 0.18);
    color: #92400e;
    border: 1px solid rgba(253, 224, 71, 0.95);
    box-shadow: 0 6px 14px rgba(180, 83, 9, 0.20);
}

.agenda-footer-actions .btn-danger-pill {
    background: rgba(255, 59, 48, 0.18);
    color: #b91c1c;
    border: 1px solid rgba(252, 165, 165, 0.95);
    box-shadow: 0 6px 14px rgba(185, 28, 28, 0.22);
}

.agenda-footer-actions .btn-primary-pill.btn-sm,
.agenda-footer-actions .btn-secondary-pill.btn-sm,
.agenda-footer-actions .btn-warning-pill.btn-sm,
.agenda-footer-actions .btn-danger-pill.btn-sm {
    padding: 6px 0;
    font-size: 11px;
    font-weight: 500;
    border-radius: var(--radius-pill);
}

/* ---------------------------------------------------------
   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);
}

/* ---------------------------------------------------------
   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 */
