/* ═══════════════════════════════════════════════════════════════
   OUVRIA DESIGN SYSTEM — styles.css
   Style: Linear.app × Notion × Figma — premium, dense, professionnel
   ═══════════════════════════════════════════════════════════════

   RÈGLE ANTI-EMOJI — NE PAS UTILISER D'EMOJIS DANS L'UI
   -------------------------------------------------------
   Les emojis sont interdits dans tout le codebase Ouvria (JS, JSX, HTML).
   - Utiliser des icônes SVG inline (viewBox="0 0 24 24", stroke-based)
   - Utiliser des caractères typographiques approuvés : ★ (U+2605), × (U+00D7)
   - Les emojis cassent l'accessibilité, la cohérence cross-OS et le design system
   ═══════════════════════════════════════════════════════════════ */

/* ═══ CSS VARIABLES ═══ */
:root {
  /* Sidebar */
  --sidebar-bg:      #0F172A;
  --sidebar-hover:   #1E293B;
  --sidebar-active:  #1E293B;
  --sidebar-border:  #1E293B;
  --sidebar-text:    #94A3B8;
  --sidebar-text-active: #F1F5F9;
  --sidebar-accent:  #F59E0B;

  /* Brand */
  --blue-primary:    #F59E0B;
  --blue-hover:      #D97706;
  --blue-light:      #E0F2FE;
  --blue-muted:      #BAE6FD;

  /* Secondary accent */
  --teal:            #0D9488;
  --teal-light:      #F0FDF9;

  /* Backgrounds */
  --bg-main:         #FAFAF7;
  --bg-card:         #FFFFFF;
  --bg-surface:      #F5F2ED;
  --bg-surface-2:    #EDE9E1;

  /* Borders */
  --border-light:    #EDE9E1;
  --border-default:  #D1CFC8;
  --border-strong:   #A8A49C;

  /* Text */
  --text-primary:    #0F172A;
  --text-secondary:  #475569;
  --text-muted:      #94A3B8;
  --text-disabled:   #CBD5E1;

  /* Statuts interventions */
  --status-pending-bg:    #FFF7ED;
  --status-pending-text:  #C2410C;
  --status-pending-dot:   #F97316;
  --status-progress-bg:   #FFFBEB;
  --status-progress-text: #1D4ED8;
  --status-progress-dot:  #3B82F6;
  --status-done-bg:       #F0FDF4;
  --status-done-text:     #15803D;
  --status-done-dot:      #22C55E;
  --status-cancelled-bg:  #F8FAFC;
  --status-cancelled-text:#64748B;
  --status-cancelled-dot: #94A3B8;
  --status-urgent-bg:     #FFF1F2;
  --status-urgent-text:   #BE123C;
  --status-urgent-dot:    #F43F5E;

  /* Feedback */
  --success:      #059669;
  --success-bg:   #F0FDF4;
  --warning:      #D97706;
  --warning-bg:   #FFFBEB;
  --danger:       #DC2626;
  --danger-bg:    #FEF2F2;
  --info:         #F59E0B;
  --info-bg:      #FFFBEB;

  /* Radius */
  --r-xs:  4px;
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.06);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 4px 16px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 6px rgba(15,23,42,0.07), 0 10px 30px rgba(15,23,42,0.08);
  --shadow-lg: 0 8px 16px rgba(15,23,42,0.08), 0 24px 48px rgba(15,23,42,0.12);

  /* Transitions */
  --t-fast:   100ms ease;
  --t-normal: 150ms ease;
  --t-slow:   250ms ease;
}

/* ═══ RESET & BASE ═══ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg-main);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══ SELECTION ═══ */
::selection { background: rgba(245,158,11,0.15); color: var(--text-primary); }

/* ═══ SMOOTH SCROLLBAR ═══ */
* { scroll-behavior: smooth; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-surface-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-default); }

/* ═══ ANIMATIONS ═══ */

/* Shimmer skeleton */
@keyframes shimmer {
  0% { background-position: -468px 0; }
  100% { background-position: 468px 0; }
}

