/* ============================================================
   E-Drive Evolution CRM — Charte graphique v2.0
   
   Palette logo E-Drive Evolution :
   ├── Navy profond   : #001A6A  (fond sidebar)
   ├── Bleu moyen     : #0088E8
   ├── Cyan signature : #00AEEF  (couleur principale)
   ├── Cyan clair     : #00C8F8
   ├── Bleu glacé     : #7AECFF
   └── Gris argent    : #A0B0C0 → #F0F0F0
   
   Typographie : Outfit (display) + DM Sans (corps) + DM Mono
   Responsive  : Mobile-first — 480 / 768 / 1024 / 1280px
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables charte E-Drive ── */
:root {
  --ed-navy:       #001A6A;
  --ed-navy-2:     #00236E;
  --ed-navy-3:     #002D8A;
  --ed-blue:       #0088E8;
  --ed-cyan:       #00AEEF;
  --ed-cyan-2:     #00C8F8;
  --ed-ice:        #7AECFF;
  --ed-grad:       linear-gradient(135deg, #001A6A 0%, #0088E8 55%, #00AEEF 100%);
  --ed-grad-h:     linear-gradient(90deg,  #0066CC 0%, #0088E8 50%, #00AEEF 100%);
  --ed-grad-light: linear-gradient(90deg, rgba(0,136,232,.08), rgba(0,174,239,.08));

  --bg-page:    #F1F5FA;
  --bg-white:   #FFFFFF;
  --bg-sidebar: #001A6A;

  --text-1: #0D1B2A;
  --text-2: #3D5060;
  --text-3: #7A90A0;
  --text-4: #A8BBC8;
  --text-w: #FFFFFF;
  --text-w2: rgba(255,255,255,.65);
  --text-w3: rgba(255,255,255,.38);

  --border:    #DDE6EF;
  --border-2:  #C4D4E0;

  --green:     #16A34A;  --green-bg:  rgba(22,163,74,.10);
  --orange:    #EA580C;  --orange-bg: rgba(234,88,12,.10);
  --red:       #DC2626;  --red-bg:    rgba(220,38,38,.10);
  --purple:    #7C3AED;  --purple-bg: rgba(124,58,237,.10);
  --teal:      #0D9488;  --teal-bg:   rgba(13,148,136,.10);

  --sidebar-w: 260px;
  --header-h:  62px;
  --r:         10px;
  --r-sm:      6px;
  --r-lg:      14px;
  --sh-sm:     0 1px 4px rgba(0,26,106,.07);
  --sh:        0 2px 12px rgba(0,26,106,.10);
  --sh-md:     0 4px 24px rgba(0,26,106,.14);
  --sh-lg:     0 8px 40px rgba(0,26,106,.20);
  --t:         .18s ease;

  --ff-d: 'Outfit', sans-serif;
  --ff-b: 'DM Sans', sans-serif;
  --ff-m: 'DM Mono', monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--ff-b); background: var(--bg-page); color: var(--text-1); min-height: 100vh; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--ed-cyan); text-decoration: none; transition: var(--t); }
a:hover { color: var(--ed-blue); }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: var(--ff-b); }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ed-blue); border-radius: 3px; }

/* ============================================================
   LAYOUT
   ============================================================ */
.crm-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  z-index: 200;
  border-right: 1px solid rgba(0,174,239,.12);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

/* Lueur intérieure subtile */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(180deg, rgba(0,174,239,.3), transparent 40%, rgba(0,174,239,.1) 100%);
  pointer-events: none;
}

.sidebar-logo {
  padding: 0 18px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: var(--ed-grad);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 2px 14px rgba(0,174,239,.45);
}
.sidebar-logo-text {
  font-family: var(--ff-d);
  font-weight: 800;
  font-size: 14.5px;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -.2px;
}
.sidebar-logo-text small {
  display: block;
  font-size: 9.5px;
  font-weight: 400;
  color: var(--text-w3);
  letter-spacing: .9px;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); }

