/* ════════════════════════════════════════════════════════════════
   HUB ERP MAINTENANCE — "Modern SaaS Light" design system
   Fond gris clair, cartes blanches, accent teal NOVALINK, Inter.
   Remplace l'ancien thème "Cyber Digital" (main.php / auth.php).
   ════════════════════════════════════════════════════════════════ */

@import url("../vendor/inter/inter.css");

:root {
  /* Surfaces */
  --app-bg:          #F4F6F9;
  --app-surface:     #FFFFFF;
  --app-surface-2:   #F8FAFC;
  --app-border:      #E5E9F0;
  --app-border-soft: rgba(15, 23, 42, .06);

  /* Accent (NOVALINK teal) */
  --app-primary:      #0F766E;
  --app-primary-dark: #0B5C56;
  --app-primary-light:#14B8A6;
  --app-primary-soft: #E6F4F1;

  /* Texte */
  --app-text:       #1F2937;
  --app-text-2:     #475569;
  --app-text-muted: #6B7280;
  --app-text-soft:  #94A3B8;

  /* Statuts */
  --app-success:      #16A34A;
  --app-success-soft: #E7F6EC;
  --app-warning:      #D97706;
  --app-warning-soft: #FEF3E2;
  --app-danger:       #DC2626;
  --app-danger-soft:  #FCEAEA;
  --app-info:         #2563EB;
  --app-info-soft:    #E8F0FE;

  /* Rayons & ombres */
  --app-radius-sm: .6rem;
  --app-radius:    .85rem;
  --app-radius-lg: 1.25rem;
  --app-radius-xl: 1.6rem;
  --app-shadow-sm: 0 4px 14px rgba(15, 23, 42, .04);
  --app-shadow:    0 12px 28px rgba(15, 23, 42, .06);
  --app-shadow-lg: 0 18px 40px rgba(15, 23, 42, .10);

  /* Layout */
  --navbar-h:       74px;
  --sidebar-rail-w: 84px;
  --sidebar-w:      264px;

  --app-font: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ════════════════════════════════
   RESET / BASE
════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--app-bg); }

body {
  font-family: var(--app-font);
  background: var(--app-bg);
  color: var(--app-text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Strip fixe au-dessus de la navbar flottante pour éviter tout
   contenu visible dans l'espace de 14px lors du scroll */
html::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 14px;
  background: var(--app-bg);
  z-index: 1041;
  pointer-events: none;
}

body::before,
body::after,
.wrapper::before {
  display: none;
}

hr { border-color: var(--app-border); opacity: 1; }

a { color: var(--app-primary); text-decoration-color: rgba(15,118,110,.35); }
a:hover { color: var(--app-primary-dark); }

code, kbd, pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
  border-radius: .4rem;
  padding: .1rem .4rem;
}

.text-muted   { color: var(--app-text-muted) !important; }
.text-primary { color: var(--app-primary) !important; }
.text-success { color: var(--app-success) !important; }
.text-danger  { color: var(--app-danger) !important; }
.text-warning { color: var(--app-warning) !important; }
.text-info    { color: var(--app-info) !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(15,23,42,.14); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ════════════════════════════════
   LAYOUT SHELL — navbar/sidebar flottants
════════════════════════════════ */
.wrapper {
  position: relative;
  z-index: auto;
  isolation: auto;
}

.layout-fixed .wrapper {
  display: block;
  min-height: 100vh;
  padding: 14px 18px 18px;
  overflow-x: clip;
}

/* Navbar flottante */
.layout-fixed .navbar,
.main-header.navbar {
  position: fixed !important;
  top: 14px;
  left: calc(var(--sidebar-rail-w) + 32px);
  right: 18px;
  z-index: 1045 !important;
  height: var(--navbar-h);
  border-radius: var(--app-radius-xl);
  background: var(--app-surface) !important;
  border: 1px solid var(--app-border) !important;
  box-shadow: var(--app-shadow-sm) !important;
  padding: 0 !important;
  transition: left .24s ease;
}

.main-header.navbar::before { display: none; }

/* La sidebar s'élargit au survol → la navbar la suit */
body:has(.main-sidebar:hover) .layout-fixed .navbar,
body:has(.main-sidebar:hover) .main-header.navbar {
  left: calc(var(--sidebar-w) + 32px);
}

.navbar .container-fluid {
  height: var(--navbar-h);
  padding: 0 1.2rem;
}

/* Sidebar flottante en mode "rail" (icônes) qui s'élargit au survol */
.main-sidebar {
  position: fixed !important;
  top: 14px;
  left: 14px;
  bottom: 14px;
  width: var(--sidebar-rail-w);
  height: auto;
  background: var(--app-surface) !important;
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius-xl);
  box-shadow: var(--app-shadow-sm);
  overflow: hidden;
  transition: width .24s ease, box-shadow .24s ease;
  z-index: 1040;
}

