@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

/* ================================================================
   LINKEVENT by LSCS — global.css  v2.0
   Source unique de vérité : variables, reset, layout, header,
   footer, boutons, formulaires, badges, modals, toasts, skeletons,
   états vides, sidebar layout, utilitaires.
   ================================================================ */


/* ================================================================
   1. VARIABLES CSS
   ================================================================ */
:root {

  /* — Couleur primaire (bleu marine) — */
  --primary:        #1E3A5F;
  --primary-m:      #3B6CB0;
  --primary-l:      #DBEAFE;
  --primary-d:      #0F1F35;
  --primary-glow:   rgba(30, 58, 95, 0.18);

  /* — Accent or — */
  --gold:           #C9A84C;
  --gold-h:         #D9B85C;
  --gold-l:         #FDF6E3;
  --gold-d:         #78490A;

  /* — Fonds & surfaces — */
  --bg:             #F8FAFC;
  --surface:        #EFF6FF;
  --surface-2:      #DBEAFE;
  --white:          #FFFFFF;

  /* — Texte — */
  --text:           #0F172A;
  --text-s:         #475569;
  --text-t:         #94A3B8;

  /* — Bordures — */
  --border:         #BFDBFE;
  --border-s:       #93C5FD;
  --border-gray:    #CBD5E1;

  /* — Sémantiques — */
  --success:        #065F46;
  --success-l:      #D1FAE5;
  --success-b:      #10B981;
  --warn:           #92400E;
  --warn-l:         #FEF3C7;
  --warn-b:         #F59E0B;
  --danger:         #991B1B;
  --danger-l:       #FEE2E2;
  --danger-b:       #E11D48;
  --neutral:        #334155;
  --neutral-l:      #F1F5F9;

  /* — Ombres — */
  --shadow:         0 16px 40px rgba(30, 58, 95, 0.08);
  --shadow-s:       0 8px 20px rgba(30, 58, 95, 0.06);
  --shadow-btn:     0 10px 22px rgba(30, 58, 95, 0.22);

  /* — Typographie — */
  --font-title:     'Cormorant Garamond', Georgia, serif;
  --font-body:      'DM Sans', system-ui, sans-serif;

  /* — Arrondis — */
  --r-xs:   6px;
  --r-sm:   10px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-pill: 999px;

  /* — Layout — */
  --container:      1200px;
  --header-h:       80px;
  --sidebar-w:      260px;

  /* — Transitions — */
  --t:   0.22s ease;
  --t-s: 0.14s ease;
}


/* ================================================================
   2. RESET & BASE
   ================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img, video, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
ul, ol { list-style: none; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-title);
  line-height: 1.18;
  color: var(--text);
  margin: 0 0 12px;
}

h1 { font-size: clamp(2.5rem, 5.5vw, 4.4rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.9rem, 4vw, 3.2rem);  font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; font-family: var(--font-body); }
h4 { font-size: 1.05rem; font-weight: 600; font-family: var(--font-body); }

p { margin: 0 0 14px; color: var(--text-s); line-height: 1.75; }
p:last-child { margin-bottom: 0; }


/* ================================================================
   3. LAYOUT UTILITAIRES
   ================================================================ */
.container {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}
.container-sm { width: min(100% - 32px, 860px);  margin: 0 auto; }
.container-md { width: min(100% - 32px, 1060px); margin: 0 auto; }

.section    { padding: 88px 0; }
.section-sm { padding: 56px 0; }

.text-center    { text-align: center; }
.text-right     { text-align: right; }
.flex           { display: flex; }
.flex-col       { display: flex; flex-direction: column; }
.items-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.mt-4  { margin-top: 4px; }  .mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-4  { margin-bottom: 4px; }  .mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}


