/*
 * PropulseCRM — Design System 2026
 * Overrides chargés après style.css via assets_helper.php
 * Ne jamais supprimer ce fichier (chargé conditionnellement si présent)
 */

/* ============================================================
   1. DESIGN TOKENS (CSS Variables)
   ============================================================ */
:root {
  /* Couleurs primaires — bleu PropulseCRM modernisé */
  --pc-sidebar-bg:        #0f1f3d;
  --pc-sidebar-hover:     rgba(255,255,255,0.07);
  --pc-sidebar-active-bg: rgba(255,255,255,0.12);
  --pc-sidebar-border:    rgba(255,255,255,0.08);
  --pc-accent:            #f0ac04;
  --pc-accent-hover:      #d4960a;

  /* Neutrals */
  --pc-bg:                #f1f4f9;
  --pc-surface:           #ffffff;
  --pc-border:            #e4e9f0;
  --pc-border-light:      #eef1f6;
  --pc-text-primary:      #0f172a;
  --pc-text-secondary:    #475569;
  --pc-text-muted:        #94a3b8;

  /* Shadows */
  --pc-shadow-xs:  0 1px 2px 0 rgba(15,23,42,0.04);
  --pc-shadow-sm:  0 1px 3px 0 rgba(15,23,42,0.08), 0 1px 2px -1px rgba(15,23,42,0.06);
  --pc-shadow-md:  0 4px 12px -2px rgba(15,23,42,0.10), 0 2px 4px -2px rgba(15,23,42,0.06);
  --pc-shadow-lg:  0 8px 24px -4px rgba(15,23,42,0.12), 0 4px 8px -4px rgba(15,23,42,0.06);
  --pc-shadow-xl:  0 16px 48px -8px rgba(15,23,42,0.16), 0 8px 16px -8px rgba(15,23,42,0.08);

  /* Radius */
  --pc-radius-sm:   6px;
  --pc-radius-md:   10px;
  --pc-radius-lg:   14px;
  --pc-radius-xl:   20px;
  --pc-radius-full: 9999px;

  /* Typography */
  --pc-font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --pc-font-size:   13.5px;
  --pc-line-height: 1.6;

  /* Transitions */
  --pc-transition: 0.15s ease;
  --pc-transition-md: 0.2s ease;
}


/* ============================================================
   2. BASE / LAYOUT
   ============================================================ */
body {
  background: var(--pc-bg);
  font-family: var(--pc-font);
  font-size: var(--pc-font-size);
  line-height: var(--pc-line-height);
  color: var(--pc-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#wrapper {
  background: var(--pc-bg);
}

.content {
  padding: 24px 28px;
}

@media (max-width: 768px) {
  .content {
    padding: 16px;
  }
}


/* ============================================================
   3. TOPBAR / HEADER
   ============================================================ */
#header {
  background: var(--pc-surface);
  border-bottom: 1px solid var(--pc-border);
  box-shadow: var(--pc-shadow-xs);
  height: 58px;
}

/* Bouton burger */
button.hide-menu {
  color: var(--pc-text-secondary) !important;
  border-radius: var(--pc-radius-sm) !important;
  transition: background var(--pc-transition), color var(--pc-transition);
}
button.hide-menu:hover {
  background: var(--pc-border-light) !important;
  color: var(--pc-text-primary) !important;
}

/* Champ de recherche */
#search_input {
  background: var(--pc-bg) !important;
  border: 1px solid var(--pc-border) !important;
  border-radius: var(--pc-radius-sm) !important;
  color: var(--pc-text-primary) !important;
  transition: border-color var(--pc-transition), box-shadow var(--pc-transition);
  height: 36px !important;
}
#search_input:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12) !important;
  background: var(--pc-surface) !important;
}

/* Icônes navbar droite */
.navbar-nav > li > a {
  color: var(--pc-text-secondary);
  transition: color var(--pc-transition);
}
.navbar-nav > li > a:hover,
.navbar-nav > li > a:focus {
  color: var(--pc-text-primary);
  background: transparent;
}
.navbar-right {
  margin-right: 20px;
}

