/* ==========================================================================
   PBP-SAU Official Institutional Design System
   Executive Midnight Navy • Ultra-Premium Glassmorphism & High-Fidelity UI
   ========================================================================== */

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Theme Colors - PBP-SAU Executive Midnight Navy */
  --bg-primary: #071224;
  --bg-primary-gradient: radial-gradient(at 12% 15%, rgba(29, 78, 216, 0.22) 0px, transparent 50%),
                         radial-gradient(at 88% 8%, rgba(14, 165, 233, 0.14) 0px, transparent 45%),
                         radial-gradient(at 50% 95%, rgba(11, 24, 48, 0.9) 0px, transparent 60%),
                         radial-gradient(at 90% 85%, rgba(30, 58, 138, 0.18) 0px, transparent 50%);
  --bg-surface: #0a1932;
  --bg-surface-elevated: #0f2344;
  --bg-card: rgba(11, 26, 50, 0.78);
  --bg-card-hover: rgba(16, 36, 68, 0.9);
  
  --border-subtle: rgba(56, 189, 248, 0.12);
  --border-glow: rgba(56, 189, 248, 0.35);
  --border-card: rgba(148, 163, 184, 0.1);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Institutional Accents */
  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-primary-subtle: rgba(37, 99, 235, 0.18);

  --accent-cyan: #38bdf8;
  --accent-cyan-subtle: rgba(56, 189, 248, 0.15);

  --accent-emerald: #10b981;
  --accent-emerald-subtle: rgba(16, 185, 129, 0.15);

  --accent-amber: #f59e0b;
  --accent-amber-subtle: rgba(245, 158, 11, 0.15);

  --accent-rose: #ef4444;
  --accent-rose-subtle: rgba(239, 68, 68, 0.15);

  --accent-purple: #818cf8;

  --sidebar-width: 240px;
  --header-height: 74px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  --shadow-subtle: 0 10px 30px -5px rgba(2, 6, 23, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-glow: 0 0 35px -5px rgba(37, 99, 235, 0.35);
  --backdrop-blur: blur(20px);
}

