/* Dark mode UX unifié — palette marine quasi noire
   Chargé après style.css pour surcharger les anciens gris. */

html.dark-mode,
html.dark-mode body {
    background-color: var(--lp-bg, #050910) !important;
    color: var(--lp-text, #e7eef8);
}

/* Utilitaires Bootstrap */
html.dark-mode .bg-white,
html.dark-mode .bg-body,
html.dark-mode .bg-body-tertiary,
html.dark-mode .bg-body-secondary,
html.dark-mode .bg-light {
    background-color: var(--lp-surface, #0e1729) !important;
    color: var(--lp-text, #e7eef8) !important;
}

html.dark-mode .text-dark,
html.dark-mode .text-body,
html.dark-mode .text-black {
    color: var(--lp-text, #e7eef8) !important;
}

html.dark-mode .text-secondary,
html.dark-mode .text-muted,
html.dark-mode .form-text,
html.dark-mode small.text-muted,
html.dark-mode .text-black-50 {
    color: var(--lp-muted, #8fa0b8) !important;
}

html.dark-mode .border,
html.dark-mode .border-top,
html.dark-mode .border-bottom,
html.dark-mode .border-start,
html.dark-mode .border-end,
html.dark-mode hr {
    border-color: var(--lp-border, #1c2c44) !important;
}

html.dark-mode .shadow,
html.dark-mode .shadow-sm,
html.dark-mode .shadow-lg {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45) !important;
}

html.dark-mode ::placeholder {
    color: var(--lp-muted, #8fa0b8) !important;
    opacity: 0.75;
}

html.dark-mode ::selection {
    background: var(--lp-accent-soft, #132744);
    color: var(--lp-text, #e7eef8);
}

/* Cartes / modales / listes */
html.dark-mode .card,
html.dark-mode .modal-content,
html.dark-mode .offcanvas,
html.dark-mode .list-group-item,
html.dark-mode .accordion-item,
html.dark-mode .dropdown-menu,
html.dark-mode .popover,
html.dark-mode .toast {
    background-color: var(--lp-surface, #0e1729) !important;
    border-color: var(--lp-border, #1c2c44) !important;
    color: var(--lp-text, #e7eef8) !important;
}

html.dark-mode .card-header,
html.dark-mode .card-footer,
html.dark-mode .modal-header,
html.dark-mode .modal-footer,
html.dark-mode .offcanvas-header,
html.dark-mode .accordion-button,
html.dark-mode .popover-header {
    background-color: var(--lp-surface-2, #142038) !important;
    border-color: var(--lp-border, #1c2c44) !important;
    color: var(--lp-text, #e7eef8) !important;
}

html.dark-mode .accordion-button:not(.collapsed) {
    background-color: var(--lp-accent-soft, #132744) !important;
    color: var(--lp-text, #e7eef8) !important;
    box-shadow: inset 0 -1px 0 var(--lp-border, #1c2c44);
}

html.dark-mode .accordion-button::after {
    filter: invert(1) brightness(1.4);
}

html.dark-mode .accordion-body,
html.dark-mode .accordion-collapse {
    background-color: var(--lp-surface, #0e1729) !important;
    color: var(--lp-text, #e7eef8);
}

html.dark-mode .list-group-item-action:hover,
html.dark-mode .list-group-item-action:focus,
html.dark-mode .dropdown-item:hover,
html.dark-mode .dropdown-item:focus {
    background-color: var(--lp-accent-soft, #132744) !important;
    color: var(--lp-text, #e7eef8) !important;
}

html.dark-mode .dropdown-divider {
    border-top-color: var(--lp-border, #1c2c44);
}

html.dark-mode .modal-backdrop.show {
    opacity: 0.72;
}

html.dark-mode .btn-close {
    filter: invert(1) grayscale(1) brightness(1.4);
}

/* Formulaires */
html.dark-mode .form-control,
html.dark-mode .form-select,
html.dark-mode .form-control-plaintext,
html.dark-mode .input-group-text,
html.dark-mode textarea.form-control {
    background-color: var(--lp-surface-2, #142038) !important;
    border-color: var(--lp-border, #1c2c44) !important;
    color: var(--lp-text, #e7eef8) !important;
}

html.dark-mode .form-control:focus,
html.dark-mode .form-select:focus,
html.dark-mode textarea.form-control:focus {
    background-color: var(--lp-surface, #0e1729) !important;
    border-color: var(--lp-accent, #3d7eff) !important;
    color: var(--lp-text, #e7eef8) !important;
    box-shadow: 0 0 0 0.25rem rgba(61, 126, 255, 0.22);
}

html.dark-mode .form-control:disabled,
html.dark-mode .form-select:disabled,
html.dark-mode .form-control[readonly] {
    background-color: var(--lp-bg-soft, #080e1a) !important;
    color: var(--lp-muted, #8fa0b8) !important;
    opacity: 1;
}

html.dark-mode .form-check-input {
    background-color: var(--lp-surface-2, #142038);
    border-color: var(--lp-border, #1c2c44);
}

html.dark-mode .form-check-input:checked {
    background-color: var(--lp-accent, #3d7eff);
    border-color: var(--lp-accent, #3d7eff);
}

html.dark-mode .form-label,
html.dark-mode label:not(.btn) {
    color: var(--lp-text, #e7eef8);
}

/* Tableaux */
html.dark-mode .table,
html.dark-mode .table thead th,
html.dark-mode .table td,
html.dark-mode .table > :not(caption) > * > * {
    color: var(--lp-text, #e7eef8);
    border-color: var(--lp-border, #1c2c44) !important;
    background-color: transparent;
}

html.dark-mode .table thead th,
html.dark-mode .table-light,
html.dark-mode .table > thead {
    background-color: var(--lp-surface-2, #142038) !important;
    color: var(--lp-text, #e7eef8) !important;
}

html.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(20, 32, 56, 0.55) !important;
    color: var(--lp-text, #e7eef8);
}

html.dark-mode .table-hover tbody tr:hover > *,
html.dark-mode .table-hover > tbody > tr:hover > * {
    background-color: var(--lp-accent-soft, #132744) !important;
    color: var(--lp-text, #e7eef8);
}

/* Tabs / pills / pagination */
html.dark-mode .nav-tabs {
    border-bottom-color: var(--lp-border, #1c2c44);
}

html.dark-mode .nav-tabs .nav-link {
    color: var(--lp-muted, #8fa0b8);
}

html.dark-mode .nav-tabs .nav-link:hover {
    border-color: var(--lp-border, #1c2c44);
    color: var(--lp-text, #e7eef8);
}

html.dark-mode .nav-tabs .nav-link.active {
    background-color: var(--lp-surface, #0e1729) !important;
    border-color: var(--lp-border, #1c2c44) var(--lp-border, #1c2c44) var(--lp-surface, #0e1729) !important;
    color: var(--lp-text, #e7eef8) !important;
}

html.dark-mode .nav-pills .nav-link {
    color: var(--lp-muted, #8fa0b8);
}

html.dark-mode .nav-pills .nav-link:hover:not(.active) {
    background-color: var(--lp-accent-soft, #132744);
    color: var(--lp-text, #e7eef8);
}

html.dark-mode .pagination .page-link {
    background-color: var(--lp-surface, #0e1729);
    border-color: var(--lp-border, #1c2c44);
    color: #8eb6ff;
}

html.dark-mode .pagination .page-link:hover {
    background-color: var(--lp-accent-soft, #132744);
    color: var(--lp-text, #e7eef8);
}

html.dark-mode .pagination .page-item.active .page-link {
    background-color: var(--lp-accent, #3d7eff);
    border-color: var(--lp-accent, #3d7eff);
}

html.dark-mode .pagination .page-item.disabled .page-link {
    background-color: var(--lp-bg-soft, #080e1a);
    color: var(--lp-muted, #8fa0b8);
}

/* Boutons */
html.dark-mode .btn-outline-primary {
    color: #8eb6ff;
    border-color: #3d6fd4;
}

html.dark-mode .btn-outline-primary:hover,
html.dark-mode .btn-outline-primary:focus {
    background-color: var(--lp-accent, #3d7eff);
    border-color: var(--lp-accent, #3d7eff);
    color: #fff;
}

html.dark-mode .btn-outline-secondary {
    color: var(--lp-muted, #8fa0b8);
    border-color: var(--lp-border, #1c2c44);
}

html.dark-mode .btn-outline-secondary:hover {
    background-color: var(--lp-surface-2, #142038);
    color: var(--lp-text, #e7eef8);
    border-color: var(--lp-muted, #8fa0b8);
}

html.dark-mode .btn-outline-success {
    color: #75e0a8;
    border-color: #2f9e68;
}

html.dark-mode .btn-outline-danger {
    color: #ff8f9a;
    border-color: #c45a64;
}

html.dark-mode .btn-outline-info {
    color: #7dd3fc;
    border-color: #2a9fbf;
}

html.dark-mode .btn-outline-warning {
    color: #ffd666;
    border-color: #c9a227;
}

html.dark-mode .btn-light,
html.dark-mode .btn-outline-light {
    background-color: var(--lp-surface-2, #142038);
    border-color: var(--lp-border, #1c2c44);
    color: var(--lp-text, #e7eef8);
}

html.dark-mode .btn-secondary {
    background-color: #2a3a55;
    border-color: #2a3a55;
}

/* Alertes & badges */
html.dark-mode .alert-primary,
html.dark-mode .alert-info {
    background-color: var(--lp-accent-soft, #132744) !important;
    border-color: #274872 !important;
    color: #cfe2ff !important;
}

html.dark-mode .alert-success {
    background-color: #0f2a1c !important;
    border-color: #1f6b45 !important;
    color: #b6f0cf !important;
}

html.dark-mode .alert-warning {
    background-color: #2a220c !important;
    border-color: #8a6d1d !important;
    color: #ffe8a3 !important;
}

html.dark-mode .alert-danger {
    background-color: #2a1216 !important;
    border-color: #8a303a !important;
    color: #ffc2c8 !important;
}

html.dark-mode .alert-secondary {
    background-color: var(--lp-surface-2, #142038) !important;
    border-color: var(--lp-border, #1c2c44) !important;
    color: var(--lp-muted, #8fa0b8) !important;
}

html.dark-mode .badge.bg-light,
html.dark-mode .badge.text-bg-light {
    background-color: var(--lp-surface-2, #142038) !important;
    color: var(--lp-text, #e7eef8) !important;
}

html.dark-mode .badge.bg-secondary {
    background-color: #334861 !important;
}

/* Typo / liens / footer */
html.dark-mode .card-title,
html.dark-mode .card-text,
html.dark-mode h1,
html.dark-mode h2,
html.dark-mode h3,
html.dark-mode h4,
html.dark-mode h5,
html.dark-mode h6 {
    color: var(--lp-text, #e7eef8);
}

html.dark-mode a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.badge) {
    color: #8eb6ff;
}

html.dark-mode a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.badge):hover {
    color: #b3d0ff;
}

html.dark-mode footer,
html.dark-mode .breadcrumb {
    background-color: var(--lp-bg-soft, #080e1a) !important;
    color: var(--lp-muted, #8fa0b8) !important;
    border-color: var(--lp-border, #1c2c44) !important;
}

html.dark-mode footer a,
html.dark-mode footer .list-unstyled a {
    color: #8eb6ff !important;
}

html.dark-mode footer h5 {
    color: var(--lp-text, #e7eef8) !important;
}

html.dark-mode .breadcrumb-item + .breadcrumb-item::before {
    color: var(--lp-muted, #8fa0b8);
}

html.dark-mode .progress {
    background-color: var(--lp-surface-2, #142038);
}

html.dark-mode .spinner-border.text-primary,
html.dark-mode .spinner-grow.text-primary {
    color: var(--lp-accent, #3d7eff) !important;
}

html.dark-mode #locationBanner {
    background: rgba(8, 14, 26, 0.96) !important;
    color: var(--lp-text, #e7eef8);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.45);
}

html.dark-mode .notifications-wrapper {
    background: rgba(8, 14, 26, 0.98) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

html.dark-mode .notification-item {
    background: var(--lp-surface, #0e1729) !important;
    border-color: var(--lp-border, #1c2c44) !important;
}

html.dark-mode .notification-item.unread {
    background: var(--lp-accent-soft, #132744) !important;
}

html.dark-mode .notification-title {
    color: var(--lp-text, #e7eef8);
}

html.dark-mode .notification-text,
html.dark-mode .notification-date {
    color: var(--lp-muted, #8fa0b8);
}

/* Composants métier */
html.dark-mode .company-card,
html.dark-mode .lp-login-card,
html.dark-mode .lp-rental-thumb,
html.dark-mode .lp-rental-item-card,
html.dark-mode .lp-stats-kpi,
html.dark-mode .lp-stats-panel,
html.dark-mode .lp-stats-activity-card,
html.dark-mode .stats-panel,
html.dark-mode .stats-grid__item,
html.dark-mode .lp-dash-activity .lp-dash-stat-row,
html.dark-mode .lp-suggest,
html.dark-mode .reviews-wrapper,
html.dark-mode .review-item,
html.dark-mode .pro-response,
html.dark-mode .contact-card,
html.dark-mode .contact-item,
html.dark-mode .addressService,
html.dark-mode .sidebar {
    background-color: var(--lp-surface, #0e1729) !important;
    border-color: var(--lp-border, #1c2c44) !important;
    color: var(--lp-text, #e7eef8);
}

html.dark-mode .contact-item:hover {
    background-color: var(--lp-accent-soft, #132744) !important;
}

html.dark-mode .contact-icon {
    background-color: var(--lp-surface-2, #142038) !important;
    color: #8eb6ff !important;
}

html.dark-mode .logo-container,
html.dark-mode .company-logo,
html.dark-mode .lp-rental-thumb-media,
html.dark-mode .lp-rental-item-card-media,
html.dark-mode .lp-rental-thumb-placeholder {
    background-color: var(--lp-bg-soft, #080e1a) !important;
    color: var(--lp-muted, #8fa0b8);
}

html.dark-mode .lp-transport-sidebar {
    background: var(--lp-bg-soft, #080e1a) !important;
    border-color: var(--lp-border, #1c2c44) !important;
}

html.dark-mode .lp-transport-sidebar-head,
html.dark-mode .lp-route-card {
    background: var(--lp-surface, #0e1729) !important;
    border-color: var(--lp-border, #1c2c44) !important;
    color: var(--lp-text, #e7eef8);
}

html.dark-mode .lp-route-card.is-active {
    background: var(--lp-accent-soft, #132744) !important;
    border-color: var(--lp-accent, #3d7eff) !important;
}

html.dark-mode .lp-route-card-title,
html.dark-mode .lp-rental-thumb-price,
html.dark-mode .lp-rental-catalog-title,
html.dark-mode .stats-grid__value,
html.dark-mode .lp-stats-kpi-value,
html.dark-mode .stats-title {
    color: var(--lp-text, #e7eef8) !important;
}

html.dark-mode .lp-route-badge {
    background: var(--lp-surface-2, #142038) !important;
    color: var(--lp-muted, #8fa0b8) !important;
}

html.dark-mode .lp-route-badge.price {
    background: #0f2a1c !important;
    color: #b6f0cf !important;
}

html.dark-mode .lp-map-hint-inner {
    background: rgba(14, 23, 41, 0.96) !important;
    border-color: var(--lp-border, #1c2c44) !important;
}

html.dark-mode .lp-home-shortcut {
    background: var(--lp-accent-soft, #132744) !important;
    border-color: var(--lp-border, #1c2c44) !important;
    color: #9ec5fe !important;
}

html.dark-mode .lp-home-shortcut:hover {
    background: var(--lp-accent, #3d7eff) !important;
    color: #fff !important;
}

html.dark-mode .lp-login-signup {
    border-top-color: var(--lp-border, #1c2c44) !important;
}

html.dark-mode .lp-login-signup-text {
    color: var(--lp-muted, #8fa0b8) !important;
}

html.dark-mode .lp-route-card-departures,
html.dark-mode .review-response {
    border-top-color: var(--lp-border, #1c2c44) !important;
}

html.dark-mode .lp-route-card-path,
html.dark-mode .lp-route-card-footer,
html.dark-mode .lp-route-dep-label,
html.dark-mode .lp-map-hint-inner p,
html.dark-mode .lp-rental-thumb-title,
html.dark-mode .lp-rental-thumb-meta,
html.dark-mode .lp-rental-catalog-count,
html.dark-mode .stats-grid__label,
html.dark-mode .stats-subtitle,
html.dark-mode .company-distance,
html.dark-mode .lp-route-empty,
html.dark-mode .lp-dash-stat-sub,
html.dark-mode .review-service,
html.dark-mode .review-date,
html.dark-mode .response-content {
    color: var(--lp-muted, #8fa0b8) !important;
}

html.dark-mode .stats-panel {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

html.dark-mode .stats-grid__item {
    border-color: var(--lp-border, #1c2c44) !important;
}

html.dark-mode .stats-grid__item:hover {
    background-color: var(--lp-accent-soft, #132744) !important;
}

html.dark-mode .lp-stats-kpi-icon.views { background: #132744 !important; color: #8eb6ff !important; }
html.dark-mode .lp-stats-kpi-icon.contacts { background: #2a220c !important; color: #ffd666 !important; }
html.dark-mode .lp-stats-kpi-icon.services { background: #1a2436 !important; color: #c5d0dc !important; }
html.dark-mode .lp-stats-kpi-icon.booking { background: #2a1216 !important; color: #ffc2c8 !important; }
html.dark-mode .lp-stats-trend.down { background: #2a1216 !important; color: #ffc2c8 !important; }
html.dark-mode .lp-stats-trend.flat { background: #1a2436 !important; color: #c5d0dc !important; }
html.dark-mode .lp-dash-stat-icon.pending { background: #2a220c !important; color: #ffd666 !important; }
html.dark-mode .lp-dash-stat-icon.past { background: #1a2436 !important; color: #c5d0dc !important; }

html.dark-mode .reviews-fade {
    background: linear-gradient(transparent, var(--lp-bg, #050910)) !important;
}

html.dark-mode .avis-container .bg-light,
html.dark-mode .review-service {
    background-color: var(--lp-surface-2, #142038) !important;
}

html.dark-mode .password-container .toggle-password {
    color: var(--lp-muted, #8fa0b8);
}

html.dark-mode .password-container .toggle-password:hover {
    color: #8eb6ff;
}

html.dark-mode .tooltip .tooltip-inner {
    background-color: #0b1220;
    color: var(--lp-text, #e7eef8);
    border: 1px solid var(--lp-border, #1c2c44);
}

html.dark-mode .rating > label {
    color: #3a4a63;
}

html.dark-mode .company-header {
    background: linear-gradient(135deg, #0b1a33 0%, #123a7a 100%);
}

/* Messages contact admin */
html.dark-mode .conversation-container,
html.dark-mode .reply-box {
    background: var(--lp-surface, #0e1729) !important;
    border-color: var(--lp-border, #1c2c44) !important;
}

html.dark-mode .message-pro .message-content {
    background: var(--lp-surface-2, #142038) !important;
    color: var(--lp-text, #e7eef8) !important;
}

html.dark-mode .message-admin .message-content {
    background: var(--lp-accent-soft, #132744) !important;
    color: var(--lp-text, #e7eef8) !important;
}

html.dark-mode .message-time,
html.dark-mode .message-sender {
    color: var(--lp-muted, #8fa0b8) !important;
}

html.dark-mode .reply-box textarea {
    background: var(--lp-surface-2, #142038) !important;
    border-color: var(--lp-border, #1c2c44) !important;
    color: var(--lp-text, #e7eef8) !important;
}