/* ================================================================
   4. BOUTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: var(--r-md);
  border: 1.5px solid transparent;
  font-family: var(--font-body);
  font-size: 0.97rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--t), box-shadow var(--t), background var(--t),
              color var(--t), border-color var(--t), opacity var(--t);
  text-decoration: none;
  line-height: 1;
  user-select: none;
}

.btn:hover          { transform: translateY(-2px); }
.btn:active         { transform: translateY(0); }
.btn:disabled,
.btn[disabled]      { opacity: 0.48; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: var(--shadow-btn); border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-m); border-color: var(--primary-m);
  box-shadow: 0 14px 28px rgba(30,58,95,0.3);
}

.btn-secondary {
  background: transparent; color: var(--primary);
  border-color: var(--primary);
}
.btn-secondary:hover { background: var(--primary); color: #fff; }

.btn-ghost {
  background: transparent; color: var(--text-s);
  border-color: var(--border-gray);
}
.btn-ghost:hover {
  background: var(--neutral-l); border-color: var(--border-s); color: var(--text);
}

.btn-gold {
  background: var(--gold); color: #1a1000; border-color: var(--gold);
}
.btn-gold:hover {
  background: var(--gold-h); border-color: var(--gold-h);
  box-shadow: 0 10px 24px rgba(201,168,76,0.3);
}

.btn-danger {
  background: var(--danger-l); color: var(--danger); border-color: #fca5a5;
}
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-light {
  background: var(--white); color: var(--primary);
  border-color: var(--border); box-shadow: var(--shadow-s);
}
.btn-light:hover { border-color: var(--gold); color: var(--gold-d); }

.btn-dark {
  background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.88);
  border-color: rgba(255,255,255,0.2);
}
.btn-dark:hover { background: rgba(255,255,255,0.18); color: #fff; }

.btn-sm  { height: 36px; padding: 0 16px; font-size: 0.84rem; border-radius: var(--r-sm); }
.btn-lg  { height: 54px; padding: 0 32px; font-size: 1rem;    border-radius: var(--r-lg); }
.btn-xl  { height: 62px; padding: 0 40px; font-size: 1.05rem; border-radius: var(--r-xl); }
.btn-full { width: 100%; }

.btn-icon {
  width: 42px; height: 42px; padding: 0;
  border-radius: var(--r-md); background: transparent;
  color: var(--text-s); border-color: var(--border-gray); font-size: 1rem;
}
.btn-icon:hover { background: var(--surface); color: var(--primary); border-color: var(--border-s); }
.btn-icon.sm { width: 34px; height: 34px; font-size: 0.9rem; }

.btn.loading {
  position: relative; color: transparent; pointer-events: none;
}
.btn.loading::after {
  content: ''; position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: rgba(255,255,255,0.9);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
.btn-ghost.loading::after, .btn-secondary.loading::after {
  border-color: rgba(30,58,95,0.2); border-top-color: var(--primary);
}


/* ================================================================
   5. FORMULAIRES
   ================================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 14px; font-weight: 600;
  color: var(--text-s); letter-spacing: 0.01em;
}
.form-label.required::after { content: ' *'; color: var(--danger-b); }

.form-control {
  width: 100%; height: 46px;
  padding: 0 14px;
  background: var(--white);
  border: 1.5px solid var(--border-gray);
  border-radius: var(--r-sm);
  font-family: var(--font-body); font-size: 15px;
  color: var(--text); outline: none;
  transition: border-color var(--t-s), box-shadow var(--t-s);
  appearance: none;
}

textarea.form-control {
  height: auto; min-height: 110px;
  padding: 12px 14px; resize: vertical; line-height: 1.6;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px; cursor: pointer;
}

.form-control:focus {
  border-color: var(--primary-m);
  box-shadow: 0 0 0 3px rgba(59,108,176,0.12);
}
.form-control::placeholder { color: var(--text-t); }
.form-control.is-error { border-color: var(--danger-b); box-shadow: 0 0 0 3px rgba(225,29,72,0.1); }
.form-control.is-success { border-color: var(--success-b); box-shadow: 0 0 0 3px rgba(16,185,129,0.1); }
.form-control:disabled { background: var(--neutral-l); color: var(--text-t); cursor: not-allowed; }

.form-hint  { font-size: 12px; color: var(--text-t); line-height: 1.5; }
.form-error { font-size: 12px; color: var(--danger); font-weight: 500; display: flex; align-items: center; gap: 5px; }

.form-grid       { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid.full  { grid-template-columns: 1fr; }

.form-actions {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-top: 8px;
}

.form-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px; height: 18px;
  accent-color: var(--primary); flex-shrink: 0; margin-top: 2px; cursor: pointer;
}
.form-check-label { font-size: 14px; color: var(--text-s); line-height: 1.5; }

/* Toggle mot de passe */
.password-wrapper { position: relative; }
.password-wrapper .form-control { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; color: var(--text-t);
  cursor: pointer; font-size: 16px; padding: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--t-s);
}
.password-toggle:hover { color: var(--primary); }

