/*
 * BATOUNOT — Design System
 * Trust & Authority + Minimal Style
 * ui-ux-pro-max: Legal SaaS / Notarial Professional
 */

/* ─── TOKENS ──────────────────────────────────────────────── */
:root {
  /* Brand Palette */
  --color-primary:         #0B1120;
  --color-primary-700:     #1e293b;
  --color-primary-600:     #334155;
  --color-primary-500:     #475569;
  --color-primary-100:     #f1f5f9;
  --color-primary-50:      #f8fafc;

  --color-gold:            #D4AF37;
  --color-gold-light:      #F3E5AB;
  --color-gold-muted:      rgba(212, 175, 55, 0.15);

  --color-accent:          #1e40af;
  --color-accent-light:    #dbeafe;
  --color-accent-muted:    rgba(30, 64, 175, 0.08);

  /* Semantic Colors */
  --color-success:         #16a34a;
  --color-success-bg:      #f0fdf4;
  --color-success-border:  #bbf7d0;

  --color-danger:          #dc2626;
  --color-danger-bg:       #fef2f2;
  --color-danger-border:   #fecaca;

  --color-warning:         #d97706;
  --color-warning-bg:      #fffbeb;
  --color-warning-border:  #fde68a;

  --color-info:            #0284c7;
  --color-info-bg:         #f0f9ff;
  --color-info-border:     #bae6fd;

  /* Surfaces */
  --color-bg:              #F8FAFC;
  --color-surface:         #ffffff;
  --color-surface-raised:  #ffffff;
  --color-border:          #e2e8f0;
  --color-border-light:    #f1f5f9;

  /* Typography */
  --color-text:            #0F172A;
  --color-text-secondary:  #475569;
  --color-text-muted:      #94a3b8;
  --color-text-inverse:    #ffffff;

  /* ─── TYPOGRAPHY ────────────────────────────────────────── */
  --font-serif:     'EB Garamond', Georgia, serif;
  --font-display:   'Plus Jakarta Sans', system-ui, sans-serif;
  --font-sans:      'Lato', system-ui, sans-serif;
  --font-mono:      'Fira Code', 'Cascadia Code', monospace;

  /* Font Sizes */
  --text-xs:    0.6875rem; /* 11px */
  --text-sm:    0.8125rem; /* 13px */
  --text-base:  0.9375rem; /* 15px */
  --text-md:    1rem;      /* 16px */
  --text-lg:    1.125rem;  /* 18px */
  --text-xl:    1.25rem;   /* 20px */
  --text-2xl:   1.5rem;    /* 24px */
  --text-3xl:   1.875rem;  /* 30px */
  --text-4xl:   2.25rem;   /* 36px */
  --text-5xl:   3rem;      /* 48px */

  /* ─── SPACING ───────────────────────────────────────────── */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* ─── BORDER RADIUS ─────────────────────────────────────── */
  --radius-xs:  0.25rem;   /* 4px  — badges compacts */
  --radius-sm:  0.5rem;    /* 8px  — inputs, tags */
  --radius-md:  0.75rem;   /* 12px — buttons */
  --radius-lg:  1rem;      /* 16px — cards */
  --radius-xl:  1.25rem;   /* 20px — panels */
  --radius-2xl: 1.5rem;    /* 24px — sections */
  --radius-full: 9999px;   /* pills */

  /* ─── SHADOWS ───────────────────────────────────────────── */
  --shadow-xs:     0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:     0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:     0 10px 30px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
  --shadow-xl:     0 20px 50px rgba(0,0,0,0.10), 0 8px 20px rgba(0,0,0,0.05);
  --shadow-gold:   0 0 20px rgba(212, 175, 55, 0.25);
  --shadow-sidebar: 4px 0 24px rgba(0,0,0,0.15);

  /* ─── TRANSITIONS ───────────────────────────────────────── */
  --transition-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base:   200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:   300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 400ms cubic-bezier(0.23, 1, 0.32, 1);

  /* ─── Z-INDEX SCALE ─────────────────────────────────────── */
  --z-base:     1;
  --z-raised:   10;
  --z-dropdown: 20;
  --z-sticky:   30;
  --z-overlay:  40;
  --z-modal:    50;
  --z-toast:    60;
  --z-tooltip:  70;
}


/* ─── BASE RESET / TYPOGRAPHY ───────────────────────────── */
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .font-serif {
  font-family: var(--font-serif);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.font-display {
  font-family: var(--font-display) !important;
}

/* ─── CARDS ─────────────────────────────────────────────── */
.ds-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.ds-card:hover {
  box-shadow: var(--shadow-md);
}

.ds-card-interactive {
  cursor: pointer;
}

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

/* Glass Card (light mode safe) */
.glass-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition-spring), transform var(--transition-spring);
}