/* Light Theme Mode */
[data-theme="light"] {
  --bg-primary: #f0f4f9;
  --bg-primary-gradient: radial-gradient(at 15% 15%, rgba(37, 99, 235, 0.08) 0px, transparent 55%),
                         radial-gradient(at 85% 10%, rgba(14, 165, 233, 0.06) 0px, transparent 50%);
  --bg-surface: #ffffff;
  --bg-surface-elevated: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-hover: #f8fafc;
  
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-glow: rgba(37, 99, 235, 0.25);
  --border-card: rgba(15, 23, 42, 0.07);

  --text-main: #0b1a30;
  --text-muted: #475569;
  --text-dim: #64748b;

  --accent-primary: #1d4ed8;
  --accent-primary-hover: #1e40af;
  --accent-primary-subtle: rgba(37, 99, 235, 0.1);
  --shadow-subtle: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.05);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: var(--bg-primary-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* App Container Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation - Radiant Light Blue Design */
.sidebar {
  width: var(--sidebar-width);
  background: radial-gradient(circle at 10% 5%, rgba(56, 189, 248, 0.28) 0%, transparent 45%),
              radial-gradient(circle at 90% 90%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
              linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 35%, #dbeafe 70%, #cce3fd 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1.5px solid rgba(56, 189, 248, 0.35);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  box-shadow: 4px 0 30px rgba(2, 132, 199, 0.15);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  background: radial-gradient(circle at 85% 25%, rgba(56, 189, 248, 0.4) 0%, transparent 55%),
              linear-gradient(135deg, #0a2560 0%, #173b8a 45%, #0284c7 100%);
  border-bottom: 1.5px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 4px 20px rgba(10, 37, 96, 0.25);
  position: relative;
  z-index: 10;
}

.sidebar-nav {
  padding: 1.25rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0369a1;
  padding: 0.75rem 0.65rem 0.25rem;
  font-weight: 800;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  color: #0f2b5c;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  border: 1px solid transparent;
}

.nav-item svg {
  color: #0284c7;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.85);
  color: #0284c7;
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateX(4px);
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.12);
}

.nav-item:hover svg {
  color: #0284c7;
  transform: scale(1.08);
}

.nav-item.active {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 50%, #1d4ed8 100%);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.38), 0 0 15px rgba(56, 189, 248, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.nav-item.active svg {
  color: #ffffff !important;
  stroke-width: 2.3;
}

.nav-item .badge {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(14, 165, 233, 0.2);
  color: #0369a1;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.nav-item.active .badge {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #1d4ed8 !important;
  border-color: transparent !important;
}

.sidebar-footer {
  padding: 0.9rem 0.75rem;
  border-top: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(240, 249, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.user-snippet {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08);
}

.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Header - Radiant Blue Design */
.top-header {
  height: var(--header-height);
  background: radial-gradient(circle at 95% 30%, rgba(56, 189, 248, 0.28) 0%, transparent 60%),
              radial-gradient(circle at 10% 50%, rgba(30, 58, 138, 0.4) 0%, transparent 50%),
              linear-gradient(135deg, #091e4a 0%, #133375 45%, #0284c7 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1.5px solid rgba(56, 189, 248, 0.35);
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: 0 4px 25px rgba(2, 6, 23, 0.35), 0 0 15px rgba(2, 132, 199, 0.12);
}

.mobile-nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mobile-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.icon-btn:hover {
  color: var(--text-main);
  border-color: var(--border-glow);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.top-header .icon-btn {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.top-header .icon-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.top-header form button.icon-btn {
  background: rgba(239, 68, 68, 0.2) !important;
  border: 1px solid rgba(248, 113, 113, 0.4) !important;
  color: #ffffff !important;
}

.top-header form button.icon-btn:hover {
  background: rgba(239, 68, 68, 0.5) !important;
  border-color: rgba(248, 113, 113, 0.75) !important;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.45) !important;
}

/* Page Layout */
.page-content {
  padding: 1.35rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 1560px;
  margin: 0 auto;
  width: 100%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #1d4ed8 0%, #0284c7 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 16px rgba(29, 78, 216, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(29, 78, 216, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  border-color: var(--border-glow);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.btn-xs {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-xs.btn-primary {
  background: linear-gradient(135deg, #1d4ed8, #0284c7);
  color: white;
}

.btn-xs.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-xs.btn-secondary:hover {
  border-color: var(--border-glow);
  background: rgba(255, 255, 255, 0.12);
}

/* Premium Glass Cards */
.card, .glass-panel, .kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-subtle);
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-card {
  padding: 1rem 1.15rem;
}

.kpi-card:hover, .card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 12px 35px -5px rgba(2, 6, 23, 0.6), 0 0 25px -5px rgba(56, 189, 248, 0.2);
}

/* Tables & Table Head Theme */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.table, table, .data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.table thead, thead, .data-table thead {
  background: linear-gradient(90deg, #1e3e97 0%, #1c4dd4 100%) !important;
}

.table thead th, thead th, th, .table th, .data-table th {
  padding: 0.65rem 0.95rem !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: #ffffff !important;
  background: linear-gradient(90deg, #1e3e97 0%, #1c4dd4 100%) !important;
  border-bottom: 3px solid #0284c7 !important;
  border-top: none !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  white-space: nowrap;
}

.table thead tr th:first-child, thead tr th:first-child, table thead tr th:first-child {
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: 0;
}

.table thead tr th:last-child, thead tr th:last-child, table thead tr th:last-child {
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: 0;
}

[data-theme="light"] .table thead th, 
[data-theme="light"] thead th, 
[data-theme="light"] th {
  background: linear-gradient(90deg, #1e3e97 0%, #1c4dd4 100%) !important;
  color: #ffffff !important;
  border-bottom: 3px solid #0284c7 !important;
}

.table td {
  padding: 0.65rem 0.95rem;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: rgba(56, 189, 248, 0.05);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-success {
  background: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.25);
}

.badge-info {
  background: var(--accent-cyan-subtle);
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.25);
}

.badge-warning {
  background: var(--accent-amber-subtle);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.25);
}

.badge-danger {
  background: var(--accent-rose-subtle);
  color: var(--accent-rose);
  border-color: rgba(239, 68, 68, 0.25);
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.1);
}

/* Pulsing Dots */
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.pulse-emerald {
  background: var(--accent-emerald);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseEmerald 2s infinite;
}

@keyframes pulseEmerald {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Forms & Inputs */
.form-control, input.form-control, select.form-control, textarea.form-control {
  background: rgba(10, 24, 48, 0.8) !important;
  border: 1px solid rgba(56, 189, 248, 0.18) !important;
  color: var(--text-main) !important;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.form-control:focus, input.form-control:focus, select.form-control:focus, textarea.form-control:focus {
  outline: none;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25), 0 0 20px rgba(56, 189, 248, 0.2) !important;
  background: rgba(14, 32, 60, 0.95) !important;
}

/* Dedicated Brand Blue Styling for Search & Filter Inputs */
input[name="search"],
.search-input,
#filterForm select,
#filterForm .form-control,
select[name="service"],
select[name="commune"],
select[name="statut"],
select[name="active"],
select[name="sort"] {
  background: rgba(29, 78, 216, 0.25) !important;
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  color: #ffffff !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 0 10px rgba(37, 99, 235, 0.15) !important;
}

#filterForm select option,
select[name="service"] option,
select[name="commune"] option,
select[name="statut"] option,
select[name="active"] option,
select[name="sort"] option {
  background: #0a1932 !important;
  color: #ffffff !important;
}

input[name="search"]::placeholder,
.search-input::placeholder {
  color: #93c5fd !important;
  opacity: 0.85;
}

input[name="search"]:focus,
.search-input:focus,
#filterForm select:focus,
#filterForm .form-control:focus,
select[name="service"]:focus,
select[name="commune"]:focus,
select[name="statut"]:focus,
select[name="active"]:focus,
select[name="sort"]:focus {
  background: rgba(30, 64, 175, 0.45) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35), 0 0 20px rgba(37, 99, 235, 0.4) !important;
}

/* Complaint & Request Handling Action Forms */
#action-box select.form-control,
#action-box input.form-control,
#action-box textarea.form-control,
#instruction-box select.form-control,
#instruction-box input.form-control,
#instruction-box textarea.form-control,
#editForm input.form-control,
#editForm select.form-control,
#editForm textarea.form-control,
#editModal input.form-control,
#editModal select.form-control,
#editModal textarea.form-control,
#addModal input.form-control,
#addModal select.form-control,
#addModal textarea.form-control {
  background: rgba(29, 78, 216, 0.25) !important;
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  color: #ffffff !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 0 10px rgba(37, 99, 235, 0.15) !important;
}

#action-box select.form-control option,
#instruction-box select.form-control option,
#editForm select.form-control option,
#editModal select.form-control option,
#addModal select.form-control option {
  background: #0a1932 !important;
  color: #ffffff !important;
}

#action-box select.form-control:focus,
#action-box input.form-control:focus,
#action-box textarea.form-control:focus,
#instruction-box select.form-control:focus,
#instruction-box input.form-control:focus,
#instruction-box textarea.form-control:focus,
#editForm input.form-control:focus,
#editForm select.form-control:focus,
#editForm textarea.form-control:focus,
#editModal input.form-control:focus,
#editModal select.form-control:focus,
#editModal textarea.form-control:focus,
#addModal input.form-control:focus,
#addModal select.form-control:focus,
#addModal textarea.form-control:focus {
  background: rgba(30, 64, 175, 0.45) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35), 0 0 20px rgba(37, 99, 235, 0.4) !important;
}

