/* Style basé sur 1306data.com */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.7);
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --line: #e2e8f0;
  --form-border: rgba(255, 255, 255, 0.65);
  --form-border-focus: rgba(255, 255, 255, 0.95);
  --form-shadow: 0 8px 22px rgba(15, 15, 15, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  --form-shadow-focus: 0 0 0 2px rgba(255, 255, 255, 0.55),
    0 0 18px rgba(0, 113, 227, 0.35),
    0 12px 28px rgba(15, 15, 15, 0.18);
  --dash-glass-bg: rgba(255, 255, 255, 0.6);
  --dash-glass-border: rgba(255, 255, 255, 0.2);
  --dash-glass-shadow: 0 10px 24px rgba(15, 15, 15, 0.08);
  --dash-glow: 0 0 16px rgba(0, 113, 227, 0.12);
  --ds-bg: #f6f7fb;
  --ds-surface: #ffffff;
  --ds-border: #e2e8f0;
  --ds-text: #0f172a;
  --ds-text-muted: #64748b;
  --ds-accent: #3b82f6;
  --ds-success: #16a34a;
  --ds-warning: #d97706;
  --ds-danger: #ef4444;
  --ds-radius-md: 14px;
  --ds-radius-lg: 18px;
  --ds-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --ds-shadow-sm: 0 8px 16px rgba(16, 24, 40, 0.06);
  --accent: #3b82f6;
  --success: #0a7d2a;
  --error: #ef4444;
  --warning: #ff9800;
  --radius-xl: 36px;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 12px;
  --shadow-xl: 0 48px 90px rgba(15, 15, 15, 0.16);
  --shadow-lg: 0 32px 60px rgba(15, 15, 15, 0.14);
  --shadow-md: 0 24px 42px rgba(15, 15, 15, 0.08);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.08);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

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

/* Sidebar */
.sidebar {
  width: 264px;
  background: rgba(255, 255, 255, 0.9);
  border-right: 1px solid rgba(10, 10, 10, 0.06);
  position: fixed;
  height: 100vh;
  overflow: visible;
  z-index: 100;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
}

.sidebar__header {
  padding: 1.4rem 1.3rem 1.2rem;
  border-bottom: 1px solid rgba(10, 10, 10, 0.06);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.sidebar__logo {
  height: 38px;
  width: auto;
}

.sidebar__brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar__brand-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.sidebar__brand-tag {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.sidebar__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.75rem 0.85rem 1.5rem;
  overflow-y: auto;
  overflow-x: visible;
}

.sidebar__section-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0.6rem 0.75rem 0.35rem;
}

.sidebar__section--footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(10, 10, 10, 0.06);
}

.sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 14px;
  border: 1px solid transparent;
}

.sidebar__nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  text-decoration: none;
  border-color: rgba(10, 10, 10, 0.06);
}

.sidebar__nav-item.active {
  background: rgba(0, 113, 227, 0.12);
  border-color: rgba(0, 113, 227, 0.18);
  color: var(--accent);
}

.sidebar__nav-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  font-size: 1.05rem;
}

.sidebar__nav-item--parent {
  width: 100%;
  background: transparent;
  cursor: default;
  border-color: transparent;
  font-weight: 600;
  justify-content: space-between;
}

.sidebar__nav-item--parent:hover {
  background: transparent;
  border-color: transparent;
}

.sidebar__item--has-submenu.open .sidebar__subnav {
  display: flex;
}

.sidebar__nav-caret {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.sidebar__item--has-submenu {
  position: relative;
}

.sidebar__item--has-submenu:hover .sidebar__subnav {
  display: flex;
}

.sidebar__item--has-submenu.open .sidebar__nav-caret {
  transform: rotate(180deg);
}

.sidebar__item--has-submenu.hover-open .sidebar__nav-caret {
  transform: rotate(180deg);
}

.sidebar__subnav {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  position: fixed;
  top: 0;
  left: 0;
  min-width: 220px;
  padding: 0.6rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid rgba(10, 10, 10, 0.08);
  box-shadow: 0 18px 40px rgba(15, 15, 15, 0.12);
  z-index: 20;
  max-height: 70vh;
  overflow-y: auto;
}

.sidebar__nav-item--sub {
  padding: 0.6rem 0.75rem;
  font-size: 0.92rem;
}

.sidebar__nav-item--sub .sidebar__nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  font-size: 0.95rem;
}

.sidebar__nav-item.active .sidebar__nav-icon {
  background: rgba(0, 113, 227, 0.16);
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: 264px;
  padding: 2rem;
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--surface);
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--line);
  margin: -2rem -2rem 2rem -2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header__title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.header__actions {
  display: flex;
  gap: 1rem;
}

/* Dashboard sections */
.dashboard-section {
  margin-bottom: 2.5rem;
}

