/* Parc Auto Groupe — charte inspirée Tapcv, accent rouge */
:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #1a0a0a;
  --muted: #6b5252;
  --brand: #ef4444;
  --brand-light: rgba(239, 68, 68, 0.28);
  --brand-hover: rgba(239, 68, 68, 0.14);
  --dark: #2d0a0a;
  --dark-mid: #450a0a;
  --border: #ece5e5;
  --danger: #dc2626;
  --warn: #f59e0b;
  --ok: #15803d;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(45, 10, 10, 0.07);
  --font: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
}

a { color: var(--dark-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  left: 16px; top: 16px; width: auto; height: auto; padding: 8px 12px;
  background: var(--surface); border-radius: 8px; z-index: 9999;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hint { color: var(--muted); font-size: 0.82rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; font-size: 0.95rem; font-weight: 600; font-family: inherit;
  border: none; border-radius: 999px; cursor: pointer; text-decoration: none;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--dark); color: #fff; box-shadow: var(--shadow); }
.btn--primary:hover { filter: brightness(1.08); text-decoration: none; }
.btn--accent { background: var(--brand); color: #fff; font-weight: 700; box-shadow: var(--shadow); }
.btn--accent:hover { filter: brightness(0.95); text-decoration: none; }
.btn--ghost { background: var(--surface); color: var(--text); border: 2px solid var(--border); }
.btn--ghost:hover { background: var(--bg); border-color: var(--dark-mid); text-decoration: none; }
.btn--danger { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.btn--sm { padding: 6px 12px; font-size: 0.85rem; }
.btn--toolbar { padding: 12px 22px; font-size: 0.95rem; min-height: 44px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Alerts & badges */
.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 0.92rem; }
.alert--success { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }
.alert--info { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; }
.alert--danger { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.badge { display: inline-block; background: #f3f4f6; border-radius: 999px; padding: 4px 9px; font-size: 0.75rem; font-weight: 700; }
.badge--ok { background: #dcfce7; color: #166534; }
.badge--warn { background: #fef3c7; color: #92400e; }
.badge--muted { background: #f3f4f6; color: #6b7280; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 5px; color: #374151; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 10px; background: #fafbfc; color: var(--text);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: 2px solid var(--brand-light); border-color: var(--dark-mid); background: #fff;
}
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-row .right { margin-left: auto; }
.note { background: #fafafa; border: 1px solid var(--border); border-radius: 12px; padding: 12px; color: var(--muted); }

/* Auth */
.layout-auth {
  min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(165deg, #faf5f5 0%, #f5ecec 48%, #efe4e4 100%);
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 28px; width: 100%; max-width: 430px; box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 6px; font-size: 1.5rem; color: var(--dark); }
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.auth-brand__logo {
  width: 48px; height: 48px; border-radius: 14px; background: var(--dark); color: #fff;
  display: grid; place-items: center; font-size: 1.4rem;
}
.auth-brand__title { font-weight: 800; font-size: 1.2rem; }
.auth-brand__sub { font-size: 0.85rem; color: var(--muted); }

/* App layout — menu horizontal en haut */
.layout-app .app-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.app-shell__main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  background: #fff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header + navigation horizontale */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
}

.app-header__inner {
  display: flex;
  align-items: center;
  gap: 12px 20px;
  padding: 12px 20px;
  max-width: 1400px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.app-header__start {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.app-header__menu-btn {
  display: inline-flex;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.app-header__menu-btn span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-header__menu-btn span span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--dark);
  border-radius: 1px;
}

@media (min-width: 1024px) {
  .app-header__menu-btn { display: none; }
}

.app-header__wordmark {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--dark);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.app-header__wordmark:hover { text-decoration: none; }
.app-header__wordmark span { color: var(--brand); }

.app-topnav {
  flex: 1;
  min-width: 0;
}

.app-topnav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.app-topnav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #3d1a1a;
  font-weight: 500;
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: inset 0 -3px 0 transparent;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.app-topnav__link:hover {
  background: var(--brand-hover);
  text-decoration: none;
}

.app-topnav__link.is-active {
  background: var(--brand-light);
  font-weight: 600;
  color: var(--dark);
  box-shadow: inset 0 -3px 0 var(--dark);
}

.app-topnav__icon {
  display: flex;
  flex-shrink: 0;
  color: #6b4040;
}

.app-topnav__link.is-active .app-topnav__icon { color: var(--dark); }

@media (max-width: 1023px) {
  .app-topnav { display: none; }
}

.app-header__end {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

.app-header__filter-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 4px;
}

.app-header__select {
  min-width: 160px;
  max-width: 220px;
  padding: 9px 32px 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 767px) {
  .app-header__filter { display: none; }
  .app-header__user-meta { display: none; }
  .app-header__logout { display: none; }
}

.app-header__user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-header__avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--dark);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.app-header__user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  font-size: 0.82rem;
}

.app-header__user-meta small { color: var(--muted); }

.app-header__logout {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  text-decoration: none;
}

.app-header__logout:hover {
  color: var(--danger);
  border-color: #fecaca;
  background: #fef2f2;
  text-decoration: none;
}

/* Titre de page */
.app-page-head {
  padding: 22px 24px 8px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.app-page-head__title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.02em;
}

.app-page-head__subtitle {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Main content */
.app-main {
  flex: 1;
  padding: 8px 24px 48px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Dashboard KPIs (Tapcv-style) */
.app-dash__kpis {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 18px 0 24px;
}
@media (min-width: 800px) { .app-dash__kpis { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.app-kpi-card {
  background: #f9fafb; border: 1px solid #eef0ef; border-radius: 12px;
  padding: 18px 16px; box-shadow: 0 1px 2px rgba(45, 10, 10, 0.04);
}
.app-kpi-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.app-kpi-card__label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.app-kpi-card__ico { color: #8b6060; opacity: 0.85; }
.app-kpi-card__value { margin: 0; font-size: 1.75rem; font-weight: 700; color: var(--dark); letter-spacing: -0.02em; }
.app-kpi-card__hint { margin: 8px 0 0; font-size: 0.78rem; color: var(--muted); font-weight: 500; }

.app-dash__grid { display: grid; gap: 18px; align-items: start; }
@media (min-width: 960px) { .app-dash__grid { grid-template-columns: 1fr minmax(260px, 320px); gap: 22px; } }

.app-dash__panel {
  background: #fff; border: 1px solid #eef0ef; border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(45, 10, 10, 0.05);
}
.app-dash__panel-head { padding: 18px 20px 12px; border-bottom: 1px solid #f0f2f1; }
.app-dash__panel-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--dark); }
.app-dash__panel-body { padding: 16px 20px 20px; }
.app-dash__empty { margin: 0; padding: 24px 20px; color: var(--muted); font-size: 0.92rem; }
.app-dash__alert-item {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
}
.app-dash__alert-item:last-child { margin-bottom: 0; }

/* Tables */
.app-table-wrap { overflow-x: auto; }
.app-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.app-table th {
  text-align: left; padding: 10px 16px; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
  background: #fafbfb; border-bottom: 1px solid #eef0ef;
}
.app-table td { padding: 14px 16px; border-bottom: 1px solid #f4f5f4; vertical-align: top; }
.app-table tbody tr:hover { background: var(--brand-hover); }

/* Tableaux — cartes empilées sur mobile / tablette (sans scroll horizontal) */
@media (max-width: 899px) {
  .app-table-wrap {
    overflow-x: visible;
  }

  .app-table {
    font-size: 0.9rem;
  }

  .app-table thead {
    display: none;
  }

  .app-table tbody {
    display: block;
  }

  .app-table tbody tr {
    display: block;
    margin-bottom: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #eef0ef;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(45, 10, 10, 0.04);
  }

  .app-table tbody tr:hover {
    background: #fff;
  }

  .app-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .app-table td {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #f4f5f4;
  }

  .app-table td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .app-table td:first-child {
    padding-top: 0;
  }

  .app-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
  }

  .app-table td.app-table__empty {
    padding: 16px 0;
    text-align: center;
    border-bottom: none;
  }

  .app-table td.app-table__empty::before {
    display: none;
  }

  .app-table td[data-label="Actions"] .table-actions {
    margin-top: 2px;
  }

  .app-table td[data-label="Actions"] .table-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .app-dash__panel .app-table-wrap {
    padding: 0 16px 16px;
  }

  .page-panel {
    padding: 16px;
  }

  .app-main {
    padding: 8px 14px 32px;
  }
}

/* Page layout */
.page-grid { display: grid; gap: 18px; margin-top: 18px; }
@media (min-width: 900px) { .page-grid--3 { grid-template-columns: 1fr 2fr; } .page-grid--2 { grid-template-columns: 1fr 1fr; } }
.page-panel {
  background: #fff; border: 1px solid #eef0ef; border-radius: 12px; padding: 20px;
  box-shadow: 0 2px 12px rgba(45, 10, 10, 0.05);
}
.page-panel h2 { margin: 0 0 16px; font-size: 1.1rem; color: var(--dark); }
.page-panel__head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.page-panel__head h2 { margin: 0; flex: 1; }
.page-panel__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.table-actions__form {
  display: flex;
  margin: 0;
}

/* Modales */
body.app-modal-open { overflow: hidden; }

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.app-modal[hidden] { display: none !important; }

.app-modal.is-open {
  display: flex !important;
}

.app-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 10, 10, 0.48);
  backdrop-filter: blur(2px);
}

.app-modal__box {
  position: relative;
  z-index: 1;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  max-height: min(90dvh, 720px);
  overflow: auto;
  box-shadow: 0 20px 50px rgba(45, 10, 10, 0.18);
  padding: 22px 24px 24px;
}

.app-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.app-modal__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
}

.app-modal__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.app-modal__close:hover { color: var(--dark); background: #fafafa; }

.app-modal__box--confirm {
  max-width: 420px;
}

.confirm-delete__message {
  margin: 0 0 12px;
  color: var(--text);
  line-height: 1.5;
}

.confirm-delete__hint {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.confirm-delete__input {
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 8px;
}

@media (max-width: 767px) {
  .app-modal { padding: 0; align-items: flex-end; }
  .app-modal__box {
    max-width: none;
    max-height: 92dvh;
    border-radius: 16px 16px 0 0;
  }
}

/* Zone upload documents */
.doc-upload-form { margin-bottom: 22px; }

.doc-upload-form__label {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
}

.doc-dropzone {
  position: relative;
  border: 2px dashed #e8b4b4;
  border-radius: 14px;
  background: #fffafa;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.doc-dropzone.is-dragover {
  border-color: var(--brand);
  background: #fef2f2;
}

.doc-dropzone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.doc-dropzone__inner {
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
}

.doc-dropzone__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.12);
  color: var(--brand);
}

.doc-dropzone__title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
}

.doc-dropzone__hint {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--muted);
}

.doc-dropzone__browse {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  text-decoration: underline;
}

.doc-dropzone__browse:hover { color: var(--dark-mid); }

.doc-dropzone__meta {
  margin: 0;
  font-size: 0.78rem;
  color: #9ca3af;
}

.doc-dropzone__files {
  list-style: none;
  margin: 0;
  padding: 0 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-dropzone__files li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.doc-dropzone__files li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.doc-upload-form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.doc-list-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
}

/* Scan contrat Gemini (ajout véhicule) */
.contract-scan-block {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.contract-scan-block__label {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
}

.contract-scan-dropzone.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.contract-scan-status {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
}

.contract-scan-status--loading {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}

.contract-scan-status--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.contract-scan-status--error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.contract-scan-status--info {
  background: #f9fafb;
  border: 1px solid var(--border);
  color: var(--muted);
}

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs .btn { border-radius: 10px; }
.tabs .btn.is-active { background: var(--dark); color: #fff; }
.search-input { width: 100%; max-width: 100%; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }

/* Mobile menu */
.app-mobile-overlay { display: none; }

@media (max-width: 1023px) {
  .app-mobile-overlay.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 200;
  }

  .app-mobile-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
  }

  .app-mobile-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: min(300px, 88vw);
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .app-mobile-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
  }

  .app-mobile-panel__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
  }

  .app-mobile-panel__filter {
    padding: 12px 16px 0;
  }

  .app-mobile-panel__nav {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
  }

  .app-mobile-panel__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
  }

  .app-mobile-panel__link.is-active {
    background: var(--brand-light);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--dark);
  }

  .app-mobile-panel__foot {
    padding: 16px;
    border-top: 1px solid var(--border);
  }

  .app-mobile-panel__cta {
    display: block;
    text-align: center;
    padding: 12px;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
  }

  .app-mobile-panel__cta--ghost {
    border: 2px solid var(--border);
    color: var(--text);
  }
}

.event-card {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 14px; margin-bottom: 12px;
}
.event-card:last-child { margin-bottom: 0; }
.user-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.user-row:last-child { border-bottom: none; }

/* Retour bureau — bouton flottant bas droite (desktop) */
.app-board-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(45, 10, 10, 0.12);
  color: var(--dark);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.app-board-fab:hover {
  border-color: var(--dark-mid);
  box-shadow: 0 6px 22px rgba(45, 10, 10, 0.16);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--dark);
}

.app-board-fab:active {
  transform: scale(0.98);
}

.app-board-fab__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--brand-hover);
  color: var(--dark);
}

