:root {
  color-scheme: light;
  --extranet-page-bg: #ffffff;
  --extranet-surface: #ffffff;
  --extranet-surface-muted: #f8f9fa;
  --extranet-border: #dee2e6;
  --extranet-text: #212529;
  --extranet-text-muted: #6c757d;
  --extranet-link: #0d6efd;
  --extranet-shadow: rgba(0, 0, 0, .1);
}

[data-bs-theme="dark"] {
  color-scheme: dark;
  --extranet-page-bg: #101418;
  --extranet-surface: #1a2026;
  --extranet-surface-muted: #222a32;
  --extranet-border: #3a4652;
  --extranet-text: #e8edf2;
  --extranet-text-muted: #aeb8c2;
  --extranet-link: #76b7ff;
  --extranet-shadow: rgba(0, 0, 0, .4);
}

html[data-bs-theme="dark"] {
  --vx-bg: #101418;
  --vx-surface: #1a2026;
  --vx-border: #3a4652;
  --vx-text: #e8edf2;
  --vx-muted: #aeb8c2;
  --vx-primary-dark: #fbbf24;
  --vx-shadow: 0 18px 45px rgba(0, 0, 0, .3);
  --bg: #101418;
  --panel: #1a2026;
  --ink: #e8edf2;
  --muted: #aeb8c2;
  --line: #3a4652;
  --brand-dark: #76b7ff;
  --danger: #ffaaa3;
  --danger-bg: #421d20;
  --success: #78d9a6;
  --success-bg: #153b2a;
}

html,
body {
  background-color: var(--extranet-page-bg);
  color: var(--extranet-text);
}