.main-sidebar:hover {
  width: var(--sidebar-w);
  overflow: visible;
  box-shadow: var(--app-shadow-lg);
  z-index: 1040;
}

.sidebar {
  height: 100%;
  padding: .8rem 0 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(15,23,42,.12) transparent;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(15,23,42,.14); border-radius: 2px; }

/* Brand link (non utilisé en layout standard mais conservé pour compat) */
.brand-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--app-border) !important;
  background: transparent !important;
  text-decoration: none;
}
.brand-link .brand-image { max-height: 30px; }
.brand-link .brand-text {
  color: var(--app-text) !important;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .02em;
}

/* Contenu / pied de page */
.layout-fixed .content-wrapper {
  margin-left: calc(var(--sidebar-rail-w) + 28px);
  margin-top: calc(var(--navbar-h) + 28px);
  min-height: calc(100vh - var(--navbar-h) - 42px);
  overflow: visible;
  background: transparent;
}

.layout-fixed .main-footer {
  margin-left: calc(var(--sidebar-rail-w) + 28px);
  background: transparent;
  border-top: 0;
  color: var(--app-text-soft);
  padding-top: .9rem;
}

.content-wrapper {
  background: transparent;
  padding: 1.35rem 0 2.25rem;
}

.content { padding: 0 1.5rem; }

/* ════════════════════════════════
   SIDEBAR — mode "rail" replié
════════════════════════════════ */
.sidebar-workspace-label,
.sidebar-user-top .info,
.sidebar-user-badges,
.sidebar-quick-grid,
.form-inline,
.sidebar-menu-shell .nav-header,
.sidebar-menu-shell .nav-link p,
.sidebar-menu-shell .nav-link .right,
.sidebar-menu-shell .badge.right {
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  overflow: hidden;
  transition: opacity .16s ease, visibility .16s ease;
}

.sidebar-user-top {
  grid-template-columns: 1fr;
  justify-items: center;
  margin-bottom: 0;
}

.sidebar-user-avatar { margin: 0 auto; }

.sidebar-quick-grid { grid-template-columns: 1fr; margin: 0 .6rem .75rem; }

.nav-sidebar .nav-link {
  min-height: 50px;
  justify-content: center;
  padding: .65rem .75rem;
  border-radius: var(--app-radius-sm);
}

.nav-sidebar .nav-link .nav-icon {
  margin-right: 0;
  width: 2.3rem;
  height: 2.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .85rem;
  font-size: .95rem;
}

/* Tooltip au survol d'un item replié */
.sidebar-menu-shell .nav-link { position: relative; }

.sidebar-menu-shell .nav-link::after {
  content: attr(data-title);
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--app-text);
  color: #fff;
  border-radius: .6rem;
  box-shadow: var(--app-shadow);
  padding: .45rem .7rem;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
  z-index: 20;
}

.sidebar-menu-shell .nav-link:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(2px);
}

/* ── Sidebar étendue au survol ── */
.main-sidebar:hover .sidebar-workspace-label,
.main-sidebar:hover .sidebar-user-top .info,
.main-sidebar:hover .sidebar-user-badges,
.main-sidebar:hover .sidebar-quick-grid,
.main-sidebar:hover .form-inline,
.main-sidebar:hover .sidebar-menu-shell .nav-header,
.main-sidebar:hover .sidebar-menu-shell .nav-link p,
.main-sidebar:hover .sidebar-menu-shell .badge.right {
  opacity: 1;
  visibility: visible;
  max-height: none;
  overflow: visible;
}

