/* ==========================================================================
   SommAI by Sytelis - Design System & Styles Globaux (Thème Blanc, Gris & Vert Fluo)
   Palette : Fond Blanc & Gris Perle (#F8FAFC / #FFFFFF), Texte Anthracite & Touches Vert Fluo
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Nuances de fond et surfaces (Blanc et Gris clair haut de gamme) */
  --bg-page: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-input: #FFFFFF;
  --bg-elevated: #FFFFFF;

  /* Textes & Typographie (Contraste optimal) */
  --text-main: #0F172A;
  --text-heading: #0F172A;
  --text-body: #334155;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --text-white: #FFFFFF;

  /* Touches Vert Fluo & Émeraude */
  --fluo-primary: #00E676;
  --fluo-brand: #00C853;
  --fluo-hover: #10B981;
  --fluo-dark: #059669;
  --fluo-subtle: #ECFDF5;
  --fluo-glow: rgba(0, 230, 118, 0.35);
  --fluo-glow-subtle: rgba(0, 230, 118, 0.15);

  /* Couleurs de statut */
  --status-danger: #EF4444;
  --status-danger-subtle: #FEF2F2;
  --status-warning: #F59E0B;
  --status-warning-subtle: #FFFBEB;
  --status-info: #0284C7;
  --status-info-subtle: #F0F9FF;

  /* Bordures et séparateurs */
  --border-subtle: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-dark: #94A3B8;
  --border-fluo: #00E676;

  /* Typographie */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Effets & Rayons */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.07), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 30px -4px rgba(15, 23, 42, 0.10), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  --shadow-fluo: 0 0 20px rgba(0, 230, 118, 0.25);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset de base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  background-color: var(--bg-page);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(0, 230, 118, 0.05) 0%, transparent 35%),
    radial-gradient(circle at 90% 90%, rgba(0, 200, 83, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: var(--fluo-dark);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-heading);
}

/* Structure principale & Navigation */
#app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  height: 42px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-subtle);
  padding: 0.35rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: transparent;
}

.nav-item:hover {
  color: var(--text-heading);
  background: rgba(255, 255, 255, 0.7);
}

.nav-item.active {
  color: #000000;
  background: var(--fluo-primary);
  font-weight: 800;
  box-shadow: 0 2px 12px var(--fluo-glow);
}

.user-profile-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.85rem 0.35rem 0.35rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.user-avatar-btn:hover {
  border-color: var(--fluo-brand);
  box-shadow: var(--shadow-md);
}

.user-avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-subtle);
  border: 2px solid var(--fluo-primary);
}

.user-name-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-heading);
}

.user-role-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--fluo-subtle);
  color: var(--fluo-dark);
  font-weight: 800;
  letter-spacing: 0.5px;
  border: 1px solid rgba(0, 200, 83, 0.25);
}

/* Zone de contenu principale */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* Cartes et panneaux */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-medium);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.card-title i, .card-title svg {
  color: var(--fluo-dark);
}

/* Grille de statistiques */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--fluo-primary);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.35rem;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-heading);
}

.stat-value.highlight {
  color: var(--fluo-dark);
}

.stat-subtext {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Formulaires et Boutons */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-heading);
  margin-bottom: 0.45rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-heading);
  font-family: var(--font-body);
  font-size: 0.95rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--fluo-brand);
  box-shadow: 0 0 0 3px var(--fluo-glow-subtle);
  background: #FFFFFF;
}

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

/* Boutons d'action */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  user-select: none;
}

.btn-primary {
  background: var(--fluo-primary);
  color: #000000;
  box-shadow: 0 2px 10px var(--fluo-glow);
}

.btn-primary:hover {
  background: #00C853;
  color: #000000;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 200, 83, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-heading);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
  background: #E2E8F0;
  color: #000000;
  border-color: var(--border-dark);
}

.btn-outline-fluo {
  background: var(--bg-surface);
  color: var(--fluo-dark);
  border: 1.5px solid var(--fluo-brand);
}

.btn-outline-fluo:hover {
  background: var(--fluo-subtle);
  color: #000000;
  border-color: var(--fluo-primary);
  box-shadow: 0 2px 12px var(--fluo-glow-subtle);
}

.btn-danger {
  background: var(--status-danger);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.95rem 1.85rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

/* Pied de page */
.footer {
  margin-top: auto;
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer strong {
  color: var(--text-heading);
}

.footer span.brand-dot {
  color: var(--fluo-dark);
  font-weight: bold;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-logo img {
  height: 32px;
  max-width: 160px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05));
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.footer-logo img:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

/* Utilitaires */
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-fluo { color: var(--fluo-dark) !important; }
.text-white { color: var(--text-heading) !important; }
.text-muted { color: var(--text-muted) !important; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

/* Scrollbar personnalisée */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-subtle);
}
::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-dark);
}