/* Dropdown quick actions */
.navbar-nav > li > .dropdown-menu {
  border-radius: var(--pc-radius-md);
  border: 1px solid var(--pc-border);
  box-shadow: var(--pc-shadow-lg);
  padding: 6px;
  margin-top: 4px;
}
.navbar-nav > li > .dropdown-menu > li > a {
  border-radius: var(--pc-radius-sm);
  padding: 7px 10px;
  transition: background var(--pc-transition), color var(--pc-transition);
  color: var(--pc-text-secondary);
}
.navbar-nav > li > .dropdown-menu > li > a:hover {
  background: var(--pc-bg);
  color: var(--pc-text-primary);
}


/* ============================================================
   4. SIDEBAR (light-mode base — dark overridé par theme_style)
   ============================================================ */
.sidebar {
  width: 230px !important;
  border-right: 1px solid var(--pc-border);
  background: var(--pc-surface);
  padding-left: 8px;
  padding-right: 8px;
}

/* Profil utilisateur */
.sidebar-user-profile > a {
  border-radius: var(--pc-radius-md) !important;
  transition: background var(--pc-transition), border-color var(--pc-transition);
}

/* Items du menu */
.sidebar ul.nav li a {
  border-radius: var(--pc-radius-sm) !important;
  border: none !important;
  padding: 7px 10px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: var(--pc-text-secondary) !important;
  transition: background var(--pc-transition), color var(--pc-transition);
  margin-top: 1px !important;
}

.sidebar ul.nav li a i.menu-icon {
  color: inherit;
  opacity: 0.7;
  font-size: 16px;
  transition: opacity var(--pc-transition);
}

/* Hover état */
.sidebar > ul.nav > li:hover > a:first-child,
.sidebar ul.nav > li > a:hover,
.sidebar ul.nav > li > a:focus {
  background: var(--pc-bg) !important;
  color: var(--pc-text-primary) !important;
  box-shadow: none !important;
  border: none !important;
}
.sidebar ul.nav > li > a:hover .menu-icon,
.sidebar ul.nav > li > a:focus .menu-icon {
  opacity: 1;
}

/* État actif */
.sidebar > ul.nav > li.active > a:first-child,
.sidebar ul.nav li.active > a {
  background: var(--pc-bg) !important;
  color: var(--pc-text-primary) !important;
  box-shadow: none !important;
  border: none !important;
  font-weight: 600 !important;
}
.sidebar ul.nav li.active > a .menu-icon {
  opacity: 1;
}

/* Sous-menus */
.sidebar ul.nav li .nav-second-level li a {
  padding: 5px 10px 5px 44px !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: var(--pc-text-secondary) !important;
  border-radius: var(--pc-radius-sm) !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}
.sidebar ul.nav li .nav-second-level li a:hover {
  background: var(--pc-bg) !important;
  color: var(--pc-text-primary) !important;
}
.sidebar ul.nav li .nav-second-level li.active a {
  color: var(--pc-text-primary) !important;
  font-weight: 600 !important;
}

/* Barre active côté gauche */
.sidebar > ul.nav > li {
  border-left: 2px solid transparent !important;
}
.sidebar > ul.nav > li.active {
  border-left-color: var(--pc-accent) !important;
}
[dir="rtl"] .sidebar > ul.nav > li {
  border-left: 0 !important;
  border-right: 2px solid transparent !important;
}
[dir="rtl"] .sidebar > ul.nav > li.active {
  border-right-color: var(--pc-accent) !important;
}

/* === Sidebar DARK MODE (couleur dynamique via theme_style) === */
/* Quand la sidebar est sombre, on réajuste les états hover/active */
.admin .sidebar[style*="background"] ul.nav li a,
.admin #side-menu li a {
  transition: background var(--pc-transition), color var(--pc-transition);
}


/* ============================================================
   5. PANELS / CARDS
   ============================================================ */
.panel,
.panel_s {
  border-radius: var(--pc-radius-lg) !important;
  border: 1px solid var(--pc-border) !important;
  box-shadow: var(--pc-shadow-sm) !important;
  background: var(--pc-surface) !important;
  overflow: hidden;
}

