@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   CALLUMBA — SYSTÈME DE DESIGN & FEUILLES DE STYLE CENTRALISÉES
   ==========================================================================
   Structure du fichier :
   0. CONFIGURATION & VARIABLES DE MISE EN PAGE (Layout Tokens)
   1. SYSTÈME DE THÈMES & COULEURS (Tokens Sombre & Clair)
   2. BASE, RESET & TYPOGRAPHIE
   3. STRUCTURE GLOBALE, SIDEBAR ("LE PIGEONNIER") & MOBILE
   4. BOUTONS & ACTIONS (Design System Unifié)
   5. BADGES & INDICATEURS
   6. CARTES, CONTENEURS & PANNEAUX
   7. FORMULAIRES & CHAMPS DE SAISIE
   8. SYSTÈME DE MODALES
   9. LECTEUR AUDIO SUR-MESURE
   10. UTILITAIRES, SCROLLBARS & RESPONSIVE
   ========================================================================== */

/* ==========================================================================
   0. CONFIGURATION & VARIABLES DE MISE EN PAGE (Layout Tokens)
   👉 Modifiez ici pour ajuster la largeur de la tour ou du contenu
   ========================================================================== */
:root {
    --sidebar-w: 270px;
    /* Largeur de la tour / barre latérale */
    --content-max-w: 1400px;
    /* Largeur maximale du contenu central */
    --content-pad-x: 100px;
    /* Marges intérieures latérales */
    --content-pad-top: 70px;
    /* Marge supérieure */
    --content-pad-bottom: 64px;
    /* Marge inférieure */
}

/* ==========================================================================
   1. SYSTÈME DE THÈMES & COULEURS (Tokens Sombre & Clair)
   ========================================================================== */

/* --- THÈME SOMBRE (Par Défaut) --- */
:root,
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #151617;
    --panel: #1b1c1e;
    --panel-2: #1e2123;
    --field: #0b0b0b;
    --border: rgba(254, 254, 254, 0.08);
    --border-2: rgba(254, 254, 254, 0.16);
    --text: #f0f0ee;
    --text-bright: #ffffff;
    --muted: #83868d;
    --accent: #f0f0ee;
    --accent-hover: #ffffff;
    --danger: #7f1d1d;
    --danger-border: #991b1b;
    --danger-text: #fca5a5;

    /* 🔘 Boutons Principaux & Actions Internes (Noir / Blanc inversé selon thème) */
    --btn-primary-bg: #ffffff;
    --btn-primary-hover: #e2e8f0;
    --btn-primary-text: #0f1012;

    /* 📞 Boutons Télécom / Lancement d'ordre (Bleu Cobalt Exécutif) */
    --btn-call-bg: #1d7ad8;
    --btn-call-hover: #1763af;
    --btn-call-text: #ffffff;

    /* 🕊️ Palette Signature Pigeon Callumba — Gris discret */
    --pigeon-body: #ffffff;
    --pigeon-light: #ffffff;
    --pigeon-stripe: #ffffff;
    --pigeon-teal: #ffffff;
    --pigeon-slate: #ffffff;
    --pigeon-dark: #ffffff;
    --pigeon-eye: #ffffff;
    --pigeon-highlight: #151617;

    --pigeon-accent: #f0f0ee;
    --pigeon-accent-hover: #ffffff;

    /* Boutons de base */
    --button: rgba(180, 205, 230, 0.06);
    --button-hover: rgba(180, 205, 230, 0.12);
    --button-border: rgba(180, 205, 230, 0.12);
    --button-border-hover: rgba(180, 205, 230, 0.25);
    --button-chat: rgba(180, 205, 230, 0.05);

    /* Typographie */
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --font-sans: Inter, "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: var(--font-sans);

    /* Rayons & Ombres */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-pill: 999px;
    --radius-card: 14px;
    --radius-inner: 10px;
    --radius-modal: 14px;
    --radius-field: 8px;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.75);
    --backdrop-bg: rgba(0, 0, 0, 0.40);
}

