/* Ekovio — App CSS (styles personnalisés, tailwind.css chargé séparément) */
@import url('/assets/css/inter.css');

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

body { font-family: 'Inter', system-ui, sans-serif; }


input.iti__tel-input { padding-right: 0 !important; }

.nav-link        { color: #6b7280; transition: color .15s; }
.nav-link:hover  { color: #111827; }
.nav-link.active { color: #111827; font-weight: 500; }

.mobile-nav-link        { display: block; padding: .625rem 0; font-size: .875rem; color: #4b5563; transition: color .15s; }
.mobile-nav-link:hover  { color: #111827; }
.mobile-nav-link.active { color: #111827; font-weight: 500; }
.iti:has(.iti__tel-input) { width: 100%; }

/* Logo Ekovio (inline, voir partials/ekovio-logo.php), repris d'ekovio-dev :
   le gris reprend celui des liens du menu (.nav-link) avec le même survol,
   seul l'accent (teal) garde la couleur de marque d'origine. */
.ekovio-logo-fg     { fill: #4b5563; transition: fill .15s; }
.ekovio-logo-link:hover .ekovio-logo-fg { fill: #111827; }
.ekovio-logo-accent { fill: #02929c; transition: fill .15s; }
.ekovio-logo-link:hover .ekovio-logo-accent { fill: #027179; }

@media (max-width: 640px) {
    form .grid.grid-cols-2 { grid-template-columns: 1fr !important; }
}

/* ── Toggle switch ──────────────────────────────────────────────────────────── */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .875rem 1rem;
    border-radius: .75rem;
    border: 1px solid #e5e7eb;
    transition: background .15s;
}
.toggle-row:not(.toggle-row--locked):hover { background: #f9fafb; }
.toggle-switch { display: inline-flex; flex-shrink: 0; cursor: pointer; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.toggle-track {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 9999px;
    background: #d1d5db;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.12);
    transition: background .2s ease;
}
.toggle-switch input:checked ~ .toggle-track { background: #2563eb; }
.toggle-switch input:focus-visible ~ .toggle-track { outline: 2px solid #93c5fd; outline-offset: 2px; }

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.22);
    transition: transform .2s ease;
}
.toggle-switch input:checked ~ .toggle-track .toggle-thumb { transform: translateX(20px); }

/* ── Search bar ───────────────────────────────────────────────────────────── */
.search-bar {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid #d1d5db;
    border-radius: .5rem;
    padding: .5rem .75rem;
    background: #fff;
    width: 16rem;
    transition: box-shadow .15s, border-color .15s;
}
.search-bar:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.25);
}
.search-bar svg { flex-shrink: 0; color: #9ca3af; }
.search-bar input {
    border: none;
    outline: none;
    background: transparent;
    font-size: .875rem;
    width: 100%;
    color: #111827;
}
.search-bar input::placeholder { color: #9ca3af; }

/* ── Clickable rows ───────────────────────────────────────────────────────── */
tr[data-href] { cursor: pointer; }

/* ── Data tables ──────────────────────────────────────────────────────────── */
table thead th { padding-top: .875rem !important; padding-bottom: .875rem !important; }
table tbody td { padding-top: 1.125rem !important; padding-bottom: 1.125rem !important; }

/* ── Confirm Modal ────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-box {
    background: #fff;
    border-radius: .875rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 22rem;
    box-shadow: 0 20px 40px rgba(0,0,0,.15);
}
.modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: .375rem;
}
.modal-msg {
    font-size: .875rem;
    color: #6b7280;
    margin-bottom: 1.25rem;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: .625rem;
}
.modal-btn-cancel {
    padding: .5rem 1rem;
    border-radius: .5rem;
    font-size: .875rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: background .15s;
}
.modal-btn-cancel:hover { background: #f9fafb; }
.modal-btn-ok {
    padding: .5rem 1rem;
    border-radius: .5rem;
    font-size: .875rem;
    font-weight: 500;
    background: #dc2626;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background .15s;
}
.modal-btn-ok:hover { background: #b91c1c; }
.modal-btn-ok.modal-btn-blue { background: #2563eb; }
.modal-btn-ok.modal-btn-blue:hover { background: #1d4ed8; }

/* Toggle always-on (obligatoire) */
.toggle-track--forced {
    background: #2563eb;
    opacity: .5;
    cursor: not-allowed;
}
.toggle-track--forced .toggle-thumb { transform: translateX(20px); }

/* ── Bulk table select ────────────────────────────────────────────────────── */
.bulk-th, .bulk-cell {
    width: 2.5rem;
    min-width: 2.5rem;
    cursor: pointer;
    user-select: none;
}
.bulk-check {
    display: flex;
    align-items: center;
    justify-content: center;
}
.bulk-check-inner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid #d1d5db;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s, background .15s, opacity .15s, box-shadow .15s;
    opacity: 0;
    flex-shrink: 0;
}
tr:hover .bulk-check-inner       { opacity: 1; border-color: #9ca3af; }
.bulk-th .bulk-check-inner        { opacity: 1; }
tr.is-bulk-selected .bulk-check-inner {
    opacity: 1;
    background: #2563eb;
    border-color: #2563eb;
}
.bulk-th.bulk-th--all .bulk-check-inner  { background: #2563eb; border-color: #2563eb; }
.bulk-th.bulk-th--some .bulk-check-inner { background: #bfdbfe; border-color: #93c5fd; }
.bulk-check-mark, .bulk-dash-mark { display: none; color: #fff; width: 10px; height: 10px; flex-shrink: 0; }
tr.is-bulk-selected .bulk-check-mark   { display: block; }
.bulk-th.bulk-th--all  .bulk-check-mark { display: block; }
.bulk-th.bulk-th--some .bulk-dash-mark  { display: block; color: #2563eb; }

/* ── Table overlay action bar ─────────────────────────────────────────────── */
.table-action-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    padding: 0 1.25rem 0 0;
    background: #eff6ff;
    border-bottom: 1px solid #bfdbfe;
    border-radius: 0;
}
.table-action-bar.hidden { display: none; }
.table-action-bar .bulk-check-inner { opacity: 1; background: #fff; }
.table-action-bar [data-bulk-action="deselect-all"] { background: none; border: none; padding: 0; }

/* ── Quill editor ───────────────────────────────────────────────────────────── */
.ql-toolbar.ql-snow,
.ql-container.ql-snow { margin-top: 0 !important; }

.ql-toolbar.ql-snow {
    margin-top: 0.75rem !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.5rem 0.5rem 0 0 !important;
    background: #f9fafb !important;
    padding: 6px 8px !important;
}

.ql-container.ql-snow {
    border: 1px solid #e5e7eb !important;
    border-top: none !important;
    border-radius: 0 0 0.5rem 0.5rem !important;
    background: #fff !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-size: 0.875rem !important;
    min-height: inherit;
}

.ql-editor { min-height: inherit; padding: 10px 12px !important; }

.ql-toolbar.ql-snow .ql-formats { margin-right: 8px !important; }

.ql-snow .ql-stroke { stroke: #6b7280 !important; }
.ql-snow .ql-fill  { fill:   #6b7280 !important; }
.ql-snow .ql-picker { color: #6b7280 !important; }

.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke { stroke: #2563eb !important; }

.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow .ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill,
.ql-snow .ql-toolbar button.ql-active .ql-fill { fill: #2563eb !important; }

.ql-snow.ql-toolbar button:hover,
.ql-snow .ql-toolbar button:hover,
.ql-snow.ql-toolbar button.ql-active,
.ql-snow .ql-toolbar button.ql-active {
    background: #eff6ff !important;
    border-radius: 0.25rem !important;
}

.ql-snow .ql-picker-label:hover,
.ql-snow .ql-picker-label.ql-active { color: #2563eb !important; }

/* ══ Repris d'ekovio-dev (2026-10-16) : interrupteurs, champs, barre latérale, thème sombre ══ */

/* Toggle always-on (obligatoire) */
.toggle-track--forced {
    background: #2563eb;
    opacity: .5;
    cursor: not-allowed;
}
.toggle-track--forced .toggle-thumb { transform: translateX(20px); }


/* ── Champs de formulaire ─────────────────────────────────────────────────── */
.form-label { display: block; font-size: .8125rem; font-weight: 500; color: #374151; margin-bottom: .25rem; }
.form-input { width: 100%; border: 1px solid #d1d5db; border-radius: .5rem; padding: .5rem .75rem; font-size: .875rem; background: #fff; }
.form-input:focus { outline: none; box-shadow: 0 0 0 2px #93c5fd; border-color: #3b82f6; }

/* ── Barre latérale gauche (toutes les pages internes) ─────────────────────
   Reprise d'ekovio-dev : pleine hauteur, réductible à une colonne d'icônes,
   en tiroir hors écran sur mobile. */
#sidebar {
    width: 270px;
    transition: width .3s cubic-bezier(.4,0,.2,1);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    flex-shrink: 0;
}
#sidebar.collapsed { width: 60px; }
#sidebar .sidebar-text { opacity: 1; transition: opacity .15s ease; white-space: nowrap; overflow: hidden; }
#sidebar.collapsed .sidebar-text { opacity: 0; pointer-events: none; }
#sidebar.collapsed #sidebarHeader { justify-content: center; }
#sidebar.collapsed #sidebarHeader .sidebar-text { display: none; }
@media (max-width: 767px) {
    #sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; width: 280px;
        transform: translateX(-100%);
        transition: transform .3s cubic-bezier(.4,0,.2,1);
        z-index: 50;
    }
    #sidebar.mobile-open { transform: translateX(0); }
    #sidebar.collapsed { width: 280px; }
    #sidebar.collapsed .sidebar-text { opacity: 1; pointer-events: auto; }
    #sidebar.collapsed #sidebarHeader { justify-content: space-between; }
    #sidebar.collapsed #sidebarHeader .sidebar-text { display: flex; }
}

}

/* ══════════════════════════════════════════════════════════════════════════
   Thème sombre - piloté par [data-theme="dark"] sur <html> (voir layouts/*)
   ══════════════════════════════════════════════════════════════════════════ */
[data-theme="dark"] { color-scheme: dark; }

[data-theme="dark"] body { background-color: #0f1420; color: #e5e7eb; }

/* Backgrounds */
[data-theme="dark"] .bg-white    { background-color: #161b26; }
[data-theme="dark"] .bg-gray-50  { background-color: #10141d; }
[data-theme="dark"] .bg-gray-50\/80 { background-color: rgba(16,20,29,.8); }
[data-theme="dark"] .bg-gray-100 { background-color: #1f2530; }
[data-theme="dark"] .bg-gray-200 { background-color: #2a3141; }
[data-theme="dark"] .bg-gray-300 { background-color: #3a4354; }
[data-theme="dark"] .bg-gray-900 { background-color: #05070c; }
[data-theme="dark"] .bg-blue-50  { background-color: rgba(37,99,235,.14); }
[data-theme="dark"] .bg-blue-50\/40 { background-color: rgba(37,99,235,.10); }
[data-theme="dark"] .bg-blue-100 { background-color: rgba(37,99,235,.22); }

/* Hover backgrounds */
[data-theme="dark"] .hover\:bg-gray-50:hover  { background-color: #1c222e; }
[data-theme="dark"] .hover\:bg-white:hover    { background-color: #1c222e; }
[data-theme="dark"] .hover\:bg-gray-50\/60:hover { background-color: rgba(28,34,46,.6); }
[data-theme="dark"] .hover\:bg-gray-100:hover { background-color: #232a38; }
[data-theme="dark"] .hover\:bg-gray-200:hover { background-color: #2a3141; }
[data-theme="dark"] .hover\:bg-blue-50:hover  { background-color: rgba(37,99,235,.18); }
[data-theme="dark"] .hover\:bg-blue-50\/30:hover { background-color: rgba(37,99,235,.06); }
[data-theme="dark"] .hover\:bg-blue-100:hover { background-color: rgba(37,99,235,.26); }
[data-theme="dark"] .hover\:bg-indigo-100:hover { background-color: rgba(99,102,241,.24); }
[data-theme="dark"] .hover\:bg-red-50:hover  { background-color: rgba(239,68,68,.16); }
[data-theme="dark"] .hover\:bg-red-200:hover { background-color: rgba(239,68,68,.28); }
[data-theme="dark"] .hover\:bg-amber-100:hover { background-color: rgba(245,158,11,.24); }
[data-theme="dark"] .hover\:bg-amber-200:hover { background-color: rgba(245,158,11,.32); }
[data-theme="dark"] .hover\:bg-orange-100:hover { background-color: rgba(249,115,22,.24); }

/* Text */
[data-theme="dark"] .text-gray-900 { color: #f3f4f6; }
[data-theme="dark"] .text-gray-800 { color: #e5e7eb; }
[data-theme="dark"] .text-gray-700 { color: #d1d5db; }
[data-theme="dark"] .text-gray-600 { color: #9ca3af; }
[data-theme="dark"] .text-gray-500 { color: #8b94a3; }
[data-theme="dark"] .text-gray-400 { color: #6b7280; }
[data-theme="dark"] .text-gray-300 { color: #4b5563; }
[data-theme="dark"] .text-gray-200 { color: #374151; }

/* Text hover - un survol doit toujours ÉCLAIRCIR sur fond sombre (comme
   #contextCountrySwitcher button:hover ci-dessous), jamais assombrir vers
   la teinte Tailwind brute (ex: hover:text-gray-700 -> #374151, presque
   invisible sur fond sombre sans cette surcharge). */
[data-theme="dark"] .hover\:text-gray-700:hover { color: #f3f4f6; }

/* Borders */
[data-theme="dark"] .border-gray-50  { border-color: #191e29; }
[data-theme="dark"] .border-gray-100 { border-color: #202634; }
[data-theme="dark"] .border-gray-200 { border-color: #2a3141; }
[data-theme="dark"] .border-gray-300 { border-color: #3a4354; }
[data-theme="dark"] .divide-gray-50  > :not([hidden]) ~ :not([hidden]) { border-color: #191e29; }
[data-theme="dark"] .divide-gray-100 > :not([hidden]) ~ :not([hidden]) { border-color: #202634; }

/* Sidebar */
[data-theme="dark"] #sidebar { background-color: #10141d; border-color: #232936; }
[data-theme="dark"] #sidebar nav a:hover,
[data-theme="dark"] #sidebar nav a.text-blue-700 { color: #ffffff; }

/* Logo Ekovio (voir aussi règles claires ci-dessus) - mêmes teintes que
   #sidebar nav a / a:hover (text-gray-600 sombre puis blanc au survol). */
[data-theme="dark"] .ekovio-logo-fg     { fill: #9ca3af; }
[data-theme="dark"] .ekovio-logo-link:hover .ekovio-logo-fg { fill: #ffffff; }
[data-theme="dark"] .ekovio-logo-accent { fill: #309ea6; }
[data-theme="dark"] .ekovio-logo-link:hover .ekovio-logo-accent { fill: #13ecfb; }

/* Sélecteurs de contexte (en-tête) */
[data-theme="dark"] #contextCompanySwitcher button:hover,
[data-theme="dark"] #contextYearSwitcher button:hover,
[data-theme="dark"] #contextCountrySwitcher button:hover { color: #ffffff; }

/* Bouton Back Office + menu utilisateur (en-tête) */
[data-theme="dark"] #boButton:hover,
[data-theme="dark"] #boButton.text-blue-700,
[data-theme="dark"] #userMenu button:hover { color: #ffffff; }

/* Inputs, selects, textareas */
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
    background-color: #161b26; color: #e5e7eb; border-color: #3a4354;
}
[data-theme="dark"] input::placeholder, [data-theme="dark"] textarea::placeholder { color: #6b7280; }
[data-theme="dark"] input:disabled { background-color: #1a202b; color: #6b7280; }
[data-theme="dark"] .form-input { background-color: #161b26; color: #e5e7eb; border-color: #3a4354; }
/* Spécificité supérieure à la règle .form-input ci-dessus (même sélectivité
   de base [data-theme="dark"] .form-input mais + [readonly]) - mêmes teintes
   que input:disabled pour rester cohérent avec le seul autre style "champ
   non modifiable" déjà présent dans ce fichier. */
[data-theme="dark"] .form-input[readonly] { background-color: #1a202b; color: #6b7280; }
/* Select coloré selon le statut (ex: .mission-status-select, voir
   partials/mission-header.php) : même piège que .form-input[readonly]
   ci-dessus - [data-theme="dark"] .bg-amber-100 etc. (spécificité
   [data-theme="dark"] + classe, identique à .form-input) ne l'emportait que
   par accident d'ordre de déclaration dans ce fichier (plus bas que la ligne
   564 pour amber/sky/emerald - purement fortuit, pas garanti). Le sélecteur
   "select.bg-*" ajoute un sélecteur de type, ce qui bat .form-input à coup
   sûr, sans dépendre de l'ordre. Mêmes teintes que les badges .bg-*-100/
   .text-*-700 plus bas dans ce fichier (section "couleurs sémantiques").
   Étendre avec la même paire pour toute autre couleur de statut posée un
   jour sur un <select>. */
[data-theme="dark"] select.bg-amber-100    { background-color: rgba(245,158,11,.20); }
[data-theme="dark"] select.text-amber-700  { color: #fbbf24; }
[data-theme="dark"] select.bg-sky-100      { background-color: rgba(14,165,233,.20); }
[data-theme="dark"] select.text-sky-700    { color: #38bdf8; }
[data-theme="dark"] select.bg-emerald-100  { background-color: rgba(16,185,129,.20); }
[data-theme="dark"] select.text-emerald-700 { color: #34d399; }

/* intl-tel-input - liste des pays (variables CSS de la librairie) */
[data-theme="dark"] .iti {
    --iti-dropdown-bg: #161b26;
    --iti-border-color: #3a4354;
    --iti-hover-color: rgba(255,255,255,.08);
    --iti-text-gray: #8b94a3;
    --iti-arrow-color: #9ca3af;
}
[data-theme="dark"] .iti__country-list { color: #e5e7eb; }

/* Modals */
[data-theme="dark"] .modal-box, [data-theme="dark"] .modal-box-lg { background: #161b26; }
[data-theme="dark"] .modal-title { color: #f3f4f6; }
[data-theme="dark"] .modal-msg { color: #9ca3af; }
[data-theme="dark"] .modal-btn-cancel { background: #1f2530; border-color: #3a4354; color: #d1d5db; }
[data-theme="dark"] .modal-btn-cancel:hover { background: #262e3d; }
[data-theme="dark"] .form-label { color: #d1d5db; }

/* Search bar */
[data-theme="dark"] .search-bar { background: #161b26; border-color: #3a4354; }
[data-theme="dark"] .search-bar input { color: #e5e7eb; }

/* Table action bar (bulk) & row selection */
[data-theme="dark"] .table-action-bar { background: #16233d; border-color: #2b3f66; }
[data-theme="dark"] .is-bulk-selected { background-color: rgba(37,99,235,.14) !important; }
[data-theme="dark"] .is-bulk-selected:hover { background-color: rgba(37,99,235,.22) !important; }
[data-theme="dark"] .bulk-check-inner { background: #161b26; border-color: #3a4354; }

/* Inline field editor */
[data-theme="dark"] .field-editor input, [data-theme="dark"] .field-editor select, [data-theme="dark"] .field-editor textarea { color: #e5e7eb; }

/* Nav links (marketing/public layout) */
[data-theme="dark"] .nav-link { color: #9ca3af; }
[data-theme="dark"] .nav-link:hover, [data-theme="dark"] .nav-link.active { color: #f3f4f6; }
[data-theme="dark"] .mobile-nav-link { color: #9ca3af; }
[data-theme="dark"] .mobile-nav-link:hover, [data-theme="dark"] .mobile-nav-link.active { color: #f3f4f6; }

/* Toggle row */
[data-theme="dark"] .toggle-row { border-color: #2a3141; }
[data-theme="dark"] .toggle-row:not(.toggle-row--locked):hover { background: #1c222e; }
[data-theme="dark"] .toggle-track { background: #3a4354; }

/* Checkbox de matrice de droits */
[data-theme="dark"] .perm-checkbox { background: #161b26; border-color: #3a4354; }
[data-theme="dark"] .perm-checkbox:hover:not(:disabled) { border-color: #4b5563; }
[data-theme="dark"] .perm-checkbox:focus-visible { outline-color: #3b82f6; }
[data-theme="dark"] .perm-radio { background: #161b26; border-color: #3a4354; }
[data-theme="dark"] .perm-radio:hover:not(:disabled) { border-color: #4b5563; }
[data-theme="dark"] .perm-radio:focus-visible { outline-color: #3b82f6; }

/* Theme picker */
[data-theme="dark"] .theme-option { background: transparent; }
[data-theme="dark"] .theme-option.border-gray-200:hover { background: #1c222e; }
[data-theme="dark"] .theme-option.bg-blue-50\/40 { background-color: rgba(37,99,235,.16); }

/* Quill editor */
[data-theme="dark"] .ql-toolbar.ql-snow { background: #1a202b !important; border-color: #3a4354 !important; }
[data-theme="dark"] .ql-container.ql-snow { background: #161b26 !important; border-color: #3a4354 !important; color: #e5e7eb; }
[data-theme="dark"] .ql-editor.ql-blank::before { color: #6b7280; }

/* Dropdown de suggestions Google Places (autocomplétion d'adresse) - injecté
   par le script Google Maps directement dans <body>, hors de la structure de
   l'app, donc stylé ici plutôt que via une classe posée par nos vues. */
[data-theme="dark"] .pac-container {
    background-color: #161b26;
    border-color: #2a3141;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
[data-theme="dark"] .pac-item {
    background-color: #161b26;
    border-top-color: #202634;
    color: #9ca3af;
}
[data-theme="dark"] .pac-item:hover,
[data-theme="dark"] .pac-item-selected {
    background-color: #232a38;
}
[data-theme="dark"] .pac-item-query {
    color: #f3f4f6;
}
[data-theme="dark"] .pac-matched {
    color: #60a5fa;
}
[data-theme="dark"] .pac-icon {
    filter: invert(1) brightness(1.3);
}

/* Scrollbar */
[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: #10141d; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2a3141; border-radius: 6px; }

/* ── Dark theme - couleurs sémantiques (alertes, badges) ──────────────────── */

/* Backgrounds pastel -> tons translucides sur fond sombre */
[data-theme="dark"] .bg-green-50   { background-color: rgba(34,197,94,.12); }
[data-theme="dark"] .bg-green-100  { background-color: rgba(34,197,94,.20); }
[data-theme="dark"] .bg-red-50     { background-color: rgba(239,68,68,.12); }
[data-theme="dark"] .bg-red-100    { background-color: rgba(239,68,68,.20); }
[data-theme="dark"] .bg-red-200    { background-color: rgba(239,68,68,.28); }
[data-theme="dark"] .bg-amber-50   { background-color: rgba(245,158,11,.12); }
[data-theme="dark"] .bg-amber-100  { background-color: rgba(245,158,11,.20); }
[data-theme="dark"] .bg-amber-200  { background-color: rgba(245,158,11,.28); }
[data-theme="dark"] .bg-purple-50  { background-color: rgba(168,85,247,.12); }
[data-theme="dark"] .bg-purple-100 { background-color: rgba(168,85,247,.20); }
[data-theme="dark"] .bg-violet-100 { background-color: rgba(139,92,246,.20); }
[data-theme="dark"] .bg-indigo-50  { background-color: rgba(99,102,241,.12); }
[data-theme="dark"] .bg-indigo-100 { background-color: rgba(99,102,241,.20); }
[data-theme="dark"] .bg-emerald-50  { background-color: rgba(16,185,129,.12); }
[data-theme="dark"] .bg-emerald-100 { background-color: rgba(16,185,129,.20); }
[data-theme="dark"] .bg-pink-100    { background-color: rgba(236,72,153,.20); }
[data-theme="dark"] .bg-orange-50   { background-color: rgba(249,115,22,.12); }
[data-theme="dark"] .bg-orange-100  { background-color: rgba(249,115,22,.20); }
[data-theme="dark"] .bg-sky-100     { background-color: rgba(14,165,233,.20); }

/* Bordures pastel */
[data-theme="dark"] .border-green-200 { border-color: rgba(34,197,94,.35); }
[data-theme="dark"] .border-red-200   { border-color: rgba(239,68,68,.35); }
[data-theme="dark"] .border-amber-200 { border-color: rgba(245,158,11,.35); }
[data-theme="dark"] .border-blue-200  { border-color: rgba(37,99,235,.35); }
[data-theme="dark"] .border-indigo-100 { border-color: rgba(99,102,241,.22); }
[data-theme="dark"] .border-emerald-100 { border-color: rgba(16,185,129,.22); }
[data-theme="dark"] .border-blue-100  { border-color: rgba(37,99,235,.22); }
[data-theme="dark"] .border-amber-100 { border-color: rgba(245,158,11,.22); }
[data-theme="dark"] .border-emerald-200 { border-color: rgba(16,185,129,.35); }
[data-theme="dark"] .border-purple-100 { border-color: rgba(168,85,247,.22); }
[data-theme="dark"] .border-red-100   { border-color: rgba(239,68,68,.22); }
/* border-blue-300 : bloc mis en avant (ex: onboarding/index.php), un ton
   plus marqué que border-blue-200 (.35 ci-dessus) - même logique de teinte
   translucide, jamais la valeur Tailwind brute (#93c5fd, trop clair/plat sur
   fond sombre). */
[data-theme="dark"] .border-blue-300  { border-color: rgba(37,99,235,.4); }

/* Ring (halo de sélection) - même traitement que les bordures 100 ci-dessus */
[data-theme="dark"] .ring-blue-100 { --tw-ring-color: rgba(37,99,235,.35); }

/* Bordure pleine "actif" (onglet courant, filtre actif, radio choisi - ex:
   sectors/detail.php, index.php filter-btn) - même teinte que text-blue-600
   ci-dessous pour que le soulignement d'onglet et son libellé restent
   visuellement assortis (bleu Tailwind brut #2563eb trop terne sur fond
   sombre une fois le texte éclairci). */
[data-theme="dark"] .border-blue-600 { border-color: #60a5fa; }

/* Bordures hover */
[data-theme="dark"] .hover\:border-blue-200:hover { border-color: #3b82f6; }
[data-theme="dark"] .hover\:border-blue-300:hover { border-color: #3b82f6; }
[data-theme="dark"] .hover\:border-gray-300:hover { border-color: #4b5563; }

/* Ombre hover (cards cliquables statements/sectors/tasks) - box-shadow
   surchargé directement (jamais les variables --tw-shadow*, jamais touchées
   ailleurs dans ce fichier) : shadow-sm par défaut est un noir à 5%
   d'opacité, imperceptible sur un fond déjà sombre - remplacé par une valeur
   plus marquée pour conserver l'effet de "soulèvement" au survol. */
[data-theme="dark"] .hover\:shadow-sm:hover { box-shadow: 0 1px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.3); }

/* Textes foncés (700/800/900) -> variantes claires lisibles sur fond sombre */
[data-theme="dark"] .text-green-600  { color: #4ade80; }
[data-theme="dark"] .text-green-700  { color: #4ade80; }
[data-theme="dark"] .text-green-800  { color: #4ade80; }
[data-theme="dark"] .text-green-900  { color: #4ade80; }
[data-theme="dark"] .text-red-500    { color: #f87171; }
[data-theme="dark"] .text-red-600    { color: #f87171; }
[data-theme="dark"] .text-red-700    { color: #f87171; }
[data-theme="dark"] .text-red-800    { color: #f87171; }
[data-theme="dark"] .text-amber-600  { color: #fbbf24; }
[data-theme="dark"] .text-amber-700  { color: #fbbf24; }
[data-theme="dark"] .text-amber-800  { color: #fbbf24; }
[data-theme="dark"] .text-amber-900  { color: #fbbf24; }
[data-theme="dark"] .text-blue-400   { color: #93c5fd; }
[data-theme="dark"] .text-blue-500   { color: #60a5fa; }
[data-theme="dark"] .text-blue-600   { color: #60a5fa; }
[data-theme="dark"] .text-blue-700   { color: #60a5fa; }
[data-theme="dark"] .text-blue-800   { color: #60a5fa; }
[data-theme="dark"] .text-purple-700 { color: #c084fc; }
[data-theme="dark"] .text-violet-700  { color: #a78bfa; }
[data-theme="dark"] .text-indigo-600 { color: #818cf8; }
[data-theme="dark"] .text-indigo-700 { color: #818cf8; }
[data-theme="dark"] .text-indigo-800 { color: #818cf8; }
[data-theme="dark"] .text-emerald-600 { color: #34d399; }
[data-theme="dark"] .text-emerald-700 { color: #34d399; }
[data-theme="dark"] .text-emerald-800 { color: #34d399; }
[data-theme="dark"] .text-pink-700    { color: #f472b6; }
[data-theme="dark"] .text-orange-700  { color: #fb923c; }
[data-theme="dark"] .text-sky-700     { color: #38bdf8; }

/* hover variants sur ces mêmes couleurs */
[data-theme="dark"] .hover\:text-blue-800:hover { color: #93c5fd; }
[data-theme="dark"] .hover\:text-red-600:hover  { color: #f87171; }
[data-theme="dark"] .hover\:text-red-700:hover  { color: #f87171; }
[data-theme="dark"] .hover\:text-red-800:hover  { color: #f87171; }
[data-theme="dark"] .hover\:text-indigo-900:hover { color: #818cf8; }

[data-theme="dark"] .task-card--highlighted { background-color: #1e3a5f !important; box-shadow: 0 0 0 2px #3b82f6; }


/* Infobulle d'aide "?" (voir info_tip() dans helpers.php, wireInfoTips() dans
   app.js). Pastille bleue identique en thème clair et sombre ; zone de tap
   élargie par ::after sans grossir la pastille. Le popover est en position
   fixe, largeur bornée à la fenêtre moins 2 x 16px pour rester lisible sur
   mobile. */
.info-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    margin-left: .25rem;
    vertical-align: text-bottom;
    border-radius: 9999px;
    background: #2563eb;
    color: #fff;
    font-size: .6875rem;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    flex-shrink: 0;
}
.info-tip::after { content: ''; position: absolute; inset: -.5rem; }
.info-tip:hover, .info-tip[aria-expanded="true"] { background: #1d4ed8; }
.info-tip:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.info-tip-popover {
    position: fixed;
    z-index: 9000;
    max-width: min(20rem, calc(100vw - 2rem));
    padding: .5rem .75rem;
    border-radius: .5rem;
    background: #111827;
    color: #fff;
    font-size: .8125rem;
    font-weight: 400;
    line-height: 1.4;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,.2);
    pointer-events: none;
}

/* Pastille "Partner" (utilisateur client rattaché à 6 sociétés ou plus, voir
   PortfolioPartnerService / partner_chip() dans helpers.php /
   partnerChipHtml() dans app.js). Réservée au Staff. Un seul code couleur,
   violet, partout (listes, fiches, en-tête, sélecteur de sociétés) pour
   qu'on l'identifie sans lire. Classes CSS et non Tailwind : helpers.php
   n'est pas scanné par le build. */
.partner-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    max-width: 100%;
    padding: .0625rem .4375rem;
    border-radius: .5rem;
    background: #f5f3ff;
    color: #6d28d9;
    box-shadow: inset 0 0 0 1px #ddd6fe;
    font-size: .6875rem;
    font-weight: 500;
    line-height: 1.25rem;
    white-space: nowrap;
    vertical-align: middle;
    text-decoration: none;
}
.partner-chip svg { width: .75rem; height: .75rem; flex-shrink: 0; }
.partner-chip span { overflow: hidden; text-overflow: ellipsis; }
a.partner-chip:hover { background: #ede9fe; color: #5b21b6; }
.partner-chip-sm { padding: 0 .3125rem; font-size: .625rem; line-height: 1rem; }
/* Sélecteur de sociétés : liseré + fond léger sur les sociétés gérées par
   un partner, 2e ligne "Partner : Nom" sous le nom de la société. */
.context-company-option.is-partner-company { box-shadow: inset 3px 0 0 #8b5cf6; background: #faf5ff; }
.context-company-option.is-partner-company:hover { background: #f3e8ff; }
.context-company-partner { display: block; font-size: .6875rem; line-height: 1rem; color: #7c3aed; }
[data-theme="dark"] .partner-chip { background: rgba(139,92,246,.16); color: #c4b5fd; box-shadow: inset 0 0 0 1px rgba(139,92,246,.35); }
[data-theme="dark"] a.partner-chip:hover { background: rgba(139,92,246,.28); color: #ddd6fe; }
[data-theme="dark"] .context-company-option.is-partner-company { background: rgba(139,92,246,.10); }
[data-theme="dark"] .context-company-option.is-partner-company:hover { background: rgba(139,92,246,.18); }
[data-theme="dark"] .context-company-partner { color: #c4b5fd; }
/* En-tête sur mobile : icône seule, le nom reste dans l'infobulle (title). */
@media (max-width: 639px) {
    .context-partner .partner-chip span { display: none; }
    .context-partner .partner-chip { padding: .1875rem; }
}

/* Thème sombre : éléments propres à Ekovio Lead */
[data-theme="dark"] .nav-link { color: #9ca3af; }
[data-theme="dark"] .nav-link:hover, [data-theme="dark"] .nav-link.active { color: #f3f4f6; }
[data-theme="dark"] .mobile-nav-link { color: #9ca3af; }
[data-theme="dark"] .mobile-nav-link:hover, [data-theme="dark"] .mobile-nav-link.active { color: #f3f4f6; }
[data-theme="dark"] .ekovio-logo-fg { fill: #9ca3af; }
[data-theme="dark"] .ekovio-logo-link:hover .ekovio-logo-fg { fill: #ffffff; }
[data-theme="dark"] .ekovio-logo-accent { fill: #309ea6; }
[data-theme="dark"] .ekovio-logo-link:hover .ekovio-logo-accent { fill: #13ecfb; }
[data-theme="dark"] .toggle-row { border-color: #2a3242; }
[data-theme="dark"] .toggle-row:not(.toggle-row--locked):hover { background: #1c2230; }
[data-theme="dark"] .form-input { background: #0f1420; border-color: #2a3242; color: #e5e7eb; }
[data-theme="dark"] .form-label { color: #d1d5db; }