.glass-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.97);
}

/* Glass Panel (dark bg) */
.glass-panel {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Liquid glass — use sparingly */
.liquid-glass {
  background: linear-gradient(135deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.08) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 8px 32px rgba(31,38,135,0.06);
}


/* ─── BUTTONS ─────────────────────────────────────────────── */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  transition: all var(--transition-base);
  cursor: pointer;
  border: 1px solid transparent;
  line-height: 1;
  white-space: nowrap;
}

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

.ds-btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-sm);
}
.ds-btn-primary:hover {
  background: var(--color-primary-700);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.ds-btn-gold {
  background: var(--color-gold);
  color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(212,175,55,0.25);
}
.ds-btn-gold:hover {
  background: var(--color-gold-light);
  box-shadow: 0 6px 16px rgba(212,175,55,0.35);
  transform: translateY(-1px);
}

.ds-btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}
.ds-btn-ghost:hover {
  background: var(--color-primary-100);
  color: var(--color-text);
}


/* ─── BADGES ─────────────────────────────────────────────── */
.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  padding: 2px var(--space-2);
  line-height: 1.4;
}

.ds-badge-neutral  { background: var(--color-primary-100); color: var(--color-primary-600); }
.ds-badge-gold     { background: var(--color-gold-muted); color: #92670a; border: 1px solid rgba(212,175,55,0.3); }
.ds-badge-success  { background: var(--color-success-bg); color: var(--color-success); border: 1px solid var(--color-success-border); }
.ds-badge-danger   { background: var(--color-danger-bg); color: var(--color-danger); border: 1px solid var(--color-danger-border); }
.ds-badge-warning  { background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid var(--color-warning-border); }
.ds-badge-info     { background: var(--color-info-bg); color: var(--color-info); border: 1px solid var(--color-info-border); }
.ds-badge-accent   { background: var(--color-accent-muted); color: var(--color-accent); }


/* ─── FORM ELEMENTS ──────────────────────────────────────── */
.ds-input {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text);
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
.ds-input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.15), inset 0 1px 2px rgba(0,0,0,0.02);
}
.ds-input::placeholder { color: var(--color-text-muted); }

.ds-label {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}


/* ─── TABLES ─────────────────────────────────────────────── */
.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.ds-table thead tr {
  background: var(--color-primary-50);
  border-bottom: 2px solid var(--color-border-light);
}
.ds-table th {
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  text-align: left;
}
.ds-table td {
  padding: var(--space-4) var(--space-5);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}
.ds-table tbody tr {
  transition: background var(--transition-fast);
}
.ds-table tbody tr:hover {
  background: rgba(30, 64, 175, 0.025);
}
.ds-table tbody tr:last-child td {
  border-bottom: none;
}


/* ─── SECTION HEADERS ────────────────────────────────────── */
.ds-section-title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.ds-section-subtitle {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  line-height: 1.5;
}

.ds-eyebrow {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}


/* ─── KPI CARDS ──────────────────────────────────────────── */
.ds-kpi {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  position: relative;
  overflow: hidden;
}
.ds-kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.ds-kpi-dark {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: transparent;
  box-shadow: var(--shadow-lg);
}
.ds-kpi-value {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-text);
}
.ds-kpi-dark .ds-kpi-value { color: var(--color-text-inverse); }
.ds-kpi-label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}


/* ─── SIDEBAR STYLES ─────────────────────────────────────── */
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #94a3b8;
  transition: all var(--transition-fast);
  position: relative;
  cursor: pointer;
  text-decoration: none;
}
.sidebar-nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #ffffff;
}
.sidebar-nav-item.active {
  background: rgba(255,255,255,0.1);
  color: var(--color-gold);
}
.sidebar-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 3px;
  background: var(--color-gold);
  border-radius: 0 2px 2px 0;
}
.sidebar-nav-item .nav-icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  font-size: 0.9375rem;
}


/* ─── PROGRESS BARS ──────────────────────────────────────── */
.ds-progress-track {
  height: 6px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.ds-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  transition: width 1s ease;
}
.ds-progress-fill.gold  { background: var(--color-gold); }
.ds-progress-fill.green { background: var(--color-success); }
.ds-progress-fill.blue  { background: var(--color-accent); }


/* ─── TABS ───────────────────────────────────────────────── */
.ds-tab-nav {
  display: flex;
  gap: var(--space-1);
  border-bottom: 2px solid var(--color-border);
  margin-bottom: var(--space-6);
}
.ds-tab {
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.ds-tab:hover { color: var(--color-text); }
.ds-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}