/* Disable browser default yellow/white autofill background & apply radiant blue */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #0c1c3d inset !important;
  box-shadow: 0 0 0 1000px #0c1c3d inset !important;
  -webkit-text-fill-color: #f8fafc !important;
  caret-color: #38bdf8 !important;
  border-color: #38bdf8 !important;
  transition: background-color 5000s ease-in-out 0s, color 5000s ease-in-out 0s !important;
}

input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #0f224a inset, 0 0 0 3px rgba(56, 189, 248, 0.35), 0 0 20px rgba(56, 189, 248, 0.3) !important;
  box-shadow: 0 0 0 1000px #0f224a inset, 0 0 0 3px rgba(56, 189, 248, 0.35), 0 0 20px rgba(56, 189, 248, 0.3) !important;
  border-color: #38bdf8 !important;
}

/* Filter Pill Group - Radiant Blue Design */
.filter-pill-group {
  display: flex;
  background: linear-gradient(135deg, rgba(10, 37, 96, 0.75) 0%, rgba(2, 132, 199, 0.28) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.filter-btn {
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: #93c5fd;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-btn:hover {
  color: #ffffff;
  background: rgba(56, 189, 248, 0.18);
}

.filter-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 50%, #1d4ed8 100%);
  color: #ffffff;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.45), 0 0 10px rgba(56, 189, 248, 0.35);
}

/* Hover Link */
.hover-underline:hover {
  text-decoration: underline !important;
  color: var(--accent-cyan) !important;
}

/* Pagination System */
.pagination, ul.pagination {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-item {
  display: inline-block;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(10, 24, 48, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}

.page-link:hover {
  color: #ffffff;
  background: rgba(29, 78, 216, 0.3);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.page-item.active .page-link, .page-link.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #1d4ed8 0%, #0284c7 100%) !important;
  border-color: #38bdf8 !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.45);
}

.page-item.disabled .page-link {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
}

/* Layout Grid Helpers */
.dashboard-chart-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.15rem;
  margin-bottom: 1.25rem;
}

.dashboard-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
}

.detail-split-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .main-wrapper {
    margin-left: 0;
  }

  .mobile-nav-toggle {
    display: flex;
  }

  .dashboard-chart-grid, 
  .dashboard-split-grid, 
  .detail-split-grid {
    grid-template-columns: 1fr !important;
  }

  .page-content {
    padding: 1.25rem;
  }
}