.main-sidebar:hover .nav-sidebar .nav-link {
  justify-content: flex-start;
  padding: .65rem .9rem;
}

.main-sidebar:hover .nav-sidebar .nav-link .nav-icon {
  margin-right: .55rem;
  flex-shrink: 0;
}

.main-sidebar:hover .sidebar-user-top {
  grid-template-columns: auto 1fr;
  justify-items: start;
}

.main-sidebar:hover .sidebar-user-avatar { margin: 0; }

.main-sidebar:hover .sidebar-quick-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.main-sidebar:hover .sidebar-menu-shell .nav-link::after { display: none; }

/* ════════════════════════════════
   TOPBAR / NAVBAR
════════════════════════════════ */
.topbar-shell {
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  gap: 1rem;
  width: 100%;
  height: 100%;
  align-items: center;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}

.topbar-center {
  min-width: 0;
  display: flex;
  justify-content: center;
}

.topbar-search {
  width: min(100%, 720px);
  display: flex;
  align-items: center;
  gap: .7rem;
  min-height: 46px;
  padding: 0 .95rem;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: 999px;
}

.topbar-search i { color: var(--app-text-soft); font-size: .86rem; flex-shrink: 0; }

.topbar-search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--app-text);
  font-size: .92rem;
  outline: none;
}

.topbar-search input::placeholder { color: var(--app-text-soft); }

.topbar-menu-btn,
.topbar-tools .nav-link,
.topbar-user-toggle,
.navbar-nav .nav-item .nav-link,
[data-lte-toggle="sidebar"],
[data-lte-toggle="fullscreen"] {
  width: 40px;
  height: 40px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: var(--app-radius-sm);
  background: var(--app-surface) !important;
  border: 1px solid var(--app-border) !important;
  color: var(--app-text-2) !important;
  padding: 0 !important;
  transition: background .2s, border-color .2s, color .2s;
}

.topbar-menu-btn:hover,
.topbar-tools .nav-link:hover,
.topbar-user-toggle:hover,
.navbar-nav .nav-item .nav-link:hover,
[data-lte-toggle="sidebar"]:hover,
[data-lte-toggle="fullscreen"]:hover {
  background: var(--app-primary-soft) !important;
  border-color: var(--app-primary-soft) !important;
  color: var(--app-primary) !important;
}

.topbar-user-toggle {
  width: auto;
  gap: .5rem;
  padding: 0 .75rem !important;
}

.navbar-brand {
  color: var(--app-text) !important;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  margin-right: 0;
}

.navbar-brand img { height: 32px; border-radius: .6rem; }

.topbar-brand-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }

.topbar-brand-title {
  color: var(--app-text);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.topbar-brand-subtitle,
.topbar-context-label {
  color: var(--app-text-soft);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem .75rem;
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  max-width: 300px;
  min-width: 0;
}

.topbar-context i { color: var(--app-primary); font-size: .8rem; flex-shrink: 0; }

.topbar-context-copy { display: flex; flex-direction: column; min-width: 0; }

.topbar-context-value,
.topbar-user-name {
  color: var(--app-text);
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 34px;
  padding: .3rem .75rem;
  border-radius: var(--app-radius-sm);
  background: var(--app-primary-soft);
  border: 1px solid rgba(15,118,110,.14);
  color: var(--app-primary-dark);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-chip i { font-size: .7rem; }

.topbar-tools { display: flex; align-items: center; gap: .35rem; }

/* Dropdowns (notifications, utilisateur) */
.navbar .dropdown-menu {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-lg);
  color: var(--app-text);
  padding: .4rem;
}

.navbar .dropdown-item {
  color: var(--app-text-2);
  border-radius: .5rem;
  padding: .55rem .75rem;
  font-size: .85rem;
  transition: background .15s, color .15s;
}

.navbar .dropdown-item:hover { background: var(--app-primary-soft); color: var(--app-primary-dark); }
.navbar .dropdown-divider { border-color: var(--app-border); }

/* ════════════════════════════════
   SIDEBAR — workspace / user / recherche / menu
════════════════════════════════ */
.sidebar-workspace,
.sidebar-menu-shell {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
}

.sidebar-workspace {
  margin: 0 .65rem .75rem;
  padding: .8rem .7rem;
  border-radius: var(--app-radius);
}

.sidebar-workspace-label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-bottom: .6rem;
  color: var(--app-text-soft);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sidebar-user-card { background: transparent; border: 0; padding: 0; }

.sidebar-user-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .7rem;
  align-items: center;
  margin-bottom: .7rem;
}

