/* ============================================================
   SNICTEPS Platform — Design System (Mode Clair & Sidebar)
   Plateforme Nationale d'Information — République de Guinée
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* GovTech — Blue / Indigo / Slate Palette */
  --primary-color: #1E3A8A; /* Deep Navy Blue */
  --primary-hover: #1D4ED8;
  --primary-light: #DBEAFE;

  /* Accent A — Royal Blue (replaces red) */
  --red-primary: #1D4ED8;
  --red-dark:    #1E3A8A;
  --red-light:   #DBEAFE;

  /* Accent B — Indigo / Medium Blue (replaces gold/amber) */
  --gold-primary: #4F46E5;
  --gold-dark:    #3730A3;
  --gold-light:   #EEF2FF;

  /* Accent C — Slate / Cool Gray (replaces green) */
  --green-primary: #475569;
  --green-dark:    #1E293B;
  --green-light:   #F1F5F9;

  /* Neutral Palette (Light Theme) */
  --bg-primary: #F8FAFC;    /* Light Slate background */
  --bg-secondary: #FFFFFF;  /* Card / Sidebar / Panel background */
  --bg-tertiary: #F1F5F9;   /* Inner elements background */
  --bg-card: #FFFFFF;
  --bg-glass: #FFFFFF;
  --bg-glass-hover: #F8FAFC;
  --bg-glass-active: #F1F5F9;

  --text-primary: #0F172A;   /* Slate 900 */
  --text-secondary: #475569; /* Slate 600 */
  --text-muted: #64748B;     /* Slate 500 */
  --text-accent: #1E293B;    /* Slate 800 */

  /* Borders */
  --border-subtle: #F1F5F9;
  --border-default: #E2E8F0;
  --border-strong: #CBD5E1;

  /* Shadows (Soft & Premium) */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.03), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -1px rgba(15, 23, 42, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.05), 0 4px 6px -2px rgba(15, 23, 42, 0.02);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.06), 0 10px 10px -5px rgba(15, 23, 42, 0.02);
  --shadow-glow-primary: 0 0 25px rgba(30, 58, 138, 0.08);

  /* Gradients — Blue palette only */
  --gradient-guinea: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
  --gradient-hero: linear-gradient(135deg, rgba(30, 58, 138, 0.02) 0%, rgba(241, 245, 249, 0.8) 100%);
  --gradient-card: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
  --gradient-dark: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Layout variables */
  --sidebar-width: 260px;
  --header-height: 64px;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 50%;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* Container */
  --container-max: 1340px;
  --container-narrow: 900px;

  /* Alias for backward compatibility with inner pages */
  --nav-height: var(--header-height);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtly animated bg meshes for GovTech premium touch */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(30, 58, 138, 0.02) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 90% 80%, rgba(16, 185, 129, 0.02) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
h4 { font-size: 1.15rem; }

/* ---------- Layout Elements ---------- */
.main-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  padding: var(--space-xl) var(--space-xl) var(--space-4xl) var(--space-xl);
  min-width: 0;
  position: relative;
  z-index: var(--z-base);
}

/* Fix layout for inner pages that render nav without .main-layout wrapper.
   body > main.container has specificity (0,1,2)=12 which beats .container (0,1,0)=10 */
body > main.container {
  margin-left: var(--sidebar-width) !important;
  margin-right: 0 !important;
  max-width: calc(100% - var(--sidebar-width));
  padding-top: var(--space-xl);
  padding-bottom: var(--space-4xl);
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
  min-width: 0;
  position: relative;
  z-index: var(--z-base);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
}

.container-narrow {
  max-width: var(--container-narrow);
}

/* ---------- Sidebar Layout ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: #080D18;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  z-index: var(--z-sticky);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.sidebar-brand {
  height: 72px;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--gradient-guinea);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: white;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.4);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 0.6rem;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-links {
  list-style: none;
  padding: var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: #94A3B8;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.sidebar-links a:hover {
  color: #F8FAFC;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-links a.active {
  color: #FFFFFF;
  background: var(--primary-color);
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(30, 58, 138, 0.35);
  position: relative;
}

.sidebar-links a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: #DBEAFE;
  border-radius: 0 3px 3px 0;
}

.sidebar-links a .nav-icon {
  font-size: 1.05rem;
  width: 20px;
  display: flex;
  justify-content: center;
}

/* ---------- Mobile Header ---------- */
.header-mobile {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-default);
  z-index: var(--z-sticky);
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.header-mobile-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.header-mobile-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--gradient-guinea);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: white;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.3);
}

.header-mobile-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: calc(var(--z-sticky) - 1);
}