.panel-heading {
  border-radius: var(--pc-radius-lg) var(--pc-radius-lg) 0 0 !important;
  padding: 16px 20px !important;
  border-bottom: 1px solid var(--pc-border-light) !important;
  background: var(--pc-surface) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  color: var(--pc-text-primary) !important;
}

.panel-body {
  padding: 20px !important;
}

.panel-footer {
  border-top: 1px solid var(--pc-border-light) !important;
  background: var(--pc-bg) !important;
  padding: 12px 20px !important;
  border-radius: 0 0 var(--pc-radius-lg) var(--pc-radius-lg) !important;
}

/* Suppression des surcharges agressives sur panel_s dans modals */
.proposal-convert-modal .panel_s,
.invoice-project .panel_s,
.estimate-pipeline .panel_s,
.proposal-pipeline-modal .panel_s {
  border-radius: var(--pc-radius-md) !important;
}


/* ============================================================
   6. TABLES
   ============================================================ */
table.table {
  margin-top: 16px;
  border-collapse: separate;
  border-spacing: 0;
}

.table > thead > tr > th {
  background: var(--pc-bg);
  color: var(--pc-text-secondary);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--pc-border) !important;
  padding: 10px 14px !important;
  white-space: nowrap;
}

.table > tbody > tr > td {
  padding: 11px 14px !important;
  border-top: 1px solid var(--pc-border-light) !important;
  vertical-align: middle !important;
  color: var(--pc-text-primary);
  font-size: 13.5px;
}

.table > tbody > tr:first-child > td {
  border-top: 1px solid var(--pc-border) !important;
}

.table > tbody > tr:hover > td {
  background: #f8fafc;
}

/* DataTables */
.dataTables_wrapper {
  background: var(--pc-surface);
  border-radius: var(--pc-radius-lg);
  border: 1px solid var(--pc-border);
  box-shadow: var(--pc-shadow-sm);
  overflow: hidden;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  padding: 12px 16px;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  padding: 12px 16px;
  border-top: 1px solid var(--pc-border-light);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--pc-radius-sm) !important;
  border: 1px solid transparent !important;
  color: var(--pc-text-secondary) !important;
  transition: all var(--pc-transition);
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--pc-bg) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text-primary) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--pc-text-primary) !important;
  border-color: var(--pc-text-primary) !important;
  color: #fff !important;
}


/* ============================================================
   7. BUTTONS
   ============================================================ */
.btn {
  border-radius: var(--pc-radius-sm) !important;
  font-weight: 500 !important;
  font-size: 13.5px !important;
  padding: 7px 14px !important;
  transition: all var(--pc-transition) !important;
  letter-spacing: 0.01em;
  line-height: 1.5 !important;
}

.btn-default {
  background: var(--pc-surface) !important;
  border: 1px solid var(--pc-border) !important;
  color: var(--pc-text-secondary) !important;
  box-shadow: var(--pc-shadow-xs) !important;
}
.btn-default:hover,
.btn-default:focus {
  background: var(--pc-bg) !important;
  border-color: #cbd5e1 !important;
  color: var(--pc-text-primary) !important;
  box-shadow: var(--pc-shadow-sm) !important;
}

.btn-primary {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  color: #fff !important;
  box-shadow: 0 1px 3px rgba(29,78,216,0.3) !important;
}
.btn-primary:hover,
.btn-primary:focus {
  background: #1e40af !important;
  border-color: #1e40af !important;
  box-shadow: 0 2px 6px rgba(29,78,216,0.4) !important;
}

.btn-success {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #fff !important;
  box-shadow: 0 1px 3px rgba(22,163,74,0.3) !important;
}
.btn-success:hover {
  background: #15803d !important;
  border-color: #15803d !important;
}

.btn-danger {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #fff !important;
  box-shadow: 0 1px 3px rgba(220,38,38,0.3) !important;
}
.btn-danger:hover {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
}

.btn-warning {
  background: #d97706 !important;
  border-color: #d97706 !important;
  color: #fff !important;
}
.btn-warning:hover {
  background: #b45309 !important;
  border-color: #b45309 !important;
}