.app-board-fab__icon svg {
  width: 18px;
  height: 18px;
}

body.app-modal-open .app-board-fab {
  display: none;
}

@media (max-width: 1023px) {
  .app-board-fab {
    display: none;
  }
}

@media (min-width: 1024px) {
  .app-main {
    padding-bottom: 72px;
  }
}

@media (max-width: 1023px) {
  .app-mobile-panel__link--board {
    margin-top: 8px;
    border-top: 1px solid var(--border);
    border-radius: 0;
    padding-top: 16px;
    font-weight: 600;
  }
}

/* Auth — split layout Tapcv, thème rouge */
body.layout-auth.flotte-auth {
  background: #fff;
  min-height: 100dvh;
}

.flotte-auth-split {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: minmax(280px, 42%) minmax(0, 1fr);
}

.flotte-auth-split__aside {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 6vw, 56px) clamp(24px, 5vw, 48px);
  background: #f9fafb;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.flotte-auth-split__aside-pattern {
  position: absolute;
  inset: 0;
  background-color: #f9fafb;
  background-image:
    radial-gradient(ellipse 85% 55% at 18% 28%, rgba(239, 68, 68, 0.28), transparent 62%),
    radial-gradient(ellipse 55% 45% at 92% 78%, rgba(45, 10, 10, 0.08), transparent 55%),
    repeating-linear-gradient(104deg, transparent 0, transparent 20px, rgba(45, 10, 10, 0.028) 20px, rgba(45, 10, 10, 0.028) 21px);
  pointer-events: none;
}