/* --- THÈME CLAIR --- */
[data-theme="light"] {
    color-scheme: light;
    --bg: #f8f8f8;
    --panel: #ffffff;
    --panel-2: #ffffff;
    --field: #ffffff;
    --shadow-modal: 0 16px 45px rgba(0, 0, 0, 0.12);
    --backdrop-bg: rgba(255, 255, 255, 0.50);
    --border: rgba(0, 0, 0, 0.07);
    --border-2: rgba(0, 0, 0, 0.12);
    --text: #2c2d30;
    --text-bright: #0f1012;
    --muted: #868b94;
    --accent: #0f1012;
    --accent-hover: #1e293b;
    --danger: #fee2e2;
    --danger-border: #fca5a5;
    --danger-text: #991b1b;

    /* 🔘 Boutons Principaux & Actions Internes (Noir / Blanc inversé selon thème) */
    --btn-primary-bg: #0f1012;
    --btn-primary-hover: #333e4e;
    --btn-primary-text: #ffffff;

    /* 📞 Boutons Télécom / Lancement d'ordre (Bleu Cobalt Exécutif) */
    --btn-call-bg: #1d7ad8;
    --btn-call-hover: #1763af;
    --btn-call-text: #ffffff;

    /* 🕊️ Palette Signature Pigeon Callumba — Gris clair discret */
    --pigeon-body: #0f1012;
    --pigeon-light: #0f1012;
    --pigeon-stripe: #0f1012;
    --pigeon-teal: #0f1012;
    --pigeon-slate: #0f1012;
    --pigeon-dark: #0f1012;
    --pigeon-eye: #0f1012;
    --pigeon-highlight: #ffffff;

    --pigeon-accent: #0f1012;
    --pigeon-accent-hover: #1e293b;

    /* Boutons de base / Survol interactif */
    --button: rgba(0, 0, 0, 0.05);
    --button-hover: rgba(0, 0, 0, 0.08);
    --button-border: #d1d5db;
    --button-border-hover: #9ca3af;
    --button-chat: rgba(0, 0, 0, 0.04);

    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   2. BASE, RESET & TYPOGRAPHIE
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text-bright);
    margin-top: 0;
    letter-spacing: -0.02em;
}

h1,
.page-topbar h1,
.topbar h1 {
    font-size: 1.75rem;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

a {
    color: inherit;
    text-decoration: none;
}

p {
    margin: 0 0 1em;
}

/* Messages d'alerte / Notification */
.page>.message,
.settings-panel .message,
.admin-panel .message,
.flash-message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #4ade80;
    margin-bottom: 16px;
    font-size: 0.88rem;
    display: none;
}

.page>.message.visible,
.settings-panel .message.visible,
.admin-panel .message.visible,
.flash-message.visible {
    display: block;
}