.sidebar-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--app-radius-sm);
  background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-light) 100%) !important;
  color: #fff !important;
}

.sidebar-user-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--app-text);
  margin: 0 0 .12rem;
}

.sidebar-user-subtitle {
  margin: 0;
  color: var(--app-text-soft);
  font-size: .72rem;
}

.sidebar-user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  margin-bottom: 0;
}

.sidebar-role-badge,
.sidebar-status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 22px;
  padding: .1rem .6rem;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.sidebar-role-badge {
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
  border: 1px solid rgba(15,118,110,.14);
}

.sidebar-status-badge {
  background: var(--app-success-soft);
  color: var(--app-success);
  border: 1px solid rgba(22,163,74,.16);
}

/* Quick grid */
.sidebar-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .4rem;
  margin: 0 .65rem .7rem;
}

.sidebar-quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  min-height: 62px;
  padding: .55rem .4rem;
  border-radius: var(--app-radius-sm);
  text-decoration: none;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  transition: background .2s, border-color .2s, transform .2s, box-shadow .2s;
}

.sidebar-quick-link:hover {
  background: var(--app-primary-soft);
  border-color: rgba(15,118,110,.18);
  transform: translateY(-2px);
  box-shadow: var(--app-shadow-sm);
}

.sidebar-quick-link.active {
  background: var(--app-primary-soft);
  border-color: rgba(15,118,110,.22);
  box-shadow: var(--app-shadow-sm);
}

.sidebar-quick-link i {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: .6rem;
  background: var(--app-surface);
  color: var(--app-primary);
  font-size: .82rem;
}

.sidebar-quick-link span {
  color: var(--app-text-2);
  font-size: .68rem;
  font-weight: 600;
  text-align: center;
}

/* Recherche */
.sidebar-search-shell {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .4rem;
  padding: .35rem;
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  margin: 0 .65rem;
}

.sidebar-search-input {
  min-height: 36px;
  border-radius: .5rem !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--app-text) !important;
  font-size: .84rem;
}

.sidebar-search-input::placeholder { color: var(--app-text-soft) !important; }

.sidebar-search-btn {
  min-width: 36px;
  border-radius: .5rem !important;
  background: var(--app-surface) !important;
  border: 1px solid var(--app-border) !important;
  color: var(--app-primary) !important;
  box-shadow: none !important;
}

.sidebar-search-btn:hover { background: var(--app-primary-soft) !important; }

.form-inline { padding: 0 0 .6rem; }

/* Menu shell */
.sidebar-menu-shell {
  margin: 0 .55rem;
  padding: .35rem;
  border-radius: var(--app-radius);
}