.flotte-auth-split__aside-glow {
  position: absolute;
  width: min(420px, 90vw);
  height: min(420px, 70vh);
  right: -12%;
  bottom: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.22) 0%, transparent 68%);
  pointer-events: none;
}

.flotte-auth-split__aside-inner { position: relative; z-index: 1; max-width: 340px; }

.flotte-auth-split__aside-kicker {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dark);
}

.flotte-auth-split__aside-title {
  margin: 0;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 700;
  line-height: 1.35;
  color: #3d1a1a;
}

.flotte-auth-split__content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100dvh;
  background: #fff;
}

.flotte-auth-header { background: transparent; border-bottom: none; }

.flotte-auth-header__inner {
  max-width: 520px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 36px) clamp(16px, 4vw, 36px) 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.flotte-auth-header__inner--solo {
  justify-content: flex-start;
}

.flotte-auth-header__wordmark {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--dark);
}
.flotte-auth-header__wordmark span { color: var(--brand); }

.flotte-auth-tabs {
  display: flex;
  align-items: center;
  padding: 4px;
  gap: 4px;
  background: #f3f4f6;
  border-radius: 10px;
}

.flotte-auth-tabs__link {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
}
.flotte-auth-tabs__link.is-active {
  background: #fff;
  color: var(--dark);
  box-shadow: 0 1px 2px rgba(45, 10, 10, 0.08);
}

