﻿/* ============================================
   STOCK V2 — PROFESSIONAL DESIGN SYSTEM v2
   Bootstrap 5 + AdminLTE Inspired | Expert UI
   ============================================ */

/* ---------- Tabs (Bootstrap) — garantit un seul panneau visible ---------- */
.tab-pane:not(.active) { display: none !important; }
.tab-pane.active { display: block; }

/* ---------- Design Tokens ---------- */
:root {
  /* Brand — Indigo pro */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-rgb: 79, 70, 229;

  --secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;

  /* Surfaces */
  --bg-body: #f8fafc;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-navbar: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #ffffff;

  /* Text */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-inverse: #ffffff;

  /* Borders & radius */
  --border: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Fonts */
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-size-base: 0.9375rem;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 0.2s var(--ease);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  color: var(--text-main);
  background-color: var(--bg-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}
h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--text-main); letter-spacing: -0.02em; line-height: 1.25; margin-bottom: 0.5rem; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }

/* ---------- Layout ---------- */
.layout-fixed { height: 100vh; overflow: hidden; }
.layout-fixed > .app-wrapper { width: 100%; max-width: 100%; }
.app-wrapper { display: flex; width: 100%; height: 100vh; overflow: hidden; }
.app-main { flex: 1; display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: var(--bg-body); }
.app-content { flex: 1; overflow-y: auto; padding: 1.75rem 2rem 3rem; }
.app-content > .container-fluid:first-child { padding-top: 0; }

/* page progress bar */
.page-progress { position: absolute; top: 0; left: 0; height: 3px; width: 40%; background: var(--primary); border-radius: 0 2px 2px 0; z-index: 1090; opacity: 0; transition: none; }
.page-progress.is-active { opacity: 1; animation: page-progress 1s ease-in-out infinite; }
@keyframes page-progress { 0% { left: -40%; } 100% { left: 100%; } }