.dashboard-page .card,
.dashboard-page .quick-action-card,
.dashboard-page .summary-item {
  background: var(--dash-glass-bg);
  border: 1px solid var(--dash-glass-border);
  box-shadow: var(--dash-glass-shadow);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.dashboard-page .stat-card {
  background: var(--dash-glass-bg);
  border: 1px solid var(--dash-glass-border);
  box-shadow: var(--dash-glass-shadow);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.dashboard-page .stat-card::before {
  opacity: 0.35;
}

.dashboard-page .card__header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.dashboard-page .chart-btn {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: var(--dash-glow);
}

.dashboard-page .chart-btn.active {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.95), rgba(90, 200, 250, 0.9));
  border-color: rgba(0, 113, 227, 0.65);
  box-shadow: 0 0 18px rgba(0, 113, 227, 0.35);
}

.dashboard-page .quick-action-icon {
  background: rgba(0, 113, 227, 0.14);
  box-shadow: 0 0 16px rgba(0, 113, 227, 0.2);
}

.dashboard-page .table-container {
  background: var(--dash-glass-bg);
  border: 1px solid var(--dash-glass-border);
  box-shadow: var(--dash-glass-shadow);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
}


.dashboard-page .stat-card,
.dashboard-page .card,
.dashboard-page .quick-action-card,
.dashboard-page .summary-item {
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-page .stat-card:hover,
.dashboard-page .card:hover,
.dashboard-page .quick-action-card:hover,
.dashboard-page .summary-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 15, 15, 0.12);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0.2rem 0 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.quick-action-card {
  background: var(--surface);
  border: 1px solid rgba(10, 10, 10, 0.08);
  border-radius: 18px;
  padding: 1.1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  transition: all 0.25s ease;
  box-shadow: 0 16px 30px rgba(15, 15, 15, 0.06);
  position: relative;
  overflow: hidden;
}

.quick-action-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(0, 113, 227, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.quick-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(15, 15, 15, 0.12);
  border-color: rgba(0, 113, 227, 0.2);
}

.quick-action-card:hover::after {
  opacity: 1;
}

.quick-action-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: rgba(0, 113, 227, 0.1);
  border-radius: 14px;
  font-size: 1.4rem;
  z-index: 1;
}

.quick-action-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  z-index: 1;
}

.quick-action-title {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.quick-action-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.quick-action-arrow {
  margin-left: auto;
  font-size: 1.1rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease, color 0.2s ease;
  z-index: 1;
}

.quick-action-card:hover .quick-action-arrow {
  transform: translateX(2px);
  color: var(--accent);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.summary-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.summary-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.35rem;
}

.summary-value {
  font-size: 1.1rem;
  font-weight: 600;
}

.summary-hint {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Dashboard CEO 2026 */
.dashboard-page {
  background: var(--ds-bg);
  border-radius: 24px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}

.dashboard-page::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.08), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(14, 165, 233, 0.08), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.08), transparent 45%);
  animation: dashboardGlow 12s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.dashboard-page > * {
  position: relative;
  z-index: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.dashboard-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  color: var(--ds-text);
}

.dashboard-subtitle {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  color: var(--ds-text-muted);
}

.dashboard-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-select {
  border: 1px solid var(--ds-border);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  background: var(--ds-surface);
  color: var(--ds-text);
}

.profile-chip {
  border: 1px solid var(--ds-border);
  background: var(--ds-surface);
  color: var(--ds-text);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.dashboard-error {
  display: none;
  padding: 0.9rem 1rem;
  border-radius: var(--ds-radius-md);
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.06);
  color: var(--ds-danger);
  font-size: 0.9rem;
}

.dashboard-page.has-error .dashboard-error {
  display: block;
}

/* ═══════════════════════════════════════════════════════════════
   KPI CARDS - GRADIENT FILL STYLE (Stripe Dashboard)
   ═══════════════════════════════════════════════════════════════ */

.dashboard-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.kpi-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  border: 1px solid var(--ds-border);
.kpi-card:nth-of-type(1) {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.96));
}

.kpi-card:nth-of-type(2) {
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.98), rgba(255, 255, 255, 0.96));
}

.kpi-card:nth-of-type(3) {
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.98), rgba(255, 255, 255, 0.96));
}
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.kpi-card > * {
  position: relative;
  z-index: 1;
}

.kpi-card[data-animate="fadeInUp"] {
  animation: fadeInUp 0.6s ease-out both;
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 16px;
  width: 30px;
  height: 8px;
  background-image:
    radial-gradient(circle, rgba(99, 102, 241, 0.75) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(16, 185, 129, 0.7) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(245, 158, 11, 0.7) 0 2px, transparent 3px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
  background-position: 0 1px, 10px 1px, 20px 1px;
  animation: dotsShift 2.4s ease-in-out infinite;
  opacity: 0.7;
  pointer-events: none;
  z-index: 2;
}

/* Gradient overlay au hover */
.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.kpi-card:nth-of-type(1)::before {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.1) 100%);
}
.kpi-card:nth-of-type(2)::before {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(52, 211, 153, 0.1) 100%);
}
.kpi-card:nth-of-type(3)::before {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06) 0%, rgba(251, 191, 36, 0.1) 100%);
}
.kpi-card:nth-of-type(4)::before {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.06) 0%, rgba(248, 113, 113, 0.1) 100%);
}
.kpi-card:nth-of-type(5)::before {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.06) 0%, rgba(56, 189, 248, 0.1) 100%);
}
.kpi-card:nth-of-type(6)::before {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.06) 0%, rgba(192, 132, 252, 0.1) 100%);
}

