/* ============================================================
   HeraHub × LUNEMAPA — custom.css
   « BTP Pro » — refonte esthétique sobre & premium.
   Palette : ardoise #0F172A · rouge LUNEMAPA #E30613 · bleu #1E40AF.
   Titres en serif (Spectral), corps en Inter, cartes à ombre douce.
   ============================================================ */

:root {
  --canvas:      #EEF1F6;   /* fond de l'espace de travail (cool, sobre) */
  --ink:         #0F172A;   /* texte principal */
  --ink-soft:    #334155;
  --muted:       #64748B;
  --line:        #E6EAF0;   /* bord de carte discret */
  --line-soft:   #EEF2F7;
  --brand:       #E30613;   /* rouge LUNEMAPA */
  --brand-dark:  #B00610;
  --blue:        #1E40AF;
  --blue-dark:   #1E3A8A;
  --card-shadow:      0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.05);
  --card-shadow-lift: 0 12px 30px -14px rgba(15,23,42,.22);
  --radius-card: 14px;
}

html, body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---- Titres de page en serif (premium, sobre) ---- */
.font-display { font-family: 'Spectral', Georgia, 'Times New Roman', serif; }
main h1 {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
}

/* Focus clavier visible partout (accessibilité) */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.search-input:focus-visible { outline: none; }

/* Hide elements pre-Alpine */
[x-cloak] { display: none !important; }

/* Lucide sizing helper (used when no inline style/size) */
[data-lucide] { width: 1em; height: 1em; }

/* Slim dark scrollbar (sidebar) */
.scrollbar-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }

/* Progress bar (avancement chantiers, etc.) */
.progress-track {
  background: #E4E8EF; height: 6px; border-radius: 9999px; overflow: hidden;
}
.progress-fill {
  background: var(--blue); height: 100%; border-radius: 9999px;
}

/* ---- Sidebar nav items ---- */
.nav-item {
  transition: background-color .15s ease, color .15s ease;
}
.nav-item:hover { background: #1E293B; }
.nav-item.active {
  background: #1E293B;
  border-left: 3px solid var(--brand);
  padding-left: calc(1rem - 3px);
}

/* ---- Tables ---- */
tbody tr.row { transition: background-color .12s ease; }
tbody tr.row:hover { background: #F6F8FB; }
main table thead th { white-space: nowrap; }

/* KPI card subtle hover lift */
.kpi-card { transition: box-shadow .2s ease, transform .2s ease; }
.kpi-card:hover { box-shadow: var(--card-shadow-lift); transform: translateY(-1px); }

/* Banner d'impact "127 h économisées" — gradient + radial overlay */
.banner-grad {
  background: linear-gradient(90deg, #0F172A 0%, #0F172A 35%, #7A0A10 75%, #E30613 100%);
}
.banner-grad::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(800px 200px at 80% 50%, rgba(255,255,255,.08), transparent 60%);
  pointer-events: none;
}

/* Generic colored dot used in pills */
.dot {
  width: 6px; height: 6px; border-radius: 9999px;
  display: inline-block; margin-right: 6px;
}

/* Topbar notification badge */
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: #E30613; color: white; font-size: 10px; font-weight: 600;
  min-width: 16px; height: 16px; border-radius: 9999px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid white;
}

/* Sidebar counter badge */
.side-badge {
  font-size: 10px; font-weight: 600; min-width: 18px; height: 18px;
  border-radius: 9999px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 6px; color: white;
}

/* Topbar / filtres — search input focus ring */
.search-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, .12);
}

/* ---- Card base : bord discret + ombre douce (premium) ---- */
.card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
}

/* Alert disc (round icon container for alert lists) */
.alert-disc {
  width: 40px; height: 40px; border-radius: 9999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.alert-disc [data-lucide] { width: 20px; height: 20px; }

/* ---- Ghost button ---- */
.btn-ghost {
  border: 1px solid var(--line);
  background: #ffffff;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-ghost:hover { background: #F6F8FB; border-color: #D8DEE8; }

/* ---- Primary CTAs — boutons pleins unifiés, légère profondeur ---- */
.btn-primary,
.btn-brand-blue,
.btn-lunemapa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;          /* px-4 py-2 */
  border-radius: 0.5rem;         /* rounded-lg */
  font-size: 0.875rem;           /* text-sm */
  line-height: 1.25rem;
  font-weight: 500;              /* font-medium */
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .10);
  transition: background-color .15s ease, box-shadow .15s ease, transform .04s ease;
}
.btn-primary:active,
.btn-brand-blue:active,
.btn-lunemapa:active { transform: translateY(0.5px); }

.btn-primary { background: var(--ink); }
.btn-primary:hover { background: #1E293B; box-shadow: 0 4px 12px -4px rgba(15,23,42,.35); }
.btn-primary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.btn-brand-blue { background: var(--blue); }
.btn-brand-blue:hover { background: var(--blue-dark); box-shadow: 0 4px 12px -4px rgba(30,64,175,.4); }
.btn-brand-blue:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.btn-lunemapa { background: var(--brand); }
.btn-lunemapa:hover { background: var(--brand-dark); box-shadow: 0 4px 12px -4px rgba(227,6,19,.4); }
.btn-lunemapa:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Spinner used in fake-IA loaders */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.spin-slow { animation: spin-slow 2s linear infinite; }

/* Subtle pulse for IA sparkles */
@keyframes sparkle-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
.sparkle-pulse { animation: sparkle-pulse 1.6s ease-in-out infinite; }