.btn-info {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #fff !important;
}
.btn-info:hover {
  background: #0369a1 !important;
  border-color: #0369a1 !important;
}

.btn-sm {
  padding: 5px 10px !important;
  font-size: 12.5px !important;
}
.btn-lg {
  padding: 10px 20px !important;
  font-size: 15px !important;
}
.btn-xs {
  padding: 3px 7px !important;
  font-size: 11.5px !important;
  border-radius: 5px !important;
}

.btn-icon {
  padding: 6px 10px !important;
}


/* ============================================================
   8. FORMULAIRES / INPUTS
   ============================================================ */
.form-control {
  border: 1px solid var(--pc-border) !important;
  border-radius: var(--pc-radius-sm) !important;
  background: var(--pc-surface) !important;
  color: var(--pc-text-primary) !important;
  box-shadow: var(--pc-shadow-xs) !important;
  transition: border-color var(--pc-transition), box-shadow var(--pc-transition) !important;
  height: 36px;
  font-size: 13.5px;
  padding: 6px 12px;
}
.form-control:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12), var(--pc-shadow-xs) !important;
  outline: none !important;
}
.form-control::placeholder {
  color: var(--pc-text-muted);
}

textarea.form-control {
  height: auto;
  min-height: 80px;
  resize: vertical;
}

.input-group-addon {
  border-color: var(--pc-border) !important;
  background: var(--pc-bg) !important;
  color: var(--pc-text-secondary) !important;
  border-radius: var(--pc-radius-sm) !important;
}

/* Select picker */
.bootstrap-select > .dropdown-toggle.btn-default {
  background: var(--pc-surface) !important;
  border: 1px solid var(--pc-border) !important;
  border-radius: var(--pc-radius-sm) !important;
  color: var(--pc-text-primary) !important;
  box-shadow: var(--pc-shadow-xs) !important;
  height: 36px;
  padding: 6px 12px;
}
.bootstrap-select > .dropdown-toggle.btn-default:hover {
  border-color: #94a3b8 !important;
}

/* Labels */
label {
  font-weight: 500 !important;
  color: var(--pc-text-primary) !important;
  font-size: 13px !important;
  margin-bottom: 4px !important;
}

/* Form groups */
.form-group {
  margin-bottom: 18px;
}

/* Checkbox/radio modernisés */
.checkbox label,
.radio label {
  font-weight: 400 !important;
  color: var(--pc-text-secondary) !important;
}


/* ============================================================
   9. BADGES ET LABELS
   ============================================================ */
.badge {
  border-radius: var(--pc-radius-full) !important;
  font-weight: 500 !important;
  font-size: 11px !important;
  padding: 3px 8px !important;
  letter-spacing: 0.02em;
}

.label {
  border-radius: var(--pc-radius-sm) !important;
  font-weight: 500 !important;
  font-size: 11.5px !important;
  padding: 3px 8px !important;
}