/* ─── DIVIDERS ───────────────────────────────────────────── */
.ds-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-6) 0;
}
.ds-divider-dashed {
  border-top: 1px dashed var(--color-border);
  margin: var(--space-6) 0;
}


/* ─── TOASTS ─────────────────────────────────────────────── */
.ds-toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  min-width: 300px;
  border: 1px solid;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  background: #ffffff;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  position: relative;
  overflow: hidden;
}
.ds-toast.success { border-color: var(--color-success-border); background: var(--color-success-bg); }
.ds-toast.error   { border-color: var(--color-danger-border);  background: var(--color-danger-bg); }
.ds-toast.warning { border-color: var(--color-warning-border); background: var(--color-warning-bg); }
.ds-toast.info    { border-color: var(--color-info-border);    background: var(--color-info-bg); }


/* ─── MODAL OVERLAY ──────────────────────────────────────── */
.ds-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
}
.ds-modal {
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.ds-modal-header {
  padding: var(--space-6) var(--space-8);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-primary-50);
}
.ds-modal-body { padding: var(--space-8); }
.ds-modal-footer {
  padding: var(--space-5) var(--space-8);
  border-top: 1px solid var(--color-border);
  background: var(--color-primary-50);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}


/* ─── ALERTS / INFO BANNERS ──────────────────────────────── */
.ds-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid;
  font-size: var(--text-sm);
}
.ds-alert-success { background: var(--color-success-bg); border-color: var(--color-success-border); color: #166534; }
.ds-alert-danger  { background: var(--color-danger-bg);  border-color: var(--color-danger-border);  color: #991b1b; }
.ds-alert-warning { background: var(--color-warning-bg); border-color: var(--color-warning-border); color: #92400e; }
.ds-alert-info    { background: var(--color-info-bg);    border-color: var(--color-info-border);    color: #075985; }


/* ─── AVATAR ─────────────────────────────────────────────── */
.ds-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold));
  color: var(--color-primary);
  font-family: var(--font-display);
  font-weight: 800;
}
.ds-avatar-sm { width: 2rem;    height: 2rem;    font-size: var(--text-xs); }
.ds-avatar-md { width: 2.5rem;  height: 2.5rem;  font-size: var(--text-sm); }
.ds-avatar-lg { width: 3rem;    height: 3rem;    font-size: var(--text-md); }
.ds-avatar-xl { width: 4rem;    height: 4rem;    font-size: var(--text-xl); }


/* ─── EMPTY STATES ───────────────────────────────────────── */
.ds-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-8);
  text-align: center;
}
.ds-empty-icon {
  font-size: 2.5rem;
  color: var(--color-border);
  margin-bottom: var(--space-2);
}
.ds-empty-title {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-text-secondary);
}
.ds-empty-body {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 320px;
}


/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slide-in-right {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes shrink-bar {
  from { width: 100%; }
  to   { width: 0%; }
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(212,175,55,0.4); }
  70%  { box-shadow: 0 0 0 8px rgba(212,175,55,0); }
  100% { box-shadow: 0 0 0 0 rgba(212,175,55,0); }
}

.animate-fade-in  { animation: fade-in var(--transition-slow) ease both; }
.animate-slide-in { animation: slide-in-right var(--transition-slow) ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ─── SCROLLBAR ──────────────────────────────────────────── */
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
.scrollbar-thin::-webkit-scrollbar       { width: 5px; height: 5px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: var(--radius-full); }

.scrollbar-hide {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scrollbar-hide::-webkit-scrollbar { display: none; }


/* ─── SELECT ─────────────────────────────────────────────── */
.ds-select {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  padding-right: 2.5rem;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text);
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.875rem center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  appearance: none;
  cursor: pointer;
}
.ds-select:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.15), inset 0 1px 2px rgba(0,0,0,0.02);
}


/* ─── FORM SECTION CARD ──────────────────────────────────── */
.premium-card,
.ds-form-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--space-8);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition-base);
}
.premium-card:hover,
.ds-form-section:hover {
  box-shadow: var(--shadow-md);
}

.ds-form-section-title {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}


/* ─── BACK LINK ──────────────────────────────────────────── */
.ds-back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
  text-decoration: none;
}
.ds-back-link:hover { color: var(--color-text); }


/* ─── PAGE HEADER ────────────────────────────────────────── */
.ds-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.ds-page-title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-top: 0.25rem;
  letter-spacing: -0.01em;
}

.ds-page-subtitle {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: 0.375rem;
  line-height: 1.5;
}


/* ─── SECTION DIVIDER ────────────────────────────────────── */
.ds-section-divider {
  border-top: 1px solid var(--color-border-light);
  margin: 1.5rem 0;
}