body,
.card,
.modal-content,
.list-group-item,
.dropdown-menu,
.accordion-item,
.offcanvas,
.popover,
.toast,
.toolbar {
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

[data-bs-theme="dark"] body,
[data-bs-theme="dark"] main,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .offcanvas {
  background-color: var(--extranet-page-bg);
  color: var(--extranet-text);
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .list-group-item,
[data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .accordion-item,
[data-bs-theme="dark"] .accordion-button,
[data-bs-theme="dark"] fieldset,
[data-bs-theme="dark"] .toolbar,
[data-bs-theme="dark"] .search-summary,
[data-bs-theme="dark"] .result-card,
[data-bs-theme="dark"] .module-card,
[data-bs-theme="dark"] .hero-panel,
[data-bs-theme="dark"] .container.border,
[data-bs-theme="dark"] .person-card {
  background-color: var(--extranet-surface) !important;
  color: var(--extranet-text) !important;
  border-color: var(--extranet-border) !important;
}

[data-bs-theme="dark"] #calendar,
[data-bs-theme="dark"] .info-panel,
[data-bs-theme="dark"] .weather-panel,
[data-bs-theme="dark"] .metric-card,
[data-bs-theme="dark"] .work-card,
[data-bs-theme="dark"] .rules-card,
[data-bs-theme="dark"] .panel-card,
[data-bs-theme="dark"] .doc-item,
[data-bs-theme="dark"] .details-panel,
[data-bs-theme="dark"] .column-row,
[data-bs-theme="dark"] .stat-settings-item,
[data-bs-theme="dark"] .chart-wrap,
[data-bs-theme="dark"] .devis-doc,
[data-bs-theme="dark"] .sticky-actions,
[data-bs-theme="dark"] .brand-panel,
[data-bs-theme="dark"] .brand-pill,
[data-bs-theme="dark"] .hero-note,
[data-bs-theme="dark"] .openbee-task-page .container {
  background: var(--extranet-surface) !important;
  color: var(--extranet-text) !important;
  border-color: var(--extranet-border) !important;
}

[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer,
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer,
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .trombi-functions,
[data-bs-theme="dark"] .search-summary {
  background-color: var(--extranet-surface-muted) !important;
  color: var(--extranet-text) !important;
  border-color: var(--extranet-border) !important;
}

[data-bs-theme="dark"] .card-toolbar,
[data-bs-theme="dark"] .rule-box,
[data-bs-theme="dark"] .prospect-header,
[data-bs-theme="dark"] .info-empty,
[data-bs-theme="dark"] .commentaire-row td,
[data-bs-theme="dark"] .group-row,
[data-bs-theme="dark"] pre,
[data-bs-theme="dark"] code,
[data-bs-theme="dark"] .log {
  background: var(--extranet-surface-muted) !important;
  color: var(--extranet-text) !important;
  border-color: var(--extranet-border) !important;
}

[data-bs-theme="dark"] .bg-menu {
  background-color: var(--extranet-surface-muted) !important;
}

[data-bs-theme="dark"] #clock,
[data-bs-theme="dark"] #date {
  color: var(--extranet-text) !important;
}

[data-bs-theme="dark"] .navbar-brand .bg-white {
  background-color: #ffffff !important;
}

[data-bs-theme="dark"] .logo-card {
  background: #ffffff !important;
}

[data-bs-theme="dark"] .metric-icon,
[data-bs-theme="dark"] .module-icon,
[data-bs-theme="dark"] .info-icon {
  background: var(--extranet-surface-muted) !important;
}

[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark"] .text-body,
[data-bs-theme="dark"] .trombi-name,
[data-bs-theme="dark"] .module-title,
[data-bs-theme="dark"] legend,
[data-bs-theme="dark"] label {
  color: var(--extranet-text) !important;
}

[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-secondary,
[data-bs-theme="dark"] .text-body-secondary,
[data-bs-theme="dark"] .form-text,
[data-bs-theme="dark"] .trombi-role,
[data-bs-theme="dark"] .result-meta,
[data-bs-theme="dark"] .result-snippet {
  color: var(--extranet-text-muted) !important;
}

[data-bs-theme="dark"] a:not(.btn):not(.nav-link):not(.badge) {
  color: var(--extranet-link);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text,
[data-bs-theme="dark"] textarea,
[data-bs-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
[data-bs-theme="dark"] select {
  background-color: #151b21 !important;
  color: var(--extranet-text) !important;
  border-color: var(--extranet-border) !important;
}

[data-bs-theme="dark"] .form-control::placeholder,
[data-bs-theme="dark"] textarea::placeholder,
[data-bs-theme="dark"] input::placeholder {
  color: #84909c !important;
  opacity: 1;
}

[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-select:disabled,
[data-bs-theme="dark"] input:disabled,
[data-bs-theme="dark"] textarea:disabled {
  background-color: #28313a !important;
  color: #aeb8c2 !important;
}

[data-bs-theme="dark"] .table {
  --bs-table-color: var(--extranet-text);
  --bs-table-bg: var(--extranet-surface);
  --bs-table-border-color: var(--extranet-border);
  --bs-table-striped-color: var(--extranet-text);
  --bs-table-striped-bg: rgba(255, 255, 255, .035);
  --bs-table-hover-color: var(--extranet-text);
  --bs-table-hover-bg: rgba(118, 183, 255, .09);
  color: var(--extranet-text) !important;
  border-color: var(--extranet-border) !important;
}

[data-bs-theme="dark"] table.dataTable tbody tr {
  background-color: var(--extranet-surface) !important;
  color: var(--extranet-text) !important;
}

[data-bs-theme="dark"] .table-light {
  --bs-table-color: var(--extranet-text);
  --bs-table-bg: var(--extranet-surface-muted);
  --bs-table-border-color: var(--extranet-border);
  --bs-table-striped-color: var(--extranet-text);
  --bs-table-striped-bg: rgba(255, 255, 255, .035);
  --bs-table-hover-color: var(--extranet-text);
  --bs-table-hover-bg: rgba(118, 183, 255, .09);
}

[data-bs-theme="dark"] .table > :not(caption) > * > *,
[data-bs-theme="dark"] table td,
[data-bs-theme="dark"] table th {
  color: inherit;
  border-color: var(--extranet-border);
}

[data-bs-theme="dark"] .tableau-special2 tbody:nth-child(odd) {
  background-color: #172a38;
}

[data-bs-theme="dark"] .tableau-special2 tbody:nth-child(even),
[data-bs-theme="dark"] .color_form {
  background-color: #352817;
}

[data-bs-theme="dark"] legend {
  background-color: var(--extranet-surface);
  border-color: var(--extranet-border);
}

[data-bs-theme="dark"] .nav-tabs {
  border-color: var(--extranet-border);
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  background-color: var(--extranet-surface);
  color: var(--extranet-text);
  border-color: var(--extranet-border) var(--extranet-border) var(--extranet-surface);
}

[data-bs-theme="dark"] .dropdown-item {
  color: var(--extranet-text);
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus,
[data-bs-theme="dark"] .dropdown-item.active {
  background-color: rgba(118, 183, 255, .12);
  color: var(--extranet-text);
}

[data-bs-theme="dark"] .pagination {
  --bs-pagination-bg: var(--extranet-surface);
  --bs-pagination-border-color: var(--extranet-border);
  --bs-pagination-color: var(--extranet-link);
  --bs-pagination-hover-bg: var(--extranet-surface-muted);
  --bs-pagination-hover-border-color: var(--extranet-border);
}

[data-bs-theme="dark"] hr,
[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end {
  border-color: var(--extranet-border) !important;
}

[data-bs-theme="dark"] .fc-daygrid-day a,
[data-bs-theme="dark"] .fc-col-header-cell a,
[data-bs-theme="dark"] .fc-toolbar-title {
  color: var(--extranet-text) !important;
}

.extranet-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  white-space: nowrap;
}

.extranet-theme-toggle-floating {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1090;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid var(--extranet-border);
  border-radius: 999px;
  background: var(--extranet-surface);
  color: var(--extranet-text);
  box-shadow: 0 .35rem 1rem var(--extranet-shadow);
}

@media (prefers-reduced-motion: reduce) {
  body,
  .card,
  .modal-content,
  .list-group-item,
  .dropdown-menu,
  .accordion-item,
  .offcanvas,
  .popover,
  .toast,
  .toolbar {
    transition: none;
  }
}

@media print {
  .extranet-theme-toggle {
    display: none !important;
  }

  html[data-bs-theme="dark"],
  html[data-bs-theme="dark"] body,
  html[data-bs-theme="dark"] main {
    background: #ffffff !important;
    color: #000000 !important;
  }

  html[data-bs-theme="dark"] .card,
  html[data-bs-theme="dark"] .devis-doc,
  html[data-bs-theme="dark"] .modal-content,
  html[data-bs-theme="dark"] .table {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #dee2e6 !important;
  }
}