/* Pulsating dot (en cours / urgente) */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

/* Legacy pulse (backward compat) */
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.8); opacity: 0.4; }
}

/* Slide-up toast */
@keyframes slide-up {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Slide-out toast */
@keyframes slide-out {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(24px); opacity: 0; }
}

/* Toast slide-in from right */
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100%) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* Toast progress bar */
@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* Fade-in page */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Page enter */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-enter { animation: pageIn 200ms cubic-bezier(0.22,1,0.36,1); }

/* Slide-in from right */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* General fade-in */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Modal in/out */
@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%,-48%) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}
@keyframes modalOut {
  from { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  to   { opacity: 0; transform: translate(-50%,-48%) scale(0.96); }
}

/* Toast in (legacy) */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Shake */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Spin */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ═══ STAGGER LIST ANIMATION ═══ */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.list-stagger > *:nth-child(1)  { animation: fadeSlideUp 300ms ease both; }
.list-stagger > *:nth-child(2)  { animation: fadeSlideUp 300ms ease 40ms both; }
.list-stagger > *:nth-child(3)  { animation: fadeSlideUp 300ms ease 80ms both; }
.list-stagger > *:nth-child(4)  { animation: fadeSlideUp 300ms ease 120ms both; }
.list-stagger > *:nth-child(5)  { animation: fadeSlideUp 300ms ease 160ms both; }
.list-stagger > *:nth-child(6)  { animation: fadeSlideUp 300ms ease 200ms both; }
.list-stagger > *:nth-child(7)  { animation: fadeSlideUp 300ms ease 240ms both; }
.list-stagger > *:nth-child(8)  { animation: fadeSlideUp 300ms ease 280ms both; }
.list-stagger > *:nth-child(9)  { animation: fadeSlideUp 300ms ease 320ms both; }
.list-stagger > *:nth-child(10) { animation: fadeSlideUp 300ms ease 360ms both; }
.list-stagger > *:nth-child(11) { animation: fadeSlideUp 300ms ease 400ms both; }
.list-stagger > *:nth-child(12) { animation: fadeSlideUp 300ms ease 440ms both; }
.list-stagger > *:nth-child(13) { animation: fadeSlideUp 300ms ease 480ms both; }
.list-stagger > *:nth-child(14) { animation: fadeSlideUp 300ms ease 520ms both; }
.list-stagger > *:nth-child(15) { animation: fadeSlideUp 300ms ease 560ms both; }
.list-stagger > *:nth-child(n+16) { animation: fadeSlideUp 300ms ease 600ms both; }

/* ═══ CARD ANIMATIONS ═══ */
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.card-animate {
  animation: cardEnter 350ms cubic-bezier(0.22,1,0.36,1) both;
}
.card-animate:nth-child(1) { animation-delay: 0ms; }
.card-animate:nth-child(2) { animation-delay: 60ms; }
.card-animate:nth-child(3) { animation-delay: 120ms; }
.card-animate:nth-child(4) { animation-delay: 180ms; }
.card-animate:nth-child(5) { animation-delay: 240ms; }
.card-animate:nth-child(6) { animation-delay: 300ms; }

/* ═══ SKELETON LOADER ═══ */
.skeleton {
  background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
  background-size: 800px 104px;
  animation: shimmer 1.2s linear infinite;
  border-radius: 6px;
}
.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: 4px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; border-radius: 4px; }
.skeleton-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ═══ FOCUS STATES ═══ */
input:focus, textarea:focus, select:focus {
  border-color: var(--blue-primary) !important;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.12) !important;
  outline: none;
}
button:focus-visible, a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.2);
  border-radius: inherit;
}

/* ═══ SECTION LABELS ═══ */
.section-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ═══ BUTTON PRESS EFFECT ═══ */
.btn-press:active { transform: scale(0.97) !important; transition: transform var(--t-fast); }

/* ═══ BUTTON RIPPLE ═══ */
@keyframes btnRipple {
  0% { transform: scale(0.95); opacity: 0.9; }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}