.kpi-card:hover::before {
  opacity: 1;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Bordure colorée au hover */
.kpi-card:nth-of-type(1):hover {
  border-color: rgba(99, 102, 241, 0.35);
}
.kpi-card:nth-of-type(2):hover {
  border-color: rgba(16, 185, 129, 0.35);
}
.kpi-card:nth-of-type(3):hover {
  border-color: rgba(245, 158, 11, 0.35);
}
.kpi-card:nth-of-type(4):hover {
  border-color: rgba(239, 68, 68, 0.35);
}
.kpi-card:nth-of-type(5):hover {
  border-color: rgba(14, 165, 233, 0.35);
}
.kpi-card:nth-of-type(6):hover {
  border-color: rgba(168, 85, 247, 0.35);
}

/* Header */
.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.kpi-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ds-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Badges */
.kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.625rem;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: none;
}

.kpi-badge--warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.kpi-badge--danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

/* Value */
.kpi-value {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ds-text);
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 1;
}

/* Meta */
.kpi-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--ds-text-muted);
  position: relative;
  z-index: 1;
}

/* Split layout */
.kpi-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.kpi-split-label {
  font-size: 0.75rem;
  color: var(--ds-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-split-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ds-text);
  font-variant-numeric: tabular-nums;
  margin-top: 0.3rem;
}

.kpi-split-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--ds-text-muted);
  margin-top: 0.2rem;
}

/* Sparkline bars */
.kpi-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 40px;
  margin-top: 0.5rem;
  position: relative;
  z-index: 1;
}

.kpi-sparkline span {
  flex: 1;
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Couleurs sparkline par carte */
.kpi-card:nth-of-type(1) .kpi-sparkline span {
  background: rgba(99, 102, 241, 0.2);
}
.kpi-card:nth-of-type(1):hover .kpi-sparkline span {
  background: rgba(99, 102, 241, 0.4);
}
.kpi-card:nth-of-type(1) .kpi-sparkline span:hover {
  background: #6366f1;
}

.kpi-card:nth-of-type(2) .kpi-sparkline span {
  background: rgba(16, 185, 129, 0.2);
}
.kpi-card:nth-of-type(2):hover .kpi-sparkline span {
  background: rgba(16, 185, 129, 0.4);
}
.kpi-card:nth-of-type(2) .kpi-sparkline span:hover {
  background: #10b981;
}

.kpi-card:nth-of-type(3) .kpi-sparkline span {
  background: rgba(245, 158, 11, 0.2);
}
.kpi-card:nth-of-type(3):hover .kpi-sparkline span {
  background: rgba(245, 158, 11, 0.4);
}
.kpi-card:nth-of-type(3) .kpi-sparkline span:hover {
  background: #f59e0b;
}

.kpi-card:nth-of-type(4) .kpi-sparkline span {
  background: rgba(239, 68, 68, 0.2);
}
.kpi-card:nth-of-type(4):hover .kpi-sparkline span {
  background: rgba(239, 68, 68, 0.4);
}
.kpi-card:nth-of-type(4) .kpi-sparkline span:hover {
  background: #ef4444;
}

.kpi-card:nth-of-type(5) .kpi-sparkline span {
  background: rgba(14, 165, 233, 0.2);
}
.kpi-card:nth-of-type(5):hover .kpi-sparkline span {
  background: rgba(14, 165, 233, 0.4);
}
.kpi-card:nth-of-type(5) .kpi-sparkline span:hover {
  background: #0ea5e9;
}

.kpi-card:nth-of-type(6) .kpi-sparkline span {
  background: rgba(168, 85, 247, 0.2);
}
.kpi-card:nth-of-type(6):hover .kpi-sparkline span {
  background: rgba(168, 85, 247, 0.4);
}
.kpi-card:nth-of-type(6) .kpi-sparkline span:hover {
  background: #a855f7;
}

/* Help text */
.kpi-help {
  font-size: 0.78rem;
  color: var(--ds-text-muted);
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

.delta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.16);
}

.delta-badge--up {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.22);
}

.delta-badge--down {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.24);
}

.delta-badge--flat {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
  border-color: rgba(100, 116, 139, 0.22);
}

.delta-subline {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--ds-text-muted);
}

.section-header--compact {
  margin-bottom: 1rem;
}