/* ─── STAT CARD ──────────────────────────────────────────── */
.ds-stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  position: relative;
  overflow: hidden;
}
.ds-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.ds-stat-value {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
  letter-spacing: -0.02em;
}
.ds-stat-label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}


/* ─── PRINT ──────────────────────────────────────────────── */
@media print {
  .no-print { display: none !important; }
  body { background: white; }
}


/* ─── SIDEBAR BADGE ──────────────────────────────────────── */
/* Dot variant for collapsed sidebar — shown via JS */
.sidebar-badge-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  height: 8px;
  width: 8px;
  border-radius: 9999px;
  background: var(--color-danger);
  box-shadow: 0 0 0 2px var(--color-primary);
}

/* ─── DARK MODE ──────────────────────────────────────────── */
/* Activable via classe .dark sur <html> (Tailwind standard) */

.dark {
  --color-primary:         #e2e8f0;
  --color-primary-700:     #cbd5e1;
  --color-primary-600:     #94a3b8;
  --color-primary-500:     #64748b;
  --color-primary-100:     #1e293b;
  --color-primary-50:      #0f172a;

  --color-bg:              #0f172a;
  --color-surface:         #1e293b;
  --color-surface-raised:  #334155;
  --color-border:          #334155;
  --color-border-light:    #1e293b;

  --color-text:            #f1f5f9;
  --color-text-secondary:  #94a3b8;
  --color-text-muted:      #64748b;
  --color-text-inverse:    #0f172a;

  --color-success-bg:      #052e16;
  --color-danger-bg:       #450a0a;
  --color-warning-bg:      #451a03;
  --color-info-bg:         #0c4a6e;
}

/* ─── P5: Audit Intégré — Nouveaux composants ─────────────────────────── */

/* Badge complétude (vert/orange/rouge) + pulse si <70% */
.ds-completude-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.5rem; height: 2.5rem; border-radius: 9999px;
  font-weight: 700; font-size: 0.75rem; cursor: pointer;
  transition: transform 0.15s ease;
}
.ds-completude-badge:hover { transform: scale(1.1); }
.ds-completude-badge.pulse { animation: ds-pulse 2s infinite; }
@keyframes ds-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* Panneau OCR coulissant (slide-in-right) */
.ds-ocr-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 28rem; max-width: 90vw;
  background: white; box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  z-index: 60; overflow-y: auto; padding: 1.5rem;
  transform: translateX(100%); transition: transform 0.3s ease;
}
.ds-ocr-panel:not(.hidden) { transform: translateX(0); }

/* Timeline chaîne formalités (points + lignes verticales) */
.ds-timeline-chain { position: relative; }
.ds-timeline-chain > div:last-child { border-left-color: transparent; }

/* Cadre groupé pour tâches parallèles */
.ds-parallel-group {
  border-left: 3px solid var(--color-gold, #D4AF37);
  padding: 0.75rem 1rem; margin: 0.5rem 0;
  background: rgba(212, 175, 55, 0.04); border-radius: 0.5rem;
}
.ds-parallel-group::before {
  content: 'Parallèle'; display: block; font-size: 0.65rem; font-weight: 700;
  color: var(--color-gold, #D4AF37); text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

/* Bannière conformité pleine largeur */
.ds-conformite-banner {
  padding: 1rem 1.5rem; border-radius: 0.75rem;
  display: flex; align-items: flex-start; gap: 0.75rem;
}

/* Ligne champ OCR extrait */
.ds-extraction-field {
  padding: 0.5rem 0; border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: center; gap: 0.75rem;
}
.ds-extraction-field:hover { background: #f8fafc; }

/* Timeline correspondance horizontale */
.ds-correspondance-timeline .border-l-2 { border-left-width: 2px; }

/* Style lecture seule pour onglets métier transformés */
.ds-form-readonly {
  background: #f8fafc; border-radius: 0.5rem; padding: 1rem;
  pointer-events: none; opacity: 0.9;
}
.ds-form-readonly input, .ds-form-readonly select, .ds-form-readonly textarea {
  background: #f1f5f9; border-color: #e2e8f0;
}

/* Progress bar mini (complétude par bloc) */
.ds-progress-bar {
  height: 0.375rem; background: #e2e8f0; border-radius: 9999px; overflow: hidden;
}
.ds-progress-fill {
  height: 100%; background: var(--color-gold, #D4AF37); border-radius: 9999px;
  transition: width 0.5s ease;
}

/* Alert variants */
.ds-alert { padding: 1rem; border-radius: 0.75rem; display: flex; align-items: flex-start; gap: 0.5rem; }
.ds-alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.ds-alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.ds-alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.ds-alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* Button extra-small */
.ds-btn-xs { padding: 0.25rem 0.5rem; font-size: 0.7rem; border-radius: 0.375rem; }