/* Status labels spécifiques PerfexCRM */
.label-success, .badge-success { background-color: #16a34a !important; }
.label-warning, .badge-warning { background-color: #d97706 !important; }
.label-danger,  .badge-danger  { background-color: #dc2626 !important; }
.label-info,    .badge-info    { background-color: #0284c7 !important; }
.label-default, .badge-default { background-color: #64748b !important; color: #fff !important; }
.label-primary, .badge-primary { background-color: #1d4ed8 !important; }

/* Tags pills */
.tw-inline-flex.tw-items-center {
  gap: 4px;
}


/* ============================================================
   10. DROPDOWNS
   ============================================================ */
.dropdown-menu {
  border-radius: var(--pc-radius-md) !important;
  border: 1px solid var(--pc-border) !important;
  box-shadow: var(--pc-shadow-lg) !important;
  padding: 6px !important;
  background: var(--pc-surface) !important;
  min-width: 180px;
}

.dropdown-menu > li > a {
  border-radius: var(--pc-radius-sm) !important;
  padding: 7px 12px !important;
  color: var(--pc-text-secondary) !important;
  font-size: 13.5px !important;
  transition: background var(--pc-transition), color var(--pc-transition) !important;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
  background: var(--pc-bg) !important;
  color: var(--pc-text-primary) !important;
}
.dropdown-menu > li.active > a,
.dropdown-menu > li.active > a:hover {
  background: #1d4ed8 !important;
  color: #fff !important;
}

.dropdown-menu > li.divider,
.dropdown-menu .divider {
  background: var(--pc-border-light) !important;
  margin: 4px 0 !important;
  height: 1px !important;
  border: none !important;
}

.dropdown-header {
  color: var(--pc-text-muted) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  padding: 4px 10px 6px !important;
}


/* ============================================================
   11. MODALS
   ============================================================ */
.modal-content {
  border-radius: var(--pc-radius-lg) !important;
  border: 1px solid var(--pc-border) !important;
  box-shadow: var(--pc-shadow-xl) !important;
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid var(--pc-border-light) !important;
  padding: 18px 24px !important;
  background: var(--pc-surface) !important;
}
.modal-header .modal-title {
  font-weight: 600 !important;
  font-size: 15px !important;
  color: var(--pc-text-primary) !important;
}
.modal-header .close {
  opacity: 0.5;
  transition: opacity var(--pc-transition);
  font-size: 20px;
  margin-top: -2px;
}
.modal-header .close:hover {
  opacity: 1;
}

.modal-body {
  padding: 24px !important;
}

.modal-footer {
  border-top: 1px solid var(--pc-border-light) !important;
  padding: 14px 24px !important;
  background: var(--pc-bg) !important;
  border-radius: 0 0 var(--pc-radius-lg) var(--pc-radius-lg) !important;
}

.modal-backdrop {
  background: rgba(15,23,42,0.5) !important;
}
.modal-backdrop.in {
  opacity: 1 !important;
}


/* ============================================================
   12. NAVIGATION TABS
   ============================================================ */
.nav-tabs {
  border-bottom: 1px solid var(--pc-border) !important;
  gap: 2px;
}

.nav-tabs > li > a {
  border-radius: var(--pc-radius-sm) var(--pc-radius-sm) 0 0 !important;
  border: 1px solid transparent !important;
  color: var(--pc-text-secondary) !important;
  font-weight: 500 !important;
  padding: 8px 16px !important;
  font-size: 13.5px !important;
  transition: color var(--pc-transition), background var(--pc-transition), border-color var(--pc-transition) !important;
  margin-bottom: -1px !important;
}
.nav-tabs > li > a:hover {
  color: var(--pc-text-primary) !important;
  background: var(--pc-bg) !important;
  border-color: var(--pc-border) var(--pc-border) transparent !important;
}
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  color: var(--pc-text-primary) !important;
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) var(--pc-border) var(--pc-surface) !important;
  font-weight: 600 !important;
}

/* Status tabs (devis, factures...) */
.nav-tabs.status-tabs {
  background: var(--pc-bg);
  border-radius: var(--pc-radius-md) var(--pc-radius-md) 0 0;
  padding: 6px 6px 0;
  border-bottom: none !important;
}


/* ============================================================
   13. ALERTS
   ============================================================ */
.alert {
  border-radius: var(--pc-radius-md) !important;
  border: none !important;
  padding: 14px 18px !important;
  font-size: 13.5px !important;
  font-weight: 400 !important;
}
.alert-success {
  background: #f0fdf4 !important;
  border-left: 4px solid #16a34a !important;
  color: #15803d !important;
}
.alert-danger,
.alert-error {
  background: #fef2f2 !important;
  border-left: 4px solid #dc2626 !important;
  color: #b91c1c !important;
}
.alert-warning {
  background: #fffbeb !important;
  border-left: 4px solid #d97706 !important;
  color: #92400e !important;
}
.alert-info {
  background: #eff6ff !important;
  border-left: 4px solid #0284c7 !important;
  color: #075985 !important;
}
.alert .close {
  opacity: 0.5;
  transition: opacity var(--pc-transition);
}
.alert .close:hover {
  opacity: 1;
}


/* ============================================================
   14. PAGE TITLES / BREADCRUMBS
   ============================================================ */
.page-header {
  border-bottom: 1px solid var(--pc-border-light) !important;
  margin: 0 0 24px !important;
  padding-bottom: 16px !important;
}

h3.page-title,
.page-title {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--pc-text-primary) !important;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.breadcrumb {
  background: transparent !important;
  padding: 0 !important;
  margin-bottom: 4px !important;
  font-size: 12.5px !important;
}
.breadcrumb > li {
  color: var(--pc-text-muted) !important;
}
.breadcrumb > li + li::before {
  color: var(--pc-text-muted) !important;
}
.breadcrumb > li > a {
  color: var(--pc-text-secondary) !important;
  transition: color var(--pc-transition);
}
.breadcrumb > li > a:hover {
  color: var(--pc-text-primary) !important;
}
.breadcrumb > .active {
  color: var(--pc-text-primary) !important;
  font-weight: 500 !important;
}


/* ============================================================
   15. STATS CARDS / DASHBOARD WIDGETS
   ============================================================ */
.tw-rounded-lg,
[class*="tw-rounded-lg"] {
  border-radius: var(--pc-radius-lg) !important;
}

/* KPI cards du dashboard */
.dashboard-kpi-card,
.widget-stat-card {
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius-lg);
  box-shadow: var(--pc-shadow-sm);
  padding: 20px;
  transition: box-shadow var(--pc-transition-md), transform var(--pc-transition-md);
}
.dashboard-kpi-card:hover {
  box-shadow: var(--pc-shadow-md);
  transform: translateY(-1px);
}

/* Aperçu sections du dashboard */
.panel.panel-default {
  border-radius: var(--pc-radius-lg) !important;
  border: 1px solid var(--pc-border) !important;
  box-shadow: var(--pc-shadow-sm) !important;
  transition: box-shadow var(--pc-transition-md);
}
.panel.panel-default:hover {
  box-shadow: var(--pc-shadow-md) !important;
}


/* ============================================================
   16. KANBAN
   ============================================================ */
.kan-ban-col-wrapper {
  gap: 12px;
}

.kan-ban-col-wrapper .panel_s {
  border-radius: var(--pc-radius-md) !important;
  border: 1px solid var(--pc-border) !important;
  box-shadow: var(--pc-shadow-sm) !important;
  transition: box-shadow var(--pc-transition-md), transform var(--pc-transition-md);
}
.kan-ban-col-wrapper .panel_s:hover {
  box-shadow: var(--pc-shadow-md) !important;
  transform: translateY(-1px);
}


/* ============================================================
   17. POPOVER / TOOLTIP
   ============================================================ */
.popover {
  border-radius: var(--pc-radius-md) !important;
  border: 1px solid var(--pc-border) !important;
  box-shadow: var(--pc-shadow-lg) !important;
  font-size: 13px !important;
}
.popover-title {
  border-radius: var(--pc-radius-md) var(--pc-radius-md) 0 0 !important;
  background: var(--pc-bg) !important;
  border-bottom: 1px solid var(--pc-border-light) !important;
  font-weight: 600 !important;
  padding: 10px 14px !important;
}
.popover-content {
  padding: 12px 14px !important;
}

.tooltip-inner {
  background: var(--pc-text-primary) !important;
  border-radius: var(--pc-radius-sm) !important;
  font-size: 12px !important;
  padding: 5px 10px !important;
  max-width: 250px;
}
.tooltip.top .tooltip-arrow { border-top-color: var(--pc-text-primary) !important; }
.tooltip.bottom .tooltip-arrow { border-bottom-color: var(--pc-text-primary) !important; }
.tooltip.left .tooltip-arrow { border-left-color: var(--pc-text-primary) !important; }
.tooltip.right .tooltip-arrow { border-right-color: var(--pc-text-primary) !important; }


/* ============================================================
   18. NOTIFICATIONS / BADGES TOPBAR
   ============================================================ */
.dropdown-menu.notifications {
  min-width: 360px !important;
  border-radius: var(--pc-radius-lg) !important;
  overflow: hidden;
}

.notification-box {
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--pc-border-light) !important;
  transition: background var(--pc-transition);
}
.notification-box:hover {
  background: var(--pc-bg) !important;
}
.notification-box:last-child {
  border-bottom: none !important;
}


/* ============================================================
   19. PARAMÈTRES SIDEBAR (Setup Menu)
   ============================================================ */
#setup-menu-wrapper {
  border-right: 1px solid var(--pc-border);
}

#setup-menu > li:first-child {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: var(--pc-text-primary) !important;
  border-bottom: 1px solid var(--pc-border-light) !important;
  padding: 12px 10px !important;
  margin-bottom: 6px !important;
}

