/* ==========================================================================
   THE TOWN - GLOBAL THEME & UI REDESIGN
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES & CONFIGURATION
   -------------------------------------------------------------------------- */
:root {
  /* The Town : violet néon du logo sur fond nuit */
  --tt-primary: #9d5cff;          /* accent néon : bordures, halos, icônes */
  --tt-primary-solid: #8544f2;    /* fond des boutons : texte blanc bien lisible dessus */
  --tt-primary-hover: #7435e0;
  --tt-primary-soft: #c4a1ff;   /* texte violet lisible sur fond sombre */
  --tt-primary-deep: #6d28d9;   /* texte violet lisible sur fond clair */
  --tt-glow: rgba(157, 92, 255, 0.45);

  --bs-primary: #9d5cff;
  --bs-primary-rgb: 157, 92, 255;
  --bs-link-color: #9d5cff;
  --bs-link-hover-color: #7435e0;

  /* UI Constants */
  --card-radius: 12px;
  --btn-radius: 8px;
  --input-radius: 8px;
  --nav-radius: 12px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --------------------------------------------------------------------------
   2. CUSTOM SCROLLBAR
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(157, 92, 255, 0.2);
  border-radius: 10px;
  transition: var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(157, 92, 255, 0.5);
}

/* Dark mode scrollbar */
html.dark-style ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

html.dark-style ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --------------------------------------------------------------------------
   3. LIGHT MODE STYLES (Default overrides)
   -------------------------------------------------------------------------- */
html.light-style body {
  background-color: #f4f6f8; /* Softer gray */
}

/* Accessibility: Deeper violet text for Light Mode */
html.light-style .text-primary {
  color: #6d28d9 !important;
}
html.light-style .bg-label-primary {
  background-color: rgba(157, 92, 255, 0.15) !important;
  color: #6d28d9 !important;
}

/* Glassmorphism Navbar */
html.light-style .layout-navbar {
  background-color: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  margin-bottom: 1.5rem !important;
  border-radius: var(--nav-radius) !important;
  width: calc(100% - 3rem) !important;
  margin: 1rem auto !important;
}

/* Cards (Light) */
html.light-style .card {
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  border-radius: var(--card-radius);
  transition: var(--transition-normal);
}

html.light-style .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Sidebar (Light) */
html.light-style .bg-menu-theme {
  background-color: #fff !important;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.03);
}

html.light-style .bg-menu-theme .menu-link {
  border-radius: var(--btn-radius);
  margin: 0 0.75rem;
}

html.light-style .bg-menu-theme .menu-item.active > .menu-link {
  background: linear-gradient(45deg, #6d28d9, #8b4df5);
  box-shadow: 0 4px 12px rgba(157, 92, 255, 0.3);
  color: #fff !important;
}

html.light-style .bg-menu-theme .menu-item.active > .menu-link i {
  color: #fff !important;
}

/* --------------------------------------------------------------------------
   3. DARK MODE STYLES (Complete Overhaul)
   -------------------------------------------------------------------------- */
html.dark-style body {
  background-color: #0d0b14 !important; /* Deep dark blue-grey */
  color: #e4dcf5 !important;
  color-scheme: dark;
}

/* Dark Navbar */
html.dark-style .layout-navbar {
  background-color: rgba(18, 14, 26, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  
  /* Centering Fix */
  border-radius: var(--nav-radius) !important;
  width: calc(100% - 3rem) !important;
  margin: 1rem auto !important;
  left: auto !important;
  right: auto !important;
  max-width: 1400px !important;
}

/* Cards (Dark) */
html.dark-style .card {
  background-color: #17131f !important;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border-radius: var(--card-radius);
}

html.dark-style .card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  background-color: transparent !important;
}

html.dark-style .card-body, 
html.dark-style .card-footer {
  color: #e4dcf5;
}

/* Text Colors (Dark) */
html.dark-style h1, html.dark-style h2, html.dark-style h3, 
html.dark-style h4, html.dark-style h5, html.dark-style h6,
html.dark-style .h1, html.dark-style .h2, html.dark-style .h3, 
html.dark-style .h4, html.dark-style .h5, html.dark-style .h6 {
  color: #ffffff !important;
}

html.dark-style .text-muted {
  color: #a79bc0 !important;
}

html.dark-style .text-body {
  color: #e4dcf5 !important;
}

/* Tables (Dark) */
html.dark-style .table {
  color: #e4dcf5 !important;
}

html.dark-style .table:not(.table-dark) th,
html.dark-style .table:not(.table-dark) td {
  background-color: transparent !important;
  color: #e4dcf5 !important;
}

html.dark-style .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255, 255, 255, 0.03) !important;
  color: #e4dcf5 !important;
  box-shadow: none !important;
}

html.dark-style .table-striped > tbody > tr:nth-of-type(even) > * {
  background-color: transparent !important;
  color: #e4dcf5 !important;
  box-shadow: none !important;
}