.nav-section { margin-bottom: 22px; }
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-w3);
  padding: 0 10px;
  margin-bottom: 5px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--text-w2);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--t);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active {
  background: rgba(0,174,239,.14);
  color: var(--ed-cyan);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--ed-grad);
  border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; opacity: .8; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: var(--ed-cyan);
  color: var(--ed-navy);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--ff-d);
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.nav-badge.orange { background: var(--orange); color: #fff; }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.user-card { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 34px; height: 34px;
  background: var(--ed-grad);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-d);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,174,239,.35);
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: var(--text-w3); text-transform: capitalize; letter-spacing: .3px; }
.logout-btn {
  background: none; border: none;
  color: var(--text-w3);
  cursor: pointer; font-size: 15px;
  padding: 6px; border-radius: 6px;
  transition: var(--t); flex-shrink: 0;
}
.logout-btn:hover { color: var(--red); background: var(--red-bg); }

/* ============================================================
   HEADER
   ============================================================ */
.crm-header {
  height: var(--header-h);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
  margin-left: var(--sidebar-w);
  box-shadow: var(--sh-sm);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  width: 36px; height: 36px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  transition: var(--t);
}
.sidebar-toggle:hover { border-color: var(--ed-cyan); }
.sidebar-toggle span { display: block; width: 16px; height: 2px; background: var(--text-1); border-radius: 2px; transition: var(--t); }

.header-title {
  font-family: var(--ff-d);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-title small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 8px; font-family: var(--ff-b); }
.header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.header-date { display: none !important; }

/* ============================================================
   OVERLAY MOBILE
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,26,106,.55);
  z-index: 150;
  backdrop-filter: blur(3px);
}
.sidebar-overlay.active { display: block; }

/* ============================================================
   MAIN
   ============================================================ */
.crm-main {
  padding: 24px;
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--header-h));
  margin-top: var(--header-h);
}

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-white);
  border-radius: var(--r);
  padding: 18px 20px;
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 5px;
  transition: var(--t);
  position: relative; overflow: hidden;
  box-shadow: var(--sh-sm);
}
.kpi-card::after {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--border);
  border-radius: var(--r) var(--r) 0 0;
}
.kpi-card.blue::after   { background: var(--ed-grad-h); }
.kpi-card.green::after  { background: var(--green); }
.kpi-card.orange::after { background: var(--orange); }
.kpi-card.red::after    { background: var(--red); }
.kpi-card.purple::after { background: var(--purple); }
.kpi-card.teal::after   { background: var(--teal); }
.kpi-card:hover { box-shadow: var(--sh); transform: translateY(-2px); border-color: var(--border-2); }
.kpi-label { font-size: 10.5px; font-weight: 600; letter-spacing: .7px; text-transform: uppercase; color: var(--text-3); }
.kpi-value { font-family: var(--ff-d); font-size: 32px; font-weight: 800; color: var(--text-1); line-height: 1; letter-spacing: -1px; }
.kpi-value.blue { background: var(--ed-grad-h); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.kpi-value.green  { color: var(--green); }
.kpi-value.orange { color: var(--orange); }
.kpi-value.red    { color: var(--red); }
.kpi-value.purple { color: var(--purple); }
.kpi-value.teal   { color: var(--teal); }
.kpi-sub { font-size: 11.5px; color: var(--text-3); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-white);
  border-radius: var(--r);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--sh-sm);
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.card-header::before {
  content: ''; display: block;
  width: 3px; height: 18px;
  background: var(--ed-grad-h);
  border-radius: 3px; flex-shrink: 0;
}
.card-title { font-family: var(--ff-d); font-size: 14px; font-weight: 700; color: var(--text-1); flex: 1; }
.card-body { padding: 20px; }
.card-body.no-pad { padding: 0; }

/* ============================================================
   TABLEAUX
   ============================================================ */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.data-table th {
  background: var(--bg-page);
  padding: 9px 14px;
  text-align: left;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .7px; text-transform: uppercase;
  color: var(--text-3); white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(0,174,239,.04); }