.filter-group {
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.2rem;
  border: 1px solid var(--ds-border);
  border-radius: 999px;
  background: var(--ds-surface);
}

.filter-btn {
  border: none;
  background: transparent;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 999px;
  color: var(--ds-text-muted);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease,
    box-shadow 150ms ease;
}

.filter-btn.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--ds-accent);
}

.filter-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.ops-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  border: 1px solid var(--ds-border);
.ops-card:nth-of-type(1) {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.96));
}

.ops-card:nth-of-type(2) {
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.98), rgba(255, 255, 255, 0.96));
}

.ops-card:nth-of-type(3) {
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.98), rgba(255, 255, 255, 0.96));
}

.ops-card:nth-of-type(4) {
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.98), rgba(255, 255, 255, 0.96));
}
  border-radius: var(--ds-radius-md);
  padding: 1.5rem;
  box-shadow: var(--ds-shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
  transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 180ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.ops-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 60%);
  opacity: 0.6;
  pointer-events: none;
  animation: cardFloat 9s ease-in-out infinite;
}

.ops-card::before {
  content: '';
  position: absolute;
  top: 10px;
  right: 14px;
  width: 28px;
  height: 8px;
  background-image:
    radial-gradient(circle, rgba(59, 130, 246, 0.7) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(14, 165, 233, 0.7) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(239, 68, 68, 0.7) 0 2px, transparent 3px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
  background-position: 0 1px, 9px 1px, 18px 1px;
  animation: dotsShift 2.6s ease-in-out infinite;
  opacity: 0.6;
  pointer-events: none;
  z-index: 2;
}

.ops-card:nth-of-type(2)::after {
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 60%);
}

.ops-card:nth-of-type(3)::after {
  background: radial-gradient(circle at top right, rgba(217, 119, 6, 0.08), transparent 60%);
}

.ops-card:nth-of-type(4)::after {
  background: radial-gradient(circle at top right, rgba(239, 68, 68, 0.08), transparent 60%);
}

.ops-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08),
    0 0 0 3px rgba(59, 130, 246, 0.12);
}

.ops-metric {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.ops-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  flex: 0 0 32px;
}

.ops-icon svg {
  width: 18px;
  height: 18px;
}

.ops-card:nth-of-type(2) .ops-icon {
  background: rgba(14, 165, 233, 0.12);
  color: #0ea5e9;
}

.ops-card:nth-of-type(3) .ops-icon {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.ops-card:nth-of-type(4) .ops-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.ops-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ds-text-muted);
}

.ops-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ds-text);
  font-variant-numeric: tabular-nums;
}

.ops-meta {
  font-size: 0.8rem;
  color: var(--ds-text-muted);
}

.actions-list {
  display: grid;
  gap: 0.6rem;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: var(--ds-radius-md);
  border: 1px solid var(--ds-border);
  background: var(--ds-surface);
  color: var(--ds-text);
  text-decoration: none;
  transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.action-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--ds-shadow-sm);
}

.action-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ds-accent);
}

.action-text {
  font-weight: 600;
}

.action-meta {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--ds-text-muted);
}

.moving-dots {
  display: inline-block;
  width: 30px;
  height: 8px;
  background-image:
    radial-gradient(circle, rgba(99, 102, 241, 0.75) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(16, 185, 129, 0.7) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(245, 158, 11, 0.7) 0 2px, transparent 3px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
  background-position: 0 1px, 10px 1px, 20px 1px;
  animation: dotsShift 2.6s ease-in-out infinite;
  opacity: 0.7;
}

.moving-dots--header {
  margin-top: 0.3rem;
}

.moving-dots--login {
  margin-left: 0.5rem;
}

.nav__cta {
  position: relative;
  overflow: visible;
}

.nav__cta-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.nav__cta-stack .moving-dots--login {
  margin-left: 0;
}

.dashboard-page .card,
.dashboard-page .table-container {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  border: 1px solid rgba(226, 232, 240, 0.9);
.analytics-grid .card--chart:nth-of-type(1) {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.96));
}

.analytics-grid .card--chart:nth-of-type(2) {
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.98), rgba(255, 255, 255, 0.96));
}

.analytics-grid .card--chart:nth-of-type(3) {
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.98), rgba(255, 255, 255, 0.96));
}

.dashboard-insights .card {
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.98), rgba(255, 255, 255, 0.96));
}

.dashboard-transactions .card {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.96));
}
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.dashboard-page .card {
  padding: 1.5rem;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.dashboard-page .card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.12;
  transition: opacity 0.3s ease;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.04), rgba(59, 130, 246, 0.08));
  background-size: 140% 140%;
  animation: cardSheen 14s ease-in-out infinite;
}

