:root {
  --black: #050505;
  --white: #ffffff;
  --grey: #f4f4f4;
  --light-grey: #fafafa;
  --ds-blue: #1d4ed8;
  --ds-blue-soft: #eaf0ff;
  --ds-blue-deep: #0f2d99;
  --muted: #ababab;
  --border: #ebebeb;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-blue: 0 6px 20px rgba(29, 78, 216, 0.3);
  --radius-btn: 12px;
  --radius-card: 16px;
  --radius-xs: 8px;
  --ease-out: cubic-bezier(0.25, 0.8, 0.25, 1);
  --site-max: 1140px;
}

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

body.biz-portal {
  margin: 0;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ─── Header site (aligné index.php / entreprises.php) ─── */
.biz-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.biz-site-header-inner {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 12px 5%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.biz-site-logo img {
  height: 56px;
  width: auto;
  display: block;
}

.biz-site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  flex: 1;
}

.biz-site-nav-link {
  text-decoration: none;
  color: var(--black);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.biz-site-nav-link:hover,
.biz-site-nav-link.is-active {
  color: var(--ds-blue);
  border-bottom-color: var(--ds-blue);
}

.biz-site-account {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.biz-site-account-text {
  text-align: right;
  line-height: 1.3;
}

.biz-site-account-text strong {
  display: block;
  font-size: 0.82rem;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.biz-site-account-text span {
  font-size: 0.72rem;
  color: var(--muted);
}

.biz-site-logout {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--white);
  background: var(--black);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 50px;
  white-space: nowrap;
  transition: background 0.2s var(--ease-out);
}

.biz-site-logout:hover {
  background: var(--ds-blue);
}

/* ─── Contenu ─── */
.biz-site-body {
  padding-top: 96px;
  min-height: calc(100vh - 64px);
}

.biz-page-head {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 8px 5% 0;
}

.biz-page-h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.biz-main {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 24px 5% 48px;
}

/* ─── Bandeau accueil ─── */
.biz-welcome-band {
  background: linear-gradient(135deg, var(--ds-blue-deep) 0%, var(--ds-blue) 55%, #3b82f6 100%);
  color: var(--white);
  border-radius: 20px;
  padding: 32px 36px;
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}

.biz-welcome-band h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.biz-welcome-band p {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 520px;
  line-height: 1.55;
}

.biz-welcome-badge {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.biz-welcome-stat {
  text-align: center;
  min-width: 120px;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.biz-welcome-stat-value {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.biz-welcome-stat-label {
  font-size: 0.72rem;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.75);
}

/* ─── Grilles contenu ─── */
.biz-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.biz-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .biz-site-header-inner { flex-wrap: wrap; }
  .biz-site-nav { order: 3; width: 100%; }
  .biz-site-account { margin-left: auto; }
  .biz-welcome-band { grid-template-columns: 1fr; }
  .biz-grid-2, .biz-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .biz-site-body { padding-top: 120px; }
  .biz-site-account-text { display: none; }
}

/* ─── Typo (tokens app) ─── */
.ds-title {
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.ds-subtitle {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 20px;
}

.ds-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.ds-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}

.ds-surface-soft {
  background: var(--light-grey);
  border: 1px solid #f3f3f3;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}

.biz-card-pad { padding: 22px 24px; }

/* ─── Stats ─── */
.biz-stat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.biz-stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.biz-stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.35;
}

.biz-km-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}

.biz-km-bar span {
  display: block;
  height: 100%;
  background: var(--ds-blue);
  border-radius: 999px;
}

/* ─── Tuiles navigation (site, pas liste mobile) ─── */
.biz-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 768px) {
  .biz-tiles { grid-template-columns: repeat(4, 1fr); }
}

.biz-tile {
  display: block;
  padding: 20px 18px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--black);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.biz-tile:hover {
  border-color: var(--ds-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.biz-tile-icon {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.biz-tile strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.biz-tile span {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}

/* ─── Boutons app ─── */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  border: none;
  border-radius: var(--radius-btn);
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.2s var(--ease-out), transform 0.2s var(--ease-out);
  touch-action: manipulation;
}

.ds-btn-blue {
  background: var(--ds-blue);
  color: var(--white);
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.22);
}

.ds-btn-blue:hover { background: var(--ds-blue-deep); }

.ds-btn-outline {
  background: var(--white);
  color: var(--black);
  border: 2px solid #e0e0e0;
}

.ds-btn-outline:hover { background: #fafafa; }

.ds-btn-sm {
  min-height: 42px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  width: auto;
}

.ds-btn-auto { width: auto; max-width: 320px; }

/* ─── Formulaires ─── */
.biz-form { display: flex; flex-direction: column; gap: 14px; }

.biz-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #333;
}

.biz-field input,
.biz-field textarea,
.biz-field select {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-family: inherit;
  background: var(--white);
}

.biz-field input:focus,
.biz-field textarea:focus {
  outline: none;
  border-color: var(--ds-blue);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.biz-field textarea { min-height: 100px; resize: vertical; }

.biz-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 640px) {
  .biz-row-2 { grid-template-columns: 1fr; }
}

/* ─── Alerts ─── */
.biz-alert {
  padding: 12px 16px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.biz-alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.biz-alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* ─── Badges ─── */
.biz-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.biz-badge-ok { background: #dcfce7; color: #166534; }
.biz-badge-warn { background: #fef9c3; color: #854d0e; }
.biz-badge-muted { background: var(--grey); color: #666; }

/* ─── Membres / tableaux ─── */
.biz-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid #f5f5f5;
}

.biz-member-row:last-child { border-bottom: none; }

.biz-member-email { font-size: 0.9rem; font-weight: 700; word-break: break-all; }
.biz-member-meta { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }

.biz-table-wrap { overflow-x: auto; }

.biz-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.biz-table th,
.biz-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #f5f5f5;
}

.biz-table th {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--light-grey);
}

.biz-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.biz-empty-icon { font-size: 2rem; margin-bottom: 10px; }

.biz-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

/* ─── Footer site ─── */
.biz-site-footer {
  border-top: 1px solid var(--border);
  background: var(--light-grey);
  padding: 20px 5%;
}

.biz-site-footer-inner {
  max-width: var(--site-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.biz-site-footer a {
  color: var(--black);
  font-weight: 600;
  text-decoration: none;
}

.biz-site-footer a:hover { color: var(--ds-blue); }

/* ─── Login ─── */
.biz-login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.biz-login-header {
  padding: 16px 5%;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.95);
}

.biz-login-header img { height: 56px; }

.biz-login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 5%;
  background: linear-gradient(180deg, var(--light-grey) 0%, var(--white) 100%);
}

.biz-login-card {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
}

.biz-chip {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--ds-blue-soft);
  color: var(--ds-blue);
  margin-bottom: 12px;
}