[data-theme="light"] .page>.message,
[data-theme="light"] .settings-panel .message,
[data-theme="light"] .admin-panel .message,
[data-theme="light"] .flash-message {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

/* ==========================================================================
   3. STRUCTURE GLOBALE, SIDEBAR ("LE PIGEONNIER") & MOBILE
   ========================================================================== */

/* Conteneur principal de page (Bande centrale aérée) */
.page {
    width: 100%;
    max-width: var(--content-max-w);
    margin: 0 auto;
    padding-left: calc(var(--sidebar-w) + var(--content-pad-x));
    padding-right: var(--content-pad-x);
    padding-top: var(--content-pad-top);
    padding-bottom: var(--content-pad-bottom);
    box-sizing: border-box;
    min-height: 100vh;
}

.page-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* --- SIDEBAR ("LE PIGEONNIER") --- */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    user-select: none;
    box-sizing: border-box;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 1. Header & Logo (Logo agrandi de +10px) */
.sidebar-header {
    height: 64px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 0px solid var(--border);
    box-sizing: border-box;
}

.sidebar-brand {
    margin: 0px 0px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

.sidebar-logo-icon {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo-icon img,
.sidebar-logo-icon svg {
    margin-top: 1px;
    width: 35px;
    height: 35px;
    display: block;
    object-fit: contain;
}

/* Typographie officielle de la marque CALLUMBA */
.sidebar-brand-name,
.brand-name-title,
.hero-brand-name {
    font-family: var(--font-sans);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: none;
    color: var(--text-bright);
    line-height: 1;
    margin-left: 0px;
    user-select: none;
    display: none;
}

.sidebar-brand-name {
    font-size: 1rem;
}

.hero-brand-name {
    font-size: 0.95rem;
    letter-spacing: 0.35em;
    margin-left: 0.35em;
}

.sidebar-close-mobile {
    display: none;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: var(--muted) !important;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1;
}

.sidebar-close-mobile:hover,
.sidebar-close-mobile:focus,
.sidebar-close-mobile:active {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: var(--text-bright) !important;
}

/* 2. Navigation Principale */
.sidebar-nav-menu {
    border-top: 1px solid var(--border);
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 0px;
}

.sidebar-nav-section-title {
    display: none;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    padding: 8px 12px 4px;
    font-weight: 600;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav-item:hover {
    background: var(--button-hover);
    color: var(--text-bright);
}

[data-theme="dark"] .sidebar-nav-item:hover {
    background: var(--button);
}

[data-theme="light"] .sidebar-nav-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-nav-item.active {
    background: var(--button);
    color: var(--text-bright);
    font-weight: 600;
}

[data-theme="dark"] .sidebar-nav-item.active {
    background: var(--button-hover);
}

[data-theme="light"] .sidebar-nav-item.active {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-nav-icon {
    color: inherit;
    flex-shrink: 0;
}

.sidebar-nav-label {
    flex: 1;
}

.sidebar-count {
    margin-left: auto;
}

/* 3. Section Espace Personnel (À ~50% de hauteur) */
.sidebar-middle-section {
    padding: 12px;
    padding-bottom: 0px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.sidebar-user-card {
    background: var(--field);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-user-card:hover {
    background: var(--field);
    border: 1px solid transparent;
}

.sidebar-user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    text-decoration: none;
    color: var(--text-bright);
}

.sidebar-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    background: #ffffff;
    border: 1px solid var(--border);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--muted);
}

.sidebar-user-avatar svg {
    width: 17px;
    height: 17px;
    color: var(--muted);
    stroke: var(--muted);
    transition: stroke 0.15s ease, color 0.15s ease;
}

.sidebar-user-card:hover .sidebar-user-avatar svg {
    color: var(--text-bright);
    stroke: var(--text-bright);
}

.sidebar-user-name {
    flex: 1;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s ease;
}

.sidebar-settings-icon {
    color: var(--muted);
    flex-shrink: 0;
    transition: transform 0.25s ease, color 0.15s ease;
}

.sidebar-user-card:hover .sidebar-settings-icon {
    transform: rotate(45deg);
    color: var(--text);
}

.sidebar-user-card:hover .sidebar-user-name {
    color: var(--text);
}

/* 4. Carte de Visite du Compte (Sous l'espace personnel) */
.sidebar-vcard {
    padding: 10px 12px;
    ;
    background: var(--field);
    background: transparent;
    border: 0px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.76rem;
}

.sidebar-vcard-row {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    gap: 6px;
}

.sidebar-vcard-label {
    color: var(--muted);
    font-size: 0.72rem;
    white-space: nowrap;
}

.sidebar-vcard-value {
    color: var(--text-bright);
    font-weight: 500;
    font-size: 0.75rem;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-vcard-value.vcard-phone {
    font-family: var(--font-sans);
    font-size: 0.73rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--text-bright);
}

.sidebar-vcard-value.mono {
    font-family: var(--font-sans);
}

/* 5. Footer Sidebar (Tout en bas : Thème & Déconnexion aux extrémités) */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 0px solid var(--border);
    background: var(--bg);
}

.sidebar-footer-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.sidebar-action-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: var(--radius-sm);
    color: var(--muted) !important;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    padding: 0;
    box-sizing: border-box;
}

.sidebar-action-btn:hover {
    color: var(--text-bright) !important;
    background: var(--field) !important;
    border-color: var(--border) !important;
}

.sidebar-action-btn.logout {
    color: var(--muted) !important;
}

.sidebar-action-btn.logout:hover {
    color: var(--text-bright) !important;
    background: var(--field) !important;
    border-color: var(--border) !important;
}

/* Visibilité monochromatique neutre des icônes de thème */
[data-theme="dark"] .icon-moon {
    display: none;
}

[data-theme="dark"] .icon-sun {
    display: inline-block;
    color: var(--muted);
}

.sidebar-action-btn:hover .icon-sun {
    color: var(--text-bright);
}

[data-theme="light"] .icon-sun {
    display: none;
}

[data-theme="light"] .icon-moon {
    display: inline-block;
    color: var(--muted);
}

.sidebar-action-btn:hover .icon-moon {
    color: var(--text-bright);
}

/* --- MOBILE TOPBAR (< 900px) --- */
.mobile-top-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    align-items: center;
    justify-content: flex-start;
    z-index: 990;
}

button.mobile-brand-logo-btn,
.mobile-brand-logo-btn {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-logo-icon {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-logo-icon img,
.mobile-logo-icon svg {
    width: 35px;
    height: 35px;
    display: block;
    object-fit: contain;
}

button.mobile-burger-btn,
.mobile-burger-btn {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    color: var(--text) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

button.mobile-burger-btn:hover,
.mobile-burger-btn:hover,
button.mobile-burger-btn:focus,
.mobile-burger-btn:focus,
button.mobile-burger-btn:active,
.mobile-burger-btn:active {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: var(--text-bright) !important;
}

.mobile-avatar-link img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 995;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   4. BOUTONS & ACTIONS (Design System Unifié)
   ========================================================================== */

button,
.button,
a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.2;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

/* Bouton Secondaire / Standard (Par Défaut sans bordure) */
[data-theme="dark"] button,
[data-theme="dark"] .button,
[data-theme="dark"] a.button {
    background: rgba(180, 205, 230, 0.07);
    border: none;
    color: #e5e7eb;
}

[data-theme="dark"] button:hover,
[data-theme="dark"] .button:hover,
[data-theme="dark"] a.button:hover {
    background: rgba(180, 205, 230, 0.12);
    color: #ffffff;
}

[data-theme="light"] button,
[data-theme="light"] .button,
[data-theme="light"] a.button {
    background: #eeeeee;
    border: none;
    color: #374151;
}

[data-theme="light"] button:hover,
[data-theme="light"] .button:hover,
[data-theme="light"] a.button:hover {
    background: #e2e2e2;
    color: #111827;
}

/* --- BOUTONS D'ICÔNES PURS & VIERGES (Reset total sans background ni box-shadow) --- */
button.btn-icon,
.btn-icon,
button.chat-toggle-btn,
.chat-toggle-btn,
button.conversation-more-btn,
.conversation-more-btn,
button.sidebar-action-btn,
.sidebar-action-btn,
button.conversation-open,
.conversation-open,
button.mobile-burger-btn,
.mobile-burger-btn,
button.sidebar-close-mobile,
.sidebar-close-mobile {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    color: var(--muted) !important;
    min-height: auto;
    line-height: 1;
}

[data-theme="dark"] button.chat-toggle-btn:hover,
[data-theme="dark"] .chat-toggle-btn:hover,
[data-theme="dark"] button.conversation-more-btn:hover,
[data-theme="dark"] .conversation-more-btn:hover,
[data-theme="dark"] .conversation-more-btn.open,
[data-theme="dark"] button.sidebar-action-btn:hover,
[data-theme="dark"] .sidebar-action-btn:hover,
[data-theme="light"] button.chat-toggle-btn:hover,
[data-theme="light"] .chat-toggle-btn:hover,
[data-theme="light"] button.conversation-more-btn:hover,
[data-theme="light"] .conversation-more-btn:hover,
[data-theme="light"] .conversation-more-btn.open,
[data-theme="light"] button.sidebar-action-btn:hover,
[data-theme="light"] .sidebar-action-btn:hover {
    background: var(--field) !important;
    background-color: var(--field) !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-bright) !important;
}

button.conversation-open:hover,
.conversation-open:hover {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Boutons Petits (Hauteur standardisée 32px pour parité stricte button/a) */
button.small,
.button.small,
a.button.small {
    height: 32px;
    min-height: 32px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.82rem;
    line-height: 1;
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    vertical-align: middle;
}

/* 🟢 1. BOUTONS TÉLÉCOMMUNICATION (WhatsApp & Appels) — Harmonisé avec les boutons standards */
/* (Héritent naturellement du style unifié .button / .button.small sans monopoliser l'attention visuelle) */

/* 🔵 2. BOUTONS DE VALIDATION & DÉCLENCHEMENT D'ORDRES — BLEU COBALT #1d4ed8 */
.btn-valider-ia,
.btn-valider-mission,
.btn-valider-contact,
.btn-validate-contact,
button.call,
.btn-call,
.btn-launch,
.btn-launch-ready,
.btn-call-action,
#btnSaveOrdre,
button.btn-send-email,
.modal-footer button.send,
#composeForm button[type="submit"],
#callumbaConfirmOkBtn.btn-confirm-launch,
#callumbaConfirmOkBtn.btn-confirm-validate,
#callumbaConfirmOkBtn.btn-confirm-success {
    background: var(--btn-call-bg, #1d7ad8) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 3px rgba(29, 78, 216, 0.25) !important;
}

.btn-valider-ia:hover,
.btn-valider-mission:hover,
.btn-valider-contact:hover,
.btn-validate-contact:hover,
button.call:hover,
.btn-call:hover,
.btn-launch:hover,
.btn-launch-ready:hover,
.btn-call-action:hover,
#btnSaveOrdre:hover,
button.btn-send-email:hover,
.modal-footer button.send:hover,
#composeForm button[type="submit"]:hover,
#callumbaConfirmOkBtn.btn-confirm-launch:hover,
#callumbaConfirmOkBtn.btn-confirm-validate:hover,
#callumbaConfirmOkBtn.btn-confirm-success:hover {
    background: var(--btn-call-hover, #1763af) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.35) !important;
}

/* 🔘 3. BOUTONS D'ACTION INTERNE, CRÉATION & ENREGISTREMENT — NOIR PROFOND / INVERSÉ */
button.primary,
.button.primary,
button.btn-primary,
.btn-primary,
#btnNewOrdre,
#btnNewMission,
#btnNewTemplate,
#btnOpenNewRdvModal,
#newContactBtn,
#composeBtn,
.btn-use-template,
#btnSaveAgenda,
#btnSaveMission,
#btnSaveTemplate,
.modal-footer button[type="submit"]:not(.send):not(.danger):not(.call):not(.btn-valider-ia):not(.btn-orange-action):not(.btn-whatsapp):not(#btnSaveOrdre),
button.btn-save,
.conversation-new {
    background: var(--btn-primary-bg, #0f1012) !important;
    border: none !important;
    color: var(--btn-primary-text, #ffffff) !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

button.primary:hover,
.button.primary:hover,
button.btn-primary:hover,
.btn-primary:hover,
#btnNewOrdre:hover,
#btnNewMission:hover,
#btnNewTemplate:hover,
#btnOpenNewRdvModal:hover,
#newContactBtn:hover,
#composeBtn:hover,
.btn-use-template:hover,
#btnSaveAgenda:hover,
#btnSaveMission:hover,
#btnSaveTemplate:hover,
.modal-footer button[type="submit"]:not(.send):not(.danger):not(.call):not(.btn-valider-ia):not(.btn-orange-action):not(.btn-whatsapp):not(#btnSaveOrdre):hover,
button.btn-save:hover,
.conversation-new:hover {
    background: var(--btn-primary-hover, #2b3646) !important;
    color: var(--btn-primary-text, #ffffff) !important;
}

/* 🔴 4. BOUTONS DESTRUCTIFS / SUPPRESSION — ROUGE #dc2626 */
#callumbaConfirmOkBtn.btn-confirm-danger,
button.danger,
.button.danger {
    background: #dc2626 !important;
    color: #ffffff !important;
    border: none !important;
}

#callumbaConfirmOkBtn.btn-confirm-danger:hover,
button.danger:hover,
.button.danger:hover {
    background: #b91c1c !important;
}

/* 🟡 BOUTON PLANIFIER / EN AVANCE (.btn-launch-scheduled-future) (SANS BORDURE) */
[data-theme="dark"] .btn-launch-scheduled-future {
    background: rgba(245, 158, 11, 0.18) !important;
    border: none !important;
    color: #fbbf24 !important;
    font-weight: 500 !important;
}

[data-theme="dark"] .btn-launch-scheduled-future:hover {
    background: #f59e0b !important;
    color: #000000 !important;
}

[data-theme="light"] .btn-launch-scheduled-future {
    background: #fef3c7 !important;
    border: none !important;
    color: #92400e !important;
    font-weight: 500 !important;
}

[data-theme="light"] .btn-launch-scheduled-future:hover {
    background: #fde68a !important;
    color: #78350f !important;
}

/* 🔴 BOUTON SUPPRIMER (GHOST DISCRET) */
.btn-delete-ghost {
    background: transparent !important;
    border: none !important;
    color: var(--muted) !important;
    font-size: 0.8rem !important;
    cursor: pointer !important;
    padding: 5px 8px !important;
    border-radius: var(--radius-sm) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    box-shadow: none !important;
    transition: color 0.15s ease, background 0.15s ease !important;
}

.btn-delete-ghost:hover {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.08) !important;
}

/* Boutons Désactivés */
button:disabled,
.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==========================================================================
   5. BADGES & INDICATEURS
   ========================================================================== */

/* Badges Compteurs Uniformisés (Onglets, Sidebar, En-têtes) — Style épuré sans fond */
.tab-badge,
.sidebar-count,
.counter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text-bright) !important;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-transform: none;
    letter-spacing: normal;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    cursor: default;
    transform: none !important;
    transition: color 0.15s ease;
}

.tab-badge,
.counter-badge {
    margin-left: 5px;
}

.sidebar-count {
    margin-left: auto;
}

.segment-btn.active .tab-badge,
.segment-btn:hover .tab-badge,
.segment-btn .tab-badge,
.sidebar-nav-item.active .sidebar-count,
.sidebar-nav-item:hover .sidebar-count,
.sidebar-nav-item .sidebar-count {
    color: var(--text-bright) !important;
    background: transparent !important;
}

.badge {
    font-size: 0.72rem;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-weight: 500;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1.3;
}

/* Badge Proposition IA */
.ai-proposal-badge,
.badge-ai-proposal {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--border);
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    background: var(--button);
    margin-left: 8px;
    vertical-align: middle;
}

/* ==========================================================================
   6. CARTES, CONTENEURS & PANNEAUX
   ========================================================================== */

.mission-panel,
.journal-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
    background: transparent;
    border: none;
    padding: 0;
}

/* Cartes Principales (Missions & Journal) */
.mission-card,
.entry-card {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    margin-bottom: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: opacity 0.2s ease;
}

.entry-card.is-read {
    opacity: 0.42;
    transition: opacity 0.2s ease;
}

.entry-card.is-read:hover {
    opacity: 0.90;
}

.mission-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-bright);
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

/* Boîte de Scénario / Synthèse / Message (Neutre et Sobre) */
.scenario-box,
.entry-body {
    background: var(--field);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 0.92rem;
    color: var(--text);
    margin: 14px 0;
    line-height: 1.55;
}

/* Destinataires */
.recipient-line {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.recipient-chip {
    background: var(--button);
    border: 1px solid var(--border);
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    color: var(--text-bright);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Titres de Section Modernes & Structurants */
.section-separator,
.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-bright);
    text-transform: none;
    letter-spacing: -0.015em;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 32px 0 14px;
    line-height: 1.3;
}

.section-separator::after,
.section-title::after {
    display: none !important;
    content: none !important;
}

.page>.section-separator:first-of-type,
.mission-panel>.section-separator:first-child,
.mission-panel>.section-separator:first-of-type {
    margin-top: 20px;
}

/* Segmented Control (Alternateur d'onglets) */
.segmented-control {
    display: inline-flex;
    align-items: center;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3px;
    gap: 3px;
}

[data-theme="dark"] .segmented-control {
    background: rgba(0, 0, 0, 0.35);
    border-color: var(--border);
}

[data-theme="light"] .segmented-control {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--border);
}

.segmented-control .segment-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    border: 0px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--muted);
    background: transparent;
    box-shadow: none;
    line-height: 1.2;
    white-space: nowrap;
}

.segmented-control .segment-btn:hover {
    color: var(--text-bright);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

[data-theme="light"] .segmented-control .segment-btn:hover {
    background: transparent;
}

.segmented-control .segment-btn.active {
    color: var(--text-bright);
    font-weight: 500;
    border: 0px solid var(--border);
}

[data-theme="dark"] .segmented-control .segment-btn.active {
    background: #232528;
    border-color: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

[data-theme="light"] .segmented-control .segment-btn.active {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    color: #111827;
}

/* ==========================================================================
   7. FORMULAIRES & CHAMPS DE SAISIE
   ========================================================================== */

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]),
select,
textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    background: var(--field) !important;
    background-color: var(--field) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-bright) !important;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    padding: 8px 12px;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* 🍎 Fix Safari / WebKit AutoFill & Trousseau Mots de passe */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--field) inset !important;
    box-shadow: 0 0 0 1000px var(--field) inset !important;
    -webkit-text-fill-color: var(--text-bright) !important;
    caret-color: var(--text-bright) !important;
    transition: background-color 5000s ease-in-out 0s;
}