.dashboard-page .card::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 16px;
  width: 30px;
  height: 8px;
  background-image:
    radial-gradient(circle, rgba(99, 102, 241, 0.65) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(16, 185, 129, 0.6) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(245, 158, 11, 0.6) 0 2px, transparent 3px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
  background-position: 0 1px, 10px 1px, 20px 1px;
  animation: dotsShift 2.8s ease-in-out infinite;
  opacity: 0.6;
  pointer-events: none;
  z-index: 2;
}

.dashboard-page .card > * {
  position: relative;
  z-index: 1;
}

.dashboard-page .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  border-color: rgba(59, 130, 246, 0.25);
}

.dashboard-page .card:hover::before {
  opacity: 0.22;
}

.dashboard-page .section-title,
.dashboard-page .card__title {
  color: var(--ds-text);
}

.dashboard-page .section-subtitle,
.dashboard-page .card__subtitle {
  color: var(--ds-text-muted);
}

.dashboard-page .card__header {
  border-bottom: 1px solid var(--ds-border);
}

.dashboard-page .chart-container {
  height: 260px;
  position: relative;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.7);
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.7));
  padding: 0.5rem 0.75rem;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--ds-text-muted);
  background: rgba(248, 250, 252, 0.85);
  border-radius: 10px;
  border: 1px dashed rgba(226, 232, 240, 0.9);
}

.dashboard-page.is-loading [data-skeleton] {
  color: transparent;
  position: relative;
  background: linear-gradient(90deg, rgba(230, 232, 238, 0.6), rgba(245, 247, 251, 0.9), rgba(230, 232, 238, 0.6));
  background-size: 200% 100%;
  border-radius: 8px;
  animation: skeletonPulse 1.2s ease-in-out infinite;
}

.dashboard-page.is-loading .kpi-sparkline,
.dashboard-page.is-loading .chart-container {
  opacity: 0.4;
}

@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.dashboard-page:focus-visible,
.dashboard-page .btn:focus-visible,
.dashboard-page .action-row:focus-visible,
.dashboard-page .filter-btn:focus-visible,
.dashboard-page .dashboard-select:focus-visible,
.dashboard-page .profile-chip:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  opacity: 1 !important; /* FORCER L'OPACITÉ */
  transform: translateY(0) !important; /* FORCER LA POSITION */
}

.card[data-animate="fadeInUp"] {
  animation: fadeInUp 0.6s ease-out forwards;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card--chart {
  margin-bottom: 2rem;
}

.card--table {
  margin-bottom: 2rem;
}

.card--alerts {
  margin-bottom: 2rem;
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--line);
}

.card__header-content {
  flex: 1;
}

.card__title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.card__subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 400;
}

.card__actions {
  display: flex;
  gap: 0.5rem;
}

.chart-btn {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 113, 227, 0.05);
}

.chart-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.chart-container {
  position: relative;
  height: 350px;
  margin-top: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.7);
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.7));
  padding: 0.5rem 0.75rem;
}

.chart-container canvas {
  max-height: 100% !important;
}

/* Buttons style macOS moderne */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.8125rem;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
  gap: 6px;
  position: relative;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  white-space: nowrap;
  user-select: none;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.2s ease;
  pointer-events: none;
}

.btn:hover::before {
  background: rgba(255, 255, 255, 0.1);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: #007AFF;
  color: #ffffff;
  border-color: #007AFF;
  box-shadow: 0 1px 2px rgba(0, 122, 255, 0.2);
}

.btn-primary:hover {
  background: #0051D5;
  border-color: #0051D5;
  box-shadow: 0 2px 4px rgba(0, 122, 255, 0.3);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary:active {
  background: #0040B3;
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.16);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-secondary:active {
  background: rgba(0, 0, 0, 0.12);
  transform: translateY(0) scale(0.98);
}

.btn-success {
  background: #34C759;
  color: #ffffff;
  border-color: #34C759;
  box-shadow: 0 1px 2px rgba(52, 199, 89, 0.2);
}

.btn-success:hover {
  background: #28A745;
  border-color: #28A745;
  box-shadow: 0 2px 4px rgba(52, 199, 89, 0.3);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-danger {
  background: #FF3B30;
  color: #ffffff;
  border-color: #FF3B30;
  box-shadow: 0 1px 2px rgba(255, 59, 48, 0.2);
}

.btn-danger:hover {
  background: #DC3545;
  border-color: #DC3545;
  box-shadow: 0 2px 4px rgba(255, 59, 48, 0.3);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: 5px;
}

/* Boutons dans les tableaux - style macOS compact */
table .btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 5px;
  margin: 0 2px;
  min-width: auto;
}

table .btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
}