/* ---------- Sidebar ---------- */
.app-sidebar {
  width: 260px; min-width: 260px;
  background: linear-gradient(180deg, #0b1120 0%, #0f172a 100%);
  color: #cbd5e1;
  display: flex; flex-direction: column;
  height: 100vh; overflow-y: auto;
  transition: width 0.25s var(--ease), transform 0.25s var(--ease);
  z-index: 1030; box-shadow: 2px 0 10px rgb(0 0 0 / 0.1);
}
.app-sidebar.collapsed { width: 80px; min-width: 80px; }
.app-sidebar.collapsed .brand-name,
.app-sidebar.collapsed .nav-link span,
.app-sidebar.collapsed .nav-header span { display: none; }
.app-sidebar.collapsed .sidebar-brand { justify-content: center; padding: 1.1rem 0.6rem; }
.app-sidebar.collapsed .nav-link { justify-content: center; padding: 0.85rem 0; }

/* Styles de sidebar configurables */
body[data-sidebar="light"] .app-sidebar {
  background: var(--sidebar-custom, #ffffff); color: #334155;
  border-right: 1px solid var(--border);
}
body[data-sidebar="light"] .app-sidebar .sidebar-brand { border-bottom: 1px solid var(--border); }
body[data-sidebar="light"] .app-sidebar .brand-name { color: var(--text-main); }
body[data-sidebar="light"] .app-sidebar .brand-link i { color: var(--primary); }
body[data-sidebar="light"] .app-sidebar .nav-link { color: var(--text-muted); }
body[data-sidebar="light"] .app-sidebar .nav-link:hover { background: #f1f5f9; color: var(--text-main); }
body[data-sidebar="light"] .app-sidebar .nav-link.active { background: var(--primary-light); color: var(--primary); }
body[data-sidebar="light"] .app-sidebar .nav-link i { color: var(--text-light); }
body[data-sidebar="light"] .app-sidebar .nav-link.active i { color: var(--primary); }
body[data-sidebar="light"] .app-sidebar .nav-header { color: var(--text-light); }
body[data-sidebar="gradient"] .app-sidebar {
  background: linear-gradient(180deg, var(--primary) 0%, var(--sidebar-custom, #1e293b) 130%);
}
body[data-sidebar="gradient"] .app-sidebar .nav-link:hover,
body[data-sidebar="gradient"] .app-sidebar .nav-link.active { background: rgba(255,255,255,0.12); }

/* Densités configurables */
body[data-density="compact"] .app-content { padding: 1rem 1.25rem 1.75rem; }
body[data-density="compact"] .card-body { padding: 0.9rem; }
body[data-density="compact"] .card-header { padding: 0.6rem 1rem; }
body[data-density="compact"] .app-navbar { height: 58px; }
body[data-density="compact"] .table td { padding: 0.5rem 0.75rem; }
body[data-density="compact"] .table th { padding: 0.5rem 0.75rem; }
body[data-density="compact"] .page-header { margin-bottom: 1rem; padding: 0.75rem 1rem; }
body[data-density="spacious"] .app-content { padding: 2.25rem 2.5rem 3.5rem; }
body[data-density="spacious"] .card-body { padding: 1.8rem; }
body[data-density="spacious"] .app-navbar { height: 78px; }
body[data-density="spacious"] .table td { padding: 1.15rem 1.25rem; }
body[data-density="spacious"] .table th { padding: 1rem 1.25rem; }

.sidebar-brand { padding: 1.3rem 1.25rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.06); display: flex; align-items: center; gap: 0.75rem; }
.sidebar-brand .brand-link { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; }
.sidebar-brand .brand-name { font-size: 1.15rem; font-weight: 800; color: #fff; white-space: nowrap; letter-spacing: -0.01em; }
.sidebar-brand i { font-size: 1.35rem; color: rgba(199, 210, 250, 0.9); }

.sidebar-menu { padding: 0.75rem; flex: 1; }
.sidebar-menu .nav-item { margin: 0.15rem 0.4rem; }
.sidebar-menu .nav-link {
  color: var(--text-muted);
  padding: 0.55rem 0.8rem;
  font-size: 0.86rem;
  font-weight: 500;
  border-radius: 8px;
  border-left: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease;
  display: flex; align-items: center; gap: 0.7rem; text-decoration: none;
}
.sidebar-menu .nav-link i { font-size: 1.05rem; width: 22px; text-align: center; flex-shrink: 0; color: var(--text-light); }
.sidebar-menu .nav-link:hover { color: var(--text-main); background: #f1f5f9; }
.sidebar-menu .nav-link.active { color: var(--primary); background: var(--primary-light); border-left-color: var(--primary); }
.sidebar-menu .nav-link.active i { color: var(--primary); }
.nav-header { padding: 0.9rem 1rem 0.4rem; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-light); }
.sidebar-backdrop { display: none; }

/* ---------- Navbar ---------- */
.app-navbar {
  background: var(--bg-navbar);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: space-between;
  height: 70px; padding: 0 1.5rem; position: sticky; top: 0; z-index: 1040;
}
.app-navbar .breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.02em; margin-bottom: 0; }
.app-navbar .breadcrumb a { color: var(--text-muted); text-decoration: none; transition: var(--transition); }
.app-navbar .breadcrumb a:hover { color: var(--primary); }
.app-navbar .breadcrumb i { color: var(--text-light); font-size: 0.6rem; line-height: 1; }
.app-navbar .breadcrumb span { color: var(--text-main); }
.navbar-start, .navbar-end { display: flex; align-items: center; gap: 0.6rem; }

.btn-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #fff; color: var(--text-muted);
  cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.95rem;
}
.btn-icon:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn-user {
  display: inline-flex; align-items: center; gap: 0.65rem;
  background: var(--bg-body); border: 1px solid var(--border); border-radius: var(--radius-full);
  padding: 0.42rem 0.95rem; transition: var(--transition);
}
.btn-user:hover { background: var(--border); border-color: var(--primary); color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-user .user-avatar {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  background: var(--primary); color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: 0.8rem; flex-shrink: 0;
}
.btn-user .user-name { font-size: 0.85rem; font-weight: 700; color: var(--text-main); white-space: nowrap; }
.btn-user .bi-chevron-down { font-size: 0.6rem; color: var(--text-light); margin-left: 0.15rem; }

/* ---------- Page header ---------- */
.page-header {
  background: rgba(255,255,255,0.6); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0; margin-bottom: 1.5rem;
}
.page-header .container-fluid { padding-right: 0; padding-left: 0; }
.page-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text-main); margin-bottom: 0.25rem; }
.page-subtitle { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0; }
.page-actions { display: flex; align-items: center; gap: 0.75rem; }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); background: var(--bg-card);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card.hoverable:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-header {
  background: transparent; border-bottom: 1px solid var(--border);
  padding: 1.1rem 1.4rem;
}
.card-header h5, .card-header h6 { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
.card-body { padding: 1.4rem; }
.card-footer { background: var(--bg-body); border-top: 1px solid var(--border); padding: 1rem 1.4rem; }

/* ---------- KPI ---------- */
.kpi-card {
  position: relative; overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  background: var(--bg-card); transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), #818cf8);
}
.kpi-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.35rem; flex-shrink: 0;
}
.kpi-value { font-size: 1.85rem; font-weight: 800; color: var(--text-main); line-height: 1.1; letter-spacing: -0.02em; }
.kpi-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-delta { font-size: 0.78rem; font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  font-weight: 700; border-radius: var(--radius-sm);
  padding: 0.55rem 1.25rem; font-size: 0.9rem;
  border: none; transition: var(--transition); display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn i { font-size: 0.9em; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 3px 6px rgb(79 70 229 / 0.25); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 12px rgb(79 70 229 / 0.35); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #475569; color: #fff; }
.btn-outline-secondary {
  background: #fff; color: var(--secondary); border: 1px solid var(--border);
}
.btn-outline-secondary:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.btn-outline-primary {
  background: #fff; color: var(--primary); border: 1px solid var(--primary);
}
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-outline-danger { background: #fff; color: var(--danger); border: 1px solid #fecaca; }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }
.btn-outline-success { background: #fff; color: var(--success); border: 1px solid #a7f3d0; }
.btn-outline-success:hover { background: var(--success); color: #fff; }
.btn-outline-info { background: #fff; color: var(--info); border: 1px solid #bae6fd; }
.btn-outline-info:hover { background: var(--info); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-sm { border-radius: 8px; padding: 0.4rem 0.9rem; font-size: 0.82rem; }
.btn-lg { border-radius: 10px; padding: 0.75rem 1.7rem; font-size: 1rem; }

/* ---------- Forms ---------- */
.form-label { font-size: 0.85rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.4rem; letter-spacing: 0.01em; }
.form-control, .form-select {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem; font-size: 0.92rem; background: var(--bg-input);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 0.2rem rgb(79 70 229 / 0.12); outline: none;
}
.form-control::placeholder { color: var(--text-light); }
.form-text { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.35rem; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { border-color: var(--primary); box-shadow: 0 0 0 0.2rem rgb(79 70 229 / 0.12); }
.input-group-text { border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted); }
.input-group .form-control { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group .input-group-text { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); border-right: none; }

/* ---------- Tables ---------- */
.table {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-card);
  border-collapse: separate; border-spacing: 0; font-size: 0.9rem;
}
.table thead th {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
  background: var(--bg-body); border-bottom: 1px solid var(--border);
  padding: 0.8rem 1rem;
}
.table tbody td {
  padding: 0.9rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle;
}
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive::-webkit-scrollbar { height: 8px; }

/* ---------- DataTables ---------- */
table.dataTable thead th, table.dataTable thead td {
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 0.72rem; color: var(--text-muted);
  background: var(--bg-body); border-bottom: 1px solid var(--border);
}
table.dataTable tbody tr { background: var(--bg-card); }
table.dataTable tbody tr:nth-child(even) { background: #f8fafc; }
table.dataTable tbody tr:hover { background: var(--primary-light); }
table.dataTable tbody td {
  border-bottom: 1px solid #f1f5f9; padding: 0.85rem 1rem;
  vertical-align: middle;
}
div.dataTables_wrapper div.dataTables_length select {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem; background: var(--bg-input);
}
div.dataTables_wrapper div.dataTables_filter input {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.45rem 0.8rem; background: var(--bg-input);
}
div.dataTables_wrapper div.dataTables_filter input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 0.2rem rgb(79 70 229 / 0.12); outline: none;
}
div.dataTables_wrapper div.dataTables_paginate .paginate_button {
  border-radius: var(--radius-sm); margin: 0 2px;
  border: 1px solid var(--border); color: var(--text-main);
  background: var(--bg-card); transition: var(--transition);
}
div.dataTables_wrapper div.dataTables_paginate .paginate_button.current {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
div.dataTables_wrapper div.dataTables_paginate .paginate_button:hover {
  background: var(--primary-light); color: var(--primary); border-color: var(--primary);
}
div.dataTables_wrapper div.dataTables_info { color: var(--text-muted); font-size: 0.85rem; }
div.dataTables_wrapper div.dataTables_processing {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-main);
}

/* ---------- Badges ---------- */
.badge {
  border-radius: var(--radius-full); font-weight: 700;
  font-size: 0.72rem; padding: 0.32em 0.75em; display: inline-flex; align-items: center; gap: 0.4em;
}
.badge.bg-primary { background: var(--primary-light); color: var(--primary); }
.badge.bg-success { background: #d1fae5; color: #065f46; }
.badge.bg-warning { background: #fef3c7; color: #92400e; }
.badge.bg-danger { background: #fee2e2; color: #991b1b; }
.badge.bg-info { background: #dbeafe; color: #1d4ed8; }
.badge.bg-secondary { background: var(--border); color: var(--text-muted); }
.badge.bg-dark { background: var(--text-main); color: #fff; }

/* ---------- Alerts ---------- */
.alert {
  border: none; border-radius: var(--radius-sm);
  padding: 1rem 1.25rem; font-size: 0.9rem; box-shadow: var(--shadow-sm);
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #dbeafe; color: #1d4ed8; }

/* ---------- Progress ---------- */
.progress { border-radius: var(--radius-full); height: 8px; background: var(--border); }
.progress-bar { border-radius: var(--radius-full); }

/* ---------- Charts ---------- */
.chart-box { position: relative; min-height: 240px; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 3.5rem 1rem; }
.empty-state-icon { width: 72px; height: 72px; background: var(--border); border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--text-light); margin-bottom: 1.25rem; }
.empty-state-title { font-size: 1.05rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.5rem; }
.empty-state-text { font-size: 0.9rem; color: var(--text-muted); max-width: 28rem; margin: 0 auto; }

/* ---------- Animations ---------- */
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeSlideIn 0.4s ease-out both; }

/* ---------- Global search ---------- */
.gs-group { margin-bottom: 0.5rem; }
.gs-group-header {
  padding: 0.75rem 1rem 0.25rem; font-size: 0.68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted);
  display: flex; align-items: center; gap: 0.5rem;
}
.gs-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.8rem 1rem; border-bottom: 1px solid #f1f5f9;
  text-decoration: none; color: var(--text-main); transition: background 0.15s;
}
.gs-item:hover, .gs-item:focus { background: #f8fafc; color: var(--text-main); }
.gs-item-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--primary-light); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0;
}
.gs-item-body { flex: 1; min-width: 0; }
.gs-item-title { display: block; font-size: 0.9rem; font-weight: 700; color: var(--text-main); }
.gs-item-sub { display: block; font-size: 0.78rem; color: var(--text-muted); }
.gs-item-meta { font-size: 0.72rem; color: var(--text-light); white-space: nowrap; }

/* ---------- Autocomplete ---------- */
.ac-wrapper { position: relative; }
.ac-wrapper .ac-spinner {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 0.9rem; height: 0.9rem;
}
.ac-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1080;
  background: #fff; border: 1px solid rgba(15,23,42,0.1); border-radius: var(--radius-sm);
  max-height: 280px; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.ac-item {
  padding: 0.5rem 0.7rem; cursor: pointer; border-bottom: 1px solid rgba(15,23,42,0.04);
  display: flex; justify-content: space-between; gap: 0.5rem; align-items: center;
}
.ac-item:hover, .ac-item.active { background: var(--primary-light); }
.ac-item .ac-label { font-size: 0.84rem; font-weight: 600; color: var(--text-main); }
.ac-item .ac-sub { font-size: 0.74rem; color: var(--text-muted); }
.ac-item .ac-extra { font-size: 0.72rem; color: var(--text-light); white-space: nowrap; }
.ac-empty { padding: 0.65rem 0.7rem; font-size: 0.8rem; color: var(--text-muted); text-align: center; }

/* ---------- Auth ---------- */
.auth-page { min-height: 100vh; background: var(--bg-body); }
.auth-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-container { width: 100%; max-width: 420px; }
.auth-grid { display: block; }
.auth-brand { display: none; }
.auth-form-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 2.25rem; }
.auth-form-wrapper { max-width: 340px; width: 100%; margin: 0 auto; }
.auth-form-header { margin-bottom: 1.75rem; text-align: center; }
.auth-title { font-size: 1.4rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.4rem; letter-spacing: -0.01em; }
.auth-subtitle { font-size: 0.88rem; color: var(--text-muted); }
.login-card { background: transparent; border: none; box-shadow: none; }
.login-body { padding: 0; }

/* ---------- Avatar / user ---------- */
.user-avatar { width: 32px; height: 32px; border-radius: var(--radius-full); background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.8rem; }
.user-name { font-size: 0.85rem; font-weight: 700; color: var(--text-main); }

/* ---------- Footer ---------- */
.app-footer {
  margin-top: auto; border-top: 1px solid var(--border);
  background: var(--bg-navbar); color: var(--text-muted);
  font-size: 0.8rem; padding: 1rem 0; box-shadow: 0 -1px 2px rgb(0 0 0 / 0.03);
}
.app-footer .footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.app-footer .footer-brand { font-weight: 800; color: var(--text-main); font-size: 0.9rem; letter-spacing: -0.01em; }
.app-footer .footer-links { display: flex; align-items: center; gap: 1.5rem; font-size: 0.8rem; }
.app-footer .footer-links a { color: var(--text-muted); text-decoration: none; transition: var(--transition); }
.app-footer .footer-links a:hover { color: var(--primary); }
.app-footer .footer-divider { width: 1px; height: 14px; background: var(--border); }
.app-footer .version-badge {
  font-size: 0.72rem; font-weight: 800; color: #fff;
  background: var(--primary); padding: 0.18rem 0.65rem; border-radius: var(--radius-full); letter-spacing: 0.03em;
}

/* ---------- Polish : refinements pro ---------- */
::selection { background: var(--primary-light); color: var(--primary); }

/* Typographie : échelle + rendu */
h1, h2, h3, h4, h5, h6 { text-wrap: balance; }
.section-label { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }

/* Composants : cartes / en-têtes cohérents */
.card-header { min-height: 0; }
.card-title { font-size: 0.95rem; letter-spacing: -0.01em; }

/* Micro-interactions */
.table tbody tr { transition: background 0.15s ease; }
.btn { will-change: transform; }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible,
a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
a { transition: color var(--transition-fast), background var(--transition-fast); }

/* Détails de table */
.table thead th { white-space: nowrap; }
.table td { line-height: 1.45; }

/* KPI : nombre aligné */
.kpi-value { font-variant-numeric: tabular-nums; }

/* Formulaires : espacement + focus */
.form-label { line-height: 1.3; }
.form-control:disabled, .form-select:disabled, .form-control[readonly] { opacity: 0.7; }

/* Badges plus lisibles */
.badge { line-height: 1.4; }

/* Scrollbar + lissage */
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .auth-grid { grid-template-columns: 1fr; max-width: 520px; }
  .auth-brand { display: none; }
  .auth-form-section { padding: 2rem; }
  .app-sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform 0.25s var(--ease); width: 260px !important; min-width: 260px; z-index: 1050; }
  .app-sidebar.mobile-open { transform: translateX(0); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 1045; opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease); }
  .sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; }
}
@media (max-width: 768px) {
  .kpi-value { font-size: 1.5rem; }
  .page-title { font-size: 1.3rem; }
  .app-navbar { padding: 0 1rem; }
  .app-content { padding: 1rem 1rem 2rem; }
}

/* ---------- Print ---------- */
@media print {
  .sidebar, .app-sidebar, .navbar, .app-navbar, .btn, .no-print { display: none !important; }
  .card { box-shadow: none; border: 1px solid var(--border); }
  body { background: #fff; }
}

/* ---------- Dark mode ---------- */
[data-bs-theme="dark"] {
  --bg-body: #0b1120;
  --bg-sidebar: #020617;
  --bg-sidebar-hover: #1e293b;
  --bg-navbar: #0f172a;
  --bg-card: #0f172a;
  --bg-input: #1e293b;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --border: #1e293b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5);
}
[data-bs-theme="dark"] body { background-color: var(--bg-body); color: var(--text-main); }
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .kpi-card,
[data-bs-theme="dark"] .table,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .dropdown-menu { background-color: var(--bg-card); border-color: var(--border); color: var(--text-main); }
[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer,
[data-bs-theme="dark"] .page-header,
[data-bs-theme="dark"] .app-navbar,
[data-bs-theme="dark"] .app-footer { background-color: var(--bg-navbar); border-color: var(--border); }
[data-bs-theme="dark"] .table thead th { background: var(--bg-body); color: var(--text-muted); border-color: var(--border); }
[data-bs-theme="dark"] .table tbody td { border-color: var(--border); }
[data-bs-theme="dark"] .table tbody tr:hover { background: #16213a; }
[data-bs-theme="dark"] table.dataTable tbody tr:hover { background: #16213a; }
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text { background: var(--bg-input); border-color: var(--border); color: var(--text-main); }
[data-bs-theme="dark"] .form-control::placeholder { color: var(--text-light); }
[data-bs-theme="dark"] .btn-icon,
[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] .btn-outline-primary,
[data-bs-theme="dark"] .btn-outline-danger,
[data-bs-theme="dark"] .btn-outline-success,
[data-bs-theme="dark"] .btn-outline-info,
[data-bs-theme="dark"] .btn-outline-dark { background: var(--bg-input); border-color: var(--border); color: var(--text-muted); }
[data-bs-theme="dark"] .btn-outline-secondary:hover { background: var(--primary-light); color: var(--primary); }
[data-bs-theme="dark"] .badge.bg-secondary { background: var(--bg-input); color: var(--text-muted); }
[data-bs-theme="dark"] .badge.bg-primary { background: rgb(79 70 229 / 0.2); color: #a5b4fc; }
[data-bs-theme="dark"] .badge.bg-success { background: rgb(16 185 129 / 0.15); color: #6ee7b7; }
[data-bs-theme="dark"] .badge.bg-warning { background: rgb(245 158 11 / 0.15); color: #fcd34d; }
[data-bs-theme="dark"] .badge.bg-danger { background: rgb(239 68 68 / 0.15); color: #fca5a5; }
[data-bs-theme="dark"] .badge.bg-info { background: rgb(6 182 212 / 0.15); color: #67e8f9; }
[data-bs-theme="dark"] .btn-user { background: var(--bg-input); border-color: var(--border); color: var(--text-main); }
[data-bs-theme="dark"] .btn-user .user-name { color: var(--text-main); }
[data-bs-theme="dark"] .page-progress { background: var(--primary); }
[data-bs-theme="dark"] .empty-state-icon { background: var(--bg-input); }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; border-color: var(--bg-body); }

/* ===== Dark mode : couverture étendue (élimine les zones blanches) ===== */
[data-bs-theme="dark"] .bg-white { background-color: var(--bg-card) !important; }
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table > thead > tr > th { background: var(--bg-body) !important; color: var(--text-muted) !important; }
[data-bs-theme="dark"] .card-header.bg-white { background-color: var(--bg-navbar) !important; }
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer { background: var(--bg-card); border-color: var(--border); }
[data-bs-theme="dark"] .modal-body { background: var(--bg-card); }
[data-bs-theme="dark"] .dropdown-item { color: var(--text-main); }
[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus { background: var(--bg-input); color: var(--primary); }
[data-bs-theme="dark"] .dropdown-header { color: var(--text-muted); }
[data-bs-theme="dark"] .dropdown-divider { border-color: var(--border); }
[data-bs-theme="dark"] .list-group-item { background: var(--bg-card); border-color: var(--border); color: var(--text-main); }
[data-bs-theme="dark"] .accordion-button { background: var(--bg-card); color: var(--text-main); }
[data-bs-theme="dark"] .accordion-body { background: var(--bg-card); color: var(--text-main); }
[data-bs-theme="dark"] .form-floating > label { color: var(--text-muted); }
[data-bs-theme="dark"] .form-floating > .form-control:focus ~ label,
[data-bs-theme="dark"] .form-floating > .form-control:not(:placeholder-shown) ~ label { color: var(--primary); }
[data-bs-theme="dark"] code,
[data-bs-theme="dark"] pre { background: var(--bg-input); color: var(--primary-light); border-radius: 6px; }
[data-bs-theme="dark"] .text-dark { color: var(--text-main) !important; }
[data-bs-theme="dark"] .text-secondary { color: var(--text-muted) !important; }
[data-bs-theme="dark"] .form-check-label { color: var(--text-main); }
[data-bs-theme="dark"] .nav-tabs .nav-link { color: var(--text-muted); }
[data-bs-theme="dark"] .nav-tabs .nav-link.active { background: var(--bg-card); color: var(--primary); border-color: var(--border) var(--border) var(--bg-card); }
[data-bs-theme="dark"] .nav-tabs .nav-link:hover { color: var(--primary); }
[data-bs-theme="dark"] .border { border-color: var(--border) !important; }
[data-bs-theme="dark"] .shadow-sm,
[data-bs-theme="dark"] .shadow,
[data-bs-theme="dark"] .shadow-lg { box-shadow: var(--shadow-sm) !important; }
[data-bs-theme="dark"] .avatar-sm,
[data-bs-theme="dark"] .kpi-icon { color: var(--text-muted); }
[data-bs-theme="dark"] .page-title { color: var(--text-main); }
[data-bs-theme="dark"] .page-subtitle { color: var(--text-muted); }
[data-bs-theme="dark"] .breadcrumb-item,
[data-bs-theme="dark"] .breadcrumb-item a { color: var(--text-muted); }
[data-bs-theme="dark"] .breadcrumb-item.active { color: var(--text-main); }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
[data-bs-theme="dark"] input[type="date"],
[data-bs-theme="dark"] input[type="time"] { color-scheme: dark; }

/* Dark mode : DataTables (évite les zones blanches) */
[data-bs-theme="dark"] table.dataTable,
[data-bs-theme="dark"] table.dataTable tbody tr,
[data-bs-theme="dark"] table.dataTable tbody td { background-color: var(--bg-card) !important; color: var(--text-main); }
[data-bs-theme="dark"] table.dataTable thead th { background: var(--bg-body) !important; color: var(--text-muted); }
[data-bs-theme="dark"] table.dataTable tbody tr:hover,
[data-bs-theme="dark"] table.dataTable tbody tr.odd:hover,
[data-bs-theme="dark"] table.dataTable tbody tr.even:hover { background-color: #16213a !important; }
[data-bs-theme="dark"] div.dataTables_wrapper .dataTables_filter input,
[data-bs-theme="dark"] div.dataTables_wrapper .dataTables_length select { background: var(--bg-input); border-color: var(--border); color: var(--text-main); }
[data-bs-theme="dark"] div.dataTables_wrapper .dataTables_info,
[data-bs-theme="dark"] div.dataTables_wrapper .dataTables_filter label,
[data-bs-theme="dark"] div.dataTables_wrapper .dataTables_length label { color: var(--text-muted); }

/* Dark mode : pagination Bootstrap/DataTables */
[data-bs-theme="dark"] .pagination .page-link { background: var(--bg-card); border-color: var(--border); color: var(--text-main); }
[data-bs-theme="dark"] .pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
[data-bs-theme="dark"] .pagination .page-link:hover { background: var(--bg-input); color: var(--primary); }
[data-bs-theme="dark"] .pagination .page-item.disabled .page-link { background: var(--bg-card); color: var(--text-light); }

/* theme toggle */
.theme-toggle { cursor: pointer; }

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); border: 2px solid var(--bg-body); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------- Select2 custom theme ---------- */
.select2-container .select2-selection--single,
.select2-container--bootstrap-5 .select2-selection--single {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--bg-input) !important;
  height: auto !important;
  min-height: 44px !important;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  color: var(--text-main) !important;
  padding: 0.65rem 0.95rem !important;
  line-height: 1.4 !important;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
  color: var(--text-muted) !important;
  top: 10px !important;
}
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
}
.select2-container--bootstrap-5 .select2-results__option {
  padding: 0.65rem 0.95rem !important;
  font-size: 0.9rem !important;
}
.select2-container--bootstrap-5 .select2-results__option--highlighted {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
}
.select2-container--bootstrap-5 .select2-results__option[aria-selected=true] {
  background: var(--border) !important;
  color: var(--text-main);
  font-weight: 700;
}
.select2-dropdown {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-lg) !important;
  margin-top: 4px !important;
}
/* ============================================================
   POLISH — raffinement de la cohérence visuelle
   ============================================================ */
.page-title { font-weight: 800; letter-spacing: -0.02em; }
.page-header { padding: 1.4rem 1.6rem; border-bottom: 1px solid var(--border); }
.card { border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
.card-header { border-bottom: 1px solid var(--border); background: var(--bg-card); border-radius: 14px 14px 0 0; }
.card-body { padding: 1.4rem; }
.table thead th { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; font-weight: 700; color: var(--text-muted); border-bottom-width: 2px; }
.table tbody td { vertical-align: middle; }
.table tbody tr { border-bottom: 1px solid var(--border); }
.btn { font-weight: 600; border-radius: 9px; }
.btn-sm { border-radius: 7px; }
.btn i { vertical-align: -2px; }
.form-label { font-weight: 600; color: var(--text-main); margin-bottom: 0.4rem; }
.badge { font-weight: 600; letter-spacing: 0.02em; }
.modal-content { border-radius: 14px; }
.modal-header { border-bottom: 1px solid var(--border); }
.modal-footer { border-top: 1px solid var(--border); }
.alert { border-radius: 10px; }
.kpi-card { border-radius: 14px; }

/* ============================================================
   SHADCN-STYLE — finition sobre (référence apex-shadcn)
   ============================================================ */
/* NB : les tokens de couleur (clairs + sombres) sont définis dans :root
   et [data-bs-theme="dark"] plus haut ; on ne les redéclare pas ici
   pour ne pas écraser le mode sombre. */

/* Cartes : bordure fine, ombre très légère, rayon modéré */
.card { border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-sm); }
.card-header { border-bottom: 1px solid var(--border); background: var(--bg-card); border-radius: 10px 10px 0 0; padding: 0.75rem 1.25rem; }
.card-body { padding: 1.25rem; }
.card-header h5, .card-header h6 { font-size: 0.9rem; font-weight: 600; }

/* KPI : compacts, valeur en gras, libellé discret */
.kpi-card { border-radius: 10px; }
.kpi-value { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-main); }
.kpi-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.kpi-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }

/* Tableaux : denses, en-têtes discrets, lignes compactes */
.table { font-size: 0.875rem; }
.table thead th { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); border-bottom: 1px solid var(--border); padding: 0.6rem 0.9rem; white-space: nowrap; }
.table tbody td { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }

/* DataTables : largeur fluide (empêche le débordement horizontal) */
div.dataTables_wrapper { width: 100%; }
div.dataTables_wrapper .dataTables_scrollHead, div.dataTables_wrapper .dataTables_scrollBody { width: 100% !important; }
table.dataTable { width: 100% !important; table-layout: auto; }
table.dataTable > thead > tr > th { white-space: normal; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Boutons : sobres, accent unique */
.btn { font-weight: 500; border-radius: 8px; }
.btn-primary { background: var(--primary); border-color: var(--primary); box-shadow: none; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Formulaires : champs compacts */
.form-label { font-size: 0.8rem; font-weight: 500; color: var(--text-main); margin-bottom: 0.3rem; }
.form-control, .form-select { min-height: 38px; font-size: 0.875rem; border-radius: 8px; border-color: var(--border); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(79 70 229 / 0.12); }
.form-control-sm, .form-select-sm { min-height: 32px; font-size: 0.82rem; }

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

/* Modales : propre */
.modal-content { border-radius: 12px; border: 1px solid var(--border); }
.modal-header { padding: 1rem 1.25rem; }
.modal-footer { padding: 0.85rem 1.25rem; }

/* Titres de page */
.page-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.page-subtitle { font-size: 0.85rem; color: var(--text-muted); }

/* ============================================================
   SHADCN — APPLICATION DÉCISIVE (référence apex-shadcn)
   Mode clair par défaut. Le sombre reste cohérent.
   ============================================================ */
html[data-bs-theme="light"], html:not([data-bs-theme="dark"]) {
  --bg-body: #f4f5f7;
  --bg-card: #ffffff;
  --border: #e4e7ec;
  --text-main: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.03);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04);
}

html[data-bs-theme="light"] body, html:not([data-bs-theme="dark"]) body {
  background-color: var(--bg-body);
  color: var(--text-main);
}

/* Contenu + cartes */
html[data-bs-theme="light"] .app-content, html:not([data-bs-theme="dark"]) .app-content { background: transparent; }
html[data-bs-theme="light"] .card, html:not([data-bs-theme="dark"]) .card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
html[data-bs-theme="light"] .card-header, html:not([data-bs-theme="dark"]) .card-header {
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.2rem;
}
html[data-bs-theme="light"] .card-body, html:not([data-bs-theme="dark"]) .card-body { padding: 1.2rem; }

/* Navbar */
html[data-bs-theme="light"] .app-navbar, html:not([data-bs-theme="dark"]) .app-navbar {
  background: var(--bg-card); border-bottom: 1px solid var(--border);
}

/* Sidebar clair imposé */
html[data-bs-theme="light"] .app-sidebar, html:not([data-bs-theme="dark"]) .app-sidebar {
  background: var(--bg-card) !important; border-right: 1px solid var(--border);
  color: var(--text-muted); box-shadow: none; width: 240px; min-width: 240px;
}
html[data-bs-theme="light"] .sidebar-brand, html:not([data-bs-theme="dark"]) .sidebar-brand {
  border-bottom: 1px solid var(--border); padding: 0.9rem 1rem;
}
html[data-bs-theme="light"] .sidebar-brand .brand-name, html:not([data-bs-theme="dark"]) .sidebar-brand .brand-name { color: var(--text-main); font-size: 1rem; font-weight: 700; }
html[data-bs-theme="light"] .sidebar-brand i, html:not([data-bs-theme="dark"]) .sidebar-brand i { color: var(--primary); font-size: 1.1rem; }
html[data-bs-theme="light"] .sidebar-menu, html:not([data-bs-theme="dark"]) .sidebar-menu { padding: 0.5rem; }
html[data-bs-theme="light"] .sidebar-menu .nav-link, html:not([data-bs-theme="dark"]) .sidebar-menu .nav-link {
  padding: 0.5rem 0.75rem; font-size: 0.84rem; border-radius: 8px;
}
html[data-bs-theme="light"] .sidebar-menu .nav-link i, html:not([data-bs-theme="dark"]) .sidebar-menu .nav-link i { font-size: 1rem; width: 20px; }
html[data-bs-theme="light"] .sidebar-menu .nav-link.active, html:not([data-bs-theme="dark"]) .sidebar-menu .nav-link.active {
  background: var(--primary-light); color: var(--primary); font-weight: 600;
}

/* Tables */
html[data-bs-theme="light"] .table, html:not([data-bs-theme="dark"]) .table { color: var(--text-main); }
html[data-bs-theme="light"] .table thead th, html:not([data-bs-theme="dark"]) .table thead th {
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  font-weight: 600; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.04em;
}
html[data-bs-theme="light"] .table tbody td, html:not([data-bs-theme="dark"]) .table tbody td { border-bottom: 1px solid var(--border); }
html[data-bs-theme="light"] .table tbody tr:hover, html:not([data-bs-theme="dark"]) .table tbody tr:hover { background: #f9fafb; }

/* Pagination */
html[data-bs-theme="light"] .pagination .page-link, html:not([data-bs-theme="dark"]) .pagination .page-link {
  background: var(--bg-card); border-color: var(--border); color: var(--text-main);
}
html[data-bs-theme="light"] .pagination .page-item.active .page-link, html:not([data-bs-theme="dark"]) .pagination .page-item.active .page-link {
  background: var(--primary); border-color: var(--primary); color: #fff;
}