.data-table .mono { font-family: var(--ff-m); font-size: 12px; color: var(--ed-cyan); font-weight: 500; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap; letter-spacing: .2px;
}
.badge-new      { background: #EFF6FF; color: #1D4ED8; }
.badge-analyse  { background: var(--purple-bg); color: var(--purple); }
.badge-offre    { background: var(--orange-bg); color: var(--orange); }
.badge-ok       { background: var(--green-bg);  color: var(--green); }
.badge-refuse   { background: var(--red-bg);    color: var(--red); }
.badge-rdv      { background: var(--teal-bg);   color: var(--teal); }
.badge-expertise{ background: rgba(0,174,239,.12); color: var(--ed-blue); }
.badge-vendu    { background: var(--green-bg);  color: #14532D; }
.badge-annule   { background: var(--border);    color: var(--text-3); }

/* ============================================================
   FORMULAIRES
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 14px; color: var(--text-1);
  background: var(--bg-white);
  transition: var(--t); outline: none;
  -webkit-appearance: none;
}
.form-control:focus { border-color: var(--ed-cyan); box-shadow: 0 0 0 3px rgba(0,174,239,.12); }
.form-control::placeholder { color: var(--border-2); }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2300AEEF' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px; cursor: pointer;
}
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.search-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
  align-items: flex-end;
}
.search-bar .form-group { margin-bottom: 0; flex: 1; min-width: 130px; }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  transition: var(--t); text-decoration: none;
  white-space: nowrap; letter-spacing: .1px;
}
.btn-primary { background: var(--ed-grad-h); color: #fff; box-shadow: 0 2px 10px rgba(0,174,239,.28); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 18px rgba(0,174,239,.42); color: #fff; }
.btn-secondary { background: var(--bg-page); color: var(--text-2); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text-1); }
.btn-ghost { background: transparent; color: var(--text-3); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--ed-cyan); color: var(--ed-cyan); }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1.5px solid transparent; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-success { background: var(--green-bg); color: var(--green); border: 1.5px solid transparent; }
.btn-success:hover { background: var(--green); color: #fff; }
.btn-sm   { padding: 5px 11px; font-size: 12px; }
.btn-lg   { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; justify-content: center; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 11px 16px; border-radius: var(--r-sm);
  font-size: 13.5px; display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
}
.alert-success { background: var(--green-bg); color: #14532D; border-left: 3px solid var(--green); }
.alert-error   { background: var(--red-bg);   color: #7F1D1D; border-left: 3px solid var(--red); }
.alert-info    { background: rgba(0,174,239,.08); color: var(--ed-blue); border-left: 3px solid var(--ed-cyan); }
.alert-warning { background: var(--orange-bg); color: #7C2D12; border-left: 3px solid var(--orange); }

/* ============================================================
   FICHE DOSSIER
   ============================================================ */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-block { margin-bottom: 14px; }
.detail-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); margin-bottom: 3px; }
.detail-value { font-size: 14px; color: var(--text-1); font-weight: 500; }
.detail-value.mono { font-family: var(--ff-m); color: var(--ed-cyan); font-size: 13px; }
.detail-value.big { font-family: var(--ff-d); font-size: 22px; font-weight: 800; background: var(--ed-grad-h); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; padding: 9px 0; position: relative; }
.timeline-item:not(:last-child)::after { content: ''; position: absolute; left: 12px; top: 30px; bottom: 0; width: 2px; background: var(--border); }
.timeline-dot { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; background: var(--bg-page); color: var(--text-3); border: 1.5px solid var(--border); z-index: 1; }
.timeline-dot.done { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.timeline-dot.current { background: rgba(0,174,239,.12); color: var(--ed-cyan); border-color: var(--ed-cyan); box-shadow: 0 0 0 3px rgba(0,174,239,.14); }
.timeline-title { font-size: 13px; font-weight: 600; color: var(--text-1); }
.timeline-date  { font-size: 11px; color: var(--text-3); }

.offre-form { background: rgba(0,174,239,.06); border: 1.5px solid rgba(0,174,239,.18); border-radius: var(--r); padding: 18px; }
.prix-input-wrap { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.prix-input-wrap:focus-within { border-color: var(--ed-cyan); box-shadow: 0 0 0 3px rgba(0,174,239,.12); }
.prix-input-wrap input { flex: 1; border: none; outline: none; padding: 10px 14px; font-size: 20px; font-family: var(--ff-d); font-weight: 700; color: var(--text-1); background: transparent; }
.prix-input-wrap .currency { padding: 0 14px; font-family: var(--ff-d); font-size: 18px; font-weight: 700; color: var(--ed-cyan); background: rgba(0,174,239,.08); }

/* ============================================================
   LOGIN — Charte E-Drive
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #001A6A 0%, #002280 40%, #004AAA 75%, #0066CC 100%);
}
.login-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,174,239,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,174,239,.055) 1px, transparent 1px);
  background-size: 46px 46px;
}
.login-glow-1 { position: absolute; width: 500px; height: 500px; background: radial-gradient(circle, rgba(0,174,239,.2) 0%, transparent 65%); top: -150px; right: -80px; pointer-events: none; }
.login-glow-2 { position: absolute; width: 350px; height: 350px; background: radial-gradient(circle, rgba(0,136,232,.14) 0%, transparent 65%); bottom: -80px; left: -50px; pointer-events: none; }

.login-box {
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: var(--r-lg);
  padding: 40px 36px;
  width: 100%; max-width: 420px;
  position: relative; z-index: 1;
  box-shadow: 0 8px 48px rgba(0,0,0,.35);
  animation: fadeUp .4s ease both;
}
@keyframes fadeUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.login-logo-icon { width: 50px; height: 50px; background: var(--ed-grad); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: 0 4px 20px rgba(0,174,239,.5); }
.login-logo-text { font-family: var(--ff-d); font-size: 18px; font-weight: 800; color: #fff; line-height: 1.2; letter-spacing: -.3px; }
.login-logo-text small { display: block; font-size: 10px; font-weight: 400; color: rgba(255,255,255,.4); letter-spacing: .9px; text-transform: uppercase; }
.login-title { font-family: var(--ff-d); font-size: 25px; font-weight: 800; color: #fff; margin-bottom: 4px; letter-spacing: -.5px; }
.login-subtitle { font-size: 13px; color: rgba(255,255,255,.42); margin-bottom: 28px; }
.login-box .form-label { color: rgba(255,255,255,.5); }
.login-box .form-control { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.11); color: #fff; }
.login-box .form-control:focus { border-color: var(--ed-cyan); background: rgba(255,255,255,.11); box-shadow: 0 0 0 3px rgba(0,174,239,.22); }
.login-box .form-control::placeholder { color: rgba(255,255,255,.22); }
.login-btn { width: 100%; padding: 13px; background: var(--ed-grad-h); color: #fff; border: none; border-radius: var(--r-sm); font-size: 15px; font-weight: 700; font-family: var(--ff-d); cursor: pointer; transition: var(--t); margin-top: 8px; box-shadow: 0 4px 18px rgba(0,174,239,.42); letter-spacing: .2px; }
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(0,174,239,.58); }
.login-footer { margin-top: 24px; text-align: center; font-size: 12px; color: rgba(255,255,255,.25); }
.login-footer a { color: rgba(255,255,255,.38); }
.login-footer a:hover { color: var(--ed-cyan); }

/* ============================================================
   UTILITAIRES
   ============================================================ */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-3); }