/* Groupe de boutons dans les tableaux */
table .btn-group {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

/* Cellules d'actions dans les tableaux */
table td:has(.btn) {
  padding: 8px 16px;
}

/* Amélioration des statuts/badges dans les tableaux - style macOS */
table .badge {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

.badge-success {
  background: rgba(52, 199, 89, 0.15);
  color: #28A745;
  border: 1px solid rgba(52, 199, 89, 0.2);
}

.badge-warning {
  background: rgba(255, 149, 0, 0.15);
  color: #FF9500;
  border: 1px solid rgba(255, 149, 0, 0.2);
}

.badge-danger {
  background: rgba(255, 59, 48, 0.15);
  color: #FF3B30;
  border: 1px solid rgba(255, 59, 48, 0.2);
}

.badge-info {
  background: rgba(0, 122, 255, 0.15);
  color: #007AFF;
  border: 1px solid rgba(0, 122, 255, 0.2);
}

.badge-secondary {
  background: rgba(0, 0, 0, 0.06);
  color: #6e6e73;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Amélioration de l'espacement dans les tableaux */
table td {
  vertical-align: middle;
}

/* Style pour les cellules vides */
table td.text-center {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 2rem;
}

/* Amélioration responsive des tableaux */
@media (max-width: 768px) {
  .table-container {
    border-radius: 8px;
  }
  
  th, td {
    padding: 10px 12px;
    font-size: 0.875rem;
  }
  
  th:first-child, td:first-child {
    padding-left: 16px;
  }
  
  th:last-child, td:last-child {
    padding-right: 16px;
  }
  
  table .btn {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
}

/* Formulaires */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--form-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.55) 100%);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  font: inherit;
  font-size: 0.95rem;
  box-shadow: var(--form-shadow);
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--form-border-focus);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--form-shadow-focus);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

/* Tableaux */
/* Tableaux style macOS moderne */
.table-container {
  overflow-x: auto;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}

thead {
  background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
  position: sticky;
  top: 0;
  z-index: 10;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-bottom: 2px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 2px 4px rgba(0, 0, 0, 0.04);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.6875rem;
  color: #1d1d1f;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: 2px solid rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  position: relative;
  background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
  -webkit-font-smoothing: antialiased;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
}

th:first-child {
  padding-left: 20px;
  border-left: 1px solid rgba(0, 0, 0, 0.12);
}

th:last-child {
  padding-right: 20px;
  border-right: 1px solid rgba(0, 0, 0, 0.12);
}

th::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.6);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: background-color 0.15s ease;
}

td:first-child {
  padding-left: 20px;
}

td:last-child {
  padding-right: 20px;
}

tbody tr {
  transition: all 0.15s ease;
  cursor: default;
}

tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

tbody tr:active {
  background: rgba(0, 0, 0, 0.04);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Lignes alternées subtiles (optionnel, style macOS) */
tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.01);
}

tbody tr:nth-child(even):hover {
  background: rgba(0, 0, 0, 0.03);
}

/* Amélioration des couleurs pour un look macOS authentique */
:root {
  --macos-blue: #007AFF;
  --macos-gray-light: #f5f5f7;
  --macos-gray-medium: #d2d2d7;
  --macos-gray-dark: #86868b;
  --macos-text-primary: #1d1d1f;
  --macos-text-secondary: #6e6e73;
  --macos-border: rgba(0, 0, 0, 0.1);
  --macos-surface: #ffffff;
  --macos-surface-hover: rgba(0, 0, 0, 0.02);
}

/* En-têtes de tableaux avec style macOS amélioré */
table thead th {
  background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
  color: #1d1d1f;
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-bottom: 2px solid rgba(0, 0, 0, 0.15);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding: 12px 16px;
  position: relative;
  -webkit-font-smoothing: antialiased;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 2px 4px rgba(0, 0, 0, 0.04);
}

table thead th:first-child {
  padding-left: 20px;
  border-left: 1px solid rgba(0, 0, 0, 0.12);
}

table thead th:last-child {
  padding-right: 20px;
  border-right: 1px solid rgba(0, 0, 0, 0.12);
}

table thead th::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.6);
}

/* Amélioration des cellules pour contraste */
table tbody td {
  color: #1d1d1f;
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* Hover plus subtil style macOS */
table tbody tr:hover {
  background: rgba(0, 122, 255, 0.04);
}

table tbody tr:active {
  background: rgba(0, 122, 255, 0.08);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(10, 125, 42, 0.1);
  color: var(--success);
}

.badge-warning {
  background: rgba(255, 152, 0, 0.1);
  color: var(--warning);
}

.badge-danger {
  background: rgba(176, 0, 32, 0.1);
  color: var(--error);
}

.badge-info {
  background: rgba(0, 113, 227, 0.1);
  color: var(--accent);
}

.badge-secondary {
  background: var(--bg);
  color: var(--text-secondary);
}

/* Alertes */
.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  border-left: 4px solid;
}

.alert-success {
  background: rgba(10, 125, 42, 0.1);
  border-color: var(--success);
  color: var(--success);
}

.alert-error {
  background: rgba(176, 0, 32, 0.1);
  border-color: var(--error);
  color: var(--error);
}

.alert-warning {
  background: rgba(255, 152, 0, 0.1);
  border-color: var(--warning);
  color: var(--warning);
}