.sidebar-overlay.open {
  display: block;
}

/* ---------- Utility Styles ---------- */
.section-header {
  margin-bottom: var(--space-xl);
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 4px;
}

.gradient-text {
  color: var(--text-accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-red {
  background: var(--red-light);
  color: var(--red-dark);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.badge-gold {
  background: var(--gold-light);
  color: var(--gold-dark);
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.badge-green {
  background: var(--green-light);
  color: var(--green-dark);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

/* ---------- Card Container (Refined white design) ---------- */
.glass-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.glass-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

/* ---------- Stats Cards ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.stat-card.red::before       { background: var(--primary-color); }
.stat-card.gold::before      { background: #3B82F6; }
.stat-card.green::before     { background: #64748B; }
.stat-card.red-accent::before{ background: #4F46E5; }

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.stat-icon {
  font-size: 1.6rem;
  margin-bottom: var(--space-xs);
  display: inline-block;
  color: var(--text-muted);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-accent);
  line-height: 1.1;
  margin-bottom: 2px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---------- Hero Section (Clair) ---------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 60%, #EEF2FF 100%);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl) var(--space-xl);
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-bottom: var(--space-2xl);
  min-height: 380px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255,255,255,0.8);
}

.hero-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 45%;
  z-index: 0;
  opacity: 0.25;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mask-image: linear-gradient(to left, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 60%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 14px;
  background: var(--primary-light);
  border: 1px solid rgba(30, 58, 138, 0.1);
  border-radius: 30px;
  color: var(--primary-color);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero h1 {
  margin-bottom: var(--space-md);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-accent);
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-xl);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-color);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: #FFFFFF;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-accent);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: var(--border-strong);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  color: var(--text-accent);
}

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

.btn-outline:hover {
  background: var(--primary-light);
  color: var(--primary-color);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 30px;
  font-size: 0.95rem;
}

.btn-group {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* ---------- Module Cards ---------- */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
}

.module-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.module-card.module-red::before   { background: var(--primary-color); }
.module-card.module-gold::before  { background: #3B82F6; }
.module-card.module-green::before { background: #64748B; }
.module-card.module-multi::before { background: var(--gradient-guinea); }

.module-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.module-icon {
  font-size: 2.1rem;
  margin-bottom: var(--space-md);
}

.module-card h3 {
  margin-bottom: var(--space-xs);
  font-size: 1.15rem;
  color: var(--text-accent);
}

.module-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: var(--space-md);
  line-height: 1.5;
  flex-grow: 1;
}

.module-count {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-md);
  margin-top: auto;
}

.module-count strong {
  color: var(--text-accent);
}

/* ---------- Status Badges ---------- */
/* shared base for all status badges */
.status-available, .status-in-use, .status-maintenance,
.status-planning, .status-in-progress, .status-completed {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.status-available {
  background: var(--primary-light);
  color: var(--primary-color);
  border: 1px solid rgba(30, 58, 138, 0.2);
}

.status-in-use {
  background: #EEF2FF;
  color: #3730A3;
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.status-maintenance {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

.status-planning {
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #CBD5E1;
}

.status-in-progress {
  background: #EEF2FF;
  color: #3730A3;
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.status-completed {
  background: var(--primary-light);
  color: var(--primary-color);
  border: 1px solid rgba(30, 58, 138, 0.2);
}

/* ---------- Detail Panel Info Cards ---------- */
.detail-info-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.detail-info-card h4 {
  color: var(--primary-color);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-default);
}

.detail-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  text-align: center;
}

.detail-stat-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  padding: 10px 8px;
  border-radius: var(--radius-sm);
}

.detail-stat-item .val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-accent);
  line-height: 1;
  margin-bottom: 3px;
}

.detail-stat-item .lbl {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* ---------- Data Tables (Clean light version) ---------- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table thead {
  background: var(--bg-tertiary);
}

.data-table th {
  padding: 14px 18px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.data-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--bg-tertiary);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- Filters Bar ---------- */
.filters-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.filter-group label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select,
.filter-input {
  padding: 8px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
  min-width: 170px;
}

.filter-select:focus,
.filter-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.filter-input::placeholder {
  color: var(--text-muted);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 250px;
  display: flex;
  align-items: center;
}

.search-box > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
  font-size: 0.85rem;
}

.search-box input {
  width: 100%;
  padding: 9px 16px 9px 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

/* ---------- Map Container ---------- */
.map-container {
  height: 480px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 10;
}

.map-container #map {
  width: 100%;
  height: 100%;
  background: var(--bg-tertiary);
}

/* ---------- Dashboard BI Grid ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-lg);
}

.dashboard-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

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

.dashboard-card-header h4 {
  font-size: 1rem;
  color: var(--text-accent);
}

.dashboard-card-header .card-action {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
}

.dashboard-card-header .card-action:hover {
  color: var(--text-primary);
}

.chart-container {
  position: relative;
  width: 100%;
  flex-grow: 1;
}

/* ---------- Modal System (Centered dialog) ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: var(--z-overlay);
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15,23,42,0.04);
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 280ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal.modal-sm {
  max-width: 560px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(16px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

.modal-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  flex-shrink: 0;
}

.modal-header h3 {
  margin-bottom: 5px;
  font-size: 1.2rem;
  color: var(--text-accent);
}

.modal-body {
  padding: var(--space-xl);
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.modal-footer {
  padding: var(--space-md) var(--space-xl);
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  flex-shrink: 0;
  background: var(--bg-tertiary);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

@media (max-width: 640px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal, .modal.modal-sm {
    max-width: 100%;
    max-height: 95vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
}

/* ---------- Detail Modal / Panel (Light style) ---------- */
.detail-panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  transition: opacity var(--transition-base);
}

.detail-panel-overlay.open {
  display: block;
}

.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 520px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-default);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-modal);
  transform: translateX(100%);
  transition: transform var(--transition-base) ease;
  display: flex;
  flex-direction: column;
}

