/* ============================================================
   POSPERE — Styles personnalisés
   ============================================================ */

:root {
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 0px;
}

/* === Layout === */
#wrapper {
  min-height: 100vh;
}

#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  transition: width 0.25s ease, transform 0.25s ease;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1030;
  overflow-y: auto;
  overflow-x: hidden;
}

#sidebar.collapsed {
  width: 0;
  overflow: hidden;
}

#page-content {
  margin-left: var(--sidebar-width);
  transition: margin-left 0.25s ease;
  min-height: 100vh;
}

#page-content.expanded {
  margin-left: 0;
}

/* === Sidebar nav === */
#sidebar .nav-link {
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: background 0.15s;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
  background-color: rgba(255, 255, 255, 0.12);
}

#sidebar .nav-link.active {
  background-color: var(--bs-primary);
  font-weight: 600;
}

/* === Cards === */
.stat-card {
  border-radius: 12px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1) !important;
}

/* === Table === */
.table th {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #6c757d;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
}

/* === Badges === */
.badge {
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* === Boutons === */
.btn-xs {
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
}

/* === Avatar === */
.avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 0.75rem;
}

/* === Page content main === */
main {
  background: #f8f9fa;
  min-height: calc(100vh - 57px - 37px);
}

/* === Pagination === */
.pagination .page-link {
  border-radius: 6px;
  margin: 0 1px;
  font-size: 0.8rem;
}

/* === Forms === */
.form-label {
  margin-bottom: 0.3rem;
  color: #495057;
}

.form-control, .form-select {
  border-radius: 8px;
  border-color: #dee2e6;
  font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* === Topbar === */
.navbar {
  min-height: 57px;
}

/* === Alerts === */
.alert {
  border-radius: 10px;
  font-size: 0.875rem;
}

/* === Tabs === */
.nav-tabs .nav-link {
  font-size: 0.875rem;
  color: #6c757d;
  border-radius: 8px 8px 0 0;
}

.nav-tabs .nav-link.active {
  font-weight: 600;
  color: var(--bs-primary);
}

/* === Card header === */
.card-header h6 {
  font-size: 0.875rem;
}

/* === Responsive === */
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
  }

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

  #page-content {
    margin-left: 0 !important;
  }

  .sidebar-overlay {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1029;
  }
}

.sidebar-overlay {
  display: none;
}

/* === Scrollbar sidebar === */
#sidebar::-webkit-scrollbar {
  width: 4px;
}

#sidebar::-webkit-scrollbar-track {
  background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
}

/* === Table row highlight === */
.table-hover > tbody > tr:hover {
  background-color: rgba(13, 110, 253, 0.04);
}