/* En-têtes de section */
.nav-sidebar .nav-header {
  margin: .6rem .35rem .3rem;
  padding: .4rem .7rem .35rem .85rem !important;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: .55rem;
  color: var(--app-text-soft) !important;
  font-size: .62rem !important;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Liens de menu */
.nav-sidebar > .nav-item { margin-bottom: .2rem; }

.nav-sidebar .nav-link {
  display: flex;
  align-items: center;
  color: var(--app-text-2) !important;
  background: transparent;
  border: 1px solid transparent;
  transition: all .18s ease;
}

.nav-sidebar .nav-link .nav-icon {
  color: var(--app-text-soft) !important;
  text-align: center;
  transition: color .18s;
}

.nav-sidebar .nav-link p {
  font-size: .855rem;
  font-weight: 600;
  line-height: 1.2;
  flex: 1;
  margin: 0;
}

.nav-sidebar .nav-link:hover {
  background: var(--app-primary-soft) !important;
  color: var(--app-primary-dark) !important;
}

.nav-sidebar .nav-link:hover .nav-icon { color: var(--app-primary) !important; }

.nav-sidebar .nav-link.active {
  background: var(--app-primary-soft) !important;
  color: var(--app-primary-dark) !important;
  font-weight: 700;
}

.nav-sidebar .nav-link.active .nav-icon { color: var(--app-primary) !important; }

/* Treeview */
.nav-treeview {
  background: transparent;
  border-left: 2px solid var(--app-border);
  margin-left: 1.1rem;
  padding-left: .3rem;
}

.nav-treeview .nav-link {
  min-height: 36px;
  padding: .45rem .7rem !important;
  border-radius: .5rem !important;
}

.nav-sidebar > .nav-item .right { transition: transform .2s ease; }
.menu-open > .nav-link .right { transform: rotate(-90deg); }

/* Méga-menu Administration */
.admin-treeview { border-left: 0; margin-left: .35rem; padding-left: 0; }

.admin-mega-grid {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: .4rem .25rem .2rem;
}

.admin-mega-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  padding: .5rem;
}

.admin-mega-title {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .2rem .35rem .4rem;
  color: var(--app-text-soft);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.admin-mega-title i { color: var(--app-primary); font-size: .78rem; }

.admin-mega-list .nav-link {
  min-height: 36px;
  padding: .4rem .6rem !important;
  border-radius: .5rem !important;
}

.nav-icon-sm { font-size: .8rem !important; width: 1.6rem !important; height: 1.6rem !important; }

/* ════════════════════════════════
   CONTENT HEADER
════════════════════════════════ */
.content-header {
  margin: 0 0 1.25rem;
  padding: 1.2rem 1.35rem;
  border-radius: var(--app-radius-lg);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow);
  position: relative;
  overflow: hidden;
}

.content-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--app-primary) 0%, var(--app-primary-light) 100%);
}

.content-header .container-fluid { padding: 0; }

.content-header h1 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--app-text);
  margin-bottom: .15rem;
}

.content-header-kicker {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .7rem;
  margin-bottom: .5rem;
  border-radius: 999px;
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.content-header-subtitle {
  margin: .25rem 0 0;
  color: var(--app-text-muted);
  font-size: .88rem;
  max-width: 46rem;
}

.content-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
}

.content-header-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .75rem;
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  color: var(--app-text-2);
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}

.content-header-chip i { color: var(--app-primary); }

.content-header .breadcrumb {
  gap: .3rem;
  padding: .3rem .5rem;
  margin: 0;
  border-radius: .5rem;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
}

.content-header .breadcrumb-item,
.content-header .breadcrumb-item a {
  color: var(--app-text-muted);
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
}

.content-header .breadcrumb-item.active { color: var(--app-text); }
.content-header .breadcrumb-item + .breadcrumb-item::before { color: var(--app-text-soft); }

/* ════════════════════════════════
   CARDS & KPI BOXES
════════════════════════════════ */
.card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
  margin-bottom: 1rem;
  transition: box-shadow .2s, transform .2s;
}

.card:hover { box-shadow: var(--app-shadow); }

.card-header {
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  padding: .85rem 1.1rem;
  border-radius: var(--app-radius) var(--app-radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.card-header .card-title,
.card-header h3, .card-header h5, .card-header h6 {
  margin: 0;
  color: var(--app-text);
  font-weight: 700;
  font-size: .92rem;
}

.card-body { padding: 1.1rem; color: var(--app-text); }

/* small-box (KPI) */
.small-box {
  border-radius: var(--app-radius) !important;
  border: 1px solid var(--app-border) !important;
  background: var(--app-surface) !important;
  box-shadow: var(--app-shadow-sm) !important;
  transition: box-shadow .2s, transform .2s;
}

.small-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--app-shadow) !important;
}