#setup-menu li a {
  border-radius: var(--pc-radius-sm) !important;
  padding: 6px 13px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: var(--pc-text-secondary) !important;
  transition: background var(--pc-transition), color var(--pc-transition) !important;
}
#setup-menu li a:hover {
  background: var(--pc-bg) !important;
  color: var(--pc-text-primary) !important;
}
#setup-menu li.active > a,
#setup-menu li.active > a:hover {
  color: var(--pc-text-primary) !important;
  font-weight: 600 !important;
}


/* ============================================================
   20. SEARCH RESULTS
   ============================================================ */
#search_results {
  border-radius: var(--pc-radius-md) !important;
  border: 1px solid var(--pc-border) !important;
  box-shadow: var(--pc-shadow-lg) !important;
  overflow: hidden;
  margin-top: 4px;
}

.search-results li a {
  padding: 9px 14px !important;
  border-bottom: 1px solid var(--pc-border-light) !important;
  transition: background var(--pc-transition);
  font-size: 13.5px !important;
  color: var(--pc-text-primary) !important;
}
.search-results li a:hover {
  background: var(--pc-bg) !important;
}


/* ============================================================
   21. MISC / UTILITAIRES
   ============================================================ */

/* Séparateurs */
hr {
  border-color: var(--pc-border-light) !important;
  margin: 20px 0 !important;
}