.btn-ripple:active { animation: btnRipple 200ms ease; }

/* ═══ HOVER GLOW EFFECT ═══ */
@keyframes subtleGlow {
  0% { box-shadow: var(--shadow-sm); }
  50% { box-shadow: 0 4px 8px rgba(245,158,11,0.08), 0 16px 32px rgba(15,23,42,0.10); }
  100% { box-shadow: var(--shadow-sm); }
}

/* ═══ INTERVENTION ROW ═══ */
@keyframes rowSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Urgence row highlight */
.urgence-row { background: var(--status-urgent-bg) !important; }

/* ═══ BADGE PULSE ON HOVER ═══ */
@keyframes badgePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ═══ NUMBER COUNTER HIGHLIGHT ═══ */
@keyframes numberPop {
  0% { transform: scale(1); }
  30% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ═══ SIDEBAR NAV INDICATOR ═══ */
@keyframes navIndicator {
  from { width: 0; opacity: 0; }
  to   { width: 3px; opacity: 1; }
}

/* ═══ RESPONSIVE MOBILE ═══ */
@media (max-width: 768px) {
  .page-enter { padding: 16px !important; }
  .card-animate { min-width: 0 !important; }
  .page-enter > div:first-child { padding: 20px !important; border-radius: 14px !important; }

  /* Modal plein écran sur mobile */
  body > div[style*="position: fixed"][style*="z-index: 101"] {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
  }

  /* Sidebar masquée sur mobile */
  .sidebar-desktop { display: none !important; }
  .bottom-nav-mobile { display: flex !important; }
}

@media (min-width: 769px) {
  .sidebar-desktop { display: flex !important; }
  .bottom-nav-mobile { display: none !important; }
}

/* ═══ BOTTOM NAV MOBILE ═══ */
.bottom-nav-mobile {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--sidebar-bg);
  display: none;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  border-top: 1px solid var(--sidebar-border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t-normal);
  position: relative;
}

.bottom-nav-item.active {
  background: var(--sidebar-active);
}

.bottom-nav-item .nav-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: var(--sidebar-text);
}

.bottom-nav-item.active .nav-label {
  color: var(--sidebar-text-active);
}

.bottom-nav-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 10px;
  background: var(--blue-primary);
  color: white;
  border-radius: var(--r-full);
  padding: 0px 5px;
  min-width: 16px;
  text-align: center;
  line-height: 16px;
}

/* ═══ EMPTY STATE ═══ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state svg {
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state h3 {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-state p {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
  max-width: 320px;
}

/* ═══ DATA TABLE ═══ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-surface);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--t-normal);
}

.data-table thead th:hover {
  color: var(--text-secondary);
}

.data-table tbody tr {
  transition: background var(--t-normal);
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: var(--bg-surface);
}

.data-table tbody td {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

/* ═══ KPI CARD HOVER ═══ */
.kpi-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-normal), box-shadow var(--t-normal);
  cursor: default;
}

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