.empty-state-icon { font-size: 42px; margin-bottom: 12px; opacity: .35; }
.empty-state h3 { font-size: 15px; color: var(--text-2); margin-bottom: 5px; font-family: var(--ff-d); }
.empty-state p { font-size: 13px; }

.pagination { display: flex; align-items: center; gap: 5px; padding: 14px 18px; border-top: 1px solid var(--border); justify-content: center; flex-wrap: wrap; }
.page-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); font-size: 13px; font-weight: 500; border: 1.5px solid var(--border); background: var(--bg-white); color: var(--text-2); cursor: pointer; transition: var(--t); text-decoration: none; }
.page-btn:hover { border-color: var(--ed-cyan); color: var(--ed-cyan); }
.page-btn.active { background: var(--ed-grad-h); border-color: transparent; color: #fff; font-weight: 700; }

/* Gradient text */
.gradient-text { background: var(--ed-grad-h); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* Helpers */
.text-muted { color: var(--text-3); }
.text-mono  { font-family: var(--ff-m); }
.text-blue  { color: var(--ed-cyan); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-orange{ color: var(--orange); }
.fw-700 { font-weight: 700; } .fw-600 { font-weight: 600; }
.fs-11  { font-size: 11px; }  .fs-12  { font-size: 12px; }  .fs-13  { font-size: 13px; }
.d-flex { display: flex; }    .align-center { align-items: center; }
.gap-8  { gap: 8px; }         .gap-10 { gap: 10px; }  .gap-14 { gap: 14px; }
.mb-0   { margin-bottom: 0; } .mb-20  { margin-bottom: 20px; }
.mt-16  { margin-top: 16px; } .ml-auto{ margin-left: auto; }
.w-100  { width: 100%; }      .text-center { text-align: center; }

/* ── Logo sidebar ── */
.sidebar-logo {
  padding: 0 16px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-logo-img {
  height: 38px;
  width: auto;
  max-width: 210px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 6px;
  padding: 3px 8px;
  display: block;
}

/* ── Burger menu ── */
.sidebar-toggle {
  display: none;
  background: #f0f4f8;
  border: 1.5px solid #c4d4e0;
  border-radius: 6px;
  width: 40px;
  height: 40px;
  min-width: 40px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.sidebar-toggle:hover { border-color: var(--ed-blue); }
.sidebar-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #0d1b2e;
  border-radius: 2px;
  transition: transform .22s ease, opacity .18s ease;
}
.sidebar-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sidebar-toggle.open span:nth-child(2) { opacity: 0; }
.sidebar-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Logo login ── */
.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}
.login-logo-img {
  height: 44px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 10px;
  padding: 8px 20px;
  display: block;
}

/* ── Filtre dates dashboard ── */
.dashboard-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh0);
}
.dashboard-filters label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.date-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.date-input-wrap input[type=date] {
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-1);
  background: var(--bg-page);
  outline: none;
  cursor: pointer;
  transition: var(--t);
}
.date-input-wrap input[type=date]:focus {
  border-color: var(--ed-blue);
  box-shadow: 0 0 0 3px rgba(0,144,232,.12);
}
.filter-sep { color: var(--text-4); font-size: 13px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablette (< 1200px) */
@media screen and (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Tablette (< 1024px) */
@media screen and (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
}

/* ── MOBILE (≤ 768px) ── */
@media screen and (max-width: 768px) {

  /* Sidebar cachée, glisse */
  .sidebar {
    position: fixed !important;
    top: 0; left: 0;
    width: 260px !important;
    height: 100vh !important;
    transform: translateX(-260px) !important;
    transition: transform .28s ease !important;
    z-index: 300 !important;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 4px 0 24px rgba(0,0,0,.35) !important;
  }

  /* Header & main pleine largeur */
  .crm-header {
    margin-left: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 0 10px !important;
  }
  .crm-main {
    margin-left: 0 !important;
    padding: 12px !important;
  }

  /* BURGER VISIBLE */
  .sidebar-toggle {
    display: flex !important;
    visibility: visible !important;
  }

  /* Header titre */
  .header-title { font-size: 14px !important; }
  .header-date  { display: none !important; }

  /* KPI grid — 2 colonnes */
  .kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .kpi-value { font-size: 22px !important; }
  .kpi-card  { padding: 12px 12px !important; }
  .kpi-label { font-size: 9.5px !important; }
  .kpi-sub   { font-size: 10.5px !important; }

  /* Grilles */
  .detail-grid { grid-template-columns: 1fr !important; }
  .form-row    { grid-template-columns: 1fr !important; }
  .form-row-3  { grid-template-columns: 1fr !important; }
  .dash-grid   { grid-template-columns: 1fr !important; }

  /* Tableaux — scroll horizontal */
  .table-wrap,
  .card-body.no-pad {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
  }
  .data-table {
    min-width: 480px !important;
    font-size: 12px !important;
    width: auto !important;
  }
  .data-table th,
  .data-table td {
    padding: 7px 9px !important;
    white-space: nowrap !important;
  }

  /* Colonnes cachées */
  .col-sm-hide,
  .col-hide-sm { display: none !important; }

  /* Filtre dates */
  .dashboard-filters {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .date-input-wrap {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Recherche */
  .search-bar { flex-direction: column !important; gap: 8px !important; }
  .search-bar .form-group { min-width: 100% !important; }
}

/* ── PETIT MOBILE (≤ 480px) ── */
@media screen and (max-width: 480px) {
  .kpi-grid  { grid-template-columns: 1fr 1fr !important; gap: 6px !important; }
  .kpi-value { font-size: 20px !important; }
  .kpi-card  { padding: 10px !important; }
  .crm-main  { padding: 8px !important; }
  .data-table { min-width: 420px !important; }
  .card-header { padding: 10px 12px !important; }
  .card-body   { padding: 12px !important; }
  .page-btn    { width: 28px; height: 28px; font-size: 11px; }
  .col-hide-xs,
  .col-xs-hide { display: none !important; }
}