.small-box .inner h3,
.small-box .inner p { color: var(--app-text) !important; }

.filter-bar {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
  padding: 1rem;
  margin-bottom: 1rem;
}

/* ════════════════════════════════
   TABLES
════════════════════════════════ */
.table-responsive {
  border-radius: var(--app-radius);
  border: 1px solid var(--app-border);
  background: var(--app-surface);
}

.table {
  margin-bottom: 0;
  color: var(--app-text);
  --bs-table-bg: transparent;
}

.table thead th {
  padding: .8rem .9rem;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-2);
  color: var(--app-text-soft);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table tbody td {
  padding: .85rem .9rem;
  border-color: var(--app-border-soft);
  vertical-align: middle;
  color: var(--app-text);
}

.table tbody tr:hover { background: var(--app-primary-soft) !important; }

/* ════════════════════════════════
   FORMS
════════════════════════════════ */
.form-control, .form-select {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  color: var(--app-text);
  min-height: 44px;
  transition: border-color .2s, box-shadow .2s;
}

.form-control::placeholder { color: var(--app-text-soft); }

.form-control:focus, .form-select:focus {
  background: var(--app-surface);
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(15,118,110,.12);
  color: var(--app-text);
  outline: none;
}

.form-label, label {
  color: var(--app-text-2);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ════════════════════════════════
   BUTTONS
════════════════════════════════ */
.btn {
  border-radius: var(--app-radius-sm);
  font-weight: 600;
  font-size: .85rem;
  transition: all .2s ease;
}

.btn-primary,
.db-btn--primary {
  background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-light) 100%) !important;
  border: none;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15,118,110,.22) !important;
}

.btn-primary:hover,
.btn-outline-primary:hover {
  transform: translateY(-1px);
}

.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 22px rgba(15,118,110,.28) !important;
  color: #ffffff !important;
}

.btn-secondary {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  color: var(--app-text-2);
}

.btn-secondary:hover { background: var(--app-border); color: var(--app-text); }

.btn-outline-primary {
  border-color: var(--app-primary);
  color: var(--app-primary);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--app-primary-soft);
  border-color: var(--app-primary);
  color: var(--app-primary-dark);
}

.btn-sm { min-height: 32px; padding: .32rem .65rem; border-radius: .5rem; }

/* ════════════════════════════════
   BADGES & ALERTS
════════════════════════════════ */
.badge { border-radius: 999px; font-weight: 700; font-size: .68rem; letter-spacing: .02em; }

.alert { border-radius: var(--app-radius); font-size: .885rem; border-width: 1px; }
.alert-danger  { background: var(--app-danger-soft);  border-color: rgba(220,38,38,.18);  color: var(--app-danger); }
.alert-success { background: var(--app-success-soft); border-color: rgba(22,163,74,.18);  color: var(--app-success); }
.alert-warning { background: var(--app-warning-soft); border-color: rgba(217,119,6,.2);   color: var(--app-warning); }
.alert-info    { background: var(--app-info-soft);    border-color: rgba(37,99,235,.18);  color: var(--app-info); }

/* ════════════════════════════════
   PAGINATION
════════════════════════════════ */
.page-link {
  background: var(--app-surface);
  border-color: var(--app-border);
  color: var(--app-text-2);
  border-radius: .5rem !important;
  margin: 0 .15rem;
}

.page-link:hover { background: var(--app-primary-soft); border-color: var(--app-primary); color: var(--app-primary-dark); }
.page-item.active .page-link { background: var(--app-primary); border-color: var(--app-primary); color: #ffffff; }

/* ════════════════════════════════
   MODAL & DROPDOWN (contenu)
════════════════════════════════ */
.modal-content {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow-lg);
  color: var(--app-text);
}

.modal { z-index: 1060 !important; }
.modal-backdrop, .modal-backdrop.show { z-index: 1050 !important; }

.modal-dialog { max-width: min(640px, calc(100vw - 1.5rem)); margin: 1rem auto; }
.modal-dialog.modal-lg { max-width: min(760px, calc(100vw - 1.5rem)); }
.modal-dialog.modal-xl { max-width: min(980px, calc(100vw - 1.5rem)); }

