/* ============================================================
   base.css — styles spécifiques au shell de base :
   toggle client, tabs modals, cl-* (form client global)
   ============================================================ */

/* ── Modal client tabs ──────────────────────────────────────── */
.cl-tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  margin-bottom: 18px;
}

.cl-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  color: var(--txt-muted, #64748b);
  border-radius: var(--radius-sm, 6px) var(--radius-sm, 6px) 0 0;
  transition: color .12s, background .12s, border-color .12s;
  white-space: nowrap;
  font-family: var(--font, system-ui);
}
.cl-tab:hover  { color: var(--txt-2, #334155); background: var(--surface-alt, #f8fafc); }
.cl-tab.active { color: var(--primary, #2563eb); border-bottom-color: var(--primary, #2563eb); }

.cl-tabcontent         { display: none; }
.cl-tabcontent.active  { display: grid; }
.cl-tabcontent.active.flex-col { display: flex; flex-direction: column; }

/* ── Toggle switch (professionnel) ──────────────────────────── */
.cl-toggle-track {
  position: relative;
  width: 40px;
  height: 22px;
  display: inline-block;
  flex-shrink: 0;
}
.cl-toggle-track input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.cl-toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 11px;
  cursor: pointer;
  transition: background .2s;
}
.cl-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.cl-toggle-track input:checked + .cl-toggle-slider { background: var(--primary, #2563eb); }
.cl-toggle-track input:checked + .cl-toggle-slider::before { transform: translateX(18px); }

/* ── Customer modal section heading ─────────────────────────── */
.cl-section-heading {
  font-size: 12px;
  font-weight: 700;
  color: var(--txt-2, #334155);
  border-bottom: 1px solid var(--border-light, #f1f5f9);
  padding-bottom: 8px;
  margin-bottom: 14px;
}

/* ── Error inline ────────────────────────────────────────────── */
.inline-error {
  color: var(--danger, #dc2626);
  font-size: 12px;
  font-weight: 600;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm, 6px);
  padding: 8px 12px;
  display: none;
}
.inline-error:not(:empty) { display: block; }

/* ── Mia drawer & bouton masqués ─────────────── */
.btn-mia,
#miaDrawer,
.mia-drawer,
.mia-backdrop,
.mia-fab {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ── Menu Utilisateur (Header Dropdown) ───────────────────────── */
.user-menu-wrapper {
  position: relative;
  display: inline-block;
}

.user-avatar {
  overflow: hidden;
  position: relative;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 270px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: dropdownFadeIn 0.18s ease-out;
}

.user-dropdown.is-open {
  display: flex;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-dropdown-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  overflow: hidden;
  flex-shrink: 0;
}

.user-dropdown-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-dropdown-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-dropdown-info strong {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-info span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.user-dropdown-menu {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  color: var(--txt-2, #334155);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.user-dropdown-item i {
  font-size: 16px;
  color: var(--txt-muted, #64748b);
  transition: color 0.15s;
}

.user-dropdown-item:hover {
  background: var(--surface-alt, #f8fafc);
  color: var(--primary, #2563eb);
}

.user-dropdown-item:hover i {
  color: var(--primary, #2563eb);
}

.user-dropdown-footer {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border-light, #f1f5f9);
}

.btn-user-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-user-logout:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

/* ── Partner Autocomplete & Enrichment (Cliniques, Cabinets, Groupes, Sociétés) ── */
.company-autocomplete-wrapper {
  margin-bottom: 6px;
}

.company-autocomplete-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface-alt, #f8fafc);
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-light, #e2e8f0);
}

.company-logo-box {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 12px;
  background: #ffffff;
  border: 1.5px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: relative;
}

.company-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  background: #ffffff;
}

.company-logo-box i.bi-building {
  font-size: 26px;
  color: #94a3b8;
}

.company-logo-spinner {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary, #2563eb);
  font-size: 20px;
}

.company-input-group {
  flex: 1;
  min-width: 0;
  position: relative;
}

.company-auto-badge {
  font-size: 11px;
  font-weight: 600;
  color: #6366f1;
  background: #eef2ff;
  border: 1px solid #e0e7ff;
  padding: 2px 8px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.company-auto-badge:hover {
  background: #e0e7ff;
  color: #4338ca;
}

.company-input-relative {
  position: relative;
  display: flex;
  align-items: center;
}

.company-input-relative input {
  padding-right: 90px !important;
  font-size: 14px;
  font-weight: 600;
}

.company-enrich-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.company-enrich-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.company-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 290px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.12), 0 6px 12px -4px rgba(0, 0, 0, 0.08);
  z-index: 1050;
  padding: 6px;
}

.company-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 4px;
}

.company-dropdown-tag {
  font-size: 9.5px;
  font-weight: 700;
  color: #7c3aed;
  background: #f5f3ff;
  padding: 1px 6px;
  border-radius: 4px;
}

.company-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.company-autocomplete-item:hover,
.company-autocomplete-item.active {
  background: #f1f5f9;
}

.company-autocomplete-logo-wrap {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.company-autocomplete-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 2px;
}

.company-autocomplete-fallback {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #e0e7ff;
  color: #4338ca;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.company-autocomplete-meta {
  flex: 1;
  min-width: 0;
}

.company-autocomplete-name {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-autocomplete-sub {
  font-size: 11.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.company-autocomplete-pill {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 3px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.company-autocomplete-item:hover .company-autocomplete-pill {
  opacity: 1;
}

.company-enrich-banner {
  margin-top: 8px;
  padding: 8px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 12px;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeInDown 0.3s ease;
}

.company-enrich-banner i {
  color: #16a34a;
  font-size: 15px;
}

.company-enrich-banner span {
  flex: 1;
}

.company-enrich-banner .banner-close-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  color: #166534;
  cursor: pointer;
  padding: 0 4px;
}

.autofill-highlight {
  animation: highlightInput 1.6s ease;
}

@keyframes highlightInput {
  0% { background-color: #dcfce7; border-color: #22c55e; }
  60% { background-color: #f0fdf4; border-color: #86efac; }
  100% { background-color: inherit; border-color: inherit; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* ── Contacts Tab in Client Modal (Modern Card Design) ────── */
.cl-contacts-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 6px;
}

.cl-contacts-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cl-contacts-banner-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #eff6ff;
  color: var(--primary, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.cl-contacts-banner-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--txt, #0f172a);
}

.cl-contacts-banner-sub {
  font-size: 12px;
  color: var(--txt-muted, #64748b);
  margin-top: 1px;
}

.cl-contacts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 4px;
}

.cl-contacts-list::-webkit-scrollbar {
  width: 6px;
}
.cl-contacts-list::-webkit-scrollbar-track {
  background: transparent;
}
.cl-contacts-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
}

.contact-card {
  background: #ffffff;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
  position: relative;
}

.contact-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.contact-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
}

.contact-card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

.contact-card-headline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-card-headline strong {
  font-size: 13.5px;
  color: var(--txt, #0f172a);
}

.contact-card-role-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  background: #f1f5f9;
  color: var(--txt-2, #334155);
}

.contact-card-delete-btn {
  appearance: none;
  border: none;
  background: #fef2f2;
  color: #ef4444;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
}

.contact-card-delete-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  transform: scale(1.05);
}

.contact-card-grid {
  display: grid;
  grid-template-columns: 110px 1fr 1fr 1.2fr;
  gap: 12px;
}

.contact-card-grid-row2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrap i {
  position: absolute;
  left: 10px;
  color: var(--txt-muted, #94a3b8);
  font-size: 13px;
  pointer-events: none;
}

.input-icon-wrap .form-input {
  padding-left: 32px;
}

.cl-contacts-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 20px;
  background: var(--surface-alt, #f8fafc);
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
}

.cl-contacts-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 10px;
}

.cl-contacts-empty strong {
  font-size: 13.5px;
  color: var(--txt, #0f172a);
}

.cl-contacts-empty span {
  font-size: 12px;
  color: var(--txt-muted, #64748b);
  margin-top: 2px;
  max-width: 320px;
}

@media (max-width: 768px) {
  .contact-card-grid {
    grid-template-columns: 1fr 1fr;
  }
  .contact-card-grid-row2 {
    grid-template-columns: 1fr;
  }
}



/* ============================================================
   GESTIVA · Shell Flottant en Capsules (Inspiré de image.png)
   Respectant strictement la palette de couleurs Gestiva :
   - Primaire : #2563eb / #1d4ed8 (Bleu Gestiva)
   - Secondaire : #0b1426 / #0f172a (Bleu nuit Gestiva)
   - Surfaces : #f1f5f9 (Fond) & #ffffff (Capsules flottantes)
   - Sidebar : Capsules verticales flottantes avec les PARTIES
   - Topbar : Capsule centrale avec les SOUS-PARTIES de la partie
              sélectionnée + Capsule Actions + Capsule Profil
   ============================================================ */

:root {
  --sidebar-rail-w: 88px;
}

body {
  background: var(--bg, #f1f5f9) !important;
  color: var(--txt, #0f172a);
}

/* ── Sidebar Gauche : Îlots Verticaux Flottants (Les PARTIES) ── */
.side.side-rail {
  width: var(--sidebar-rail-w) !important;
  background: transparent !important;
  border-right: none !important;
  position: fixed !important;
  top: 78px !important;
  left: 0 !important;
  height: calc(100vh - 94px) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  padding: 0 0 10px 14px !important;
  z-index: 100 !important;
  box-shadow: none !important;
  pointer-events: none;
}

.side-pill-island {
  pointer-events: auto;
  background: var(--surface, #ffffff) !important;
  border: 1px solid var(--border, #e2e8f0) !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(37, 99, 235, 0.04) !important;
}

.main-wrapper {
  margin-left: 0 !important;
  width: 100% !important;
  min-height: 100vh !important;
  background: var(--bg, #f1f5f9) !important;
  transition: none !important;
}

.main-content {
  margin-left: var(--sidebar-rail-w) !important;
  padding: 18px 26px 28px 18px !important;
}

/* ── Navigation des Parties (Capsule Principale d'Icônes) ─── */
.side-nav-rail {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
  max-height: calc(100vh - 230px) !important;
  overflow-y: auto !important;
  overflow-x: visible !important;
  scrollbar-width: none !important;
  padding: 6px 6px !important;
  width: 54px !important;
  flex: 0 1 auto !important;
  margin-bottom: auto !important;
}
.side-nav-rail::-webkit-scrollbar { display: none; }

.side-rail-btn {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  font-size: 17px !important;
  color: #64748b !important;
  text-decoration: none !important;
  position: relative !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 auto !important;
}

.side-rail-btn i,
.side-rail-btn i.bi,
.side nav .side-rail-btn i.bi,
.app-container.sidebar-collapsed .side nav .side-rail-btn i.bi {
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  height: auto !important;
  font-size: 17px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  opacity: 1 !important;
}

.side-rail-btn[style*="display: none"],
.side-rail-btn[style*="display:none"] {
  display: none !important;
}

@media (max-height: 860px) {
  .side-nav-rail {
    gap: 3px !important;
    padding: 5px !important;
    max-height: calc(100vh - 210px) !important;
  }
  .side-rail-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    font-size: 15.5px !important;
  }
  .side-rail-btn i,
  .side-rail-btn i.bi,
  .side nav .side-rail-btn i.bi,
  .app-container.sidebar-collapsed .side nav .side-rail-btn i.bi {
    font-size: 15.5px !important;
  }
}

.side-rail-btn::before {
  display: none !important;
}

.side-rail-btn:hover {
  background: var(--primary-light, #eff6ff) !important;
  color: var(--primary, #2563eb) !important;
  transform: translateY(-1px) scale(1.05);
}

.side-rail-btn:hover i {
  color: var(--primary, #2563eb) !important;
  opacity: 1 !important;
}

/* Cercle actif de la PARTIE SÉLECTIONNÉE aux couleurs de l'app Gestiva */
.side-rail-btn.active {
  background: linear-gradient(135deg, var(--primary, #2563eb), var(--primary-hover, #1d4ed8)) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35) !important;
  transform: scale(1.04);
}

.side-rail-btn.active i {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* Tooltip au survol des icônes de la sidebar */
.side-rail-tooltip {
  position: fixed;
  left: 84px;
  background: var(--sidebar-bg, #0b1426);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 6px 18px rgba(11, 20, 38, 0.22);
  z-index: 2500;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.side-rail-btn:hover .side-rail-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* ── Capsule Bas de Sidebar : Réglages & Déconnexion ──────── */
.side-footer-rail {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 6px !important;
  width: 54px !important;
  flex-shrink: 0 !important;
  margin-top: 8px !important;
}

.side-rail-btn.logout-red {
  color: var(--danger, #ef4444) !important;
}

.side-rail-btn.logout-red:hover {
  background: var(--danger-light, #fef2f2) !important;
  color: var(--danger-hover, #dc2626) !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.18);
}

.side-rail-btn.logout-red:hover i {
  color: var(--danger-hover, #dc2626) !important;
}

.side-rail-btn.logout-red .side-rail-tooltip {
  background: var(--danger-hover, #dc2626);
  border-color: #fca5a5;
}

/* ── TOP BAR FLOTTANTE EN CAPSULES (Comme sur image.png) ──── */
.top-bar {
  background: rgba(241, 245, 249, 0.88) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border-bottom: none !important;
  height: 74px !important;
  padding: 12px 24px 8px 14px !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 95 !important;
}

.top-bar-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Capsule Marque / Logo en haut à gauche (comme Vertix sur image.png) */
.top-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  padding: 5px 14px 5px 6px;
  border-radius: 999px;
  text-decoration: none !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  transition: all 0.18s ease;
}

.top-brand-pill:hover {
  border-color: var(--primary-border, #bfdbfe);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.1);
}

.top-brand-logo-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary, #2563eb), var(--primary-hover, #1d4ed8));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28);
}

.brand-icon-rail {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.top-brand-text {
  display: flex;
  align-items: center;
  gap: 7px;
}

.brand-name-main {
  font-size: 15px;
  font-weight: 800;
  color: var(--secondary, #0f172a);
  letter-spacing: -0.3px;
}

.brand-sec-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary, #2563eb);
  background: var(--primary-light, #eff6ff);
  border: 1px solid var(--primary-border, #bfdbfe);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ── Capsule Centrale Flottante des SOUS-PARTIES (image.png) ── */
.top-nav-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface, #ffffff);
  padding: 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
  max-width: 100%;
  flex: 0 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.top-nav-pills::-webkit-scrollbar { display: none; }

.top-nav-pill {
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.top-nav-pill-icon {
  font-size: 13px;
  opacity: 0.75;
}

.top-nav-pill:hover {
  color: var(--primary, #2563eb);
  background: var(--primary-light, #eff6ff);
}

.top-nav-pill:hover .top-nav-pill-icon {
  opacity: 1;
  color: var(--primary, #2563eb);
}

/* SOUS-PARTIE ACTIVE : Capsule pleine aux couleurs de l'app Gestiva */
.top-nav-pill.active {
  background: linear-gradient(135deg, var(--primary, #2563eb), var(--primary-hover, #1d4ed8)) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
  font-weight: 700;
}

.top-nav-pill.active .top-nav-pill-icon {
  color: #ffffff !important;
  opacity: 1;
}

/* ── Zone Droite : Capsule Actions + Capsule Utilisateur ──── */
.top-right {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-shrink: 0;
}

.top-actions-island {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 999px;
  padding: 4px 6px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.top-search input {
  border-radius: 999px !important;
  background: var(--surface-alt, #f8fafc) !important;
  border: 1px solid transparent !important;
  height: 34px !important;
  width: 170px !important;
  font-size: 12px !important;
  padding: 4px 12px 4px 30px !important;
  color: var(--txt, #0f172a) !important;
}

.top-search input:focus {
  background: var(--surface, #ffffff) !important;
  border-color: var(--primary-border, #bfdbfe) !important;
  width: 220px !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.top-icon-btn {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  border: none !important;
  background: var(--surface-alt, #f8fafc) !important;
  color: var(--txt-muted, #475569) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  padding: 0 !important;
}

.top-icon-btn i,
.top-icon-btn i.bi {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.top-icon-btn:hover {
  background: var(--primary-light, #eff6ff) !important;
  color: var(--primary, #2563eb) !important;
}


/* ── Capsule Profil Utilisateur dans la Topbar (image.png) ─── */
.user-avatar-badge {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 4px 14px 4px 5px !important;
  border-radius: 999px !important;
  border: 1px solid var(--border, #e2e8f0) !important;
  background: var(--surface, #ffffff) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  height: 44px !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05) !important;
}

.user-avatar-badge:hover {
  background: var(--surface, #ffffff) !important;
  border-color: var(--primary-border, #bfdbfe) !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.1) !important;
}

.user-avatar {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  position: relative !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(135deg, var(--primary, #2563eb), var(--primary-hover, #1d4ed8)) !important;
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25) !important;
}

.user-avatar img {
  width: 34px !important;
  height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
}

.user-dropdown-avatar {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
}

.user-dropdown-avatar img {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
}

.user-meta-info {
  display: flex !important;
  flex-direction: column !important;
  text-align: left !important;
  line-height: 1.2 !important;
}

.user-meta-info strong {
  font-size: 12.5px !important;
  color: var(--txt, #0f172a) !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}

.user-meta-info span {
  font-size: 10.5px !important;
  color: var(--txt-muted, #64748b) !important;
  white-space: nowrap !important;
}

@media (max-width: 1100px) {
  .top-search input {
    width: 130px !important;
  }
  .user-meta-info {
    display: none !important;
  }
  .user-avatar-badge {
    padding: 4px !important;
  }
}