/* Scrollbars modernes (Chrome/Edge/Safari) */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Loader/Spinner */
.spinner,
.loader {
  border-radius: 50%;
}

/* Well */
.well {
  background: var(--pc-bg) !important;
  border: 1px solid var(--pc-border) !important;
  border-radius: var(--pc-radius-md) !important;
  box-shadow: none !important;
  padding: 16px !important;
}

/* Code blocks */
code {
  background: var(--pc-bg) !important;
  border: 1px solid var(--pc-border-light) !important;
  border-radius: 4px !important;
  padding: 2px 6px !important;
  font-size: 12.5px !important;
  color: #be185d !important;
}
pre {
  background: var(--pc-bg) !important;
  border: 1px solid var(--pc-border) !important;
  border-radius: var(--pc-radius-md) !important;
  padding: 16px !important;
}

/* List groups */
.list-group-item {
  border-color: var(--pc-border-light) !important;
  transition: background var(--pc-transition);
}
.list-group-item:first-child { border-radius: var(--pc-radius-sm) var(--pc-radius-sm) 0 0 !important; }
.list-group-item:last-child  { border-radius: 0 0 var(--pc-radius-sm) var(--pc-radius-sm) !important; }
a.list-group-item:hover { background: var(--pc-bg) !important; }

/* Note / reminder box */
.note {
  background: #fffbeb !important;
  border: 1px solid #fde68a !important;
  border-radius: var(--pc-radius-sm) !important;
  color: #78350f !important;
}

/* Annonces */
.announcement .alert {
  margin-bottom: 0 !important;
}

/* Focus ring global */
*:focus-visible {
  outline: 2px solid #3b82f6 !important;
  outline-offset: 2px !important;
}

/* Row options dans les tables */
table .row-options a {
  border-radius: 4px;
  padding: 2px 5px;
  transition: background var(--pc-transition), color var(--pc-transition);
}
table tbody tr:hover .row-options a:hover {
  background: var(--pc-bg);
  color: var(--pc-text-primary) !important;
}