html.dark-style .table thead th {
  background-color: #1f1a2b !important;
  color: #fff !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html.dark-style .table tbody td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

html.dark-style .table-hover tbody tr:hover > * {
  background-color: rgba(255, 255, 255, 0.07) !important;
  color: #fff !important;
}

/* Forms & Inputs (Dark) */
html.dark-style .form-control, 
html.dark-style .form-select, 
html.dark-style .input-group-text {
  background-color: #120f1a !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  color-scheme: dark;
}

html.dark-style .form-control:focus, 
html.dark-style .form-select:focus {
  border-color: var(--tt-primary) !important;
  background-color: #120f1a !important;
  box-shadow: 0 0 0 0.25rem rgba(157, 92, 255, 0.25) !important;
}

/* Sidebar (Dark) */
html.dark-style .bg-menu-theme {
  background-color: #17131f !important;
}

html.dark-style .bg-menu-theme .menu-link {
  color: #e4dcf5 !important;
}

html.dark-style .bg-menu-theme .menu-link:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

html.dark-style .bg-menu-theme .menu-item.active > .menu-link {
  background: linear-gradient(45deg, #6d28d9, #8b4df5) !important;
  box-shadow: 0 4px 15px rgba(157, 92, 255, 0.4) !important;
  color: #fff !important;
}

html.dark-style .bg-menu-theme .menu-header-text {
  color: #a79bc0 !important;
}

/* Dropdowns (Dark) */
html.dark-style .dropdown-menu {
  background-color: #17131f !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

html.dark-style .dropdown-item {
  color: #e4dcf5 !important;
}

html.dark-style .dropdown-item:hover, 
html.dark-style .dropdown-item:focus {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: #fff !important;
}

html.dark-style .dropdown-divider {
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

/* Badges (Dark) */
html.dark-style .bg-label-primary { background-color: rgba(157, 92, 255, 0.2) !important; color: #c4a1ff !important; }
html.dark-style .bg-label-success { background-color: rgba(40, 167, 69, 0.2) !important; color: #75b798 !important; }
html.dark-style .bg-label-warning { background-color: rgba(255, 193, 7, 0.2) !important; color: #ffda6a !important; }
html.dark-style .bg-label-danger { background-color: rgba(220, 53, 69, 0.2) !important; color: #ea868f !important; }
html.dark-style .bg-label-info { background-color: rgba(23, 162, 184, 0.2) !important; color: #6edff6 !important; }

/* Text Colors (Dark) */
html.dark-style .text-primary { color: #c4a1ff !important; }

/* Collapse Fix */
.collapse.show {
    visibility: visible !important;
    height: auto !important;
}


/* Footer (Dark) */
html.dark-style .content-footer,
html.dark-style .bg-footer-theme {
  background-color: #120f1a !important;
  color: #a79bc0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

html.dark-style .footer-link {
  color: #e4dcf5 !important;
}

html.dark-style .footer-link:hover {
  color: #fff !important;
}

/* Custom Options (Checkboxes Cards) (Dark) */
html.dark-style .custom-option {
  background-color: #120f1a !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e4dcf5 !important;
}

html.dark-style .custom-option.checked {
  border-color: var(--tt-primary) !important;
  background-color: rgba(157, 92, 255, 0.1) !important;
}

html.dark-style .custom-option-header .h6,
html.dark-style .custom-option-header h6 {
  color: #fff !important;
}

html.dark-style .custom-option-body {
  color: #a79bc0 !important;
}

html.dark-style .custom-option:hover {
  border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Checkbox and Radio Inputs (Dark) */
html.dark-style .form-check-input {
  background-color: #17131f !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

html.dark-style .form-check-input:checked {
  background-color: var(--tt-primary-solid) !important;
  border-color: var(--tt-primary) !important;
  box-shadow: 0 2px 4px rgba(157, 92, 255, 0.4) !important;
}

html.dark-style .form-check-input:checked[type=checkbox] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") !important;
}

/* --------------------------------------------------------------------------
   4. ACCORDION & LS CUSTOM COMPONENTS (Dark)
   -------------------------------------------------------------------------- */
html.dark-style .accordion-item {
  background-color: #17131f !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

html.dark-style .accordion-button {
  background-color: #1f1a2b !important;
  color: #fff !important;
}

html.dark-style .accordion-button:not(.collapsed) {
  background-color: #261f35 !important;
  color: #fff !important;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.1) !important;
}

html.dark-style .accordion-button::after {
  filter: invert(1) grayscale(1) brightness(2);
}

html.dark-style .accordion-body {
  background-color: #17131f !important;
  color: #e4dcf5 !important;
}

/* --------------------------------------------------------------------------
   5. GLOBAL COMPONENTS (Both Modes)
   -------------------------------------------------------------------------- */
/* Buttons */
.btn {
  border-radius: var(--btn-radius) !important;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  transition: var(--transition-fast);
}

.btn-primary {
  background-color: var(--tt-primary-solid) !important;
  border-color: var(--tt-primary) !important;
  color: #fff !important; 
}

.btn-primary:hover {
  background-color: var(--tt-primary-hover) !important;
  border-color: var(--tt-primary-hover) !important;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(157, 92, 255, 0.3) !important;
}

/* LS Blue Button (Secondary Action) */
.btn-ls-blue {
  background-color: var(--tt-primary-solid) !important;
  border-color: var(--tt-primary) !important;
  color: #fff !important;
}

.btn-ls-yellow:hover {
  background-color: var(--tt-primary-hover) !important;
  border-color: var(--tt-primary-hover) !important;
  color: #17131f !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(157, 92, 255, 0.4) !important;
}

/* Inputs */
.form-control, .form-select {
  border-radius: var(--input-radius) !important;
  padding: 0.6rem 1rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--tt-primary);
  box-shadow: 0 0 0 0.25rem rgba(157, 92, 255, 0.15);
}

/* Toggle Switch */
.dark-mode-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  margin: 0;
}
.dark-mode-toggle input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.dark-mode-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e0e0e0;
  transition: .4s;
  border-radius: 34px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
.dark-mode-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .dark-mode-slider {
  background-color: var(--tt-primary);
}
input:checked + .dark-mode-slider:before {
  transform: translateX(20px);
}

/* --------------------------------------------------------------------------
   5. LOGO CENTERING FIX
   -------------------------------------------------------------------------- */
/* Force Logo Container to be Sticky and On Top */
.app-brand.demo {
  height: 170px !important;
  padding: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  position: sticky !important; /* Makes it stay at top if menu scrolls */
  top: 0 !important;
  z-index: 1000 !important; /* Higher than anything else */
  width: 100% !important;
  flex-shrink: 0 !important; /* Prevents shrinking */
}

/* Le logo néon est toujours posé sur du noir, comme une enseigne (mode clair inclus) */
html.light-style .app-brand.demo,
html.dark-style .app-brand.demo {
  background: radial-gradient(circle at 50% 45%, #1c1230 0%, #08060d 70%) !important;
  box-shadow: 0 1px 0 rgba(157, 92, 255, 0.25);
}

/* Hide the shadow element if it causes conflicts */
.menu-inner-shadow {
  display: none !important;
}

.app-brand-logo.demo {
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.app-brand-logo.demo img {
  max-width: 138px !important;
  max-height: 138px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
}

/* Logo sur plaque ronde noire (connexion, barre du haut) */
.brand-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #1c1230 0%, #08060d 72%);
  box-shadow: 0 0 0 1px rgba(157, 92, 255, 0.35), 0 0 24px rgba(157, 92, 255, 0.25);
}

/* Fix sidebar trigger hiding logo */
.layout-menu-toggle {
  position: absolute;
  right: 10px;
  top: 10px;
}

/* --------------------------------------------------------------------------
   7. SELECT2 DARK MODE FIXES
   -------------------------------------------------------------------------- */
html.dark-style .select2-container--bootstrap-5 .select2-selection {
  background-color: #120f1a !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

html.dark-style .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  color: #fff !important;
}

/* Dropdown Menu (Results) */
html.dark-style .select2-container--bootstrap-5 .select2-dropdown {
  background-color: #17131f !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

/* Search Field inside dropdown */
html.dark-style .select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field {
  background-color: #0d0b14 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

/* Search results items */
html.dark-style .select2-container--bootstrap-5 .select2-results__option {
  color: #e4dcf5 !important;
}

/* Highlighted/Hovered item */
html.dark-style .select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
  background-color: var(--tt-primary-solid) !important;
  color: #fff !important;
}

/* Selected item */
html.dark-style .select2-container--bootstrap-5 .select2-results__option[aria-selected=true] {
  background-color: rgba(157, 92, 255, 0.2) !important;
  color: #fff !important;
}

/* Placeholder */
html.dark-style .select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
  color: #a79bc0 !important;
}

/* --------------------------------------------------------------------------
   6. FORM FIXES (Input Groups)
   -------------------------------------------------------------------------- */
/* Fix Border Radius for Input Groups (Override global !important) */
.input-group > .form-control,
.input-group > .form-select,
.input-group > .input-group-text {
  border-radius: 0 !important;
}

.input-group > :first-child {
  border-top-left-radius: var(--input-radius) !important;
  border-bottom-left-radius: var(--input-radius) !important;
}

.input-group > :last-child {
  border-top-right-radius: var(--input-radius) !important;
  border-bottom-right-radius: var(--input-radius) !important;
}

/* Fix Input Group Merge Visuals */
.input-group-merge > .input-group-text {
  border-color: #d9dee3; /* Standard Light Mode Border */
  background-color: #fff; /* White background for seamless merge */
  color: #566a7f; /* Standard text color */
}

/* Dark Mode Specific Merge Styles */
html.dark-style .input-group-merge > .input-group-text {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background-color: #120f1a !important; /* Match dark input bg */
  color: #fff !important;
}

/* Remove borders between merged elements */
/* For Left Icon + Input */
.input-group-merge > .input-group-text:first-child {
  border-right: 0 !important;
}
.input-group-merge > .form-control:not(:first-child):not(:last-child) {
  border-left: 0 !important;
  border-right: 0 !important;
}

/* For Input + Right Icon/Text */
.input-group-merge > .form-control:last-child {
  border-left: 0 !important;
}

/* For Icon + Input + Icon (Middle Input) */
.input-group-merge > .form-control:not(:first-child):not(:last-child) {
  border-left: 0 !important;
  border-right: 0 !important;
}

/* Specific fix for the reduction field (Icon + Input + Text) */
/* If the last element is input-group-text (like %) */
.input-group-merge > .input-group-text:last-child {
  border-left: 0 !important;
}

/* Ensure focus ring doesn't look weird */
.input-group-merge .form-control:focus {
  z-index: 3;
}

/* Remove box-shadow (halo) for merged inputs in Dark Mode to avoid broken look */
html.dark-style .input-group-merge .form-control:focus,
html.dark-style .input-group-merge .form-select:focus {
  box-shadow: none !important;
}

/* Highlight icon border when input is focused */
html.dark-style .input-group-merge:focus-within .input-group-text,
html.dark-style .input-group-merge:focus-within .form-control {
  border-color: var(--tt-primary) !important;
}

/* Light mode focus highlight */
html.light-style .input-group-merge:focus-within .input-group-text,
html.light-style .input-group-merge:focus-within .form-control {
  border-color: var(--tt-primary) !important;
}

/* --------------------------------------------------------------------------
   8. CUSTOM NUMBER INPUTS (Themed Native Arrows)
   -------------------------------------------------------------------------- */
/* Style for native number arrows */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  opacity: 1;
  cursor: pointer;
  height: 24px;
  width: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' style='fill: rgba(157, 92, 255, 1);'%3E%3Cpath d='M7 14l5-5 5 5z'/%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-color: transparent !important;
  margin-right: 4px;
}

/* Dark mode arrows */
html.dark-style input[type=number]::-webkit-inner-spin-button,
html.dark-style input[type=number]::-webkit-outer-spin-button {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' style='fill: rgba(255, 255, 255, 0.8);'%3E%3Cpath d='M7 14l5-5 5 5z'/%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") !important;
  filter: none !important;
  background-color: transparent !important;
}

/* Ensure consistent alignment */
input[type=number] {
  padding-right: 0.5rem !important;
}


/* ==========================================================================
   8. COMPREHENSIVE PRIMARY COLOR OVERRIDES (Fix for primary color)
   ========================================================================== */

/* Force Primary Colors */
.text-primary { color: var(--tt-primary) !important; }
.bg-primary { 
    background-color: var(--tt-primary-solid) !important; 
    color: #fff !important;
}
a { color: var(--tt-primary); }
a:hover { color: var(--tt-primary-hover); }

/* Navigation & Menu */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  background-color: var(--tt-primary-solid) !important;
  color: #fff !important;
  box-shadow: 0 2px 4px rgba(157, 92, 255, 0.4) !important;
}

/* Pagination */
.page-item.active .page-link {
  background-color: var(--tt-primary-solid) !important;
  border-color: var(--tt-primary) !important;
  color: #fff !important;
}
.page-link { color: var(--tt-primary); }
.page-link:hover { color: var(--tt-primary-hover); }

/* Form Elements */
.form-check-input:checked {
  background-color: var(--tt-primary-solid) !important;
  border-color: var(--tt-primary) !important;
}
.form-control:focus, 
.form-select:focus,
.input-group-text:focus {
  border-color: var(--tt-primary) !important;
  box-shadow: 0 0 0 0.25rem rgba(157, 92, 255, 0.25) !important;
}

/* Dropdowns */
.dropdown-item.active, 
.dropdown-item:active {
  background-color: var(--tt-primary-solid) !important;
  color: #fff !important;
}

/* Specific Sneat Overrides */
.app-brand-text { color: var(--tt-primary) !important; }
.menu-link i { color: inherit; } /* Let the parent color dictate */
.menu-item.active .menu-link { 
  background: linear-gradient(45deg, #6d28d9, #8b4df5) !important;
  box-shadow: 0 4px 15px rgba(157, 92, 255, 0.4) !important;
}
.menu-item.active .menu-icon { color: #fff !important; }

/* Timeline & specialized components */
.timeline-point-primary {
  background-color: var(--tt-primary-solid) !important;
  box-shadow: 0 0 0 3px rgba(157, 92, 255, 0.2);
}

/* Primary label */
.bg-label-primary {
  background-color: rgba(157, 92, 255, 0.1) !important;
  color: var(--tt-primary) !important;
}
html.dark-style .bg-label-primary {
  background-color: rgba(157, 92, 255, 0.2) !important;
  color: #c4a1ff !important;
}

/* Fix for buttons that might be missed */
.btn-outline-primary {
  color: var(--tt-primary) !important;
  border-color: var(--tt-primary) !important;
}
.btn-outline-primary:hover {
  background-color: var(--tt-primary-solid) !important;
  color: #fff !important;
}


/* Custom Tabs Coloring */

/* Active State - Flashy (Shared) */
.nav-tabs .nav-link.active.nav-link-customs {
  background-color: var(--tt-primary-solid) !important;
  color: #fff !important;
  border-color: var(--tt-primary) !important;
}

.nav-tabs .nav-link.active.nav-link-repairs {
  background-color: var(--tt-primary-solid) !important;
  color: #fff !important;
  border-color: var(--tt-primary) !important;
}

/* ==========================================================================
   DARK MODE - Inactive Tabs
   ========================================================================== */
html.dark-style .nav-tabs .nav-link:not(.active).nav-link-customs {
  background-color: rgba(157, 92, 255, 0.25) !important;
  color: #ffffff !important; /* White text for contrast */
  border-color: transparent !important;
}

html.dark-style .nav-tabs .nav-link:not(.active).nav-link-repairs {
  background-color: rgba(157, 92, 255, 0.15) !important;
  color: #ffffff !important; /* White text for contrast */
  border-color: transparent !important;
}

/* Hover State Dark Mode */
html.dark-style .nav-tabs .nav-link:not(.active).nav-link-customs:hover {
  background-color: rgba(157, 92, 255, 0.5) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

html.dark-style .nav-tabs .nav-link:not(.active).nav-link-repairs:hover {
  background-color: rgba(157, 92, 255, 0.4) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

/* ==========================================================================
   LIGHT MODE - Inactive Tabs (Gray Text)
   ========================================================================== */
html.light-style .nav-tabs .nav-link:not(.active).nav-link-customs {
  background-color: rgba(157, 92, 255, 0.1) !important; /* Lighter background */
  color: #697a8d !important; /* Gray text */
  border-color: transparent !important;
}

html.light-style .nav-tabs .nav-link:not(.active).nav-link-repairs {
  background-color: rgba(157, 92, 255, 0.1) !important; /* Lighter background */
  color: #697a8d !important; /* Gray text */
  border-color: transparent !important;
}

/* Hover State Light Mode */
html.light-style .nav-tabs .nav-link:not(.active).nav-link-customs:hover {
  background-color: rgba(157, 92, 255, 0.2) !important;
  color: #566a7f !important; /* Darker Gray on hover */
  border-color: transparent !important;
}

html.light-style .nav-tabs .nav-link:not(.active).nav-link-repairs:hover {
  background-color: rgba(157, 92, 255, 0.2) !important;
  color: #566a7f !important; /* Darker Gray on hover */
  border-color: transparent !important;
}


/* --------------------------------------------------------------------------
   9. MODAL STYLES (Dark Mode)
   -------------------------------------------------------------------------- */
html.dark-style .modal-content {
  background-color: #17131f !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

html.dark-style .modal-header,
html.dark-style .modal-footer {
  border-color: rgba(255, 255, 255, 0.05) !important;
}

html.dark-style .modal-title {
  color: #fff !important;
}

html.dark-style .modal-body {
  color: #e4dcf5 !important;
}

html.dark-style .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}



/* --------------------------------------------------------------------------
   10. THE TOWN : TOUCHES NÉON
   -------------------------------------------------------------------------- */
html.dark-style .card {
  border-color: rgba(157, 92, 255, 0.12);
}

html.dark-style .bg-menu-theme {
  border-right: 1px solid rgba(157, 92, 255, 0.12);
}

.btn-primary,
.bg-menu-theme .menu-item.active > .menu-link {
  text-shadow: 0 1px 2px rgba(40, 10, 90, 0.45);
}

html.dark-style .btn-primary:hover,
html.dark-style .bg-menu-theme .menu-item.active > .menu-link {
  box-shadow: 0 0 18px var(--tt-glow) !important;
}

/* Cartes mises en avant en violet (indicateurs) */
html.dark-style .text-primary {
  color: var(--tt-primary-soft) !important;
}

html.light-style a {
  color: var(--tt-primary-deep);
}

html.dark-style a:not(.btn):not(.menu-link):not(.dropdown-item):not(.nav-link):not(.footer-link):not(.page-link):not(.card) {
  color: var(--tt-primary-soft);
}

html.dark-style .page-link {
  background-color: #17131f;
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--tt-primary-soft);
}

html.dark-style .table-light,
html.dark-style .table-light > * {
  --bs-table-bg: #1f1a2b;
  background-color: #1f1a2b !important;
  color: #fff !important;
}

html.dark-style .table-active > * {
  background-color: rgba(157, 92, 255, 0.12) !important;
}

html.dark-style .table-success > * {
  background-color: rgba(40, 167, 69, 0.18) !important;
  color: #9be3b4 !important;
}

html.dark-style .table-danger > * {
  background-color: rgba(220, 53, 69, 0.18) !important;
  color: #f1a1a8 !important;
}

/* ==========================================================================
   11. CONTRASTE & LISIBILITÉ
   Objectif : tout texte à au moins 4.5:1 sur son fond, en clair comme en sombre.
   ========================================================================== */
:root {
  /* Fonds pleins (texte blanc dessus) */
  --tt-success-solid: #1b8539;
  --tt-success-solid-hover: #166f2f;
  --tt-danger-solid: #d32f1e;
  --tt-danger-solid-hover: #b52617;
  --tt-warning-solid: #b05c00;
  --tt-warning-solid-hover: #944d00;
  --tt-info-solid: #0b7f9c;
  --tt-info-solid-hover: #096a83;
  --tt-secondary-solid: #5f6b7a;
  --tt-secondary-solid-hover: #4f5966;
}

html.light-style {
  --tt-text: #566476;
  --tt-text-strong: #2f3b4a;
  --tt-text-muted: #647080;
  --tt-border: #d9dee3;
  --tt-surface-2: #f4f6f8;
  --tt-primary-text: #6d28d9;
  --tt-success-text: #17692c;
  --tt-danger-text: #b3261a;
  --tt-warning-text: #8a4d00;
  --tt-info-text: #086479;
  --tt-secondary-text: #5f6b7a;
}

html.dark-style {
  --tt-text: #e4dcf5;
  --tt-text-strong: #ffffff;
  --tt-text-muted: #a79bc0;
  --tt-border: rgba(255, 255, 255, 0.12);
  --tt-surface: #17131f;
  --tt-surface-2: #1f1a2b;
  --tt-surface-3: #2a2438;
  --tt-primary-text: #c4a1ff;
  --tt-success-text: #6fdc8c;
  --tt-danger-text: #ff8a80;
  --tt-warning-text: #ffcb52;
  --tt-info-text: #67d7f2;
  --tt-secondary-text: #c9c1dc;
}

/* --- Textes de base (mode clair : le gris du thème était trop pâle) --- */
html.light-style body,
html.light-style .table,
html.light-style .dropdown-item,
html.light-style .bg-menu-theme .menu-link,
html.light-style .form-control,
html.light-style .form-select,
html.light-style .list-group-item,
html.light-style .layout-navbar,
html.light-style .accordion-button,
html.light-style .nav-link:not(.active):not(.text-white) {
  color: var(--tt-text);
}
html.light-style .text-muted,
html.light-style .form-text,
html.light-style .bg-menu-theme .menu-header-text,
html.light-style .card-subtitle,
html.light-style .content-footer {
  color: var(--tt-text-muted) !important;
}
html.light-style .form-control::placeholder { color: #8a96a3; }

html.dark-style .layout-navbar,
html.dark-style .layout-navbar .nav-link {
  color: var(--tt-text);
}
html.dark-style .form-text,
html.dark-style .card-subtitle,
html.dark-style .dropdown-header,
html.dark-style figcaption { color: var(--tt-text-muted) !important; }
html.dark-style .text-dark,
html.dark-style .text-black,
html.dark-style .text-heading { color: #f1ecfa !important; }
html.dark-style .text-light { color: var(--tt-text-muted) !important; }
html.dark-style .text-gray-900,
html.dark-style .text-gray-800,
html.dark-style .text-gray-700 { color: #f1ecfa; }
html.dark-style .text-gray-600,
html.dark-style .text-gray-500,
html.dark-style .text-gray-400 { color: var(--tt-text-muted); }

/* --- Liens --- */
html.dark-style a:not(.btn):not(.menu-link):not(.dropdown-item):not(.nav-link):not(.footer-link):not(.page-link):not(.card):hover {
  color: #dcc7ff;
}
html.dark-style .page-link:hover { color: #fff; }
html.light-style .page-link,
html.light-style .btn-outline-primary { color: var(--tt-primary-text) !important; }

/* --- Couleurs de statut : texte --- */
html.light-style .text-success, html.dark-style .text-success { color: var(--tt-success-text) !important; }
html.light-style .text-danger,  html.dark-style .text-danger  { color: var(--tt-danger-text) !important; }
html.light-style .text-warning, html.dark-style .text-warning { color: var(--tt-warning-text) !important; }
html.light-style .text-info,    html.dark-style .text-info    { color: var(--tt-info-text) !important; }
html.light-style .text-secondary, html.dark-style .text-secondary { color: var(--tt-secondary-text) !important; }

/* --- Couleurs de statut : fonds pleins (badges, boutons, toasts) --- */
.bg-success   { background-color: var(--tt-success-solid) !important; }
.bg-danger    { background-color: var(--tt-danger-solid) !important; }
.bg-warning   { background-color: var(--tt-warning-solid) !important; }
.bg-info      { background-color: var(--tt-info-solid) !important; }
.bg-secondary { background-color: var(--tt-secondary-solid) !important; }
.badge.bg-success, .badge.bg-danger, .badge.bg-warning, .badge.bg-info,
.badge.bg-secondary, .badge.bg-primary, .badge.bg-dark,
.badge.bg-warning.text-dark { color: #fff !important; }

.btn-primary { border-color: var(--tt-primary-solid) !important; }
.btn-success   { background-color: var(--tt-success-solid) !important;   border-color: var(--tt-success-solid) !important;   color: #fff !important; }
.btn-danger    { background-color: var(--tt-danger-solid) !important;    border-color: var(--tt-danger-solid) !important;    color: #fff !important; }
.btn-warning   { background-color: var(--tt-warning-solid) !important;   border-color: var(--tt-warning-solid) !important;   color: #fff !important; }
.btn-info      { background-color: var(--tt-info-solid) !important;      border-color: var(--tt-info-solid) !important;      color: #fff !important; }
.btn-secondary { background-color: var(--tt-secondary-solid) !important; border-color: var(--tt-secondary-solid) !important; color: #fff !important; }
.btn-success:hover   { background-color: var(--tt-success-solid-hover) !important;   border-color: var(--tt-success-solid-hover) !important; }
.btn-danger:hover    { background-color: var(--tt-danger-solid-hover) !important;    border-color: var(--tt-danger-solid-hover) !important; }
.btn-warning:hover   { background-color: var(--tt-warning-solid-hover) !important;   border-color: var(--tt-warning-solid-hover) !important; }
.btn-info:hover      { background-color: var(--tt-info-solid-hover) !important;      border-color: var(--tt-info-solid-hover) !important; }
.btn-secondary:hover { background-color: var(--tt-secondary-solid-hover) !important; border-color: var(--tt-secondary-solid-hover) !important; }
html.dark-style .btn-dark {
  background-color: var(--tt-surface-3) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
}

/* --- Boutons contour --- */
html.dark-style .btn-outline-primary { color: var(--tt-primary-text) !important; }
html.light-style .btn-outline-primary:hover,
html.dark-style .btn-outline-primary:hover,
html.light-style .btn-outline-primary:active,
html.dark-style .btn-outline-primary:active,
html.light-style .btn-outline-primary.active,
html.dark-style .btn-outline-primary.active,
html.light-style .btn-check:checked + .btn-outline-primary,
html.dark-style .btn-check:checked + .btn-outline-primary {
  background-color: var(--tt-primary-solid) !important;
  border-color: var(--tt-primary-solid) !important;
  color: #fff !important;
}

html.light-style .btn-outline-success, html.dark-style .btn-outline-success { color: var(--tt-success-text); border-color: var(--tt-success-text); }
html.light-style .btn-outline-danger,  html.dark-style .btn-outline-danger  { color: var(--tt-danger-text);  border-color: var(--tt-danger-text); }
html.light-style .btn-outline-warning, html.dark-style .btn-outline-warning { color: var(--tt-warning-text); border-color: var(--tt-warning-text); }
html.light-style .btn-outline-info,    html.dark-style .btn-outline-info    { color: var(--tt-info-text);    border-color: var(--tt-info-text); }
html.light-style .btn-outline-secondary { color: var(--tt-secondary-text); border-color: #a7b0bb; }
html.dark-style .btn-outline-secondary { color: var(--tt-secondary-text); border-color: rgba(255, 255, 255, 0.28); }
html.dark-style .btn-outline-dark { color: var(--tt-text); border-color: rgba(255, 255, 255, 0.3); }

.btn-outline-success:hover, .btn-check:checked + .btn-outline-success { background-color: var(--tt-success-solid) !important; border-color: var(--tt-success-solid) !important; color: #fff !important; }
.btn-outline-danger:hover,  .btn-check:checked + .btn-outline-danger  { background-color: var(--tt-danger-solid) !important;  border-color: var(--tt-danger-solid) !important;  color: #fff !important; }
.btn-outline-warning:hover, .btn-check:checked + .btn-outline-warning { background-color: var(--tt-warning-solid) !important; border-color: var(--tt-warning-solid) !important; color: #fff !important; }
.btn-outline-info:hover,    .btn-check:checked + .btn-outline-info    { background-color: var(--tt-info-solid) !important;    border-color: var(--tt-info-solid) !important;    color: #fff !important; }
.btn-outline-secondary:hover,
html.dark-style .btn-outline-dark:hover { background-color: var(--tt-secondary-solid) !important; border-color: var(--tt-secondary-solid) !important; color: #fff !important; }

/* --- Étiquettes pastel (badges, avatars, boutons « label ») --- */
html.light-style .bg-label-success, html.light-style .btn-label-success { color: var(--tt-success-text) !important; }
html.light-style .bg-label-danger,  html.light-style .btn-label-danger  { color: var(--tt-danger-text) !important; }
html.light-style .bg-label-warning, html.light-style .btn-label-warning { color: var(--tt-warning-text) !important; }
html.light-style .bg-label-info,    html.light-style .btn-label-info    { color: var(--tt-info-text) !important; }
html.light-style .bg-label-secondary, html.light-style .btn-label-secondary,
html.light-style .bg-label-dark { color: #4f5966 !important; }

html.dark-style .bg-label-success, html.dark-style .btn-label-success { background-color: rgba(52, 199, 100, 0.16) !important; color: var(--tt-success-text) !important; }
html.dark-style .bg-label-danger,  html.dark-style .btn-label-danger  { background-color: rgba(255, 99, 85, 0.16) !important;  color: var(--tt-danger-text) !important; }
html.dark-style .bg-label-warning, html.dark-style .btn-label-warning { background-color: rgba(255, 190, 40, 0.16) !important; color: var(--tt-warning-text) !important; }
html.dark-style .bg-label-info,    html.dark-style .btn-label-info    { background-color: rgba(60, 200, 235, 0.16) !important; color: var(--tt-info-text) !important; }
html.dark-style .bg-label-secondary, html.dark-style .btn-label-secondary,
html.dark-style .bg-label-dark { background-color: rgba(255, 255, 255, 0.09) !important; color: var(--tt-secondary-text) !important; border-color: transparent !important; }
html.dark-style .btn-label-secondary:hover { background-color: rgba(255, 255, 255, 0.16) !important; color: #fff !important; }
html.dark-style .btn-label-primary { background-color: rgba(157, 92, 255, 0.2) !important; color: var(--tt-primary-text) !important; }

.avatar .avatar-initial { background-color: var(--tt-secondary-solid); }
[class*="bg-label-"] > .avatar-initial:not([class*="bg-"]) { background-color: transparent; color: inherit; }

/* --- Alertes --- */
html.light-style .alert-success { color: var(--tt-success-text); }
html.light-style .alert-danger  { color: var(--tt-danger-text); }
html.light-style .alert-warning { color: var(--tt-warning-text); }
html.light-style .alert-info    { color: var(--tt-info-text); }
html.light-style .alert-primary { color: var(--tt-primary-text); }
html.light-style .alert-secondary { color: #4f5966; }

html.dark-style .alert { border: 1px solid transparent; }
html.dark-style .alert-success { background-color: rgba(52, 199, 100, 0.13) !important; border-color: rgba(52, 199, 100, 0.35) !important; color: var(--tt-success-text) !important; }
html.dark-style .alert-danger  { background-color: rgba(255, 99, 85, 0.13) !important;  border-color: rgba(255, 99, 85, 0.35) !important;  color: var(--tt-danger-text) !important; }
html.dark-style .alert-warning { background-color: rgba(255, 190, 40, 0.13) !important; border-color: rgba(255, 190, 40, 0.35) !important; color: var(--tt-warning-text) !important; }
html.dark-style .alert-info    { background-color: rgba(60, 200, 235, 0.13) !important; border-color: rgba(60, 200, 235, 0.35) !important; color: var(--tt-info-text) !important; }
html.dark-style .alert-primary { background-color: rgba(157, 92, 255, 0.15) !important; border-color: rgba(157, 92, 255, 0.4) !important;  color: var(--tt-primary-text) !important; }
html.dark-style .alert-secondary,
html.dark-style .alert-dark,
html.dark-style .alert-light { background-color: rgba(255, 255, 255, 0.07) !important; border-color: var(--tt-border) !important; color: var(--tt-text) !important; }
html.dark-style .alert .alert-link,
html.dark-style .alert a:not(.btn) { color: inherit !important; text-decoration: underline; }
html.dark-style .alert .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* --- Fonds clairs restés blancs en mode sombre --- */
html.dark-style .bg-white,
html.dark-style .bg-light,
html.dark-style .bg-lighter,
html.dark-style .bg-body,
html.dark-style .bg-gray-50,
html.dark-style .bg-gray-100,
html.dark-style .bg-gray-200 {
  background-color: var(--tt-surface-2) !important;
  color: var(--tt-text);
}
html.dark-style .badge.bg-white { background-color: rgba(255, 255, 255, 0.92) !important; }
html.dark-style .badge.bg-white.text-warning { color: #8a4d00 !important; }

html.dark-style .list-group-item {
  background-color: transparent;
  border-color: var(--tt-border);
  color: var(--tt-text);
}
html.dark-style .list-group-item-action:hover { background-color: rgba(255, 255, 255, 0.05); color: #fff; }

html.dark-style pre,
html.dark-style pre code {
  background-color: #120f1a !important;
  color: var(--tt-text) !important;
}
html.dark-style code { color: #ff9ccb; }
html.dark-style kbd { background-color: var(--tt-surface-3); color: #fff; }

/* --- Bordures --- */
html.dark-style hr { border-color: var(--tt-border); color: var(--tt-border); opacity: 1; }
html.dark-style .border,
html.dark-style .border-top,
html.dark-style .border-bottom,
html.dark-style .border-start,
html.dark-style .border-end,
html.dark-style .border-light { border-color: var(--tt-border) !important; }
html.dark-style .border-primary   { border-color: var(--tt-primary) !important; }
html.dark-style .border-success   { border-color: var(--tt-success-text) !important; }
html.dark-style .border-danger    { border-color: var(--tt-danger-text) !important; }
html.dark-style .border-warning   { border-color: var(--tt-warning-text) !important; }
html.dark-style .border-info      { border-color: var(--tt-info-text) !important; }
html.dark-style .border-secondary { border-color: rgba(255, 255, 255, 0.25) !important; }

/* --- Formulaires (mode sombre) --- */
html.dark-style label,
html.dark-style .form-label,
html.dark-style .col-form-label,
html.dark-style .form-check-label,
html.dark-style legend { color: #d3c9e8; }
html.dark-style .form-control::placeholder { color: #8d82a6 !important; opacity: 1; }
html.dark-style .form-control:disabled,
html.dark-style .form-control[readonly],
html.dark-style .form-select:disabled {
  background-color: #1b1726 !important;
  color: #b3abc6 !important;
}
html.dark-style .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23d3c9e8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
}
html.dark-style .form-select option { background-color: #17131f; color: #fff; }
html.dark-style .invalid-feedback { color: var(--tt-danger-text); }
html.dark-style .valid-feedback { color: var(--tt-success-text); }
html.dark-style .form-control.is-invalid { border-color: var(--tt-danger-text) !important; }

/* --- Onglets & pastilles de navigation --- */
html.dark-style .nav-tabs .nav-link:not(.active),
html.dark-style .nav-pills .nav-link:not(.active):not(.text-white) { color: #cfc6e3; }
html.dark-style .nav-tabs .nav-link:not(.active):hover,
html.dark-style .nav-pills .nav-link:not(.active):not(.text-white):hover { color: #fff; }
html.dark-style .nav-tabs { border-color: var(--tt-border); }
html.dark-style .nav-tabs .nav-link.active:not(.nav-link-customs):not(.nav-link-repairs) {
  background-color: var(--tt-surface);
  border-color: var(--tt-border) var(--tt-border) var(--tt-surface);
  color: #fff;
}
html.dark-style .nav-align-top .tab-content,
html.dark-style .nav-align-left .tab-content,
html.dark-style .nav-align-right .tab-content,
html.dark-style .nav-align-bottom .tab-content {
  background-color: var(--tt-surface);
  color: var(--tt-text);
}

/* --- Pagination --- */
html.dark-style .page-link { background-color: var(--tt-surface-2) !important; }
html.dark-style .page-item.disabled .page-link { color: #857b9e !important; }
html.dark-style .page-item.active .page-link { background-color: var(--tt-primary-solid) !important; }

/* --- Tableaux colorés (mode sombre) --- */
html.dark-style .table-warning > * { background-color: rgba(255, 190, 40, 0.14) !important; color: var(--tt-warning-text) !important; }
html.dark-style .table-info > *    { background-color: rgba(60, 200, 235, 0.14) !important; color: var(--tt-info-text) !important; }
html.dark-style .table-primary > * { background-color: rgba(157, 92, 255, 0.16) !important; color: var(--tt-primary-text) !important; }
html.dark-style .table-secondary > * { background-color: rgba(255, 255, 255, 0.06) !important; }

/* --- Divers composants (mode sombre) --- */
html.dark-style .breadcrumb-item,
html.dark-style .breadcrumb-item::before { color: var(--tt-text-muted); }
html.dark-style .breadcrumb-item.active { color: var(--tt-text); }
html.dark-style .progress { background-color: rgba(255, 255, 255, 0.09); }
html.dark-style .toast:not([class*="bg-"]),
html.dark-style .popover,
html.dark-style .offcanvas {
  background-color: var(--tt-surface-2);
  color: var(--tt-text);
  border-color: var(--tt-border);
}
html.dark-style .popover-header { background-color: var(--tt-surface-3); color: #fff; border-color: var(--tt-border); }
html.dark-style .popover-body { color: var(--tt-text); }
html.dark-style .toast-header { background-color: var(--tt-surface-3); color: #fff; }
html.dark-style .select2-container--bootstrap-5 .select2-results__option:not(.select2-results__option--highlighted):not([aria-selected=true]) {
  background-color: transparent !important;
}
html.dark-style .select2-container--bootstrap-5 .select2-results__option--highlighted { color: #fff !important; }

/* --- Caisse : lignes du panier --- */
.cart-item {
  background-color: #fff;
  border: 1px solid var(--tt-border);
}
html.dark-style .cart-item { background-color: var(--tt-surface-2); }
.cart-item .item-name { color: var(--tt-text-strong); }
.cart-item .item-details,
.cart-item .cart-item-choices { color: var(--tt-text-muted); }
html.dark-style .cart-item .cart-qty-input,
html.light-style .cart-item .cart-qty-input { color: var(--tt-text-strong) !important; }

/* --- Notifications (toasts) colorées --- */
html .toast.bg-success, html .toast.bg-success .toast-header { background-color: var(--tt-success-solid) !important; color: #fff !important; }
html .toast.bg-danger,  html .toast.bg-danger .toast-header  { background-color: var(--tt-danger-solid) !important;  color: #fff !important; }
html .toast.bg-warning, html .toast.bg-warning .toast-header { background-color: var(--tt-warning-solid) !important; color: #fff !important; }
html .toast.bg-info,    html .toast.bg-info .toast-header    { background-color: var(--tt-info-solid) !important;    color: #fff !important; }
html.dark-style .page-item.disabled .page-link { color: #9087a8 !important; }

/* --- Mode clair : derniers gris trop pâles --- */
html.light-style .card,
html.light-style .card-body,
html.light-style .table > :not(caption) > * > *,
html.light-style .footer-link,
html.light-style .modal-body {
  color: var(--tt-text);
}
html.light-style h1, html.light-style h2, html.light-style h3,
html.light-style h4, html.light-style h5, html.light-style h6,
html.light-style .table th {
  color: var(--tt-text-strong);
}
html.light-style .btn-label-secondary { background-color: #e6e9ed; border-color: transparent; }
html.light-style .btn-label-secondary:hover { background-color: #d5dae0; color: #2f3b4a !important; }