.alert-info {
  background: rgba(0, 113, 227, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Responsive pour les cartes stats */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .stat-card {
    min-height: 100px;
    padding: 1.25rem;
  }
  
  .stat-card__value {
    font-size: 1.1rem;
  }
  
  .stat-card__icon {
    font-size: 2rem;
  }
}

/* Stat Cards Modernes */
.stat-card {
  --stat-accent: var(--accent);
  --stat-accent-soft: rgba(0, 113, 227, 0.12);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78));
  border-radius: 22px;
  padding: 1.6rem;
  border: 1px solid rgba(10, 10, 10, 0.06);
  box-shadow: 0 24px 50px rgba(15, 15, 15, 0.08);
  position: relative;
  overflow: hidden;
  transition: all 0.35s ease;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  opacity: 0;
  transform: translateY(20px);
  min-height: 120px;
  backdrop-filter: blur(12px);
}

.stat-card[data-animate="fadeInUp"] {
  animation: fadeInUp 0.6s ease-out forwards;
}

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 32px 70px rgba(15, 15, 15, 0.14);
  border-color: rgba(0, 113, 227, 0.22);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, var(--stat-accent-soft), transparent 65%);
  opacity: 0.6;
  transition: opacity 0.35s ease;
  z-index: 0;
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card--primary {
  --stat-accent: #0071e3;
  --stat-accent-soft: rgba(0, 113, 227, 0.14);
}

.stat-card--warning {
  --stat-accent: #ff9800;
  --stat-accent-soft: rgba(255, 152, 0, 0.18);
}

.stat-card--success {
  --stat-accent: #0a7d2a;
  --stat-accent-soft: rgba(10, 125, 42, 0.18);
}

.stat-card--info {
  --stat-accent: #2196f3;
  --stat-accent-soft: rgba(33, 150, 243, 0.18);
}

.stat-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--stat-accent-soft);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.stat-card__icon:nth-child(1) {
  animation-delay: 0s;
}

.stat-card__icon:nth-child(2) {
  animation-delay: 0.5s;
}

.stat-card__icon:nth-child(3) {
  animation-delay: 1s;
}

.stat-card__icon:nth-child(4) {
  animation-delay: 1.5s;
}

.stat-card__content {
  flex: 1;
  min-width: 0; /* Permet au contenu de se rétrécir */
  overflow: hidden; /* Empêche le débordement */
  position: relative;
  z-index: 1;
}

.stat-card__label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
  font-weight: 600;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.stat-card__value {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.35rem 0;
  line-height: 1.2;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  background: linear-gradient(135deg, var(--stat-accent), var(--text-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  width: 100%;
}

.stat-card__subvalue {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.stat-card__trend {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

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

@keyframes dashboardGlow {
  0%, 100% {
    transform: translate3d(0, 0, 0);
    opacity: 0.7;
  }
  50% {
    transform: translate3d(2%, -2%, 0);
    opacity: 1;
  }
}

@keyframes cardSheen {
  0%, 100% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 60%;
  }
}

@keyframes cardGlow {
  0%, 100% {
    transform: translate3d(0, 0, 0);
    opacity: 0.3;
  }
  50% {
    transform: translate3d(2%, -2%, 0);
    opacity: 0.5;
  }
}

@keyframes cardFloat {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-1.5%, 1.5%, 0);
  }
}

@keyframes dotsShift {
  0%, 100% {
    background-position: 0 1px, 10px 1px, 20px 1px;
    opacity: 0.5;
  }
  50% {
    background-position: 4px 1px, 14px 1px, 24px 1px;
    opacity: 0.85;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Modals */
/* Modal Overlay - Centrage parfait */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay.active {
  display: flex;
}

/* Modal principal - Centré parfaitement style macOS */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal.active,
.modal[style*="display: block"],
.modal[style*="display:flex"] {
  display: flex !important;
}

/* Modal Content - Le contenu centré style macOS */
.modal-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.1);
  position: relative;
  margin: auto;
  animation: modalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-font-smoothing: antialiased;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Responsive modals */
@media (max-width: 768px) {
  .modal {
    padding: 1rem;
  }
  
  .modal-content {
    padding: 1.5rem;
    max-width: 100%;
    border-radius: 12px;
  }
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.modal__title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.modal__close:hover {
  background: var(--bg);
}

/* Sidebar Overlay pour mobile */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 99;
  display: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
}

/* Responsive - Tablette (901px - 1024px) */
@media (max-width: 1024px) {
  .main-content {
    padding: 1.5rem;
  }
  
  .header {
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    padding: 1.25rem 1.5rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .form-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

/* Responsive - Mobile et Tablette (jusqu'à 900px) */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    padding: 1rem;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  .header {
    margin: -1rem -1rem 1rem -1rem;
    padding: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
    width: calc(100% + 2rem);
  }
  
  .header__title {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
  }
  
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    transition: all 0.2s ease;
  }
  
  .mobile-menu-btn:hover {
    background: var(--bg);
    border-color: var(--text-primary);
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .stat-card {
    padding: 1.25rem;
    flex-direction: column;
    text-align: center;
  }
  
  .stat-card__icon {
    font-size: 2rem;
  }
  
  .stat-card__value {
    font-size: 1.1rem;
    line-height: 1.3;
  }
  
  /* Ajustement pour les valeurs longues */
  .stat-card__value {
    font-size: clamp(1rem, 3vw, 1.25rem);
  }
  
  /* Table moderne */
  .modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  .modern-table thead {
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.05), rgba(0, 113, 227, 0.02));
  }

  .modern-table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--line);
  }

  .modern-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--line);
  }

  .modern-table tbody tr:hover {
    background: rgba(0, 113, 227, 0.03);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  .modern-table tbody td {
    padding: 1rem 1.25rem;
    color: var(--text-primary);
  }

  /* Alerts Container */
  .alerts-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border-left: 4px solid;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    animation: slideInRight 0.4s ease-out;
    transition: all 0.2s ease;
  }

  .alert:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
  }

  .alert-info {
    border-left-color: var(--accent);
    background: rgba(0, 113, 227, 0.05);
  }

  .alert-warning {
    border-left-color: var(--warning);
    background: rgba(255, 152, 0, 0.05);
  }

  .alert-success {
    border-left-color: var(--success);
    background: rgba(10, 125, 42, 0.05);
  }

  .alert-danger {
    border-left-color: var(--error);
    background: rgba(176, 0, 32, 0.05);
  }

  @keyframes slideInRight {
    from {
      opacity: 0;
      transform: translateX(-20px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .card {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
  }
  
  .card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .card__title {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
  }
  
  .btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
  }
  
  .btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
  }
  
  .header__actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  /* Tableaux responsive */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
    width: calc(100% + 2rem);
  }
  
  table {
    min-width: 600px;
    font-size: 0.9rem;
    width: 100%;
  }
  
  th {
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  
  td {
    padding: 0.75rem 0.5rem;
    white-space: nowrap;
  }
  
  /* Modals responsive */
  .modal-overlay {
    padding: 1rem;
  }
  
  .modal {
    padding: 1.5rem;
    max-height: 85vh;
  }
  
  .modal__title {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
  }
}

