/**
 * Thème sombre global MaintSoft — activé via html[data-theme="dark"]
 */
html[data-theme='dark'] {
  color-scheme: dark;
  --phc-bg: #0f1419;
  --phc-bg-elevated: #1a222d;
  --phc-bg-panel: #151b24;
  --phc-bg-input: #0d1117;
  --phc-border: #2a3544;
  --phc-border-soft: #243041;
  --phc-text: #e8eef6;
  --phc-text-muted: #9aa8b8;
  --phc-accent: #3b82f6;
  --phc-accent-soft: rgba(59, 130, 246, 0.18);
  --phc-danger: #f87171;
  --phc-success: #34d399;
  --phc-warning: #fbbf24;
  color: var(--phc-text);
  background: var(--phc-bg);
}

html[data-theme='dark'] body {
  background: var(--phc-bg) !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .muted,
html[data-theme='dark'] .text-muted,
html[data-theme='dark'] small.muted {
  color: var(--phc-text-muted) !important;
}

html[data-theme='dark'] label,
html[data-theme='dark'] .form-group label {
  color: var(--phc-text) !important;
}

/* Layout / chrome */
html[data-theme='dark'] .sidebar,
html[data-theme='dark'] .sidebar-header,
html[data-theme='dark'] .sidebar-footer,
html[data-theme='dark'] .bottom-nav,
html[data-theme='dark'] .mobile-header,
html[data-theme='dark'] .app-header,
html[data-theme='dark'] header.app-topbar {
  background: #0c1118 !important;
  border-color: var(--phc-border) !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .sidebar-nav a,
html[data-theme='dark'] .nav-links a,
html[data-theme='dark'] .bottom-nav a {
  color: var(--phc-text-muted) !important;
}

html[data-theme='dark'] .sidebar-nav a.active,
html[data-theme='dark'] .nav-links a.active,
html[data-theme='dark'] .bottom-nav a.active,
html[data-theme='dark'] .sidebar-nav a:hover,
html[data-theme='dark'] .nav-links a:hover {
  color: var(--phc-text) !important;
  background: var(--phc-accent-soft) !important;
}

html[data-theme='dark'] main.layout,
html[data-theme='dark'] #app-main,
html[data-theme='dark'] .main-content,
html[data-theme='dark'] .content-area {
  background: var(--phc-bg) !important;
  color: var(--phc-text) !important;
}

/* Panels / cards */
html[data-theme='dark'] .panel,
html[data-theme='dark'] .card,
html[data-theme='dark'] .modal,
html[data-theme='dark'] .modal-content,
html[data-theme='dark'] .dialog,
html[data-theme='dark'] .phc-modal,
html[data-theme='dark'] .phc-modal__dialog,
html[data-theme='dark'] .suivi-da__import-fold,
html[data-theme='dark'] .suivi-da__dashboard,
html[data-theme='dark'] .suivi-da-stat,
html[data-theme='dark'] .suivi-da__depense,
html[data-theme='dark'] .data-table,
html[data-theme='dark'] table.data-table,
html[data-theme='dark'] .login-card,
html[data-theme='dark'] .auth-card {
  background: var(--phc-bg-panel) !important;
  color: var(--phc-text) !important;
  border-color: var(--phc-border) !important;
  box-shadow: none !important;
}

html[data-theme='dark'] .panel-head,
html[data-theme='dark'] .panel-body,
html[data-theme='dark'] .modal-header,
html[data-theme='dark'] .modal-footer,
html[data-theme='dark'] .phc-modal__header,
html[data-theme='dark'] .phc-modal__footer {
  background: transparent !important;
  color: var(--phc-text) !important;
  border-color: var(--phc-border) !important;
}

html[data-theme='dark'] h1,
html[data-theme='dark'] h2,
html[data-theme='dark'] h3,
html[data-theme='dark'] h4,
html[data-theme='dark'] .suivi-da__title,
html[data-theme='dark'] .panel-head h2 {
  color: var(--phc-text) !important;
}

/* Forms */
html[data-theme='dark'] input,
html[data-theme='dark'] select,
html[data-theme='dark'] textarea,
html[data-theme='dark'] .form-control,
html[data-theme='dark'] .form-select,
html[data-theme='dark'] input[type='search'],
html[data-theme='dark'] input[type='text'],
html[data-theme='dark'] input[type='number'],
html[data-theme='dark'] input[type='email'],
html[data-theme='dark'] input[type='password'],
html[data-theme='dark'] input[type='date'] {
  background: var(--phc-bg-input) !important;
  color: var(--phc-text) !important;
  border-color: var(--phc-border) !important;
}

html[data-theme='dark'] input::placeholder,
html[data-theme='dark'] textarea::placeholder {
  color: #6b7a8c !important;
}

html[data-theme='dark'] option {
  background: #1a2332 !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] select,
html[data-theme='dark'] select.form-control {
  color-scheme: dark;
}

/* Tables */
html[data-theme='dark'] table,
html[data-theme='dark'] .data-table th,
html[data-theme='dark'] .data-table td,
html[data-theme='dark'] thead th {
  border-color: var(--phc-border) !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] thead th,
html[data-theme='dark'] .data-table thead {
  background: #121821 !important;
  color: var(--phc-text-muted) !important;
}

html[data-theme='dark'] tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02) !important;
}

html[data-theme='dark'] tbody tr:hover {
  background: rgba(59, 130, 246, 0.08) !important;
}

html[data-theme='dark'] .suivi-da-ligne--done,
html[data-theme='dark'] .suivi-da-ligne--stocked {
  background: rgba(52, 211, 153, 0.1) !important;
}

html[data-theme='dark'] .suivi-da-ligne--partial,
html[data-theme='dark'] .suivi-da-ligne--recue {
  background: rgba(251, 191, 36, 0.08) !important;
}

/* Buttons */
html[data-theme='dark'] .button.secondary,
html[data-theme='dark'] button.secondary,
html[data-theme='dark'] .btn-secondary {
  background: #243041 !important;
  color: var(--phc-text) !important;
  border-color: var(--phc-border) !important;
}

html[data-theme='dark'] .button.primary,
html[data-theme='dark'] button.primary,
html[data-theme='dark'] .btn-primary {
  background: #2563eb !important;
  color: #fff !important;
  border-color: #1d4ed8 !important;
}

html[data-theme='dark'] .suivi-da-link,
html[data-theme='dark'] a:not(.button):not(.btn) {
  color: #93c5fd !important;
}

/* Badges / pills keep readable contrast */
html[data-theme='dark'] .suivi-da-pill--da_ouverte {
  background: #422006 !important;
  color: #fde68a !important;
}
html[data-theme='dark'] .suivi-da-pill--po_en_cours {
  background: #1e3a5f !important;
  color: #bfdbfe !important;
}
html[data-theme='dark'] .suivi-da-pill--livraison_partielle,
html[data-theme='dark'] .suivi-da-pill--recue_site_partielle {
  background: #431407 !important;
  color: #fed7aa !important;
}
html[data-theme='dark'] .suivi-da-pill--livree,
html[data-theme='dark'] .suivi-da-pill--recue_site {
  background: #064e3b !important;
  color: #a7f3d0 !important;
}
html[data-theme='dark'] .suivi-da-pill--cat-garage {
  background: #312e81 !important;
  color: #c7d2fe !important;
}
html[data-theme='dark'] .suivi-da-pill--cat-usine {
  background: #831843 !important;
  color: #fbcfe8 !important;
}
html[data-theme='dark'] .suivi-da-pill--cat-generale {
  background: #155e75 !important;
  color: #a5f3fc !important;
}

html[data-theme='dark'] .suivi-da-stock-ok {
  background: #064e3b !important;
  color: #a7f3d0 !important;
}

html[data-theme='dark'] .suivi-da-lignes-actions,
html[data-theme='dark'] .suivi-da__toolbar,
html[data-theme='dark'] .sdr-accordion,
html[data-theme='dark'] details,
html[data-theme='dark'] summary,
html[data-theme='dark'] .suivi-da-lignes-table-wrap {
  background: var(--phc-bg-elevated) !important;
  color: var(--phc-text) !important;
  border-color: var(--phc-border) !important;
}

html[data-theme='dark'] .sdd-export-livraison {
  background: var(--phc-bg-elevated) !important;
  border-color: var(--phc-border) !important;
}

html[data-theme='dark'] .sdd-export-livraison__label {
  color: var(--phc-text-muted, #94a3b8) !important;
}

html[data-theme='dark'] .suivi-da-lignes-table thead th {
  background: #0f766e !important;
  color: #ecfeff !important;
  border-color: #0d9488 !important;
  padding: 0.28rem 0.3rem !important;
  font-size: 0.65rem !important;
}

html[data-theme='dark'] .suivi-da-lignes-table td {
  padding: 0.18rem 0.3rem !important;
  border-color: var(--phc-border) !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .suivi-da-bulk-bar {
  background: #3f1d1d !important;
  border-color: #7f1d1d !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .suivi-da-row.is-selected {
  background: rgba(59, 130, 246, 0.16) !important;
}

html[data-theme='dark'] .suivi-da-inline-loader {
  color: var(--phc-text-muted) !important;
}

html[data-theme='dark'] .suivi-da-inline-loader__spin {
  border-color: #334155 !important;
  border-top-color: #60a5fa !important;
}

html[data-theme='dark'] .sidebar-user-card,
html[data-theme='dark'] .user-info,
html[data-theme='dark'] .user-name,
html[data-theme='dark'] .user-role {
  color: var(--phc-text) !important;
}

/* Login */
html[data-theme='dark'] .login-page,
html[data-theme='dark'] .login-wrapper,
html[data-theme='dark'] body.login-body {
  background: #0b1017 !important;
  color: var(--phc-text) !important;
}

/* Scrollbars */
html[data-theme='dark'] * {
  scrollbar-color: #3a4658 #121821;
}

/* Loading overlays / toasts */
html[data-theme='dark'] .app-loading,
html[data-theme='dark'] .toast,
html[data-theme='dark'] .notification {
  background: #1a222d !important;
  color: var(--phc-text) !important;
  border-color: var(--phc-border) !important;
}

/* Suivi DA — panneau développé (était resté blanc) */
html[data-theme='dark'] .suivi-da-row.is-expanded,
html[data-theme='dark'] .suivi-da-row.is-expanded td {
  background: #1a222d !important;
}

html[data-theme='dark'] .suivi-da-row-detail > td {
  background: #121821 !important;
  border-color: var(--phc-border) !important;
}

html[data-theme='dark'] .suivi-da-expand-panel {
  background: #1a222d !important;
  border-color: var(--phc-border) !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .suivi-da-expand-item,
html[data-theme='dark'] .suivi-da-expand-label,
html[data-theme='dark'] .suivi-da-expand-grid,
html[data-theme='dark'] .suivi-da-expand-actions {
  color: var(--phc-text) !important;
  border-color: var(--phc-border) !important;
}

html[data-theme='dark'] .suivi-da-expand-label {
  color: var(--phc-text-muted) !important;
}

html[data-theme='dark'] .suivi-da-expand-btn {
  background: #243041 !important;
  border-color: var(--phc-border) !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .suivi-da-expand-btn:hover {
  background: #2f3d52 !important;
}

/* Filets blancs fréquents (cartes / détails) */
html[data-theme='dark'] [style*='background: #fff'],
html[data-theme='dark'] [style*='background:#fff'],
html[data-theme='dark'] [style*='background: #ffffff'],
html[data-theme='dark'] [style*='background:#ffffff'],
html[data-theme='dark'] [style*='background: white'],
html[data-theme='dark'] [style*='background:white'] {
  background: var(--phc-bg-panel) !important;
}

html[data-theme='dark'] .suivi-da__table-wrap,
html[data-theme='dark'] .suivi-da-table--compact,
html[data-theme='dark'] .suivi-da-detail-meta,
html[data-theme='dark'] .suivi-da-liaisons-block,
html[data-theme='dark'] .suivi-da-liaisons-panel,
html[data-theme='dark'] .sdr-aside,
html[data-theme='dark'] .sdr-main,
html[data-theme='dark'] .sdr-message-block,
html[data-theme='dark'] .sdr-actions-bar,
html[data-theme='dark'] .sdr-contacts-panel,
html[data-theme='dark'] .sdr-scroll-zone {
  background: var(--phc-bg-panel) !important;
  color: var(--phc-text) !important;
  border-color: var(--phc-border) !important;
}

/* Bloc Dépenses (cartes encore claires) */
html[data-theme='dark'] .suivi-da__depense,
html[data-theme='dark'] .suivi-da__depense-head,
html[data-theme='dark'] .suivi-da__depense-title {
  color: #5eead4 !important;
  background: transparent !important;
}

html[data-theme='dark'] .suivi-da-depense-card,
html[data-theme='dark'] .suivi-da-depense-card--sage,
html[data-theme='dark'] .suivi-da-depense-card--po,
html[data-theme='dark'] .suivi-da-depense-card--pending,
html[data-theme='dark'] .suivi-da-depense-card--muted {
  background: #1a222d !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .suivi-da-depense-card--sage {
  border-color: #115e59 !important;
  background: linear-gradient(180deg, #134e4a 0%, #1a222d 100%) !important;
}

html[data-theme='dark'] .suivi-da-depense-card--po {
  border-color: #1e3a5f !important;
  background: linear-gradient(180deg, #1e3a5f 0%, #1a222d 100%) !important;
}

html[data-theme='dark'] .suivi-da-depense-card--pending {
  border-color: #78350f !important;
  background: linear-gradient(180deg, #451a03 0%, #1a222d 100%) !important;
}

html[data-theme='dark'] .suivi-da-depense-card--muted {
  border-color: var(--phc-border) !important;
  background: #151b24 !important;
}

html[data-theme='dark'] .suivi-da-depense-card__amount {
  color: #f1f5f9 !important;
}

html[data-theme='dark'] .suivi-da-depense-card__label,
html[data-theme='dark'] .suivi-da-depense-card__meta {
  color: #94a3b8 !important;
}

html[data-theme='dark'] .suivi-da__depense-chip {
  background: #243041 !important;
  color: #cbd5e1 !important;
  border-color: var(--phc-border) !important;
}

html[data-theme='dark'] .suivi-da__depense-fx-btn {
  background: #243041 !important;
  color: var(--phc-text) !important;
  border-color: var(--phc-border) !important;
}

html[data-theme='dark'] .suivi-da__depense-fx-btn:hover {
  background: #2f3d52 !important;
}

html[data-theme='dark'] .suivi-da-stat {
  background: #1a222d !important;
  color: var(--phc-text) !important;
  border-color: var(--phc-border) !important;
}

html[data-theme='dark'] .suivi-da-stat__n {
  background: transparent !important;
  color: #93c5fd !important;
  border: none !important;
}

html[data-theme='dark'] .suivi-da-stat__l {
  background: transparent !important;
  color: var(--phc-text-muted) !important;
  border: none !important;
}

/* Borders / sélection navigation */
html[data-theme='dark'] .sidebar-nav .nav-link.active,
html[data-theme='dark'] .nav-links .nav-link.active,
html[data-theme='dark'] .mobile-nav-links .nav-link.active {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #e8eef6 !important;
  border-color: transparent !important;
  border-left: 3px solid #3b82f6 !important;
  box-shadow: none !important;
  outline: none !important;
}

html[data-theme='dark'] .sidebar-nav .nav-link.active::before,
html[data-theme='dark'] .mobile-nav-links .nav-link.active::before {
  background: #3b82f6 !important;
}

html[data-theme='dark'] .sidebar-nav .nav-group,
html[data-theme='dark'] .mobile-nav-links .nav-group {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .sidebar-nav .nav-group.is-active-group,
html[data-theme='dark'] .mobile-nav-links .nav-group.is-active-group {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: #1e3a5f !important;
  box-shadow: none !important;
}

html[data-theme='dark'] .sidebar-nav .nav-link:focus,
html[data-theme='dark'] .sidebar-nav .nav-link:focus-visible,
html[data-theme='dark'] .nav-link:focus-visible,
html[data-theme='dark'] button:focus-visible,
html[data-theme='dark'] a:focus-visible {
  outline: 2px solid #3b82f6 !important;
  outline-offset: 1px;
  box-shadow: none !important;
}

/* Avancement Livr / Site / Stock (encore clairs) */
html[data-theme='dark'] .suivi-da-etat {
  background: #243041 !important;
  color: #94a3b8 !important;
}

html[data-theme='dark'] .suivi-da-etat--partial {
  background: #431407 !important;
  color: #fed7aa !important;
}

html[data-theme='dark'] .suivi-da-etat--full {
  background: #064e3b !important;
  color: #a7f3d0 !important;
}

html[data-theme='dark'] .suivi-da-etat--none {
  background: #1a222d !important;
  color: #64748b !important;
}

/* Liaisons / cotations / lien MaintSoft (panneaux blancs) */
html[data-theme='dark'] .suivi-da-liaisons-block,
html[data-theme='dark'] .suivi-da-liaisons-block--collapsible,
html[data-theme='dark'] .suivi-da-app-link-block,
html[data-theme='dark'] .suivi-da-cotations-block,
html[data-theme='dark'] .suivi-da-liaisons-panel,
html[data-theme='dark'] .suivi-da-liaisons-col {
  background: #1a222d !important;
  border-color: #2a3544 !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .suivi-da-annexes-teaser {
  background: #151b24 !important;
  border-color: #2a3544 !important;
}
html[data-theme='dark'] .suivi-da-annexes-teaser__title {
  color: #e2e8f0 !important;
  font-size: 0.8rem !important;
}
html[data-theme='dark'] .suivi-da-annexes-chip {
  background: #121820 !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}
html[data-theme='dark'] .suivi-da-annexes-teaser__go {
  color: #5eead4 !important;
}

html[data-theme='dark'] .suivi-da-liaisons-toggle {
  background: transparent !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .suivi-da-liaisons-toggle:hover {
  background: #243041 !important;
}

html[data-theme='dark'] .suivi-da-liaisons-toggle:focus-visible {
  outline: 2px solid #3b82f6 !important;
}

html[data-theme='dark'] .suivi-da-liaisons-toggle-title,
html[data-theme='dark'] .suivi-da-liaisons-col-title,
html[data-theme='dark'] .suivi-da-detail-lignes-title {
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .suivi-da-liaisons-toggle-summary,
html[data-theme='dark'] .suivi-da-liaisons-toggle-chevron,
html[data-theme='dark'] .suivi-da-liaisons-col-count {
  color: var(--phc-text-muted) !important;
}

html[data-theme='dark'] .suivi-da-detail-meta,
html[data-theme='dark'] .suivi-da-detail-meta__row,
html[data-theme='dark'] .suivi-da-detail-meta__objet {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .suivi-da-detail-meta__row--secondary {
  border-top-color: #2a3544 !important;
}

html[data-theme='dark'] .suivi-da-meta-label {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .suivi-da-meta-value,
html[data-theme='dark'] .suivi-da-meta-value strong,
html[data-theme='dark'] .suivi-da-detail-meta__objet {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .suivi-da-etat,
html[data-theme='dark'] .suivi-da-etat--none {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .suivi-da-categorie-select,
html[data-theme='dark'] .suivi-da-meta-value .form-control,
html[data-theme='dark'] .suivi-da-meta-value select {
  background: #0d1117 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .suivi-da-etat {
  background: #243041 !important;
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .suivi-da-etat--partial {
  background: rgba(154, 52, 18, 0.35) !important;
  color: #fdba74 !important;
}

html[data-theme='dark'] .suivi-da-etat--full {
  background: rgba(6, 95, 70, 0.35) !important;
  color: #6ee7b7 !important;
}

html[data-theme='dark'] .suivi-da__head-actions .button,
html[data-theme='dark'] .suivi-da-detail-page .button.secondary {
  background: #243041 !important;
  border-color: #2a3544 !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .suivi-da-ligne--recue:not(.suivi-da-ligne--stocked) td {
  background: rgba(120, 53, 15, 0.25) !important;
}

/* ========== GLOBAL : toutes pages / onglets / pages dédiées ========== */
html[data-theme='dark'] .filters,
html[data-theme='dark'] .filters-bar,
html[data-theme='dark'] .engins-filters-bar,
html[data-theme='dark'] .filters-container-catalogue,
html[data-theme='dark'] .toolbar,
html[data-theme='dark'] .page-toolbar,
html[data-theme='dark'] .list-toolbar,
html[data-theme='dark'] .tabs,
html[data-theme='dark'] .tab-bar,
html[data-theme='dark'] .nav-tabs,
html[data-theme='dark'] .mobile-tabs,
html[data-theme='dark'] .section-card,
html[data-theme='dark'] .content-card,
html[data-theme='dark'] .info-card,
html[data-theme='dark'] .stat-card,
html[data-theme='dark'] .kpi-card,
html[data-theme='dark'] .widget,
html[data-theme='dark'] .box,
html[data-theme='dark'] .auth,
html[data-theme='dark'] .auth-layout,
html[data-theme='dark'] .auth-card,
html[data-theme='dark'] .login-card {
  background: var(--phc-bg-panel) !important;
  color: var(--phc-text) !important;
  border-color: var(--phc-border) !important;
}

html[data-theme='dark'] .filters label,
html[data-theme='dark'] .filters-bar label,
html[data-theme='dark'] .engins-filters-bar label,
html[data-theme='dark'] .filter-item-engins label,
html[data-theme='dark'] .filter-label,
html[data-theme='dark'] .mobile-workflow-page .filters label,
html[data-theme='dark'] .mobile-workflow-page .filter-label,
html[data-theme='dark'] .mobile-workflow-page .filters-title {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .signalement-card,
html[data-theme='dark'] .historique-card,
html[data-theme='dark'] .demande-card,
html[data-theme='dark'] .intervention-card,
html[data-theme='dark'] .maintenance-compact-card,
html[data-theme='dark'] .piece-card,
html[data-theme='dark'] .consommable-card,
html[data-theme='dark'] .engin-card,
html[data-theme='dark'] .stock-card,
html[data-theme='dark'] .tool-card,
html[data-theme='dark'] .report-card,
html[data-theme='dark'] .prediction-card,
html[data-theme='dark'] .pb-card,
html[data-theme='dark'] .colisage-card,
html[data-theme='dark'] .colisage-detail-card,
html[data-theme='dark'] .colisage-recu-item,
html[data-theme='dark'] .transport-card {
  background: #1a222d !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .colisage-detail-grid .item {
  background: #0d1117 !important;
  border-color: #243041 !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .colisage-detail-grid .item strong,
html[data-theme='dark'] .colisage-recus-stats {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .colisage-back,
html[data-theme='dark'] .colisage-detail-card a {
  color: #3b82f6 !important;
}

html[data-theme='dark'] .colisage-recu-item summary {
  background: rgba(52, 211, 153, 0.08) !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .colisage-recu-item .ref {
  color: #34d399 !important;
}

html[data-theme='dark'] .colisage-recu-item .body {
  border-color: #243041 !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .colisage-recus-stats .pill {
  background: rgba(52, 211, 153, 0.15) !important;
  color: #34d399 !important;
}

html[data-theme='dark'] .signalement-card h3,
html[data-theme='dark'] .signalement-card h4,
html[data-theme='dark'] .demande-card h3,
html[data-theme='dark'] .maintenance-compact-card h3,
html[data-theme='dark'] .maintenance-compact-card .card-title,
html[data-theme='dark'] .signalement-header,
html[data-theme='dark'] .demande-header,
html[data-theme='dark'] .historique-header,
html[data-theme='dark'] .piece-card-header h4,
html[data-theme='dark'] .piece-card-body,
html[data-theme='dark'] .piece-card-body p,
html[data-theme='dark'] .piece-card-body strong {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .tabs button,
html[data-theme='dark'] .tab-btn,
html[data-theme='dark'] .nav-tabs a,
html[data-theme='dark'] .mobile-tabs button,
html[data-theme='dark'] [role='tab'] {
  background: transparent !important;
  color: #9aa8b8 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .tabs button.active,
html[data-theme='dark'] .tab-btn.active,
html[data-theme='dark'] .nav-tabs a.active,
html[data-theme='dark'] .mobile-tabs button.active,
html[data-theme='dark'] [role='tab'][aria-selected='true'] {
  color: #e8eef6 !important;
  border-bottom-color: #3b82f6 !important;
  background: rgba(59, 130, 246, 0.12) !important;
}

html[data-theme='dark'] .table-container,
html[data-theme='dark'] .list-container,
html[data-theme='dark'] .empty-state,
html[data-theme='dark'] .placeholder {
  background: transparent !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .loading-overlay {
  background: rgba(8, 12, 18, 0.55) !important;
}

html[data-theme='dark'] .sidebar,
html[data-theme='dark'] .app-bar-mobile {
  z-index: 9500 !important;
}

html[data-theme='dark'] .global-loading-box,
html[data-theme='dark'] .app-loading,
html[data-theme='dark'] .phc-page-loader {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border: 1px solid #2a3544 !important;
}

html[data-theme='dark'] .phc-page-loader {
  padding: 2rem;
  text-align: center;
  border-radius: 10px;
}

html[data-theme='dark'] .phc-page-loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .phc-page-loader .spinner,
html[data-theme='dark'] .spinner {
  border-color: #334155 !important;
  border-top-color: #3b82f6 !important;
}

html[data-theme='dark'] .loader-spinner,
html[data-theme='dark'] .global-loading-spinner {
  border-color: rgba(148, 163, 184, 0.35) !important;
  border-top-color: #3b82f6 !important;
}

html[data-theme='dark'] td[style*='color: #6b7280'],
html[data-theme='dark'] div[style*='color: #6b7280'] {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] div[style*='background: #f9fafb'],
html[data-theme='dark'] div[style*='background:#f9fafb'],
html[data-theme='dark'] div[style*='background: #fff'],
html[data-theme='dark'] div[style*='background:#fff'],
html[data-theme='dark'] div[style*='background: white'],
html[data-theme='dark'] div[style*='background:white'],
html[data-theme='dark'] section[style*='background: #fff'],
html[data-theme='dark'] section[style*='background:#fff'] {
  background: #151b24 !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .breadcrumb,
html[data-theme='dark'] .app-breadcrumb,
html[data-theme='dark'] .page-header,
html[data-theme='dark'] .panel-subtitle,
html[data-theme='dark'] .subtitle {
  color: #9aa8b8 !important;
  background: transparent !important;
}

/* ========== FORCE DARK : cartes / filtres / loaders (priorité max) ========== */
html[data-theme='dark'] .composant-card label,
html[data-theme='dark'] .composant-card strong,
html[data-theme='dark'] .composant-card p,
html[data-theme='dark'] .composant-info,
html[data-theme='dark'] .composant-checkbox {
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .composant-card .muted,
html[data-theme='dark'] .composant-info .muted {
  color: var(--phc-text-muted) !important;
}

html[data-theme='dark'] .composant-selected-card,
html[data-theme='dark'] .engin-info,
html[data-theme='dark'] .form-maintenance .filters-bar {
  background: var(--phc-bg-elevated) !important;
  color: var(--phc-text) !important;
  border-color: var(--phc-border) !important;
}

html[data-theme='dark'] .composant-selected-card h4,
html[data-theme='dark'] .composant-selected-card label,
html[data-theme='dark'] .composant-selected-card .form-group label,
html[data-theme='dark'] .form-step h3,
html[data-theme='dark'] .form-maintenance label {
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .composant-selected-card input,
html[data-theme='dark'] .composant-selected-card select,
html[data-theme='dark'] .composant-selected-card textarea {
  background: var(--phc-bg-input) !important;
  color: var(--phc-text) !important;
  border-color: var(--phc-border) !important;
}

html[data-theme='dark'] .form-actions {
  border-color: var(--phc-border) !important;
}

html[data-theme='dark'] .demande-achat-card,
html[data-theme='dark'] .demande-consommable-card,
html[data-theme='dark'] .composant-card,
html[data-theme='dark'] .maintenance-compact-card.signalement-card,
html[data-theme='dark'] .maintenance-compact-card.demande-achat-card,
html[data-theme='dark'] #demandes-achat-list-container,
html[data-theme='dark'] #signalements-list .signalement-card,
html[data-theme='dark'] .collapsible-panel,
html[data-theme='dark'] .filters-container-catalogue,
html[data-theme='dark'] .engins-filters-bar,
html[data-theme='dark'] .filters-bar,
html[data-theme='dark'] .filters[style],
html[data-theme='dark'] .engins-filters-bar[style],
html[data-theme='dark'] .filters-bar[style],
html[data-theme='dark'] .mobile-workflow-page .filters-container-catalogue {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .demande-achat-card h3,
html[data-theme='dark'] .demande-achat-card h4,
html[data-theme='dark'] .demande-achat-header,
html[data-theme='dark'] .demande-achat-header *,
html[data-theme='dark'] .signalement-header h3,
html[data-theme='dark'] .signalement-header h4,
html[data-theme='dark'] .maintenance-compact-card h3,
html[data-theme='dark'] .maintenance-compact-card h4 {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .mobile-workflow-page .filters label,
html[data-theme='dark'] .mobile-workflow-page .engins-filters-bar label,
html[data-theme='dark'] .mobile-workflow-page .filter-label,
html[data-theme='dark'] .mobile-workflow-page .filters-title {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .app-loading-placeholder,
html[data-theme='dark'] .arp-loading,
html[data-theme='dark'] .phc-page-loader,
html[data-theme='dark'] td.phc-page-loader {
  background: #151b24 !important;
  color: #9aa8b8 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .arp-loading__text,
html[data-theme='dark'] .arp-loading__hint,
html[data-theme='dark'] .create-spinner-text,
html[data-theme='dark'] .loader-spinner + span {
  color: #9aa8b8 !important;
}

@keyframes phc-spin {
  to { transform: rotate(360deg); }
}
html[data-theme='dark'] .spinner,
html[data-theme='dark'] .loader-spinner,
html[data-theme='dark'] .arp-loading__spinner {
  animation: phc-spin 1s linear infinite;
}

/* Rapport actifs / composants (assets_rapport_problemes) */
html[data-theme='dark'] .assets-rapport-page.panel {
  background: transparent !important;
  color: var(--phc-text, #e8eef6) !important;
}

html[data-theme='dark'] .arp-report-header {
  border-bottom-color: var(--phc-border, #2a3544) !important;
}

html[data-theme='dark'] .arp-report-title {
  color: var(--phc-text, #e8eef6) !important;
}

html[data-theme='dark'] .arp-report-meta,
html[data-theme='dark'] .assets-rapport-page__empty {
  color: var(--phc-text-muted, #9aa8b8) !important;
}

html[data-theme='dark'] .assets-rapport-page__back {
  background: var(--phc-bg-input, #1a2330) !important;
  border-color: var(--phc-border, #2a3544) !important;
  color: #93c5fd !important;
}

html[data-theme='dark'] .assets-rapport-page__back:hover {
  background: var(--phc-bg-elevated, #151b24) !important;
}

html[data-theme='dark'] .assets-rapport-page__filters {
  background: var(--phc-bg-elevated, #151b24) !important;
  border-color: var(--phc-border, #2a3544) !important;
  color: var(--phc-text, #e8eef6) !important;
}

html[data-theme='dark'] .assets-rapport-page__filters select,
html[data-theme='dark'] .assets-rapport-page__filters input[type='text'],
html[data-theme='dark'] .assets-rapport-page__filters .search-input {
  background: var(--phc-bg-input, #1a2330) !important;
  color: var(--phc-text, #e8eef6) !important;
  border-color: var(--phc-border, #2a3544) !important;
}

html[data-theme='dark'] .assets-rapport-page__filters .arp-filter--check label {
  color: var(--phc-text, #e8eef6) !important;
}

html[data-theme='dark'] .arp-views-bar {
  background: var(--phc-bg, #0f1419) !important;
  border-bottom-color: var(--phc-border, #2a3544) !important;
}

html[data-theme='dark'] .arp-views-label {
  color: var(--phc-text-muted, #9aa8b8) !important;
}

html[data-theme='dark'] .assets-rapport-page__tabs button {
  background: var(--phc-bg-input, #1a2330) !important;
  border-color: var(--phc-border, #2a3544) !important;
  color: var(--phc-text, #e8eef6) !important;
}

html[data-theme='dark'] .assets-rapport-page__tabs button.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}

html[data-theme='dark'] .assets-rapport-ensemble-block {
  border-bottom-color: var(--phc-border, #2a3544) !important;
}

html[data-theme='dark'] .assets-rapport-ensemble-block h3 {
  color: var(--phc-text, #e8eef6) !important;
}

html[data-theme='dark'] .assets-rapport-ensemble-block > .muted {
  color: var(--phc-text-muted, #9aa8b8) !important;
}

html[data-theme='dark'] .assets-rapport-ensemble-block--sub {
  border-top-color: var(--phc-border, #2a3544) !important;
}

html[data-theme='dark'] .assets-rapport-ensemble-block th,
html[data-theme='dark'] .assets-rapport-detail-scroll th {
  background: #1e3a5f !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .assets-rapport-ensemble-block td,
html[data-theme='dark'] .assets-rapport-detail-scroll td {
  border-bottom-color: var(--phc-border, #2a3544) !important;
  color: var(--phc-text, #e8eef6) !important;
}

html[data-theme='dark'] .assets-rapport-detail-scroll .cell-problem {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #fca5a5 !important;
}

html[data-theme='dark'] .assets-rapport-detail-scroll .da-link {
  color: #93c5fd !important;
}
html[data-theme="dark"] .demande-details-card,
html[data-theme="dark"] .dds-card {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}
html[data-theme="dark"] .demande-details-header h4,
html[data-theme="dark"] .demande-details-body dd,
html[data-theme="dark"] .demande-details-card table td,
html[data-theme="dark"] .demande-details-card table th {
  color: #e8eef6 !important;
}
html[data-theme="dark"] .demande-details-body dt {
  color: #9aa8b8 !important;
}


/* anti-flash load */
html[data-theme='dark'] :root,
html[data-theme='dark'] {
  background: #0f1419 !important;
}
html[data-theme='dark'] #app-main:empty,
html[data-theme='dark'] #app-main .phc-page-loader,
html[data-theme='dark'] .loading-overlay:not(.hidden) {
  background: #0f1419 !important;
}

/* ——— Surfaces encore claires (mobile + pages métier) ——— */
html[data-theme='dark'] [style*='background: #f9fafb'],
html[data-theme='dark'] [style*='background:#f9fafb'],
html[data-theme='dark'] [style*='background: #f8fafc'],
html[data-theme='dark'] [style*='background:#f8fafc'],
html[data-theme='dark'] [style*='background: #f1f5f9'],
html[data-theme='dark'] [style*='background:#f1f5f9'],
html[data-theme='dark'] [style*='background: #fafbfc'],
html[data-theme='dark'] [style*='background:#fafbfc'],
html[data-theme='dark'] [style*='background: #fff7ed'],
html[data-theme='dark'] [style*='background:#fff7ed'],
html[data-theme='dark'] [style*='background: #fffbeb'],
html[data-theme='dark'] [style*='background:#fffbeb'] {
  background: #151b24 !important;
}

html[data-theme='dark'] [style*='color: #1f2937'],
html[data-theme='dark'] [style*='color:#1f2937'],
html[data-theme='dark'] [style*='color: #111827'],
html[data-theme='dark'] [style*='color:#111827'],
html[data-theme='dark'] [style*='color: #374151'],
html[data-theme='dark'] [style*='color:#374151'],
html[data-theme='dark'] [style*='color: #4b5563'],
html[data-theme='dark'] [style*='color:#4b5563'] {
  color: #e8eef6 !important;
}

html[data-theme='dark'] [style*='color: #6b7280'],
html[data-theme='dark'] [style*='color:#6b7280'],
html[data-theme='dark'] [style*='color: #64748b'],
html[data-theme='dark'] [style*='color:#64748b'],
html[data-theme='dark'] [style*='color: #9ca3af'],
html[data-theme='dark'] [style*='color:#9ca3af'] {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] [style*='border: 1px solid #e5e7eb'],
html[data-theme='dark'] [style*='border:1px solid #e5e7eb'],
html[data-theme='dark'] [style*='border-bottom: 2px solid #e5e7eb'],
html[data-theme='dark'] [style*='border: 1px solid #d1d5db'],
html[data-theme='dark'] [style*='border:1px solid #d1d5db'] {
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .stock-site-group,
html[data-theme='dark'] .stocks-filters-box,
html[data-theme='dark'] .collapsible-panel,
html[data-theme='dark'] .collapsible-filter-grid,
html[data-theme='dark'] .stock-consommables-table,
html[data-theme='dark'] .stock-consommables-cards {
  background: #151b24 !important;
  border-color: #2a3544 !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .stock-site-group__title,
html[data-theme='dark'] .stock-site-group h3,
html[data-theme='dark'] .stocks-filters-box h3,
html[data-theme='dark'] .collapsible-panel h3 {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .stock-site-group__count {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .stock-site-body--block,
html[data-theme='dark'] .stock-site-body table,
html[data-theme='dark'] .stock-site-body thead tr,
html[data-theme='dark'] .stock-site-body th,
html[data-theme='dark'] .stock-site-body td {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .suivi-da__import-fold,
html[data-theme='dark'] .suivi-da__import-fold > summary {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .suivi-da-table--compact tr.suivi-da-row,
html[data-theme='dark'] .suivi-da-table--compact tr.suivi-da-row > td {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .suivi-da-expand-panel,
html[data-theme='dark'] .suivi-da-expand-item,
html[data-theme='dark'] .suivi-da-expand-label {
  background: transparent !important;
  color: #9aa8b8 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .suivi-da-expand-item > span:not(.suivi-da-expand-label) {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .table-responsive-cards tr,
html[data-theme='dark'] .table-responsive-cards td,
html[data-theme='dark'] .table-responsive-cards th {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
  box-shadow: none !important;
}

html[data-theme='dark'] .dashboard-tabs-container,
html[data-theme='dark'] .dashboard-tabs-nav,
html[data-theme='dark'] .dashboard-kpi-operational,
html[data-theme='dark'] .tab-content,
html[data-theme='dark'] .tabs {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .signalement-card,
html[data-theme='dark'] .demande-achat-card,
html[data-theme='dark'] .maintenance-compact-card,
html[data-theme='dark'] .engin-card,
html[data-theme='dark'] .card,
html[data-theme='dark'] .stat-card,
html[data-theme='dark'] .kpi-card {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] select,
html[data-theme='dark'] input[type='text'],
html[data-theme='dark'] input[type='search'],
html[data-theme='dark'] input[type='number'],
html[data-theme='dark'] input[type='date'],
html[data-theme='dark'] input[type='email'],
html[data-theme='dark'] input[type='password'],
html[data-theme='dark'] textarea,
html[data-theme='dark'] .form-control {
  background: #0d1117 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .panel,
html[data-theme='dark'] .panel-head,
html[data-theme='dark'] .panel-body,
html[data-theme='dark'] #app-main,
html[data-theme='dark'] #app-main > section {
  background: #0f1419 !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .sdr-accordion,
html[data-theme='dark'] .sdr-accordion--main,
html[data-theme='dark'] .sdr-accordion[open] > .sdr-accordion__summary,
html[data-theme='dark'] .sdr-accordion__summary,
html[data-theme='dark'] .sdr-accordion__body {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}



/* === FORCE DARK CHROME v20260816 === */
html[data-theme='dark'] .app-topbar,
html[data-theme='dark'] header.app-topbar,
html[data-theme='dark'] #app-topbar,
html[data-theme='dark'] .app-content-column,
html[data-theme='dark'] .app-bar-mobile,
html[data-theme='dark'] .mobile-header,
html[data-theme='dark'] .app-bar-mobile .mobile-header-content {
  background: #0c1118 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
  box-shadow: none !important;
}

html[data-theme='dark'] .app-topbar__crumb,
html[data-theme='dark'] .app-topbar__crumb--active,
html[data-theme='dark'] .app-topbar__title,
html[data-theme='dark'] #mobile-page-title,
html[data-theme='dark'] #mobile-page-subtitle {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .app-topbar__crumb-sep {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .suivi-da__toolbar,
html[data-theme='dark'] .suivi-da__import-fold,
html[data-theme='dark'] .suivi-da__import-fold > summary,
html[data-theme='dark'] .suivi-da__import-fold-body,
html[data-theme='dark'] .suivi-da__dashboard,
html[data-theme='dark'] .suivi-da-stat,
html[data-theme='dark'] .suivi-da-depense-card,
html[data-theme='dark'] .suivi-da__depense,
html[data-theme='dark'] .codes-budget__toolbar,
html[data-theme='dark'] .codes-budget__edit,
html[data-theme='dark'] .collapsible-panel,
html[data-theme='dark'] .collapsible-filter-grid,
html[data-theme='dark'] .stocks-filters-box,
html[data-theme='dark'] .stock-site-group,
html[data-theme='dark'] .filters,
html[data-theme='dark'] .filters-bar {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .suivi-da__toolbar .form-control,
html[data-theme='dark'] .suivi-da__toolbar select,
html[data-theme='dark'] .suivi-da__toolbar input,
html[data-theme='dark'] .suivi-da__toolbar .button.secondary,
html[data-theme='dark'] .filters .form-control,
html[data-theme='dark'] .filters select,
html[data-theme='dark'] .filters input,
html[data-theme='dark'] .collapsible-panel select,
html[data-theme='dark'] .collapsible-panel input,
html[data-theme='dark'] .stocks-filters-box select,
html[data-theme='dark'] .stocks-filters-box input,
html[data-theme='dark'] .mobile-workflow-page select,
html[data-theme='dark'] .mobile-workflow-page input[type='text'],
html[data-theme='dark'] .mobile-workflow-page input[type='search'],
html[data-theme='dark'] .mobile-workflow-page input[type='number'],
html[data-theme='dark'] .mobile-workflow-page input[type='date'],
html[data-theme='dark'] .mobile-workflow-page .form-control,
html[data-theme='dark'] .panel select,
html[data-theme='dark'] .panel input:not([type='checkbox']):not([type='radio']):not([type='file']),
html[data-theme='dark'] .panel textarea {
  background: #0d1117 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .suivi-da-stat__l,
html[data-theme='dark'] .suivi-da__import-fold > summary,
html[data-theme='dark'] .suivi-da__subtitle {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .suivi-da-stat__n,
html[data-theme='dark'] .suivi-da__title,
html[data-theme='dark'] .panel-head h2,
html[data-theme='dark'] .panel-head h3 {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .button.secondary {
  background: #243041 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .table-responsive-cards tr,
html[data-theme='dark'] .table-responsive-cards td {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
  box-shadow: none !important;
}

html[data-theme='dark'] .nav-search__input {
  background: #0d1117 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

/* === FORCE DARK PAGES v20260818 — dashboard / monitoring / reports / genset === */
html[data-theme='dark'] .monitor-page {
  --monitor-border: #2a3544;
  --monitor-soft: #151b24;
}

html[data-theme='dark'] .dashboard-pro {
  --db-bg: #0f1419;
  --db-card: #151b24;
  --db-border: #2a3544;
  --db-text: #e8eef6;
  --db-muted: #9aa8b8;
}

html[data-theme='dark'] .monitor-card,
html[data-theme='dark'] .monitor-summary-card,
html[data-theme='dark'] .monitor-kpi-row,
html[data-theme='dark'] .monitor-component-card,
html[data-theme='dark'] .monitor-auto-refresh,
html[data-theme='dark'] .monitor-select,
html[data-theme='dark'] .monitor-input,
html[data-theme='dark'] .monitor-tab-btn:not(.active),
html[data-theme='dark'] .monitor-details-head,
html[data-theme='dark'] .monitor-inline-filters {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .monitor-tab-btn:not(.active) {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .monitor-card-title,
html[data-theme='dark'] .monitor-component-title-wrap,
html[data-theme='dark'] .monitor-kpi-row strong,
html[data-theme='dark'] .monitor-summary-card strong {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .monitor-kpi-row span,
html[data-theme='dark'] .monitor-auto-refresh,
html[data-theme='dark'] .monitor-card .muted,
html[data-theme='dark'] .monitor-component-ref {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .dashboard-card,
html[data-theme='dark'] .dashboard-card-detailed,
html[data-theme='dark'] .dashboard-card-header,
html[data-theme='dark'] .dashboard-card-content,
html[data-theme='dark'] .dashboard-card-scrollable,
html[data-theme='dark'] .db-pro-summary-card--inline,
html[data-theme='dark'] .db-pro-indicators-panel,
html[data-theme='dark'] .db-pro-section,
html[data-theme='dark'] .db-pro-chart-card,
html[data-theme='dark'] .db-pro-grid-card,
html[data-theme='dark'] .metric-item,
html[data-theme='dark'] .stat-card,
html[data-theme='dark'] .stat-card-info,
html[data-theme='dark'] .dashboard-stats-grid .stat-card {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
  box-shadow: none !important;
}

html[data-theme='dark'] .dashboard-card-title,
html[data-theme='dark'] .db-pro-summary-card__value,
html[data-theme='dark'] .db-pro-section__title,
html[data-theme='dark'] .stat-value,
html[data-theme='dark'] .stat-label,
html[data-theme='dark'] .stat-content {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .db-pro-summary-card__label,
html[data-theme='dark'] .dashboard-card-content .muted,
html[data-theme='dark'] .db-pro-indicators-panel__hint {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .dashboard-card-header {
  border-bottom-color: #2a3544 !important;
}

html[data-theme='dark'] .dashboard-tab-btn:not(.active),
html[data-theme='dark'] .tab-button:not(.active) {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .metric-card,
html[data-theme='dark'] .panel-section,
html[data-theme='dark'] .reports-section,
html[data-theme='dark'] .reports-section-header,
html[data-theme='dark'] .reports-tabs-container,
html[data-theme='dark'] .reports-tabs-buttons,
html[data-theme='dark'] .reports-categories-container,
html[data-theme='dark'] .reports-categories-tabs,
html[data-theme='dark'] .reports-category-content,
html[data-theme='dark'] .reports-tab-content,
html[data-theme='dark'] .reports-subtabs,
html[data-theme='dark'] .reports-site-section,
html[data-theme='dark'] .reports-indicateurs-strip {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
  box-shadow: none !important;
}

html[data-theme='dark'] .metrics-container,
html[data-theme='dark'] .metrics-grid {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: inherit !important;
}

html[data-theme='dark'] .metric-label,
html[data-theme='dark'] .metric-subvalue,
html[data-theme='dark'] .metric-explanation,
html[data-theme='dark'] .reports-section-description {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .metric-value,
html[data-theme='dark'] .reports-section-title,
html[data-theme='dark'] .reports-site-section-title {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .reports-category-button,
html[data-theme='dark'] .reports-tab-button,
html[data-theme='dark'] .reports-subtab-button {
  color: #9aa8b8 !important;
  background: transparent !important;
}

html[data-theme='dark'] .reports-category-button:hover,
html[data-theme='dark'] .reports-tab-button:hover,
html[data-theme='dark'] .reports-subtab-button:hover {
  color: #e8eef6 !important;
  background: #1a2330 !important;
}

html[data-theme='dark'] .reports-category-button.active,
html[data-theme='dark'] .reports-tab-button.active,
html[data-theme='dark'] .reports-subtab-button.active {
  color: #7dd3fc !important;
  background: #1a2330 !important;
  border-bottom-color: #38bdf8 !important;
}

html[data-theme='dark'] .reports-search-input {
  background: #0d1117 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .genset-main-tab:not(.active),
html[data-theme='dark'] .genset-site-group,
html[data-theme='dark'] .genset-generator-card,
html[data-theme='dark'] .genset-generator-card-stat,
html[data-theme='dark'] .genset-workflow-hint,
html[data-theme='dark'] .genset-panel,
html[data-theme='dark'] .genset-form-card,
html[data-theme='dark'] .genset-history-card,
html[data-theme='dark'] .genset-consult-upload-item {
  background: #1a222d !important;
  border-color: #2a3544 !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .genset-consult-upload-item.is-active {
  background: #1e3a4f !important;
  border-color: #38bdf8 !important;
}

html[data-theme='dark'] .genset-hub-empty {
  background: #151b24 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .genset-hub-empty h3 {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .genset-empty {
  background: #151b24 !important;
  border-color: #2a3544 !important;
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .genset-card,
html[data-theme='dark'] .genset-events-card,
html[data-theme='dark'] .genset-bar-list,
html[data-theme='dark'] .genset-log-row,
html[data-theme='dark'] .genset-section,
html[data-theme='dark'] .genset-filters,
html[data-theme='dark'] .genset-table-wrap,
html[data-theme='dark'] .genset-consult-filters {
  background: #151b24 !important;
  border-color: #2a3544 !important;
  color: #e8eef6 !important;
  box-shadow: none !important;
}

html[data-theme='dark'] .genset-kpi__item,
html[data-theme='dark'] .genset-consult-kpi .genset-kpi__item {
  background: #1a222d !important;
  border-color: #2a3544 !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .genset-site-group__head {
  background: #1a222d !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .genset-site-group__head:hover {
  background: #222b38 !important;
}

html[data-theme='dark'] .genset-site-group__meta,
html[data-theme='dark'] .genset-hub-check,
html[data-theme='dark'] .genset-gen-table th {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .genset-gen-table th {
  background: #121820 !important;
  border-bottom-color: #2a3544 !important;
}

html[data-theme='dark'] .genset-gen-table td {
  border-bottom-color: #243041 !important;
}

html[data-theme='dark'] .genset-gen-row:hover {
  background: #1a2838 !important;
}

html[data-theme='dark'] .genset-gen-row.is-selected {
  background: #1e3a4f !important;
  outline-color: #38bdf8 !important;
}

html[data-theme='dark'] .genset-gen-ref {
  color: #7dd3fc !important;
}

html[data-theme='dark'] .genset-pill {
  background: #243041 !important;
  color: #cbd5e1 !important;
}

html[data-theme='dark'] .genset-pill.is-ok {
  background: #14532d !important;
  color: #86efac !important;
}

html[data-theme='dark'] .genset-generator-card.is-selected {
  background: #1a2838 !important;
  border-color: #38bdf8 !important;
}

html[data-theme='dark'] .genset-generator-card-ref {
  color: #7dd3fc !important;
}

html[data-theme='dark'] .genset-generator-card-site,
html[data-theme='dark'] .genset-workflow-hint {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .genset-main-tabs {
  border-bottom-color: #2a3544 !important;
}

html[data-theme='dark'] .genset-main-tab:not(.active) {
  color: #e8eef6 !important;
}

/* Conteneurs / titres inline souvent hardcodés blancs */
html[data-theme='dark'] #app-main [style*='background: white'],
html[data-theme='dark'] #app-main [style*='background:white'],
html[data-theme='dark'] #app-main [style*='background: #fff'],
html[data-theme='dark'] #app-main [style*='background:#fff'],
html[data-theme='dark'] #app-main [style*='background: #ffffff'],
html[data-theme='dark'] #app-main [style*='background:#ffffff'],
html[data-theme='dark'] #app-main [style*='background: #f9fafb'],
html[data-theme='dark'] #app-main [style*='background:#f9fafb'],
html[data-theme='dark'] #app-main [style*='background: #f8fafc'],
html[data-theme='dark'] #app-main [style*='background:#f8fafc'],
html[data-theme='dark'] #app-main [style*='background: #f0f9ff'],
html[data-theme='dark'] #app-main [style*='background:#f0f9ff'] {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .db-pro-quicklink {
  background: #151b24 !important;
  color: #7dd3fc !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .db-pro-quicklink:hover {
  background: #1a2838 !important;
  border-color: #38bdf8 !important;
}

html[data-theme='dark'] .dashboard-pro .dashboard-tabs-container,
html[data-theme='dark'] .dashboard-pro .dashboard-tabs-nav,
html[data-theme='dark'] .dashboard-tabs-content,
html[data-theme='dark'] .dashboard-tab-pane {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .data-table,
html[data-theme='dark'] .data-table tbody,
html[data-theme='dark'] .data-table tbody td,
html[data-theme='dark'] .table-container {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .data-table thead th {
  background: #0b4a63 !important;
  color: #fff !important;
}

/* Mobile : écraser les fonds clairs !important de styles.css */
@media (max-width: 768px) {
  html[data-theme='dark'] .button.secondary,
  html[data-theme='dark'] button.secondary,
  html[data-theme='dark'] .btn-secondary {
    background: #243041 !important;
    color: #e8eef6 !important;
    border-color: #2a3544 !important;
  }

  html[data-theme='dark'] .table-responsive-cards tr,
  html[data-theme='dark'] .table-responsive-cards td {
    background: #151b24 !important;
    color: #e8eef6 !important;
    border-color: #2a3544 !important;
    box-shadow: none !important;
  }

  html[data-theme='dark'] .dashboard-kpi-operational {
    background: #151b24 !important;
    border-color: #2a3544 !important;
  }
}

html[data-theme='dark'] .dashboard-kpi-operational {
  background: #151b24 !important;
  border-color: #2a3544 !important;
  color: #e8eef6 !important;
}

/* Badges statut — dark (listes DA / signalements) */
html[data-theme='dark'] .badge.success,
html[data-theme='dark'] .badge-success {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #6ee7b7 !important;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

html[data-theme='dark'] .badge.warning,
html[data-theme='dark'] .badge-warning {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

html[data-theme='dark'] .badge.error,
html[data-theme='dark'] .badge-danger,
html[data-theme='dark'] .badge.danger {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

html[data-theme='dark'] .badge.info,
html[data-theme='dark'] .badge-info {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #93c5fd !important;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

html[data-theme='dark'] .badge:not(.success):not(.warning):not(.error):not(.info):not(.danger) {
  background: rgba(148, 163, 184, 0.14) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Cartes demandes — titres / lignes détail */
.mcard-title {
  margin: 0;
  color: #1f2937;
  font-size: 1rem;
}

.mcard-muted {
  color: #6b7280;
  font-weight: normal;
}

.mcard-type-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 6px;
}

.mcard-type-tag--piece {
  background: #dbeafe;
  color: #1d4ed8;
}

.mcard-type-tag--cons {
  background: #fef3c7;
  color: #b45309;
}

.demande-piece-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: #1a222d;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  border: 1px solid #2a3544;
}

.demande-piece-row__name {
  font-weight: 500;
  color: #e8eef6;
}

.demande-piece-row__meta {
  font-size: 0.8rem;
  color: #6b7280;
}

html[data-theme='dark'] .mcard-title,
html[data-theme='dark'] .demande-piece-row__name,
html[data-theme='dark'] .demande-achat-card dd {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .mcard-muted,
html[data-theme='dark'] .demande-piece-row__meta,
html[data-theme='dark'] .demande-achat-card dt {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .mcard-type-tag--piece {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
}

html[data-theme='dark'] .mcard-type-tag--cons {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #fbbf24 !important;
}

html[data-theme='dark'] .demande-piece-row,
html[data-theme='dark'] .demande-achat-card .demande-piece-row,
html[data-theme='dark'] .maintenance-card-details > div[style*='background:white'],
html[data-theme='dark'] .maintenance-card-details > div[style*='background: white'] {
  background: #1a222d !important;
  border-color: #2a3544 !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .demande-achat-body,
html[data-theme='dark'] .maintenance-card-details dl {
  border-top-color: #2a3544 !important;
}

/* Centrale DA / DA Outils Divers */
html[data-theme='dark'] .centrale-da {
  --cd-accent: #60a5fa;
  --cd-accent-hover: #93c5fd;
  --cd-surface: #0f1419;
  --cd-card: #151b24;
  --cd-border: #2a3544;
  --cd-border-accent: #334155;
  --cd-muted: #9aa8b8;
  --cd-shadow: none;
  --cd-shadow-md: none;
  --cd-focus: 0 0 0 3px rgba(59, 130, 246, 0.28);
}

html[data-theme='dark'] .centrale-da.panel,
html[data-theme='dark'] .centrale-da__card-main,
html[data-theme='dark'] .da-outils-divers-card,
html[data-theme='dark'] .da-outils-divers-page .centrale-da__card-main {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
  box-shadow: none !important;
}

html[data-theme='dark'] .centrale-da__title,
html[data-theme='dark'] .tools-form-section-label,
html[data-theme='dark'] .centrale-da label,
html[data-theme='dark'] .da-outils-divers-page label {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .centrale-da__subtitle,
html[data-theme='dark'] .centrale-da__back,
html[data-theme='dark'] .da-od-role-note,
html[data-theme='dark'] .tools-role-note {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .centrale-da .form-control,
html[data-theme='dark'] .da-outils-divers-page .form-control,
html[data-theme='dark'] .centrale-da select,
html[data-theme='dark'] .centrale-da input,
html[data-theme='dark'] .centrale-da textarea {
  background: #0d1117 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .da-od-table-wrap,
html[data-theme='dark'] .da-od-table,
html[data-theme='dark'] .da-od-table th,
html[data-theme='dark'] .da-od-table td {
  background: #151b24 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .da-od-table th {
  background: #1a222d !important;
  color: #cbd5e1 !important;
}

/* ===== Signalement details / workflow (inline panels) ===== */
.sig-panel,
.wf-panel {
  background: #151b24;
  border: 1px solid #2a3544;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: none;
}

.sig-panel--section {
  margin-top: 0;
  margin-bottom: 1rem;
  padding: 1rem;
}

.sig-desc-block {
  margin: 0.9rem 0 1rem;
  padding: 0.85rem 1rem;
  background: #121820;
  border: 1px solid #2a3544;
  border-left: 3px solid #3b82f6;
  border-radius: 8px;
}

.sig-desc-block__label {
  font-size: 0.72rem;
  color: #9aa8b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.sig-desc-block__text {
  color: #e8eef6;
  font-size: 0.95rem;
  white-space: pre-wrap;
  line-height: 1.55;
  word-break: break-word;
}

.sig-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #2a3544;
  border-left: 1px solid #2a3544;
  border-radius: 8px;
  overflow: hidden;
  background: #121820;
}

.sig-meta-cell {
  padding: 0.75rem 0.9rem;
  border-right: 1px solid #2a3544;
  border-bottom: 1px solid #2a3544;
  min-width: 0;
}

.sig-meta-label {
  font-size: 0.7rem;
  color: #9aa8b8;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.sig-meta-value {
  font-weight: 600;
  color: #e8eef6;
  font-size: 0.95rem;
  line-height: 1.35;
  word-break: break-word;
}

.sig-meta-sub {
  font-size: 0.8rem;
  color: #9aa8b8;
  margin-top: 0.25rem;
}

.sig-meta-edit {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
  flex-wrap: nowrap;
}

.sig-meta-edit__input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  font-size: 0.82rem !important;
  padding: 0.35rem 0.45rem !important;
  min-height: 2rem !important;
}

.sig-meta-edit__btn {
  flex: 0 0 auto;
  font-size: 0.78rem !important;
  padding: 0.35rem 0.6rem !important;
  min-height: 2rem !important;
  white-space: nowrap;
}

.sig-meta-badge {
  display: inline-block;
  color: #fff;
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  font-size: 0.82rem;
}

.sig-meta-badge--ok { background: #16a34a; }
.sig-meta-badge--warn { background: #dc2626; }

@media (max-width: 1100px) {
  .sig-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .sig-meta-grid { grid-template-columns: 1fr; }
  .sig-meta-edit { flex-wrap: wrap; }
}

.sig-panel__title,
.wf-panel__title {
  color: #e8eef6;
  border-bottom: 2px solid #3b82f6;
  padding-bottom: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sig-stock-banner {
  padding: 0.75rem 1rem;
  background: #ecfeff;
  border: 1px solid #67e8f9;
  border-radius: 8px;
  font-size: 0.88rem;
  color: #0e7490;
}

.sig-stock-banner__muted {
  color: #64748b;
}

.sig-info-banner {
  padding: 0.85rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1e3a8a;
}

.sig-ok-banner {
  padding: 1rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
}

.sig-ok-banner h5 {
  color: #166534;
}

.sig-ok-banner p {
  color: #15803d;
}

.wf-panel__subtitle {
  margin: 0 0 1rem;
  color: #374151;
  font-size: 0.95rem;
  font-weight: 600;
}

.wf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.35rem;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.wf-step {
  margin-left: 2.5rem;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #6b7280;
}

.wf-step__label {
  font-weight: 600;
  font-size: 0.95rem;
  color: inherit;
}

.wf-step__meta {
  font-size: 0.8rem;
  margin-top: 0.25rem;
  color: #6b7280;
}

.wf-step__meta--pending {
  color: #9ca3af;
  font-style: italic;
}

.wf-step[data-state='active'] {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1e40af;
}

.wf-step[data-state='done'] {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

.wf-step[data-state='pending'] {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #6b7280;
}

.wf-step-dot {
  position: absolute;
  left: 0;
  top: 0.25rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  border: 3px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background: #d1d5db;
}

.wf-step-dot[data-state='active'] {
  background: #3b82f6;
}

.wf-step-dot[data-state='done'] {
  background: #10b981;
}

.wf-history-item {
  padding: 0.75rem;
  background: #f9fafb;
  border-left: 3px solid #3b82f6;
  border-radius: 6px;
}

.wf-history-item__title {
  font-weight: 600;
  color: #e8eef6;
  font-size: 0.9rem;
}

.wf-history-item__comment {
  font-size: 0.8rem;
  color: #4b5563;
  margin-top: 0.5rem;
  font-style: italic;
  padding: 0.5rem;
  background: #151b24;
  border-radius: 4px;
}

html[data-theme='dark'] .sig-panel,
html[data-theme='dark'] .wf-panel,
html[data-theme='dark'] .report-section.sig-panel {
  background: var(--phc-bg-panel) !important;
  border-color: var(--phc-border) !important;
  box-shadow: none !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .sig-panel__title,
html[data-theme='dark'] .wf-panel__title,
html[data-theme='dark'] .report-section.sig-panel h4,
html[data-theme='dark'] .wf-panel__subtitle,
html[data-theme='dark'] .wf-history-item__title {
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .sig-stock-banner {
  background: rgba(8, 145, 178, 0.14) !important;
  border-color: #0e7490 !important;
  color: #67e8f9 !important;
}

html[data-theme='dark'] .sig-stock-banner__muted,
html[data-theme='dark'] .sig-stock-banner code {
  color: var(--phc-text-muted) !important;
}

html[data-theme='dark'] .sig-info-banner {
  background: rgba(59, 130, 246, 0.12) !important;
  border-color: #1d4ed8 !important;
  color: #93c5fd !important;
}

html[data-theme='dark'] .sig-ok-banner {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: #059669 !important;
}

html[data-theme='dark'] .sig-ok-banner h5 {
  color: #6ee7b7 !important;
}

html[data-theme='dark'] .sig-ok-banner p {
  color: #a7f3d0 !important;
}

html[data-theme='dark'] .wf-badge {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
}

html[data-theme='dark'] .wf-step[data-state='pending'] {
  background: #1a222d !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

html[data-theme='dark'] .wf-step[data-state='active'] {
  background: rgba(59, 130, 246, 0.18) !important;
  border-color: #3b82f6 !important;
  color: #93c5fd !important;
}

html[data-theme='dark'] .wf-step[data-state='done'] {
  background: rgba(16, 185, 129, 0.14) !important;
  border-color: #10b981 !important;
  color: #6ee7b7 !important;
}

html[data-theme='dark'] .wf-step__meta,
html[data-theme='dark'] .wf-step__meta--pending {
  color: var(--phc-text-muted) !important;
}

html[data-theme='dark'] .wf-step-dot {
  border-color: var(--phc-bg-panel) !important;
}

html[data-theme='dark'] .wf-history-item {
  background: var(--phc-bg-elevated) !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .wf-history-item__comment {
  background: var(--phc-bg-input) !important;
  color: var(--phc-text-muted) !important;
}

html[data-theme='dark'] #signalement-actions-section.sig-panel,
html[data-theme='dark'] #workflow-timeline-section .wf-panel {
  background: var(--phc-bg-panel) !important;
  border-color: var(--phc-border) !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] #workflow-section {
  background: rgba(251, 191, 36, 0.12) !important;
  border-color: #b45309 !important;
  color: #fcd34d !important;
}

html[data-theme='dark'] #workflow-section h5,
html[data-theme='dark'] #workflow-section p {
  color: #fcd34d !important;
}

html[data-theme='dark'] .sig-panel select,
html[data-theme='dark'] .sig-panel input,
html[data-theme='dark'] .sig-panel textarea,
html[data-theme='dark'] .wf-panel select,
html[data-theme='dark'] .wf-panel input,
html[data-theme='dark'] .wf-panel textarea,
html[data-theme='dark'] #signalement-actions-section select,
html[data-theme='dark'] #signalement-actions-section input,
html[data-theme='dark'] #signalement-actions-section textarea {
  background: var(--phc-bg-input) !important;
  color: var(--phc-text) !important;
  border-color: var(--phc-border) !important;
}

html[data-theme='dark'] .finalize-component-card,
html[data-theme='dark'] form[id^='finalize-form-inline'],
html[data-theme='dark'] form[id^='cloture-form-inline'],
html[data-theme='dark'] .cloture-form-inline,
html[data-theme='dark'] .sig-panel > div[style*='background: #f9fafb'],
html[data-theme='dark'] .sig-panel div[style*='background: #f9fafb'],
html[data-theme='dark'] .sig-panel div[style*='background: #eff6ff'],
html[data-theme='dark'] .wf-panel div[style*='background: #eff6ff'],
html[data-theme='dark'] .wf-panel div[style*='background: #f9fafb'] {
  background: var(--phc-bg-elevated) !important;
  border-color: var(--phc-border) !important;
  color: var(--phc-text) !important;
}

/* Modal clôture plein écran progressif — saisie facilitée par étapes */
html.cloture-wizard-open,
html.cloture-wizard-open body,
body.cloture-wizard-open {
  overflow: hidden !important;
}

.cloture-wizard {
  position: fixed;
  inset: 0;
  z-index: 30050; /* au-dessus sidebar (20000) + topbar */
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
}

.cloture-wizard__backdrop {
  display: block;
  position: absolute;
  inset: 0;
  background: #0a0e14;
}

.cloture-wizard__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  background: #0f1419;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: #e8eef6;
  min-height: 0;
  overflow: hidden;
}

.cloture-wizard__head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem 0.55rem;
  border-bottom: 1px solid #2a3544;
  background: #121821;
}

.cloture-wizard__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e8eef6;
}

.cloture-wizard__sub {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

.cloture-wizard__close {
  border: none;
  background: #1a222d;
  color: #94a3b8;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.cloture-wizard__close:hover {
  color: #e8eef6;
  background: #243041;
}

.cloture-wizard__steps {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 280px));
  justify-content: start;
  gap: 0.45rem;
  padding: 0.55rem 1.25rem;
  background: #121821;
  border-bottom: 1px solid #2a3544;
}

.cloture-wizard__tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.4rem;
  border: 1px solid #2a3544;
  border-radius: 8px;
  background: #151b24;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.cloture-wizard__tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #243041;
  font-size: 0.75rem;
}

.cloture-wizard__tab.is-active {
  border-color: #3b82f6;
  color: #e8eef6;
  background: rgba(59, 130, 246, 0.14);
}

.cloture-wizard__tab.is-active span {
  background: #3b82f6;
  color: #fff;
}

.cloture-wizard__tab.is-done {
  border-color: #166534;
  color: #86efac;
}

.cloture-wizard__tab.is-done span {
  background: #16a34a;
  color: #fff;
}

.cloture-wizard__form.cloture-form-inline {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cloture-wizard__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1.25rem;
}

.cloture-wizard__step {
  flex: 1 1 auto;
  min-height: 0;
}

.cloture-wizard__step[data-cloture-step="1"] .cloture-composants-box {
  max-height: none;
  height: 100%;
}

.cloture-wizard__fields--intervention {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: 1fr;
  gap: 1rem;
  align-items: stretch;
  overflow: hidden !important;
  height: 100%;
  min-height: 0;
}

.cloture-wizard__col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cloture-wizard__col--form {
  overflow: hidden;
}

.cloture-wizard__col--form > .cloture-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0;
  align-items: start;
}

.cloture-wizard__col--form > .cloture-form-row > .form-group {
  margin: 0;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cloture-wizard__col--form > .cloture-form-row .cloture-input {
  width: 100%;
}

.cloture-wizard__col--form .cloture-alert {
  margin: 0;
  flex: 0 0 auto;
}

.cloture-wizard__ops {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0 !important;
}

.cloture-wizard__ops textarea.cloture-input {
  flex: 1 1 auto;
  min-height: 140px;
  height: 100%;
  resize: none;
}

.cloture-wizard__col--tech {
  min-height: 0;
}

.cloture-wizard__col--tech .cloture-tech-picker {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}

.cloture-tech-picker {
  border: 1px solid #2a3544;
  border-radius: 10px;
  background: #121821;
  padding: 0.7rem 0.8rem;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  box-sizing: border-box;
}

.cloture-tech-picker__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
  min-height: 1.35rem;
}

.cloture-tech-picker__head .cloture-label {
  font-size: 0.72rem;
  line-height: 1.2;
}

.cloture-tech-picker__count {
  font-size: 0.75rem;
  color: #93c5fd;
  font-weight: 600;
  white-space: nowrap;
}

.cloture-tech-picker__search {
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
}

.cloture-tech-picker__list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  align-content: start;
  align-items: stretch;
  padding: 0;
  margin: 0;
}

.cloture-tech-chip {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid #2a3544;
  border-radius: 8px;
  background: #151b24;
  cursor: pointer;
  color: #e8eef6;
  font-size: 0.86rem;
  line-height: 1.25;
  box-sizing: border-box;
  min-width: 0;
}

.cloture-tech-chip[hidden],
.cloture-tech-chip.is-filtered-out {
  display: none !important;
}

.cloture-tech-chip:hover {
  border-color: #3b82f6;
}

.cloture-tech-chip.is-checked {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.14);
}

.cloture-tech-chip input {
  margin: 0 !important;
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
}

.cloture-tech-chip > span {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cloture-tech-chip__name {
  font-weight: 600;
  color: #e8eef6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cloture-tech-chip__site {
  display: block;
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
  margin: 0;
}

.cloture-tech-picker .cloture-help {
  flex: 0 0 auto;
  margin: 0;
}

.cloture-tech-picker select[multiple] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.cloture-wizard__step {
  flex: 1 1 auto;
  min-height: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.cloture-wizard__step.is-active,
.cloture-wizard__step:not([hidden]) {
  display: flex;
}

.cloture-wizard__step .cloture-composants-box {
  flex: 1 1 auto;
  height: auto;
  max-height: none;
}

.cloture-wizard__fields {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  gap: 0.55rem;
  padding-right: 0.15rem;
}

.cloture-wizard__foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #2a3544;
  background: #121821;
}

.cloture-wizard__nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

@media (max-width: 960px) {
  .cloture-wizard__steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .cloture-wizard__fields--intervention {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(280px, 1fr);
    overflow: auto !important;
  }

  .cloture-wizard__col--tech .cloture-tech-picker {
    min-height: 280px;
  }

  .cloture-tech-picker__list {
    grid-template-columns: 1fr;
  }
}

/* Multi-composants : résumé + saut + cartes compactes */
.cloture-comp-summary {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

.cloture-comp-summary strong {
  color: #93c5fd;
}

.cloture-comp-jump {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.45rem;
}

.cloture-comp-jump__btn {
  border: 1px solid #2a3544;
  background: #151b24;
  color: #cbd5e1;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.cloture-comp-jump__btn.is-active,
.cloture-comp-jump__btn:hover {
  border-color: #3b82f6;
  color: #e8eef6;
  background: rgba(59, 130, 246, 0.14);
}

.cloture-composants-scroll--multi {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.cloture-comp-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.cloture-composants-scroll--multi .cloture-comp-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 0.1rem;
}

.cloture-comp-list--multi .cloture-comp-card {
  padding: 0.45rem 0.55rem;
}

.cloture-comp-list--multi .cloture-comp-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cloture-comp-card__idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: #243041;
  color: #93c5fd;
  font-size: 0.7rem;
  font-weight: 700;
}

.cloture-comp-card.is-flash {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.45);
}

@media (max-width: 1100px) {
  .cloture-comp-list--multi .cloture-comp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .cloture-wizard__body,
  .cloture-wizard__head,
  .cloture-wizard__steps,
  .cloture-wizard__foot {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .cloture-wizard__tab {
    font-size: 0.72rem;
    flex-direction: column;
    gap: 0.2rem;
  }

  .cloture-tech-picker__list {
    grid-template-columns: 1fr;
  }
}

/* Formulaire clôture — base densifiée */
.cloture-form-inline {
  margin: 0;
  padding: 0.55rem 0.65rem 0;
  background: #1a222d;
  border: 1px solid #2a3544;
  border-radius: 8px;
  color: #e8eef6;
  max-height: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.cloture-form-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 0.55rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.cloture-form-fields {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cloture-field {
  margin: 0 !important;
}

.cloture-form-inline .form-group {
  margin-bottom: 0;
}

.cloture-form-inline .cloture-form-row {
  margin-bottom: 0;
  gap: 0.45rem;
}

.cloture-composants-box {
  margin: 0;
  padding: 0.55rem 0.65rem;
  background: #121821;
  border: 1px solid #2a3544;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: none;
  height: 100%;
  overflow: hidden;
}

.cloture-composants-box__bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 0 0 auto;
  margin-bottom: 0.45rem;
}

.cloture-composants-box__title {
  margin: 0;
  color: #e8eef6;
  font-size: 0.92rem;
}

.cloture-composants-box__hint {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.3;
}

.cloture-composants-box__date-toggle {
  flex: 0 0 auto;
  font-size: 0.78rem;
  white-space: nowrap;
}

.cloture-custom-date {
  margin-bottom: 0.45rem;
}

.cloture-composants-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.15rem;
}

.cloture-composants-box__foot {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid #2a3544;
}

.cloture-comp-card {
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.45rem;
  background: #151b24;
  border: 1px solid #2a3544;
  border-radius: 6px;
  color: #e8eef6;
}

.cloture-comp-card:last-child {
  margin-bottom: 0;
}

.cloture-comp-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.45rem;
}

.cloture-comp-card__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  min-width: 0;
  font-size: 0.88rem;
}

.cloture-comp-card__meta {
  font-size: 0.75rem;
  font-weight: 500;
}

.cloture-comp-card__check {
  flex: 0 0 auto;
  font-size: 0.78rem;
}

.cloture-comp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 0.55rem;
}

.cloture-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
  font-weight: 600;
  font-size: 0.72rem;
  color: #94a3b8;
}

.cloture-help {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: #6b7280;
  line-height: 1.25;
}

.cloture-check-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: inherit;
}

.cloture-input {
  width: 100%;
  max-width: 100%;
  min-height: 2.05rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #2a3544;
  border-radius: 6px;
  background: #0d1117;
  color: #e8eef6;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  box-sizing: border-box;
}

@media (max-width: 980px) {
  .cloture-form-split {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .cloture-composants-box {
    max-height: min(38vh, 320px);
    height: auto;
  }

  .cloture-form-fields {
    overflow: visible;
  }
}

@media (max-width: 720px) {
  .cloture-comp-grid {
    grid-template-columns: 1fr;
  }

  .cloture-composants-box {
    max-height: min(42vh, 300px);
  }
}

.sig-details-page.is-cloture-entry .cloture-form-inline {
  max-height: none !important;
  height: 100%;
}

.cloture-input--readonly {
  background: #f9fafb;
}

textarea.cloture-input {
  resize: vertical;
}

.cloture-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 0;
}

.cloture-form-row--stock {
  grid-template-columns: 2fr 1fr;
  gap: 0.75rem;
}

.cloture-duree-texte {
  margin: 0;
  font-size: 0.78rem;
  color: #059669;
  font-weight: 600;
}

.cloture-alert {
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
}

.cloture-alert--warn {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 0.85rem;
}

.cloture-alert--info {
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: #0e7490;
}

.cloture-planif-box {
  margin-top: 1rem;
  padding: 1rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
}

.cloture-stock-fields {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid #bae6fd;
}

.cloture-form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

html[data-theme='dark'] .cloture-form-inline {
  background: var(--phc-bg-elevated) !important;
  border-color: var(--phc-border) !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .cloture-composants-box,
html[data-theme='dark'] .cloture-planif-box,
html[data-theme='dark'] .cloture-alert--info {
  background: rgba(59, 130, 246, 0.12) !important;
  border-color: var(--phc-border) !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .cloture-composants-box__title {
  color: #93c5fd !important;
}

html[data-theme='dark'] .cloture-composants-box__hint,
html[data-theme='dark'] .cloture-help,
html[data-theme='dark'] .cloture-alert--info .cloture-help {
  color: var(--phc-text-muted) !important;
}

html[data-theme='dark'] .cloture-comp-card {
  background: var(--phc-bg-input) !important;
  border-color: var(--phc-border) !important;
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .cloture-comp-card__head,
html[data-theme='dark'] .cloture-label,
html[data-theme='dark'] .cloture-check-label,
html[data-theme='dark'] .cloture-form-inline label,
html[data-theme='dark'] .cloture-form-inline strong,
html[data-theme='dark'] .cloture-form-inline span {
  color: var(--phc-text) !important;
}

html[data-theme='dark'] .cloture-input,
html[data-theme='dark'] .cloture-form-inline input,
html[data-theme='dark'] .cloture-form-inline select,
html[data-theme='dark'] .cloture-form-inline textarea {
  background: var(--phc-bg-input) !important;
  color: var(--phc-text) !important;
  border-color: var(--phc-border) !important;
}

html[data-theme='dark'] .cloture-input--readonly {
  background: rgba(0, 0, 0, 0.25) !important;
}

html[data-theme='dark'] .cloture-alert--warn {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  color: #fbbf24 !important;
}

html[data-theme='dark'] .cloture-duree-texte {
  color: #34d399 !important;
}

html[data-theme='dark'] .cloture-stock-fields {
  border-top-color: var(--phc-border) !important;
}

html[data-theme='dark'] .cloture-form-actions {
  border-top-color: var(--phc-border) !important;
}

html[data-theme='dark'] .sig-panel table td {
  border-color: var(--phc-border) !important;
  color: var(--phc-text) !important;
}

@media (max-width: 720px) {
  .cloture-form-row,
  .cloture-form-row--stock {
    grid-template-columns: 1fr;
  }
}

/* Paramètres — menu cartes */
html[data-theme='dark'] .settings-menu-item {
  background: var(--phc-bg-elevated, #151b24) !important;
  border-color: var(--phc-border, #2a3544) !important;
  color: var(--phc-text, #e8eef6) !important;
}

html[data-theme='dark'] .settings-menu-item:hover {
  background: var(--phc-bg-input, #1a2330) !important;
  border-color: #3b82f6 !important;
  box-shadow: none !important;
}

html[data-theme='dark'] .settings-menu-icon {
  background: rgba(59, 130, 246, 0.12) !important;
}

html[data-theme='dark'] .settings-menu-item h3 {
  color: var(--phc-text, #e8eef6) !important;
}

html[data-theme='dark'] .settings-menu-item .muted,
html[data-theme='dark'] .settings-menu-item p {
  color: var(--phc-text-muted, #9aa8b8) !important;
}

html[data-theme='dark'] .settings-section-label {
  color: #94a3b8 !important;
}

html[data-theme='dark'] .settings-menu-item--accent {
  border-color: rgba(45, 212, 191, 0.55) !important;
  background: linear-gradient(180deg, rgba(13, 148, 136, 0.2), var(--phc-bg-elevated, #151b24)) !important;
}

html[data-theme='dark'] .settings-menu-item--accent:hover {
  border-color: #2dd4bf !important;
}

/* Dashboard — onglet Activité (listes signalements / interventions) */
html[data-theme='dark'] .dashboard-activity-grid,
html[data-theme='dark'] .dashboard-activity-list {
  background: transparent !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .recent-item,
html[data-theme='dark'] .upcoming-item {
  border-bottom-color: #2a3544 !important;
  background: transparent !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .recent-item:hover,
html[data-theme='dark'] .upcoming-item:hover {
  background-color: rgba(255, 255, 255, 0.04) !important;
}

html[data-theme='dark'] .activity-item-title {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .activity-item-description {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .activity-item-date {
  color: #7a8a9a !important;
}

html[data-theme='dark'] .dashboard-card-link {
  color: #93c5fd !important;
}

html[data-theme='dark'] .dashboard-activity-list::-webkit-scrollbar-thumb {
  background: #3d4f63 !important;
}

html[data-theme='dark'] .auth-form label span {
  color: #c5d0dc !important;
}

html[data-theme='dark'] .auth-password-toggle {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .auth-form .error {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}

/* Vérifications — cycle auto (rappel) */
html[data-theme='dark'] .verif-cycle,
html[data-theme='dark'] #verif-auto-cycle-panel,
html[data-theme='dark'] #auto-return-config-panel {
  background: #151b24 !important;
  border-color: #2a3544 !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .verif-cycle__label,
html[data-theme='dark'] #verif-auto-cycle-panel strong {
  color: #93c5fd !important;
}

html[data-theme='dark'] .verif-cycle__status,
html[data-theme='dark'] #verif-cycle-status-label {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .verif-cycle__form:not([hidden]) {
  border-top-color: #2a3544 !important;
}

html[data-theme='dark'] .verif-cycle__form label,
html[data-theme='dark'] #verif-cycle-form label {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] #verif-cycle-form input[type='time'],
html[data-theme='dark'] #verif-cycle-form input[type='number'],
html[data-theme='dark'] #auto-return-form input[type='time'] {
  background: #0d1117 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

/* Login */
html[data-theme='dark'] .auth-form label span {
  color: #c5d0dc !important;
}

html[data-theme='dark'] .auth-password-toggle {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .auth-form .error {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}

/* Catch-all dark : voir /css/theme-dark-catchall.css (chargé en dernier). */

/* ========== Prévisions / saisie consommables ========== */
html[data-theme='dark'] .saisie-toolbar {
  background: #151b24 !important;
  border-color: #2a3544 !important;
  box-shadow: none !important;
}

html[data-theme='dark'] .saisie-toolbar-head {
  background: #1a222d !important;
  border-bottom-color: #2a3544 !important;
}

html[data-theme='dark'] .saisie-toolbar-title {
  color: #7dd3fc !important;
}

html[data-theme='dark'] .saisie-stat-pill {
  background: #0d1117 !important;
  border-color: #2a3544 !important;
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .saisie-stat-pill strong {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .saisie-toolbar-body {
  background: #151b24 !important;
}

html[data-theme='dark'] .saisie-field-label {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .saisie-field-input,
html[data-theme='dark'] .saisie-field-select {
  background: #0d1117 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .saisie-field-input:focus,
html[data-theme='dark'] .saisie-field-select:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
}

html[data-theme='dark'] .saisie-field-icon {
  color: #64748b !important;
}

html[data-theme='dark'] .saisie-action-btn {
  background: #1a222d !important;
  border-color: #2a3544 !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .saisie-action-btn:hover {
  background: #243041 !important;
  border-color: #38bdf8 !important;
  color: #7dd3fc !important;
}

html[data-theme='dark'] .saisie-engin-panel,
html[data-theme='dark'] .saisie-cat-panel {
  background: #151b24 !important;
  border-color: #2a3544 !important;
  box-shadow: none !important;
}

html[data-theme='dark'] .saisie-engin-summary,
html[data-theme='dark'] .saisie-cat-summary {
  background: #1a222d !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .saisie-engin-summary:hover,
html[data-theme='dark'] .saisie-cat-summary:hover,
html[data-theme='dark'] .saisie-cat-panel[open] > .saisie-cat-summary {
  background: #222b38 !important;
}

html[data-theme='dark'] .saisie-engin-title,
html[data-theme='dark'] .saisie-cat-name,
html[data-theme='dark'] .saisie-cons-name {
  color: #e8eef6 !important;
}

html[data-theme='dark'] .saisie-engin-badge {
  background: #0c4a6e !important;
  color: #7dd3fc !important;
}

html[data-theme='dark'] .saisie-engin-toolbar,
html[data-theme='dark'] .saisie-engin-body,
html[data-theme='dark'] .saisie-cat-toolbar,
html[data-theme='dark'] .saisie-cat-body {
  background: #121820 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .saisie-cat-count {
  background: #243041 !important;
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .saisie-engin-empty,
html[data-theme='dark'] .saisie-cons-meta,
html[data-theme='dark'] .saisie-qty-label,
html[data-theme='dark'] .saisie-unit {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] .saisie-cons-row,
html[data-theme='dark'] .consommable-row {
  background: #151b24 !important;
  border-color: #2a3544 !important;
  color: #e8eef6 !important;
}

html[data-theme='dark'] .saisie-cons-row:hover,
html[data-theme='dark'] .consommable-row:hover {
  background: #1a222d !important;
}

html[data-theme='dark'] .saisie-cons-row--filled {
  background: #1a2838 !important;
}

html[data-theme='dark'] .saisie-qty-field .form-control {
  background: #0d1117 !important;
  color: #e8eef6 !important;
  border-color: #2a3544 !important;
}

html[data-theme='dark'] .saisie-apply-all-btn {
  background: #1a222d !important;
  border-color: #2a3544 !important;
  color: #cbd5e1 !important;
}

html[data-theme='dark'] .saisie-apply-all-btn:hover {
  border-color: #38bdf8 !important;
  color: #7dd3fc !important;
  background: #243041 !important;
}

html[data-theme='dark'] #tab-saisie .panel-section strong,
html[data-theme='dark'] #tab-previsions .panel-section strong,
html[data-theme='dark'] #tab-saisie .panel-section [style*='color: #1f2937'],
html[data-theme='dark'] #tab-saisie .panel-section [style*='color:#1f2937'] {
  color: #e8eef6 !important;
}

html[data-theme='dark'] #tab-saisie .panel-section p[style*='color: #6b7280'],
html[data-theme='dark'] #tab-saisie .panel-section p[style*='color:#6b7280'] {
  color: #9aa8b8 !important;
}

html[data-theme='dark'] #tab-previsions h3[style*='color: #1f2937'],
html[data-theme='dark'] #tab-previsions h3[style*='color:#1f2937'] {
  color: #e8eef6 !important;
}

/* ===== Tools page (dark) ===== */
html[data-theme='dark'] .tools-page {
  --tools-border: #2a3544;
  --tools-soft: #151b24;
  --tools-text: #e8eef6;
  --tools-muted: #9aa8b8;
  --tools-accent: #2563eb;
  --tools-accent-ring: rgba(37, 99, 235, 0.25);
}
html[data-theme='dark'] .tools-tabs {
  background: #121821 !important;
  border-color: #2a3544 !important;
}
html[data-theme='dark'] .tools-tab-btn {
  background: #0d1117 !important;
  border-color: #2a3544 !important;
  color: #cbd5e1 !important;
}
html[data-theme='dark'] .tools-tab-btn.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}
html[data-theme='dark'] .tools-page .data-table th {
  background: #151b24 !important;
  color: #94a3b8 !important;
  border-bottom-color: #2a3544 !important;
}
html[data-theme='dark'] .tools-page .data-table td {
  color: #e2e8f0 !important;
  border-color: #1e293b !important;
}
html[data-theme='dark'] .tools-page .tools-input,
html[data-theme='dark'] .tools-page .tools-select,
html[data-theme='dark'] .tools-page textarea.tools-input {
  background: #0d1117 !important;
  border-color: #2a3544 !important;
  color: #e8eef6 !important;
}
html[data-theme='dark'] .tools-page .panel-section,
html[data-theme='dark'] .tools-page .tools-card,
html[data-theme='dark'] .tools-page [style*='background: #f'],
html[data-theme='dark'] .tools-page [style*='background:#f'] {
  background: #151b24 !important;
  border-color: #2a3544 !important;
  color: #e8eef6 !important;
}
