:root {
  --sidebar-width: 230px;
  --sidebar-collapsed-width: 60px;
  --topbar-height: 52px;
  --sidebar-bg: #134e4a;
  --sidebar-text: #99d6d0;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: rgba(45, 212, 191, 0.18);
  --sidebar-hover-bg: rgba(45, 212, 191, 0.08);
  --brand-color: #2dd4bf;
}

/* ── Layout ─────────────────────────────────────── */
body {
  background: #f0fdfa;
  display: flex;
  min-height: 100vh;
  margin: 0;
}

body.login-page {
  align-items: center;
  justify-content: center;
  background: #f0fdfa;
}

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: width 0.2s ease;
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-width); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: var(--topbar-height);
}

.brand-icon { font-size: 1.4rem; color: var(--brand-color); flex-shrink: 0; }
.brand-name  { font-weight: 700; font-size: 1.05rem; color: #fff; letter-spacing: 0.02em; white-space: nowrap; }

.sidebar.collapsed .brand-name,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-footer span { display: none; }

.sidebar-nav {
  list-style: none;
  padding: 12px 8px;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
  padding: 8px 10px 4px;
  white-space: nowrap;
}

.sidebar-nav .nav-item {
  border-radius: 6px;
  margin-bottom: 2px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.sidebar-nav .nav-link i {
  font-size: 1rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.sidebar-nav .nav-item:hover .nav-link  { background: var(--sidebar-hover-bg); color: #fff; }
.sidebar-nav .nav-item.active .nav-link { background: var(--sidebar-active-bg); color: var(--sidebar-active); font-weight: 600; box-shadow: inset 2px 0 0 var(--brand-color); }

/* Sous-menu — items indentés */
.sidebar-nav .nav-sub .nav-link {
  padding-left: 28px;
  font-size: 0.82rem;
}

.sidebar-nav .nav-sub .nav-link i { font-size: 0.85rem; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  font-size: 0.8rem;
}

/* ── Main wrapper ─────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.2s ease;
}

.main-wrapper.sidebar-collapsed { margin-left: var(--sidebar-collapsed-width); }

/* ── Topbar ─────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar .breadcrumb { font-size: 0.82rem; }
.sidebar-toggle { color: #6c757d; padding: 4px 8px; margin-right: 4px; }

/* ── Content ─────────────────────────────────────── */
.content { padding: 24px; flex: 1; }

/* ── Page header ─────────────────────────────────── */
.page-header h1 { font-size: 1.25rem; font-weight: 700; color: #1a1d23; }

/* ── Cards & Tables ─────────────────────────────── */
.card { border: 1px solid #e9ecef; border-radius: 10px; }

.table th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
}

/* ── Brand overrides Bootstrap ───────────────────── */
.btn-dark {
  background-color: #134e4a;
  border-color: #134e4a;
  color: #fff;
}
.btn-dark:hover, .btn-dark:focus, .btn-dark:active,
.btn-dark:first-child:active {
  background-color: #0d3835;
  border-color: #0d3835;
  color: #fff;
}

.card-header.bg-dark {
  background-color: #134e4a !important;
  border-bottom-color: #1a6b65 !important;
}

/* Bootstrap 5 table variants */
thead.table-dark {
  --bs-table-bg: #134e4a;
  --bs-table-color: #ffffff;
  --bs-table-border-color: #1a6b65;
}
thead.table-dark th { color: #ffffff; }

thead.table-light {
  --bs-table-bg: #e6faf8;
  --bs-table-color: #134e4a;
  --bs-table-border-color: #b2e8e4;
}
thead.table-light th { color: #134e4a; }

/* ── Login ─────────────────────────────────────── */
.login-wrapper { width: 100%; max-width: 380px; padding: 16px; }
.login-card { border: 1px solid #dee2e6; border-radius: 12px; }
.login-icon { font-size: 2rem; color: var(--brand-color); }

/* ── Sidebar collapsed ─────────────────────────── */
.sidebar.collapsed .sidebar-nav .nav-link { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 12px; }