.kpi-card .kpi-value {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 32px;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.kpi-card .kpi-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.kpi-card .kpi-trend {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.kpi-card .kpi-trend.positive { color: var(--success); }
.kpi-card .kpi-trend.negative { color: var(--danger); }

/* ═══ CARD BASE ═══ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-normal), box-shadow var(--t-normal);
}

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

/* ═══ PRINT STYLES ═══ */
@media print {
  .sidebar-desktop, .bottom-nav-mobile { display: none !important; }
  body { background: white; }
  .page-enter { animation: none; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ===== MOBILE-FIRST FIXES ===== */
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0.8; }
  to { transform: translateY(0); opacity: 1; }
}

/* Safe areas & touch targets */
:root {
  --touch-min: 44px;
  --bottom-nav-height: calc(60px + env(safe-area-inset-bottom, 0px));
}

/* Prevent zoom on input focus (iOS) */
@media screen and (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Main content padding above bottom nav */
  main, .main-content {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Fullscreen modals on mobile */
  .modal-overlay > div {
    width: 100vw !important;
    max-width: 100vw !important;
    min-height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }

  /* Touch feedback */
  button, a, [role="button"] {
    -webkit-tap-highlight-color: transparent;
  }

  /* Page padding */
  .page-content, [style*="padding:28px 32px"], [style*="padding: 28px 32px"] {
    padding: 16px !important;
  }

  /* Typography scale */
  h1 { font-size: 22px !important; }
  h2 { font-size: 18px !important; }
}

/* Active touch scale */
@media (hover: none) and (pointer: coarse) {
  button:active, a:active {
    transform: scale(0.97) !important;
    opacity: 0.85 !important;
    transition: transform 80ms ease, opacity 80ms ease !important;
  }
}

/* Hide scrollbars */
.scroll-x-hidden::-webkit-scrollbar { display: none; }
.scroll-x-hidden { scrollbar-width: none; -ms-overflow-style: none; }

/* Horizontal KPI scroll */
.kpi-scroll-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 16px 8px;
  margin: 0 -16px;
}
.kpi-scroll-container::-webkit-scrollbar { display: none; }
.kpi-card-mobile {
  flex-shrink: 0;
  width: 140px;
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid #EDE9E1;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* FAB — Floating Action Button */
.fab-button {
  position: fixed;
  bottom: calc(64px + env(safe-area-inset-bottom) + 16px);
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: white;
  font-size: 28px;
  line-height: 56px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
  cursor: pointer;
  z-index: 100;
  display: none;
  border: none;
  transition: transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.fab-button:active { transform: scale(0.92); }
@media (max-width: 767px) {
  .fab-button { display: block; }
}

/* Pull-to-refresh indicator */
.ptr-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: top 0.2s;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
}

/* Mobile clients card list */
.client-card-mobile {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(15,23,42,0.07);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease;
}
.client-card-mobile:active { transform: scale(0.98); }

/* Planning mobile date strip */
.planning-date-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.planning-date-strip::-webkit-scrollbar { display: none; }
.planning-date-day {
  flex-shrink: 0;
  width: 46px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  background: #F5F2ED;
  border: 1.5px solid transparent;
  transition: all 150ms;
  -webkit-tap-highlight-color: transparent;
}
.planning-date-day.active {
  background: #FFFBEB;
  border-color: #F59E0B;
}
.planning-date-day.today {
  background: linear-gradient(135deg, #F59E0B, #D97706);
}

/* ═══ MOBILE PAGE HEADER ═══ */
@media (max-width: 767px) {
  .page-title {
    font-size: 20px !important;
    padding: 12px 16px !important;
  }
  h1[style*="font-size:26px"],
  h1[style*="fontSize:26px"] {
    font-size: 20px !important;
  }
}

/* Mobile quick-actions strip */
.quick-actions-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.quick-actions-strip::-webkit-scrollbar { display: none; }

/* ── TYPOGRAPHIE AMÉLIORÉE ── */
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.5;
}

/* ── CARTES COHÉRENTES ── */
.card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #F1EDE6;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* ── TABLEAUX ── */
table { border-collapse: collapse; width: 100%; }
th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94A3B8;
  padding: 10px 16px;
  background: #FAFAF7;
  border-bottom: 1px solid #F1EDE6;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid #F8F7F4;
  font-size: 13.5px;
  color: #374151;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFAF7; }

/* ── BOUTONS ── */
.btn-primary {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(245,158,11,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,158,11,0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s ease;
}
.btn-secondary:hover { background: #F9FAFB; border-color: #D1D5DB; }

/* ── BADGES DE STATUT ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge-success { background: #DCFCE7; color: #15803D; }
.badge-warning { background: #FEF3C7; color: #B45309; }
.badge-danger  { background: #FEE2E2; color: #B91C1C; }
.badge-info    { background: #DBEAFE; color: #1D4ED8; }
.badge-neutral { background: #F3F4F6; color: #6B7280; }

/* ── PAGE CONTAINER ── */
.page-container {
  padding: 24px 28px;
  max-width: 1400px;
  margin: 0 auto;
}
@media (max-width: 1024px) { .page-container { padding: 20px; } }
@media (max-width: 767px)  { .page-container { padding: 12px; } }

/* ── FORMULAIRES ── */
input, select, textarea {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  border-radius: 8px;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  color: #111827;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.12);
}

/* ── EMPTY STATE AMÉLIORÉ ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  text-align: center;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.empty-state h3 { font-size: 16px; font-weight: 700; color: #111827; margin-bottom: 8px; }
.empty-state p  { font-size: 13.5px; color: #6B7280; max-width: 280px; line-height: 1.6; }

/* ── MOBILE IMPROVEMENTS ── */
@media (max-width: 767px) {
  /* Textes lisibles */
  h1, h2 { font-size: clamp(18px, 4vw, 24px) !important; }
  h3 { font-size: clamp(15px, 3.5vw, 18px) !important; }
  p, td, li { font-size: 13.5px !important; }

  /* Tables scrollables */
  .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }

  /* Boutons full-width sur mobile */
  .btn-mobile-full { width: 100% !important; justify-content: center; }

  /* Grilles 1 colonne */
  .grid-responsive { grid-template-columns: 1fr !important; }

  /* Headers compacts */
  .page-header { padding: 12px 16px !important; }
  .page-header h1 { font-size: 18px !important; }

  /* Cartes sans padding excessif */
  .card-mobile { padding: 12px !important; }

  /* Overflow sur les formulaires */
  form { max-width: 100% !important; }

  /* Lignes de devis en colonne */
  .devis-ligne-grid { grid-template-columns: 1fr !important; gap: 8px !important; }

  /* Filtres en scroll horizontal */
  .filters-row {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filters-row::-webkit-scrollbar { display: none; }
  .filters-row > * { flex-shrink: 0; }
}

/* ── STAT CARDS AMÉLIORÉES ── */
.stat-card {
  background: #fff;
  border: 1px solid #F1EDE6;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); transform: translateY(-1px); }
.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.stat-card .stat-value {
  font-size: 26px;
  font-weight: 800;
  color: #111827;
  font-family: 'Sora', sans-serif;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 12px;
  color: #9CA3AF;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-card .stat-trend {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}
.stat-trend.up { color: #16A34A; }
.stat-trend.down { color: #DC2626; }

/* ── LISIBILITÉ GÉNÉRALE ── */
/* Sidebar compact */
.sidebar-nav-item {
  border-radius: 8px;
  transition: all 0.15s ease;
}
.sidebar-nav-item:hover { background: rgba(245,158,11,0.08); }
.sidebar-nav-item.active { background: rgba(245,158,11,0.12); }

/* En-têtes de section */
.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94A3B8;
  margin-bottom: 8px;
  margin-top: 16px;
}

/* Ligne séparateur subtile */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #E5E7EB 20%, #E5E7EB 80%, transparent);
  margin: 16px 0;
}

/* Scroll smooth */
* { scroll-behavior: smooth; }

/* Focus visible accessible */
:focus-visible {
  outline: 2px solid #F59E0B;
  outline-offset: 2px;
}

/* Transitions par défaut */
button, a, input, select { transition: all 0.15s ease; }

/* Overflow prevention */
.overflow-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── MOBILE : tableaux → cartes ── */
@media (max-width: 767px) {
  /* Convertir tables en cards sur mobile */
  .mobile-card-table thead { display: none; }
  .mobile-card-table tbody tr {
    display: block;
    background: #fff;
    border: 1px solid #F1EDE6;
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }
  .mobile-card-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: none;
    font-size: 13px;
  }
  .mobile-card-table td:before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #94A3B8;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    margin-right: 12px;
  }
}

/* ── AMÉLIORATION MODALS MOBILE ── */
@media (max-width: 767px) {
  .modal-overlay {
    align-items: flex-end !important;
  }
  .modal-content {
    border-radius: 20px 20px 0 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
  }
}