/* Pagination */
.pagination > li > a,
.pagination > li > span {
  border-color: var(--pc-border) !important;
  color: var(--pc-text-secondary) !important;
  transition: all var(--pc-transition);
}
.pagination > li > a:hover {
  background: var(--pc-bg) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text-primary) !important;
}
.pagination > .active > a,
.pagination > .active > a:hover {
  background: var(--pc-text-primary) !important;
  border-color: var(--pc-text-primary) !important;
  color: #fff !important;
}
.pagination > li:first-child > a { border-radius: var(--pc-radius-sm) 0 0 var(--pc-radius-sm) !important; }
.pagination > li:last-child > a  { border-radius: 0 var(--pc-radius-sm) var(--pc-radius-sm) 0 !important; }


/* ============================================================
   22. RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .panel,
  .panel_s {
    border-radius: var(--pc-radius-md) !important;
  }

  .modal-content {
    border-radius: var(--pc-radius-md) !important;
    margin: 10px !important;
  }

  .btn {
    font-size: 13px !important;
  }
}


/* ============================================================
   23. DARK/LIGHT SIDEBAR — Ajustements fin pour sidebar sombre
   ============================================================ */

/*
 * Quand le fond de la sidebar est sombre (injecté dynamiquement
 * par theme_style via style inline), les hovers/actifs héritent
 * du background du thème — on s'assure juste que les bords et
 * le profil s'adaptent visuellement.
 */
.admin .sidebar .dropdown-menu {
  background: var(--pc-surface) !important;
  border: 1px solid var(--pc-border) !important;
  box-shadow: var(--pc-shadow-lg) !important;
}


/* ============================================================
   24. DASHBOARD WIDGETS SPECIFIQUES
   ============================================================ */

/* Widget dragger */
.widget-dragger {
  opacity: 0;
  transition: opacity var(--pc-transition);
}
.widget:hover .widget-dragger {
  opacity: 1;
}

/* top_stats_wrapper — barre de KPI stats en haut du dashboard */
.top_stats_wrapper {
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius-lg);
  padding: 18px 20px;
  box-shadow: var(--pc-shadow-sm);
  height: 100%;
  transition: box-shadow var(--pc-transition-md), transform var(--pc-transition-md);
}
.top_stats_wrapper:hover {
  box-shadow: var(--pc-shadow-md);
  transform: translateY(-1px);
}

/* Finance overview panel */
.finance-summary .panel_s {
  background: var(--pc-surface) !important;
}
.home-summary .text-stats-wrapper {
  margin-bottom: 6px;
}
.home-summary .text-stats-wrapper a {
  font-size: 13.5px;
  transition: color var(--pc-transition);
}
.home-summary .text-stats-wrapper a ._total {
  font-size: 16px;
  font-weight: 700;
  color: var(--pc-text-primary);
  margin-right: 6px;
}

/* Progress bars */
.progress {
  border-radius: var(--pc-radius-full) !important;
  background: var(--pc-bg) !important;
  height: 6px !important;
  overflow: hidden;
  box-shadow: none !important;
}
.progress-bar-mini {
  height: 5px !important;
}
.progress-bar {
  border-radius: var(--pc-radius-full) !important;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.progress-bar-danger  { background-color: #ef4444 !important; }
.progress-bar-success { background-color: #22c55e !important; }
.progress-bar-warning { background-color: #f59e0b !important; }
.progress-bar-info    { background-color: #38bdf8 !important; }
.progress-bar-default { background-color: #6366f1 !important; }

/* Finance stats text */
.progress-finance-status {
  font-size: 12px !important;
  color: var(--pc-text-muted) !important;
  margin-bottom: 8px;
}

/* Screen options button */
.screen-options-btn {
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius-sm);
  box-shadow: var(--pc-shadow-xs);
  color: var(--pc-text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  transition: all var(--pc-transition);
}
.screen-options-btn:hover {
  background: var(--pc-bg);
  color: var(--pc-text-primary);
  box-shadow: var(--pc-shadow-sm);
}


/* ============================================================
   25. ANIMATIONS D'ENTRÉE
   ============================================================ */
.panel,
.panel_s,
.dataTables_wrapper {
  animation: pc-fade-in 0.18s ease-out;
}

@keyframes pc-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