@media (max-width: 640px) {
  .top-header {
    padding: 0 1rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   Alert & Notification System • Distinct Warning Types
   ========================================================================== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 1.25rem;
  position: relative;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s ease;
  animation: alertSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes alertSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.shake {
  animation: fieldShake 0.4s ease-in-out;
}

/* Type 1: Warning (Attention / Champ Requis) - Amber Glow */
.alert-warning {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fef3c7;
  box-shadow: 0 4px 20px -3px rgba(245, 158, 11, 0.25);
}

.alert-warning svg,
.alert-warning .alert-icon {
  color: #fbbf24;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Type 2: Danger / Error (Erreur Critique) - Ruby Rose Glow */
.alert-danger,
.alert-error {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fee2e2;
  box-shadow: 0 4px 20px -3px rgba(239, 68, 68, 0.25);
}

.alert-danger svg,
.alert-error svg,
.alert-danger .alert-icon,
.alert-error .alert-icon {
  color: #f87171;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Type 3: Info (Information / Conseil) - Radiant Cyan/Sky */
.alert-info {
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: #e0f2fe;
  box-shadow: 0 4px 20px -3px rgba(14, 165, 233, 0.2);
}

.alert-info svg,
.alert-info .alert-icon {
  color: #38bdf8;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Type 4: Success (Validation / Succès) - Emerald */
.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #d1fae5;
  box-shadow: 0 4px 20px -3px rgba(16, 185, 129, 0.2);
}

.alert-success svg,
.alert-success .alert-icon {
  color: #34d399;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Form Field Inline Warning Badges */
.field-warning-message {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  margin-top: 0.4rem;
  animation: alertSlideIn 0.25s ease-out;
}

.field-warning-message.type-missing {
  color: #fcd34d;
}

.field-warning-message.type-format {
  color: #fdba74;
}

.field-warning-message.type-requirement {
  color: #7dd3fc;
}

.field-warning-message.type-error {
  color: #fca5a5;
}

/* Field States */
.input-warning {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3), 0 0 15px rgba(245, 158, 11, 0.25) !important;
}

.input-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35), 0 0 15px rgba(239, 68, 68, 0.3) !important;
}