.modal-header {
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-2);
  border-radius: var(--app-radius-lg) var(--app-radius-lg) 0 0;
}

.modal-header .modal-title { color: var(--app-text); font-weight: 700; }
.modal-footer { border-top: 1px solid var(--app-border); background: transparent; }

.dropdown-menu {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-lg);
  color: var(--app-text);
  padding: .35rem;
}

.dropdown-item {
  color: var(--app-text-2);
  border-radius: .5rem;
  font-size: .85rem;
  padding: .55rem .75rem;
  transition: background .15s, color .15s;
}

.dropdown-item:hover, .dropdown-item:focus { background: var(--app-primary-soft); color: var(--app-primary-dark); }
.dropdown-divider { border-color: var(--app-border); }

/* ════════════════════════════════
   NAV PILLS (onglets de contenu)
════════════════════════════════ */
.content .nav-pills .nav-link,
.card .nav-pills .nav-link {
  border-radius: var(--app-radius-sm);
  color: var(--app-text-2);
  font-weight: 600;
  font-size: .85rem;
  transition: background .18s, color .18s;
}

.content .nav-pills .nav-link:hover,
.card .nav-pills .nav-link:hover { background: var(--app-primary-soft); color: var(--app-primary-dark); }

.content .nav-pills .nav-link.active,
.card .nav-pills .nav-link.active { background: var(--app-primary); color: #ffffff; }

/* ════════════════════════════════
   TOAST & FOOTER
════════════════════════════════ */
.toast {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  color: var(--app-text);
  box-shadow: var(--app-shadow-lg);
}

.toast-header {
  background: var(--app-surface-2);
  border-bottom: 1px solid var(--app-border);
  color: var(--app-text);
  border-radius: var(--app-radius) var(--app-radius) 0 0;
}

.main-footer {
  padding: .55rem 1.5rem;
  font-size: .72rem;
  color: var(--app-text-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}

.footer-meta { display: flex; align-items: center; gap: .75rem; }
.footer-badge { display: inline-flex; align-items: center; gap: .35rem; }

/* ════════════════════════════════
   UNIFIED PAGE HERO COMPONENT
════════════════════════════════ */
.view-hero {
  position: relative;
  border-radius: var(--app-radius-lg);
  padding: 1.4rem 1.75rem 1.35rem;
  background: linear-gradient(135deg, var(--app-primary-dark) 0%, var(--app-primary) 55%, var(--app-primary-light) 100%);
  color: #fff;
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: 0 14px 32px rgba(15,118,110,.18);
}
.view-hero::before {
  content: '';
  position: absolute;
  right: -60px; top: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}
.view-hero::after {
  content: '';
  position: absolute;
  left: -40px; bottom: -50px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  pointer-events: none;
}
.view-hero__inner {
  position: relative; z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.view-hero__label {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .32rem .7rem;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  font-size: .72rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  margin-bottom: .6rem;
}
.view-hero__title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 .4rem;
  color: #fff;
}
.view-hero__sub {
  font-size: .9rem;
  color: rgba(255,255,255,.82);
  margin: 0;
  max-width: 46rem;
}
.view-hero__actions {
  display: flex; gap: .6rem; flex-wrap: wrap;
  align-items: center;
  padding-top: .15rem;
  flex-shrink: 0;
}
.view-hero__actions .btn {
  border-radius: 999px;
  padding: .55rem 1rem;
  font-size: .84rem; font-weight: 600;
}
.view-hero__chips {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; gap: .6rem;
  margin-top: 1.1rem;
}
.view-hero__chip {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: .85rem;
  padding: .55rem .9rem;
  backdrop-filter: blur(8px);
  transition: background .15s;
}
.view-hero__chip:hover { background: rgba(255,255,255,.22); }
.view-hero__chip .chip-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: rgba(255,255,255,.18);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem;
  flex-shrink: 0;
}
.view-hero__chip .chip-val {
  font-size: 1.15rem; font-weight: 800;
  line-height: 1; color: #fff;
}
.view-hero__chip .chip-lbl {
  font-size: .72rem;
  color: rgba(255,255,255,.8);
  text-transform: uppercase;
  letter-spacing: .04em;
}
/* Variantes d'accent (alerte/danger/succès) */
.view-hero__chip--warn    { background: rgba(217,119,6,.24);  border-color: rgba(217,119,6,.35); }
.view-hero__chip--danger  { background: rgba(220,38,38,.22);  border-color: rgba(220,38,38,.35); }
.view-hero__chip--success { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.28); }

