/* ============================================
   DeepStack SIV — Skin DeepStack OS
   2026-06-25 — Option C : sidebar dark, contenu clair
   ============================================ */

/* === SIDEBAR DARK NAVY === */
aside.w-64 {
  background: linear-gradient(180deg, #0a0e1a 0%, #0d1224 100%) !important;
  border-right: 1px solid rgba(99, 130, 255, 0.12) !important;
  color: #e9ecf5;
  position: relative;
  overflow: hidden;
}

/* Glow subtil top-left de la sidebar */
aside.w-64::before {
  content: '';
  position: absolute;
  top: -100px;
  left: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(110, 140, 255, 0.18), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

aside.w-64 > * {
  position: relative;
  z-index: 1;
}

/* Logo header */
aside.w-64 .p-5 {
  border-bottom-color: rgba(99, 130, 255, 0.12) !important;
}

aside.w-64 .text-gray-900 {
  color: #e9ecf5 !important;
}

aside.w-64 .text-gray-400,
aside.w-64 .text-gray-500 {
  color: #5a637a !important;
}

/* Logo carré bleu → gradient bleu/violet DeepStack */
aside.w-64 .bg-brand-600 {
  background: linear-gradient(135deg, #6e8cff 0%, #a78bff 100%) !important;
  box-shadow: 0 4px 12px rgba(110, 140, 255, 0.35);
}

/* Section titles (PRINCIPAL, INTÉGRATIONS, etc.) */
aside.w-64 p.text-xs.font-semibold.uppercase {
  color: #5a637a !important;
  letter-spacing: 0.12em;
}

/* Sidebar links (inactif) */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: #8590ad !important;
  text-align: left;
  background: transparent;
  transition: all 180ms ease;
}

.sidebar-link:hover {
  background: rgba(110, 140, 255, 0.08) !important;
  color: #c8d0ff !important;
}

/* Sidebar link ACTIF — gradient subtil + bord gauche */
.sidebar-link-active {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #ffffff !important;
  background: linear-gradient(90deg, rgba(110, 140, 255, 0.18), rgba(167, 139, 255, 0.12)) !important;
  border-left: 2px solid #6e8cff;
  padding-left: 10px;
  text-align: left;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(110, 140, 255, 0.15);
}

/* Avatar bottom + logout */
aside.w-64 .bg-gray-300,
aside.w-64 .bg-gray-200 {
  background: rgba(110, 140, 255, 0.2) !important;
  color: #c8d0ff !important;
}

/* === HEADER MAIN === */
/* Le breadcrumb header avec Accueil / Tableau de bord */
main > div:first-child,
.h-14 {
  background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%) !important;
  border-bottom: 1px solid rgba(99, 130, 255, 0.08) !important;
}

/* === BOUTONS PRIMARY GRADIENT === */
button.bg-brand-600,
button[class*='bg-brand-600'],
.btn-primary,
a.bg-brand-600 {
  background: linear-gradient(135deg, #6e8cff 0%, #a78bff 100%) !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(110, 140, 255, 0.25) !important;
  transition: all 200ms ease !important;
}

button.bg-brand-600:hover {
  box-shadow: 0 6px 18px rgba(110, 140, 255, 0.4) !important;
  transform: translateY(-1px);
}

/* === BADGES & TAGS — version subtile === */
.bg-brand-50 {
  background: rgba(110, 140, 255, 0.08) !important;
  color: #4f6bda !important;
}

/* === CARDS — léger glow bleu en haut === */
.bg-white.rounded-lg,
.bg-white.rounded-xl,
.bg-white.shadow {
  position: relative;
  border-color: rgba(110, 140, 255, 0.08) !important;
}

/* === HISTOGRAMMES — FIX TITRES === */
/* Les titres ne doivent pas passer derrière les barres */
/* Augmente le z-index des labels et titres + padding top sur le container chart */
[class*='recharts'] .recharts-text,
.recharts-cartesian-axis-tick-value,
.chart-title {
  position: relative;
  z-index: 10;
}

/* Si un h3/h4 est dans la même card qu'un chart, on assure que rien ne passe par-dessus */
.bg-white > h3,
.bg-white > h4,
.bg-white > .text-base.font-semibold,
.bg-white > .text-lg.font-semibold {
  position: relative;
  z-index: 5;
  padding-bottom: 12px;
  margin-bottom: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(255,255,255,0.95));
}

/* Conteneur chart : padding-top pour éviter overlap titre */
.recharts-responsive-container,
.recharts-wrapper {
  padding-top: 8px !important;
}

/* === ACCENTS LIENS === */
.text-brand-600,
a.text-brand-600 {
  background: linear-gradient(135deg, #6e8cff, #a78bff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 500;
}

/* === SCROLLBAR sidebar (Webkit) === */
aside.w-64 nav::-webkit-scrollbar { width: 4px; }
aside.w-64 nav::-webkit-scrollbar-track { background: transparent; }
aside.w-64 nav::-webkit-scrollbar-thumb {
  background: rgba(110, 140, 255, 0.2);
  border-radius: 2px;
}
aside.w-64 nav::-webkit-scrollbar-thumb:hover {
  background: rgba(110, 140, 255, 0.35);
}

/* === FONTS — fallback Inter pour cohérence avec login === */
body, button, input, select, textarea {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