.password-strength { display: flex; gap: 4px; margin-top: 8px; }
.strength-bar {
  height: 3px; flex: 1; border-radius: 3px;
  background: var(--border); transition: background 0.3s;
}
.strength-bar.weak   { background: var(--danger-b); }
.strength-bar.medium { background: var(--warn-b); }
.strength-bar.strong { background: var(--success-b); }
.strength-label { font-size: 11px; color: var(--text-t); margin-top: 4px; }


/* ================================================================
   6. HEADER
   ================================================================ */
.site-header {
  position: sticky; top: 0; z-index: 900;
  height: var(--header-h);
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(191, 219, 254, 0.65);
  transition: box-shadow var(--t);
}

.site-header.scrolled {
  box-shadow: 0 4px 24px rgba(30, 58, 95, 0.09);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
}

/* Logo */
.logo {
  display: inline-flex; align-items: center;
  gap: 11px; flex-shrink: 0; text-decoration: none;
}

.logo-mark {
  width: 44px; height: 44px; border-radius: 13px;
  background: linear-gradient(135deg, var(--primary), var(--primary-m));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-size: 1.4rem; font-weight: 700;
  flex-shrink: 0; box-shadow: 0 6px 18px rgba(30,58,95,0.22);
  transition: transform var(--t);
}

.logo:hover .logo-mark { transform: scale(1.06) rotate(-2deg); }

.logo-text {
  font-family: var(--font-title);
  font-size: 1.22rem; font-weight: 700;
  color: var(--text); letter-spacing: -0.01em; line-height: 1;
}

/* Nav desktop */
.header-mobile-panel {
  display: flex; align-items: center;
  justify-content: space-between; gap: 24px; flex: 1;
}

.main-nav { display: flex; align-items: center; gap: 4px; margin: 0 auto; }

.main-nav a {
  position: relative; padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 0.97rem; font-weight: 500;
  color: var(--text-s);
  transition: color var(--t), background var(--t);
  white-space: nowrap;
}
.main-nav a:hover { color: var(--primary); background: var(--surface); }
.main-nav a.active {
  color: var(--primary); background: var(--surface-2); font-weight: 600;
}

.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--danger-b); color: #fff;
  font-size: 10px; font-weight: 600;
  border-radius: var(--r-pill); margin-left: 4px; vertical-align: middle;
}

.header-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

/* Bloc utilisateur connecté */
.header-user {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border);
  background: var(--white); cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t);
  text-decoration: none; color: var(--text);
}
.header-user:hover { border-color: var(--border-s); box-shadow: var(--shadow-s); }

.header-user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}

.header-user-name {
  font-size: 13px; font-weight: 500; color: var(--text);
  max-width: 120px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* Burger mobile */
.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--primary); font-size: 1.1rem;
  cursor: pointer; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background var(--t), border-color var(--t); line-height: 1;
}
.menu-toggle:hover { background: var(--surface); border-color: var(--border-s); }


/* ================================================================
   7. FOOTER
   ================================================================ */
.site-footer {
  background: linear-gradient(160deg, var(--primary-d) 0%, #07121f 100%);
  color: rgba(255,255,255,0.82);
  margin-top: 80px; padding-top: 68px;
  position: relative; overflow: hidden;
}

.site-footer::before {
  content: ''; position: absolute;
  top: -160px; right: -120px;
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(201,168,76,0.10) 0%, transparent 64%);
  pointer-events: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 0.9fr;
  gap: 36px;
  padding-bottom: 48px;
  position: relative; z-index: 1;
}

.footer-logo .logo-text { color: #fff; }
.footer-logo .logo-mark {
  background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: none; color: #fff;
}

.footer-tagline {
  font-size: 13px; color: rgba(255,255,255,0.52);
  line-height: 1.7; max-width: 320px; margin-top: 14px;
}

.footer-col-title {
  font-family: var(--font-body);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.38); margin-bottom: 18px;
}

