/* ============================================================
   ADMIN THEME - Services Publics
   Professionnel, moderne, accessible
   ============================================================ */

:root {
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --success: #198754;
  --success-dark: #15603d;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #0dcaf0;
  --light: #f8f9fa;
  --dark: #212529;
  --muted: #6c757d;
  --border: #dee2e6;
  --card-bg: #ffffff;
  --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body.admin-layout {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: var(--dark);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navbar professionnel */
.navbar {
  background: linear-gradient(to right, #1a1f3a, #1e2a47);
  box-shadow: var(--shadow-lg);
  border-bottom: 3px solid var(--primary);
}

.navbar-dark .navbar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.brand-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: white;
}

/* Sidebar */
.sidebar {
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  min-height: 100vh;
  padding-top: 1rem;
  overflow-y: auto;
}

.sidebar .nav-link {
  color: var(--muted);
  padding: 0.625rem 0.875rem;
  border-radius: 6px;
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
  background: linear-gradient(90deg, rgba(13, 110, 253, 0.08), transparent);
  color: var(--primary);
  border-left-color: var(--primary);
}

.sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(13, 110, 253, 0.15), transparent);
  color: var(--primary);
  font-weight: 500;
  border-left-color: var(--primary);
}

.sidebar .nav-link i {
  width: 1.25rem;
  text-align: center;
  margin-right: 0.5rem;
}

.sidebar hr {
  margin: 0.75rem 0;
  opacity: 0.3;
}

/* Main content */
main {
  flex: 1;
  background: transparent;
}

/* Cards */
.card {
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

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

.card-header {
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.05), transparent);
  border-radius: 11px 11px 0 0;
}

/* Stat Cards */
.stat-box {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.stat-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-box .stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-box .stat-label {
  font-size: 0.8rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

/* Badge animations */
.badge {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-weight: 500;
}

/* Buttons */
.btn {
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

/* Tables */
table {
  font-size: 0.95rem;
}

.table th {
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), transparent);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.table td {
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: rgba(13, 110, 253, 0.03);
}

/* Widget boxes */
.widget-box {
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.widget-header {
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.08), transparent);
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--dark);
}

.widget-header i {
  margin-right: 0.5rem;
  color: var(--primary);
}

.widget-body {
  padding: 1.25rem;
}

/* Chart containers */
.chart-container {
  position: relative;
  height: 300px;
  margin-bottom: 1rem;
}

/* Footer */
.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: auto;
  padding: 1.5rem;
}

/* Responsive */
@media (max-width: 991px) {
  #adminSidebar {
    position: fixed;
    z-index: 1050;
    left: -300px;
    top: 56px;
    width: 300px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    transition: left 0.25s ease;
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
  }
  
  #adminSidebar.open {
    left: 0;
  }
  
  main {
    margin-left: 0;
  }
}

@media (max-width: 576px) {
  .stat-box .stat-value {
    font-size: 1.8rem;
  }
  
  .action-btn-group {
    flex-direction: column;
  }
  
  .action-btn-group .btn {
    width: 100%;
  }
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: slideIn 0.3s ease-out;
}

/* Accessibility */
a:focus, button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .sidebar, .navbar, .footer {
    display: none;
  }
  
  main {
    margin-left: 0;
  }
}
