/* ══════════════════════════════════════════════════════════
   Espace Client Bike2Mobility — Design System
   ec-style.css v1.0
   ══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ec-navy:       #133742;
  --ec-navy-dark:  #0d2e38;
  --ec-navy-mid:   #1e4d5e;
  --ec-lime:       #c7ff98;
  --ec-lime-dark:  #a8e878;
  --ec-teal:       #60d9d1;
  --ec-bg:         #f5f7f8;
  --ec-muted:      #eef2f4;
  --ec-text:       #1a2e35;
  --ec-text-light: #5a7a85;
  --ec-white:      #ffffff;
  --ec-sidebar-w:  240px;
  --ec-topbar-h:   56px;
  --ec-radius:     10px;
  --ec-radius-lg:  16px;
  --ec-shadow:     0 2px 12px rgba(19,55,66,0.08);
  --ec-shadow-md:  0 6px 24px rgba(19,55,66,0.12);
}

html { height: 100%; }

body {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--ec-bg);
  color: var(--ec-text);
  min-height: 100vh;
  display: flex;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════ */

.ec-sidebar {
  width: var(--ec-sidebar-w);
  min-height: 100vh;
  background: var(--ec-navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  transition: transform 0.25s ease;
}

.ec-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ec-brand-name {
  font-family: 'Clash Display', sans-serif;
  font-size: 0.95rem;
  color: white;
  display: block;
  line-height: 1.1;
}

.ec-brand-sub {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  display: block;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ec-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ec-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--ec-radius);
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}

.ec-nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.ec-nav-item.active {
  background: rgba(199,255,152,0.12);
  color: var(--ec-lime);
}

.ec-nav-item.active svg { color: var(--ec-lime); }

.ec-sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.ec-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.ec-user-avatar {
  width: 32px; height: 32px;
  background: var(--ec-navy-mid);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ec-lime);
  flex-shrink: 0;
}

.ec-user-details { min-width: 0; flex: 1; }
.ec-user-name { font-size: 0.82rem; color: white; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-user-company { font-size: 0.7rem; color: rgba(255,255,255,0.4); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ec-signout-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.3);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  transition: all 0.15s;
  flex-shrink: 0;
}
.ec-signout-btn:hover { color: white; background: rgba(255,255,255,0.08); }

/* ══════════════════════════════════════════════════════════
   TOP BAR (mobile)
   ══════════════════════════════════════════════════════════ */

.ec-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--ec-topbar-h);
  background: var(--ec-navy);
  z-index: 199;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.ec-topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Clash Display', sans-serif;
  font-size: 0.95rem;
  color: white;
}

.ec-menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
}

.ec-menu-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.2s;
}

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════ */

.ec-main {
  flex: 1;
  margin-left: var(--ec-sidebar-w);
  min-height: 100vh;
  padding: 28px 32px;
  overflow-x: hidden;
}

.ec-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.ec-page-title {
  font-family: 'Clash Display', sans-serif;
  font-size: 1.6rem;
  color: var(--ec-navy);
  line-height: 1.2;
}

.ec-page-sub {
  font-size: 0.875rem;
  color: var(--ec-text-light);
  margin-top: 4px;
}

.ec-header-actions { display: flex; align-items: center; gap: 10px; }

/* ══════════════════════════════════════════════════════════
   KPI CARDS
   ══════════════════════════════════════════════════════════ */

.ec-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.ec-kpi-card {
  background: var(--ec-white);
  border-radius: var(--ec-radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--ec-shadow);
}

.ec-kpi-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.ec-icon-teal { background: rgba(96,217,209,0.15); color: var(--ec-teal); }
.ec-icon-lime { background: rgba(199,255,152,0.25); color: #5a9c32; }
.ec-icon-navy { background: rgba(19,55,66,0.08); color: var(--ec-navy); }
.ec-icon-muted { background: var(--ec-muted); color: var(--ec-text-light); }

.ec-kpi-value {
  font-family: 'Clash Display', sans-serif;
  font-size: 1.6rem;
  color: var(--ec-navy);
  line-height: 1;
}

.ec-kpi-label {
  font-size: 0.78rem;
  color: var(--ec-text-light);
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════
   SECTIONS
   ══════════════════════════════════════════════════════════ */

.ec-section { margin-bottom: 32px; }

.ec-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.ec-section-title {
  font-family: 'Clash Display', sans-serif;
  font-size: 1.1rem;
  color: var(--ec-navy);
}

.ec-section-meta {
  font-size: 0.83rem;
  color: var(--ec-text-light);
}

/* ══════════════════════════════════════════════════════════
   STEPS (étapes projet)
   ══════════════════════════════════════════════════════════ */

.ec-steps-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ec-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--ec-white);
  border-radius: var(--ec-radius-lg);
  border: 2px solid transparent;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: var(--ec-shadow);
}

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