[data-theme="light"] input:-webkit-autofill,
[data-theme="light"] input:-webkit-autofill:hover,
[data-theme="light"] input:-webkit-autofill:focus,
[data-theme="light"] input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: #111827 !important;
    caret-color: #111827 !important;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0);
}

/* 📅 Champs Date & Heure (Modales Agenda, Missions, Carnet) */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    position: relative;
    cursor: pointer;
}

/* --- Thème Clair : Datepicker et icônes calendrier/horloge en mode clair --- */
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="time"],
[data-theme="light"] input[type="datetime-local"],
html[data-theme="light"] input[type="date"],
html[data-theme="light"] input[type="time"],
html[data-theme="light"] input[type="datetime-local"] {
    color-scheme: light !important;
}

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
html[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator,
html[data-theme="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    border-radius: 4px;
    padding: 3px;
    margin-right: -2px;
    filter: none !important;
    opacity: 0.75;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator:hover,
[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator:hover,
[data-theme="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
html[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator:hover,
html[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator:hover,
html[data-theme="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* --- Thème Sombre : Datepicker et icônes calendrier/horloge en mode sombre --- */
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"],
:root:not([data-theme="light"]) input[type="date"],
:root:not([data-theme="light"]) input[type="time"],
:root:not([data-theme="light"]) input[type="datetime-local"] {
    color-scheme: dark !important;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
:root:not([data-theme="light"]) input[type="date"]::-webkit-calendar-picker-indicator,
:root:not([data-theme="light"]) input[type="time"]::-webkit-calendar-picker-indicator,
:root:not([data-theme="light"]) input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    border-radius: 4px;
    padding: 3px;
    margin-right: -2px;
    filter: none !important;
    opacity: 0.85;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
:root:not([data-theme="light"]) input[type="date"]::-webkit-calendar-picker-indicator:hover,
:root:not([data-theme="light"]) input[type="time"]::-webkit-calendar-picker-indicator:hover,
:root:not([data-theme="light"]) input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    transform: scale(1.1);
}

label {
    display: block;
    font-size: 0.84rem;
    color: var(--text);
    margin-bottom: 4px;
}

.form-group>label,
.form-field>label,
label.form-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Labels horizontaux automatiques pour les checkboxes et boutons radio */
label:has(input[type="checkbox"]),
label:has(input[type="radio"]),
.checkbox-label,
.radio-label,
label.inline {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    cursor: pointer !important;
    margin-bottom: 0 !important;
    text-align: left !important;
}

input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px !important;
    min-width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: var(--field) !important;
    border: 1.5px solid var(--border-2) !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    box-sizing: border-box !important;
    transition: all 0.15s ease !important;
}

input[type="checkbox"]:hover {
    border-color: var(--accent) !important;
}

input[type="checkbox"]:checked {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
}

input[type="checkbox"]:checked::after {
    content: '';
    display: block;
    width: 4px;
    height: 8px;
    border: solid var(--bg);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px !important;
    min-width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: var(--field) !important;
    border: 1.5px solid var(--border-2) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    box-sizing: border-box !important;
    transition: all 0.15s ease !important;
}

input[type="radio"]:hover {
    border-color: var(--accent) !important;
}

input[type="radio"]:checked {
    background: var(--field) !important;
    border-color: var(--accent) !important;
}

input[type="radio"]:checked::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

/* Grille de formulaire standard */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

/* ==========================================================================
   8. SYSTÈME DE MODALES
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--backdrop-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 2000;
    transition: opacity 0.18s ease;
}

.modal-backdrop[aria-hidden="true"],
.modal-backdrop[style*="display: none"] {
    display: none !important;
}

.modal-backdrop.open {
    display: flex !important;
}

.modal {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    width: min(600px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 22px 24px;
    box-sizing: border-box;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none !important;
    border: none;
    color: var(--muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
}

.modal-close:hover {
    color: var(--text-bright);
}

.modal-body {
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--border);
}

.modal-footer-right {
    display: flex;
    gap: 8px;
}

/* ==========================================================================
   9. LECTEUR AUDIO SUR-MESURE CALLUMBA
   ========================================================================== */

.custom-audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--field);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    max-width: 480px;
}

.audio-play-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--button);
    border: 1px solid var(--border);
    color: var(--text-bright);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: transform 0.1s ease;
}

.audio-play-btn:hover {
    transform: scale(1.05);
}

.audio-progress-wrap {
    flex: 1;
    position: relative;
    height: 6px;
    background: rgba(254, 254, 254, 0.1);
    border-radius: 3px;
    display: flex;
    align-items: center;
}

[data-theme="light"] .audio-progress-wrap {
    background: rgba(0, 0, 0, 0.1);
}

.audio-progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    border-radius: 3px;
    overflow: hidden;
}

.audio-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.audio-seek {
    position: absolute;
    left: 0;
    top: -5px;
    width: 100%;
    height: 16px;
    opacity: 0;
    cursor: pointer;
    margin: 0;
}

.audio-time {
    font-family: var(--font-sans);
    font-variant-numeric: tabular-nums;
    font-size: 0.76rem;
    color: var(--muted);
    flex-shrink: 0;
}

/* ==========================================================================
   10. UTILITAIRES, SCROLLBARS & RESPONSIVE
   ========================================================================== */

/* --- Classes Utilitaires Universelles --- */
/* Flexbox & Grille */
.d-flex,
.flex {
    display: flex;
}

.d-inline-flex,
.inline-flex {
    display: inline-flex;
}

.d-grid,
.grid {
    display: grid;
}

.flex-row {
    flex-direction: row;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1 1 0%;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

/* Alignement & Justification */
.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.justify-start {
    justify-content: flex-start;
}

/* Espacements & Gaps */
.gap-1 {
    gap: 4px;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.gap-6 {
    gap: 24px;
}

/* Marges externes */
.m-0 {
    margin: 0;
}

.mt-1 {
    margin-top: 4px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

.ml-auto {
    margin-left: auto;
}

.mr-auto {
    margin-right: auto;
}

/* Typographie & Couleurs */
.text-muted {
    color: var(--muted);
}

.text-bright {
    color: var(--text-bright);
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.85rem;
}

.text-base {
    font-size: 0.95rem;
}

.text-lg {
    font-size: 1.15rem;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.font-mono {
    font-family: var(--font-mono);
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dimensions & Affichage */
.w-full,
.w-100 {
    width: 100%;
}

.h-full {
    height: 100%;
}

.d-none,
.hidden {
    display: none;
}

.d-block,
.block {
    display: block;
}

.pointer {
    cursor: pointer;
}

/* Barres de défilement discrètes */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* --- RESPONSIVE TABLETTES & MOBILES --- */
@media (max-width: 1024px) {
    :root {
        --content-pad-x: 32px;
        --content-pad-top: 48px;
    }
}

@media (max-width: 900px) {
    .mobile-top-bar {
        display: flex;
    }

    .app-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-soft);
        transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
        will-change: transform;
    }

    .app-sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-close-mobile {
        display: block;
    }

    .page {
        padding-left: 16px;
        padding-right: 16px;
        padding-top: 76px;
        padding-bottom: 40px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {

    .mission-card,
    .entry-card {
        padding: 16px 16px;
    }

    .page-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .page-topbar.agenda-topbar {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .page-topbar>div {
        justify-content: space-between;
    }

    .modal {
        padding: 16px;
    }
}

/* --- MODALE UNIVERSELLE DE CONFIRMATION CALLUMBA --- */
.callumba-confirm-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--backdrop-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 16px;
    box-sizing: border-box;
}

.callumba-confirm-backdrop.active {
    display: flex;
}

.callumba-confirm-modal {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-modal);
    box-shadow: var(--shadow-modal);
    max-width: 410px;
    width: 100%;
    padding: 26px 24px 22px;
    text-align: center;
    box-sizing: border-box;
    animation: callumbaConfirmPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes callumbaConfirmPop {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(6px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.callumba-confirm-icon {
    margin: 0 auto 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.12);
    color: #ef4444;
}

.callumba-confirm-title {
    font-size: 1.18rem;
    margin: 0 0 8px;
    font-weight: 600;
    color: var(--text-bright);
}

.callumba-confirm-message {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0 0 22px;
    line-height: 1.5;
}

.callumba-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.callumba-confirm-actions .button {
    min-width: 105px;
    padding: 8px 16px;
}

/* Adaptation du logo pigeon selon le thème Callumba (découplé du thème de l'OS) */
.logo-for-dark {
    display: none !important;
}

.logo-for-light {
    display: block !important;
}

[data-theme="dark"] .logo-for-light {
    display: none !important;
}

[data-theme="dark"] .logo-for-dark {
    display: block !important;
}