/* Rétrocompatibilité avec footer.php qui utilise <h4> */
.site-footer h4 {
  font-family: var(--font-body);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.38); margin-bottom: 18px;
  line-height: 1.4;
}

.footer-links {
  display: flex; flex-direction: column; gap: 10px;
}
.footer-links a,
.footer-links span {
  font-size: 15px; color: rgba(255,255,255,0.62); transition: color var(--t); line-height: 1.4;
}
.footer-links a:hover { color: #fff; }
.footer-links a.highlight { color: var(--gold); }
.footer-links a.highlight:hover { color: var(--gold-h); }

.footer-social { display: flex; gap: 8px; margin-top: 20px; }
.footer-social a {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.52); font-size: 14px;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.footer-social a:hover {
  background: rgba(255,255,255,0.12); color: #fff;
  border-color: rgba(255,255,255,0.25);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 20px 0 26px;
  display: flex; align-items: center;
  justify-content: space-between; gap: 14px;
  flex-wrap: wrap; position: relative; z-index: 1;
}

.footer-copy {
  font-size: 13px; color: rgba(255,255,255,0.38); margin: 0;
}

/* Rétrocompatibilité footer.php → <p> dans footer-bottom */
.footer-bottom p {
  font-size: 13px; color: rgba(255,255,255,0.38); margin: 0;
}

.footer-legal { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.footer-legal a { font-size: 13px; color: rgba(255,255,255,0.46); transition: color var(--t); }
.footer-legal a:hover { color: rgba(255,255,255,0.85); }
.footer-legal span  { color: rgba(255,255,255,0.2); font-size: 11px; }


/* ================================================================
   8. BADGES & STATUTS
   ================================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600;
  line-height: 1; white-space: nowrap;
}

.badge-blue   { background: var(--surface-2); color: var(--primary); }
.badge-marine { background: var(--primary);   color: #fff; }
.badge-gold   { background: var(--gold-l);    color: var(--gold-d); }
.badge-green  { background: var(--success-l); color: var(--success); }
.badge-amber  { background: var(--warn-l);    color: var(--warn); }
.badge-red    { background: var(--danger-l);  color: var(--danger); }
.badge-gray   { background: var(--neutral-l); color: var(--neutral); }

/* Statuts des demandes (avec pastille auto via ::before) */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.status-badge::before {
  content: ''; width: 5px; height: 5px;
  border-radius: 50%; flex-shrink: 0;
}

.s-nouvelle   { background: var(--surface-2); color: var(--primary); }
.s-nouvelle::before   { background: var(--primary-m); }
.s-lue        { background: var(--success-l); color: var(--success); }
.s-lue::before        { background: var(--success-b); }
.s-en-attente { background: var(--warn-l);    color: var(--warn); }
.s-en-attente::before { background: var(--warn-b); }
.s-devis      { background: var(--gold-l);    color: var(--gold-d); }
.s-devis::before      { background: var(--gold); }
.s-traitee    { background: var(--neutral-l); color: var(--neutral); }
.s-traitee::before    { background: #64748B; }
.s-refusee    { background: var(--danger-l);  color: var(--danger); }
.s-refusee::before    { background: var(--danger-b); }
.s-active     { background: var(--success-l); color: var(--success); }
.s-active::before     { background: var(--success-b); }
.s-inactive   { background: var(--neutral-l); color: var(--neutral); }
.s-inactive::before   { background: #94A3B8; }


/* ================================================================
   9. CARDS — BASE COMMUNE
   ================================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--border-s); }
.card-body { padding: 1.4rem 1.6rem; }
.card-header {
  padding: 1.2rem 1.6rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-header-title { font-size: 15px; font-weight: 600; color: var(--text); }
.card-footer {
  padding: 1rem 1.6rem; border-top: 1px solid var(--border);
  background: var(--neutral-l);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card.featured { border: 2px solid var(--primary); box-shadow: 0 0 0 4px var(--primary-l); }

.card-stat {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 1.4rem 1.6rem;
  display: flex; align-items: flex-start; gap: 14px;
}
.card-stat-icon {
  width: 46px; height: 46px; border-radius: var(--r-sm);
  background: var(--surface); display: flex; align-items: center;
  justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.card-stat-val {
  font-family: var(--font-title); font-size: 2rem; font-weight: 700;
  color: var(--primary); line-height: 1; margin-bottom: 4px;
}
.card-stat-label { font-size: 13px; color: var(--text-t); }
.card-stat-trend { font-size: 12px; font-weight: 600; margin-top: 4px; }
.card-stat-trend.up   { color: var(--success); }
.card-stat-trend.down { color: var(--danger); }


/* ================================================================
   10. AVATAR
   ================================================================ */
.avatar {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; flex-shrink: 0;
  font-family: var(--font-body); line-height: 1;
}
.avatar-sm { width: 32px;  height: 32px;  font-size: 12px; }
.avatar-md { width: 44px;  height: 44px;  font-size: 15px; }
.avatar-lg { width: 60px;  height: 60px;  font-size: 20px; }
.avatar-xl { width: 80px;  height: 80px;  font-size: 26px; }

.avatar-blue  { background: var(--surface-2); color: var(--primary); }
.avatar-gold  { background: var(--gold-l);    color: var(--gold-d);  }
.avatar-green { background: var(--success-l); color: var(--success); }
.avatar-gray  { background: var(--neutral-l); color: var(--neutral); }
.avatar-dark  { background: var(--primary);   color: #fff; }


/* ================================================================
   11. TOASTS
   ================================================================ */
.toast-container {
  position: fixed;
  top: calc(var(--header-h) + 16px); right: 20px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 12px 36px rgba(30,58,95,0.14);
  min-width: 300px; max-width: 420px;
  pointer-events: auto;
  animation: toastIn 0.28s ease forwards;
  border-left: 4px solid var(--primary-m);
}
.toast.success { border-left-color: var(--success-b); }
.toast.warn    { border-left-color: var(--warn-b); }
.toast.danger  { border-left-color: var(--danger-b); }
.toast.hiding  { animation: toastOut 0.22s ease forwards; }

.toast-icon { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.toast-msg   { font-size: 12px; color: var(--text-s); line-height: 1.5; margin: 0; }
.toast-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-t); font-size: 14px; padding: 0; flex-shrink: 0; line-height: 1;
  transition: color var(--t-s);
}
.toast-close:hover { color: var(--text); }


/* ================================================================
   12. ALERTES INLINE
   ================================================================ */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: var(--r-md);
  font-size: 14px; line-height: 1.6; margin-bottom: 16px;
}
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-blue  { background: var(--surface-2); color: var(--primary-d); border-left: 3px solid var(--primary-m); }
.alert-green { background: var(--success-l); color: #022C22;          border-left: 3px solid var(--success-b); }
.alert-amber { background: var(--warn-l);    color: #451a03;          border-left: 3px solid var(--warn-b); }
.alert-red   { background: var(--danger-l);  color: #4C0519;          border-left: 3px solid var(--danger-b); }
.alert-gold  { background: var(--gold-l);    color: #3A2000;          border-left: 3px solid var(--gold); }


/* ================================================================
   13. MODAL
   ================================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 31, 53, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
}
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--white); border-radius: var(--r-xl);
  box-shadow: 0 28px 80px rgba(15,31,53,0.22);
  width: 100%; max-width: 540px; max-height: 88vh; overflow-y: auto;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s ease;
}
.modal-overlay.is-open .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 720px; }
.modal-sm { max-width: 400px; }

.modal-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
  padding: 1.6rem 1.8rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: var(--font-title); font-size: 1.4rem;
  font-weight: 700; color: var(--text); line-height: 1.2;
}
.modal-close {
  width: 34px; height: 34px; background: var(--neutral-l);
  border: none; border-radius: var(--r-sm); color: var(--text-s);
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background var(--t-s), color var(--t-s);
}
.modal-close:hover { background: var(--danger-l); color: var(--danger); }

.modal-body   { padding: 1.6rem 1.8rem; }
.modal-footer {
  padding: 1.2rem 1.8rem; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}


/* ================================================================
   14. SKELETON LOADERS
   ================================================================ */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #e8eef5 25%, #f0f4f8 50%, #e8eef5 75%);
  background-size: 1200px 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--r-sm);
}
.skeleton-text   { height: 14px; border-radius: 4px; }
.skeleton-title  { height: 24px; border-radius: 4px; }
.skeleton-avatar { border-radius: 50% !important; }
.skeleton-btn    { height: 42px; border-radius: var(--r-md); }
.skeleton-card   { height: 180px; border-radius: var(--r-lg); }


/* ================================================================
   15. ÉTATS VIDES
   ================================================================ */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: 56px 24px; gap: 12px;
}
.empty-state-icon { font-size: 3rem; opacity: 0.35; margin-bottom: 4px; }
.empty-state-title {
  font-family: var(--font-title); font-size: 1.25rem;
  font-weight: 600; color: var(--text);
}
.empty-state-text {
  font-size: 14px; color: var(--text-t);
  max-width: 380px; line-height: 1.65; margin: 0;
}
.empty-state-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: center; margin-top: 8px;
}


/* ================================================================
   16. TABLEAU
   ================================================================ */
.table-wrapper {
  overflow-x: auto; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--white);
}
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
  background: var(--surface); font-family: var(--font-body);
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-t);
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td {
  padding: 13px 16px; color: var(--text-s);
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--t-s); }
.table tbody tr:hover { background: #fafcff; }
.table .td-name { font-weight: 600; color: var(--text); }
.table .td-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }


/* ================================================================
   17. PAGINATION
   ================================================================ */
.pagination { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 8px;
  border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--white); color: var(--text-s);
  font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background var(--t-s), border-color var(--t-s), color var(--t-s);
}
.page-link:hover { background: var(--surface); border-color: var(--border-s); color: var(--primary); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.page-link.disabled { opacity: 0.35; pointer-events: none; }


/* ================================================================
   18. SIDEBAR LAYOUT (dashboards)
   ================================================================ */
.dash-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--header-h));
  align-items: start;
}

.dash-sidebar {
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--white); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 24px 14px; gap: 2px;
}

.dash-sidebar-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-t); padding: 0 10px;
  margin-bottom: 4px; margin-top: 18px;
}
.dash-sidebar-label:first-child { margin-top: 0; }

.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 15px; font-weight: 500; color: var(--text-s);
  text-decoration: none; transition: background var(--t-s), color var(--t-s);
}
.sidebar-link:hover { background: var(--surface); color: var(--primary); }
.sidebar-link.active { background: var(--primary); color: #fff; font-weight: 600; }
.sidebar-link.active .sidebar-link-icon { color: rgba(255,255,255,0.72); }

.sidebar-link-icon {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0; color: var(--text-t);
  transition: color var(--t-s);
}
.sidebar-link:hover .sidebar-link-icon { color: var(--primary); }

.sidebar-link-badge {
  margin-left: auto;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--danger-b); color: #fff;
  font-size: 10px; font-weight: 600; border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
}
.sidebar-link.active .sidebar-link-badge { background: rgba(255,255,255,0.25); color: #fff; }

.dash-main { padding: 32px 36px; min-width: 0; }

.dash-main-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
  margin-bottom: 28px; flex-wrap: wrap;
}
.dash-page-title {
  font-family: var(--font-title); font-size: 2rem;
  font-weight: 700; color: var(--text); margin: 0 0 4px;
}
.dash-page-sub { font-size: 15px; color: var(--text-t); margin: 0; }