.detail-panel.open {
  transform: translateX(0);
}

.detail-panel-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-panel-header h3 {
  font-size: 1.25rem;
  margin-bottom: 4px;
  color: var(--text-accent);
}

.detail-panel-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px;
  transition: color var(--transition-fast);
}

.detail-panel-close:hover {
  color: var(--text-primary);
}

.detail-panel-body {
  padding: var(--space-lg);
  overflow-y: auto;
  flex-grow: 1;
}

/* ---------- Tabs component (Light theme style) ---------- */
.tabs {
  display: flex;
  gap: var(--space-xs);
  border-bottom: 1px solid var(--border-default);
  padding-bottom: 1px;
}

.tab {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab:hover {
  color: var(--primary-color);
}

.tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* ---------- Footer (Light mode elegant) ---------- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-default);
  padding: var(--space-xl) 0;
  margin-top: var(--space-3xl);
  position: relative;
  z-index: var(--z-base);
}

/* Footer rendu via document.write() sur les pages internes = enfant direct de body */
body > footer {
  margin-left: var(--sidebar-width);
}

@media (max-width: 1024px) {
  body > footer {
    margin-left: 0;
  }
}

.guinea-stripe {
  height: 3px;
  background: var(--gradient-guinea);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  border-radius: 0 0 2px 2px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--primary-color);
}

/* ---------- Responsive Breakpoints & Overrides ---------- */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  
  .main-content {
    margin-left: 0;
    padding-top: calc(var(--header-height) + var(--space-md));
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
  
  .header-mobile {
    display: flex;
  }
  
  .hero {
    flex-direction: column;
    padding: var(--space-xl);
    min-height: auto;
  }
  
  .hero-bg {
    position: relative;
    width: 100%;
    height: 200px;
    opacity: 0.8;
    margin-top: var(--space-md);
  }
  
  .hero-bg img {
    mask-image: none;
    -webkit-mask-image: none;
    border-radius: var(--radius-md);
  }
  
  .hero-content {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-card {
    grid-column: span 1 !important;
  }
  
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group select,
  .filter-group input {
    min-width: 0;
    width: 100%;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-links {
    justify-content: center;
  }
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* ---------- Focus Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Progress bar for projects ---------- */
.progress-bar-wrap {
  height: 6px;
  background: var(--border-default);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--primary-color), #3B82F6);
  transition: width 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Toast notification ---------- */
.toast {
  position: fixed;
  top: 80px;
  right: 20px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-toast);
  font-family: var(--font-body);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 300ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-width: 360px;
}

.toast-success {
  background: var(--primary-light);
  border: 1px solid rgba(30, 58, 138, 0.2);
  color: var(--primary-color);
}

.toast-error {
  background: #EEF2FF;
  border: 1px solid rgba(79, 70, 229, 0.3);
  color: #3730A3;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- Responsive: mobile body > main ---------- */
@media (max-width: 1024px) {
  body > main.container {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    padding-top: calc(var(--header-height) + var(--space-md)) !important;
    padding-left: var(--space-md) !important;
    padding-right: var(--space-md) !important;
  }
}

/* Micro-animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-up {
  animation: fadeIn 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