/* Responsive - Mobile (jusqu'à 600px) */
@media (max-width: 600px) {
  .main-content {
    padding: 0.75rem;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  .header {
    margin: -0.75rem -0.75rem 1rem -0.75rem;
    padding: 0.75rem;
    width: calc(100% + 1.5rem);
  }
  
  .header__title {
    font-size: 1.15rem;
  }
  
  .card {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  .stat-card__label {
    font-size: 0.75rem;
  }
  
  .stat-card__value {
    font-size: 1.1rem;
  }
  
  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    width: 100%;
    justify-content: center;
  }
  
  .btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    width: auto;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  .table-container {
    margin: 0 -0.75rem;
    padding: 0 0.75rem;
    width: calc(100% + 1.5rem);
  }
  
  table {
    min-width: 500px;
    font-size: 0.85rem;
    width: 100%;
  }
  
  th {
    padding: 0.6rem 0.4rem;
    font-size: 0.75rem;
  }
  
  td {
    padding: 0.6rem 0.4rem;
  }
  
  .modal {
    padding: 1rem;
    border-radius: var(--radius-md);
  }
  
  .modal__header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }
  
  .badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
  
  .alert {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
}

/* Desktop - Sidebar toujours visible */
@media (min-width: 901px) {
  .mobile-menu-btn {
    display: none;
  }
  
  .sidebar-overlay {
    display: none !important;
  }
}

/* Utilitaires */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-flex {
  display: flex;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Loading */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* Styles pour les onglets - S'assurer qu'ils sont visibles */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--line);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(0, 113, 227, 0.05);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FORCER L'AFFICHAGE DES TABLEAUX SUR DESKTOP */
@media (min-width: 769px) {
  .table-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .table-container table {
    display: table !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    width: 100% !important;
  }
  
  .table-container tbody {
    display: table-row-group !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .table-container tr {
    display: table-row !important;
    visibility: visible !important;
  }
  
  .table-container td,
  .table-container th {
    display: table-cell !important;
    visibility: visible !important;
  }
  
  /* Cacher les cartes sur desktop */
  .table-cards-container {
    display: none !important;
  }
}


/* FORCER L'AFFICHAGE DES CONTENEURS PARENTS */
.card {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  min-height: 200px !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 1 !important;
}

.main-content {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  min-height: 100vh !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 1 !important;
}

.content {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 1 !important;
}

/* S'assurer que les tableaux sont toujours visibles */
.table-container {
  position: relative !important;
  z-index: 2 !important;
}