/* ── Animations d'entrée ── */
@keyframes vhFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes vhFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes vhSlideRight {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}
.vh-a   { animation: vhFadeUp .4s cubic-bezier(.22,1,.36,1) both; }
.vh-a-d1{ animation: vhFadeUp .4s cubic-bezier(.22,1,.36,1) .07s both; }
.vh-a-d2{ animation: vhFadeUp .4s cubic-bezier(.22,1,.36,1) .14s both; }
.vh-a-d3{ animation: vhFadeUp .4s cubic-bezier(.22,1,.36,1) .21s both; }
.vh-a-d4{ animation: vhFadeUp .4s cubic-bezier(.22,1,.36,1) .28s both; }
.vh-a-d5{ animation: vhFadeUp .4s cubic-bezier(.22,1,.36,1) .35s both; }
.vh-slide { animation: vhSlideRight .38s cubic-bezier(.22,1,.36,1) both; }
.vh-fade  { animation: vhFadeIn .45s ease both; }
/* Délais échelonnés : data-vh-delay="N" (1-6) */
[data-vh-delay="1"]{ animation-delay: .07s !important; }
[data-vh-delay="2"]{ animation-delay: .14s !important; }
[data-vh-delay="3"]{ animation-delay: .21s !important; }
[data-vh-delay="4"]{ animation-delay: .28s !important; }
[data-vh-delay="5"]{ animation-delay: .35s !important; }
[data-vh-delay="6"]{ animation-delay: .42s !important; }

/* Animation d'entrée au scroll */
.anim-card {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .4s ease, transform .4s ease;
}
.anim-card.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-width: 991.98px) {
  .main-header.navbar { left: 14px; right: 14px; }

  .topbar-shell { grid-template-columns: 1fr auto; }

  .topbar-center { grid-column: 1 / -1; order: 3; }

  .layout-fixed .content-wrapper,
  .layout-fixed .main-footer { margin-left: 0; }

  .main-sidebar {
    left: 0;
    top: 14px;
    bottom: 14px;
    width: var(--sidebar-w);
    border-radius: 0 var(--app-radius-xl) var(--app-radius-xl) 0;
    transform: translateX(-100%);
    transition: transform .3s ease-in-out;
    box-shadow: var(--app-shadow-lg);
  }

  .sidebar-workspace-label,
  .sidebar-user-top .info,
  .sidebar-user-badges,
  .sidebar-quick-grid,
  .form-inline,
  .sidebar-menu-shell .nav-header,
  .sidebar-menu-shell .nav-link p,
  .sidebar-menu-shell .nav-link .right,
  .sidebar-menu-shell .badge.right {
    opacity: 1;
    visibility: visible;
    max-height: 200px;
  }

  .sidebar-menu-shell .nav-link::after { display: none; }

  .nav-sidebar .nav-link { justify-content: flex-start; }

  .nav-sidebar .nav-link .nav-icon {
    margin-right: .65rem;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: .6rem;
    font-size: .88rem;
  }

  .sidebar-user-top { grid-template-columns: auto 1fr; justify-items: start; }
  .sidebar-user-avatar { margin: 0; }
  .sidebar-quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  body.sidebar-open .main-sidebar { transform: translateX(0); }
}

@media (max-width: 768px) {
  .layout-fixed .wrapper { padding: 12px; }

  .topbar-context,
  .topbar-chip,
  .topbar-brand-subtitle,
  .topbar-user-name { display: none; }

  .content-header { padding: .9rem; }
  .content { padding: 0 .75rem; }
}