.dash-stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 28px;
}


/* ================================================================
   19. DROPDOWN
   ================================================================ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 200px; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow); padding: 6px; z-index: 200;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity var(--t-s), transform var(--t-s);
}
.dropdown.is-open .dropdown-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }

.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-xs);
  font-size: 14px; color: var(--text-s); text-decoration: none;
  transition: background var(--t-s), color var(--t-s);
  cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; font-family: var(--font-body);
}
.dropdown-item:hover { background: var(--surface); color: var(--primary); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-l); }
.dropdown-divider { height: 1px; background: var(--border); margin: 5px 0; }


/* ================================================================
   20. SECTION HEADERS & EYEBROW
   ================================================================ */
.section-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; border-radius: var(--r-pill);
  background: rgba(201, 168, 76, 0.1); color: var(--gold-d);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 16px;
}

.section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-t);
  display: flex; align-items: center; gap: 12px; margin-bottom: 1.4rem;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.section-heading {
  max-width: 680px; margin: 0 auto 44px; text-align: center;
}
.section-heading h2 { margin-bottom: 12px; }
.section-heading p { font-size: 1rem; color: var(--text-s); margin: 0; line-height: 1.7; }


/* ================================================================
   21. SPINNER
   ================================================================ */
@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  display: inline-block; width: 24px; height: 24px;
  border: 2.5px solid var(--border-s); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }

.page-loader {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; flex-direction: column; gap: 14px;
  color: var(--text-t); font-size: 14px;
}


/* ================================================================
   22. DIVIDERS & BREADCRUMB
   ================================================================ */
.divider       { height: 1px; background: var(--border); margin: 20px 0; }
.divider-gold  {
  height: 2px; width: 40px;
  background: linear-gradient(to right, var(--gold), var(--gold-h));
  border-radius: 2px; margin: 14px 0;
}
.divider-label {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-t); font-size: 12px; font-weight: 500; margin: 20px 0;
}
.divider-label::before, .divider-label::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.breadcrumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.breadcrumb-item { font-size: 13px; color: var(--text-t); }
.breadcrumb-item a { color: var(--primary-m); transition: color var(--t-s); }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--border-s); font-size: 11px; }
.breadcrumb-item.current { color: var(--text-s); font-weight: 500; }


/* ================================================================
   23. ANIMATIONS
   ================================================================ */
@keyframes toastIn  { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(0); }    to { opacity:0; transform:translateX(20px); } }
@keyframes fadeIn   { from { opacity:0; transform:translateY(8px); }  to { opacity:1; transform:translateY(0); } }

.fade-in { animation: fadeIn 0.3s ease forwards; }
body.modal-open { overflow: hidden; }


/* ================================================================
   24. RESPONSIVE
   ================================================================ */
@media (max-width: 1100px) {
  .dash-stats-row          { grid-template-columns: repeat(2, 1fr); }
  .form-grid.three         { grid-template-columns: repeat(2, 1fr); }
  .footer-grid             { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 991px) {
  .menu-toggle { display: inline-flex; }

  .header-mobile-panel {
    position: absolute; top: calc(100% + 10px); left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border); border-radius: var(--r-xl);
    padding: 18px; box-shadow: var(--shadow);
    display: none; gap: 16px; z-index: 800;
  }
  .header-mobile-panel.is-open { display: flex; }

  .main-nav { flex-direction: column; align-items: stretch; gap: 2px; margin: 0; }
  .main-nav a { padding: 11px 14px; font-size: 0.96rem; }

  .header-actions { flex-direction: column; align-items: stretch; }
  .header-actions .btn,
  .header-actions .header-user { width: 100%; justify-content: center; }

  /* Sidebar dashboard → barre horizontale */
  .dash-layout             { grid-template-columns: 1fr; }
  .dash-sidebar {
    position: static; height: auto;
    border-right: none; border-bottom: 1px solid var(--border);
    flex-direction: row; flex-wrap: wrap; padding: 12px 16px; gap: 4px;
  }
  .dash-sidebar-label      { display: none; }
  .sidebar-link            { padding: 7px 12px; font-size: 13px; }
  .dash-main               { padding: 24px 20px; }
}

@media (max-width: 768px) {
  :root { --header-h: 70px; }
  .dash-stats-row  { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .footer-grid     { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .footer-bottom   { flex-direction: column; align-items: flex-start; gap: 10px; }
  .modal           { border-radius: var(--r-lg); }
  .form-grid       { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .dash-stats-row  { grid-template-columns: 1fr 1fr; }
  .footer-grid     { grid-template-columns: 1fr; gap: 22px; }
  .toast-container { right: 12px; left: 12px; }
  .toast           { min-width: unset; }
}

@media (max-width: 440px) {
  .dash-stats-row  { grid-template-columns: 1fr; }
}