.flotte-auth-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px clamp(16px, 4vw, 40px) 48px;
}

.flotte-auth-main__inner { width: 100%; max-width: 440px; margin: 0 auto; }

.flotte-auth-title {
  margin: 0 0 6px;
  font-size: clamp(1.45rem, 3vw, 1.75rem);
  font-weight: 800;
  color: #3d1a1a;
  letter-spacing: -0.02em;
}

.flotte-auth-lead {
  margin: 0 0 22px;
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.5;
}

.flotte-auth-form--line .form-group { margin-bottom: 20px; }

.flotte-auth-form--line label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
}

.flotte-auth-form--line input[type="email"],
.flotte-auth-form--line input[type="password"] {
  width: 100%;
  padding: 10px 12px 12px;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid #e5e7eb;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
}

.flotte-auth-form--line input:focus {
  outline: none;
  border-bottom-color: var(--dark);
  background: transparent;
}

.flotte-auth-actions { margin-top: 8px; }
.flotte-auth-actions--row { display: grid; grid-template-columns: 1fr; gap: 12px; }
.flotte-auth-actions--row .btn { width: 100%; }

.flotte-auth-back {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.9rem;
}

.flotte-auth-back a {
  color: var(--muted);
  font-weight: 600;
}

.flotte-auth-back a:hover {
  color: var(--dark);
}

.alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.92rem;
}

@media (max-width: 767px) {
  .flotte-auth-split { grid-template-columns: 1fr; }
  .flotte-auth-split__aside {
    order: 2;
    min-height: 160px;
    border-right: none;
    border-top: 1px solid var(--border);
    align-items: center;
    padding: 24px 20px;
  }
  .flotte-auth-split__aside-inner { max-width: none; }
  .flotte-auth-split__aside-title { font-size: 1.05rem; }
  .flotte-auth-split__content { order: 1; min-height: 0; }
  .flotte-auth-header__inner { flex-direction: column; align-items: stretch; }
}