.ec-step-completed { border-left: 4px solid var(--ec-lime-dark); }
.ec-step-in_progress { border-left: 4px solid var(--ec-teal); }
.ec-step-pending { border-left: 4px solid #e2e8ec; }

.ec-step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Clash Display', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ec-step-completed .ec-step-num { background: var(--ec-lime-dark); color: var(--ec-navy); }
.ec-step-in_progress .ec-step-num { background: var(--ec-teal); color: var(--ec-navy); }
.ec-step-pending .ec-step-num { background: var(--ec-muted); color: var(--ec-text-light); }

.ec-step-body { flex: 1; min-width: 0; }
.ec-step-title { font-size: 0.875rem; font-weight: 600; color: var(--ec-text); }

.ec-step-status {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
}

.ec-step-status-completed { color: var(--ec-lime-dark); }
.ec-step-status-in_progress { color: var(--ec-teal); }
.ec-step-status-pending { color: var(--ec-text-light); }

.ec-step-arrow { color: var(--ec-text-light); font-size: 0.9rem; }

/* ══════════════════════════════════════════════════════════
   QUICK GRID
   ══════════════════════════════════════════════════════════ */

.ec-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.ec-quick-card {
  background: var(--ec-white);
  border-radius: var(--ec-radius-lg);
  padding: 24px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--ec-shadow);
  border: 2px solid transparent;
  transition: all 0.2s;
  position: relative;
}

.ec-quick-card:hover {
  border-color: var(--ec-teal);
  transform: translateY(-2px);
  box-shadow: var(--ec-shadow-md);
}

.ec-quick-contact:hover { border-color: var(--ec-lime-dark); }

.ec-quick-icon {
  width: 40px; height: 40px;
  background: var(--ec-muted);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ec-navy);
  margin-bottom: 8px;
}

.ec-quick-card h3 {
  font-family: 'Clash Display', sans-serif;
  font-size: 0.95rem;
  color: var(--ec-navy);
}

.ec-quick-card p {
  font-size: 0.8rem;
  color: var(--ec-text-light);
  line-height: 1.4;
}

.ec-quick-arrow {
  position: absolute;
  bottom: 16px; right: 16px;
  font-size: 0.9rem;
  color: var(--ec-text-light);
}

/* ══════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════ */

.ec-card {
  background: var(--ec-white);
  border-radius: var(--ec-radius-lg);
  padding: 20px;
  box-shadow: var(--ec-shadow);
}

.ec-card-title {
  font-family: 'Clash Display', sans-serif;
  font-size: 0.95rem;
  color: var(--ec-navy);
  margin-bottom: 16px;
}

/* ══════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════ */

.ec-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--ec-radius);
  border: none;
  font-family: 'Clash Display', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.ec-btn-primary {
  background: var(--ec-navy);
  color: var(--ec-lime);
}
.ec-btn-primary:hover { background: var(--ec-navy-mid); transform: translateY(-1px); }

.ec-btn-ghost {
  background: var(--ec-muted);
  color: var(--ec-text);
  border: 2px solid #e2e8ec;
}
.ec-btn-ghost:hover { border-color: var(--ec-navy); color: var(--ec-navy); }

/* ══════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════ */

.ec-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ec-badge-teal { background: rgba(96,217,209,0.15); color: #1a7a76; }
.ec-badge-lime { background: rgba(199,255,152,0.3); color: #4a7a22; }
.ec-badge-navy { background: rgba(19,55,66,0.08); color: var(--ec-navy); }

/* ══════════════════════════════════════════════════════════
   TABLE
   ══════════════════════════════════════════════════════════ */

.ec-table-wrap {
  background: var(--ec-white);
  border-radius: var(--ec-radius-lg);
  overflow: hidden;
  box-shadow: var(--ec-shadow);
  overflow-x: auto;
}

.ec-table {
  width: 100%;
  border-collapse: collapse;
}

.ec-table thead {
  background: var(--ec-muted);
}

.ec-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ec-text-light);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.ec-table td {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--ec-text);
  border-top: 1px solid #f0f4f6;
}

.ec-table tr:hover td { background: #f8fafb; }

/* ══════════════════════════════════════════════════════════
   LOADING / ONBOARDING
   ══════════════════════════════════════════════════════════ */

.ec-loading {
  text-align: center;
  padding: 32px;
  color: var(--ec-text-light);
  font-size: 0.875rem;
}

.ec-onboarding {
  background: var(--ec-white);
  border-radius: var(--ec-radius-lg);
  padding: 40px;
  text-align: center;
  grid-column: 1 / -1;
  box-shadow: var(--ec-shadow);
}

.ec-onboarding-icon { font-size: 2.5rem; margin-bottom: 12px; }
.ec-onboarding h3 { font-family: 'Clash Display', sans-serif; font-size: 1.2rem; color: var(--ec-navy); margin-bottom: 8px; }
.ec-onboarding p { font-size: 0.875rem; color: var(--ec-text-light); margin-bottom: 20px; }

/* ══════════════════════════════════════════════════════════
   OVERLAY (mobile sidebar)
   ══════════════════════════════════════════════════════════ */

.ec-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(19,55,66,0.5);
  z-index: 199;
}

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

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
  .ec-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .ec-steps-container { grid-template-columns: repeat(2, 1fr); }
  .ec-quick-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .ec-sidebar { transform: translateX(-100%); }
  .ec-sidebar.open { transform: translateX(0); }

  .ec-topbar { display: flex; }

  .ec-main {
    margin-left: 0;
    padding: 20px 16px;
    padding-top: calc(var(--ec-topbar-h) + 20px);
  }

  .ec-kpi-grid { grid-template-columns: 1fr 1fr; }
  .ec-steps-container { grid-template-columns: 1fr; }
  .ec-quick-grid { grid-template-columns: 1fr; }

  .ec-page-title { font-size: 1.3rem; }

  .ec-table th, .ec-table td { padding: 10px 12px; font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .ec-kpi-grid { grid-template-columns: 1fr; }
}
