:root {
  --showcase-blue: #1268df;
  --showcase-green: #148a43;
  --showcase-orange: #ff7207;
  --showcase-red: #e53a46;
  --showcase-cyan: #08aeca;
  --showcase-purple: #8b4df6;
  --showcase-ink: #111827;
  --showcase-muted: #596578;
  --showcase-line: #dce5f1;
  --showcase-shadow: 0 22px 70px rgba(20, 36, 68, 0.08);
}

* { box-sizing: border-box; }
.app-shell::before { display: none !important; }
nextjs-portal, [data-nextjs-toast], [data-nextjs-dev-tools-button] { display: none !important; }

.app-shell .showcase-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  height: 184px;
  overflow: visible;
  border-bottom: 1px solid #e7edf6;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(18px);
}

.app-shell .showcase-topbar-inner {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: start;
  gap: clamp(18px, 1.4vw, 30px);
  width: 100%;
  max-width: none;
  height: 100%;
  padding: 36px 36px 0;
  overflow: visible;
}

.showcase-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 205px;
  margin-top: 14px;
  color: var(--showcase-blue);
  text-decoration: none;
}

/* Nom de l'auto-école (paramétré), détaché du logo, en écriture manuscrite lisible. */
.brand-name {
  font-family: "Caveat", "Segoe Script", "Comic Sans MS", cursive;
  font-weight: 700;
  font-size: 23px;
  line-height: 1;
  color: #21459a;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0;
}

.vehicle-tabs {
  position: relative;
  /* z-index positif : isolation+filter font de .vehicle-tabs un contexte d'empilement ; sans z-index il reste
     en z-auto et le frère DOM suivant (.showcase-actions, qui s'enroule sous les onglets en tablette/desktop étroit)
     peint PAR-DESSUS le menu déroulant. z-index 90 le fait passer au-dessus de la rangée d'actions. */
  z-index: 90;
  display: flex;
  align-items: stretch;
  width: max-content;
  height: 100px;
  isolation: isolate;
  filter: drop-shadow(0 18px 36px rgba(15, 23, 42, 0.06));
}

.vehicle-tab-group {
  position: relative;
  width: clamp(150px, 11.1vw, 256px);
  height: 100px;
}

.vehicle-tab-summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  height: 100px;
  margin: 0;
  padding: 0 22px;
  border: 1px solid #e1e7f0;
  color: #162033;
  font-size: clamp(18px, 1.3vw, 26px);
  font-weight: 1000;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: transform 160ms ease, filter 160ms ease;
}

.vehicle-tab-summary::-webkit-details-marker { display: none; }
.vehicle-tab-summary::marker { content: ""; }
.vehicle-tab-summary:hover { transform: translateY(-2px); filter: saturate(1.06); }

.vehicle-tab-cars .vehicle-tab-summary {
  border-color: #1268df;
  border-radius: 12px 0 0 12px;
  background: linear-gradient(135deg, #0f63d8 0%, #2787ff 100%);
  color: #fff;
}
.vehicle-tab-bikes .vehicle-tab-summary {
  border-color: #ffd8dd;
  background: linear-gradient(135deg, #fff8f9 0%, #ffe5e9 100%);
  color: #e1323d;
}
.vehicle-tab-trucks .vehicle-tab-summary {
  border-color: #ffdfbf;
  background: linear-gradient(135deg, #fff8ef 0%, #ffecd5 100%);
  color: #f16500;
}
.vehicle-tab-machines .vehicle-tab-summary {
  border-color: #dcebd0;
  border-radius: 0 12px 12px 0;
  background: linear-gradient(135deg, #f7fbf1 0%, #e8f4dc 100%);
  color: #16813d;
}

.vehicle-tab-group[open] .vehicle-tab-summary::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -15px;
  z-index: 2;
  width: 25px;
  height: 25px;
  transform: translateX(-50%) rotate(45deg);
}
.vehicle-tab-cars[open] .vehicle-tab-summary::after { background: #2787ff; }
.vehicle-tab-bikes[open] .vehicle-tab-summary::after { background: #ffe5e9; }
.vehicle-tab-trucks[open] .vehicle-tab-summary::after { background: #ffecd5; }
.vehicle-tab-machines[open] .vehicle-tab-summary::after { background: #e8f4dc; }

.vehicle-menu {
  position: absolute;
  top: 120px;
  left: 0;
  z-index: 120;
  display: grid;
  width: 338px;
  overflow: hidden;
  border: 1px solid #e3eaf3;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.17);
}

.vehicle-menu-link {
  display: grid;
  grid-template-columns: 38px 1fr 18px;
  align-items: center;
  min-height: 56px;
  padding: 0 28px;
  border-bottom: 1px solid #e8edf4;
  color: #111827;
  font-size: 18px;
  font-weight: 900;
  text-decoration: none;
  transition: background 150ms ease, padding-left 150ms ease;
}
.vehicle-menu-link:last-child { border-bottom: 0; }
.vehicle-menu-link:hover { padding-left: 32px; background: #f8fbff; }
.vehicle-menu-link svg:last-child { justify-self: end; color: #818b9a; transform: rotate(-90deg); }
.vehicle-menu-link:nth-child(1) svg:first-child { color: var(--showcase-blue); }
.vehicle-menu-link:nth-child(2) svg:first-child { color: var(--showcase-green); }
.vehicle-menu-link:nth-child(3) svg:first-child { color: var(--showcase-cyan); }
.vehicle-menu-link:nth-child(4) svg:first-child { color: #6b7280; }
.vehicle-menu-link:nth-child(5) svg:first-child { color: var(--showcase-red); }
.vehicle-menu-link:nth-child(6) svg:first-child { color: var(--showcase-orange); }
.vehicle-menu-link:nth-child(7) svg:first-child { color: var(--showcase-purple); }

.showcase-actions {
  justify-self: end;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: clamp(12px, 1.55vw, 32px);
  min-width: max-content;
}

.showcase-action {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  width: clamp(88px, 6.7vw, 138px);
  height: clamp(80px, 5.3vw, 106px);
  border: 1px solid #dce5f0;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  font-size: clamp(13px, 0.82vw, 17px);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.showcase-action svg { color: #161d2c; }
.showcase-action:hover,
.showcase-action.active {
  transform: translateY(-2px);
  border-color: #b7d8ff;
  box-shadow: 0 22px 48px rgba(18, 104, 223, 0.15);
}
.showcase-action b {
  position: absolute;
  top: -13px;
  right: -10px;
  display: grid;
  min-width: 31px;
  height: 31px;
  padding: 0 9px;
  place-items: center;
  border-radius: 999px;
  background: #ef3341;
  color: #fff;
  font-size: 16px;
  font-weight: 1000;
  box-shadow: 0 10px 24px rgba(239, 51, 65, 0.35);
}

.app-shell > .stage {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 184px);
  padding: 52px 60px 22px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 46%, #f8fbff 100%);
}

.showcase-dashboard {
  width: 100%;
  max-width: 1928px;
  margin: 0 auto;
}

.showcase-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px;
  margin: 0 0 44px clamp(0px, 30vw, 615px);
}

.showcase-stat-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 76px;
  grid-template-rows: auto auto auto 1fr;
  min-height: 260px;
  padding: 35px 30px 28px;
  overflow: hidden;
  border: 1px solid currentColor;
  border-radius: 15px;
  background: #fff;
  color: var(--showcase-blue);
  text-decoration: none;
  box-shadow: var(--showcase-shadow);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.showcase-stat-card:hover { transform: translateY(-3px); box-shadow: 0 2px 8px rgba(15, 33, 70, 0.08), 0 8px 20px rgba(15, 33, 70, 0.07); }
.showcase-stat-card span { color: currentColor; font-size: 16px; font-weight: 1000; }
.showcase-stat-card strong { margin-top: 20px; color: currentColor; font-size: 50px; line-height: 0.92; font-weight: 1000; letter-spacing: -0.055em; }
.showcase-stat-card small { margin-top: 8px; color: #3f4c60; font-size: 18px; font-weight: 650; }
.showcase-stat-card i {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  justify-self: end;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.12;
}
.showcase-stat-card i svg { color: currentColor; }
.showcase-stat-card em {
  grid-column: 1 / -1;
  align-self: end;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid currentColor;
  color: currentColor;
  font-size: 17px;
  font-style: normal;
  font-weight: 900;
}
.stat-blue { color: #1068df; background: linear-gradient(145deg, #fff, #f4f9ff); }
.stat-green { color: #138a43; background: linear-gradient(145deg, #fff, #f2fbf5); }
.stat-orange { color: #ff7207; background: linear-gradient(145deg, #fff, #fff5eb); }
.stat-red { color: #e53a46; background: linear-gradient(145deg, #fff, #fff2f4); }

.showcase-grid {
  display: grid;
  grid-template-columns: 1.01fr 0.98fr 0.99fr;
  gap: 34px;
  align-items: stretch;
  height: 500px;
}

.showcase-panel {
  border: 1px solid var(--showcase-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--showcase-shadow);
}

.vehicle-showcase-card,
.cost-showcase-card,
.alert-showcase-card,
.validation-showcase-card { padding: 32px; }

.showcase-panel-title {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}
.showcase-panel-title h2 { margin: 0; color: #111827; font-size: 24px; line-height: 1; font-weight: 1000; letter-spacing: -0.035em; }
.showcase-panel-title > i {
  display: grid;
  width: 66px;
  height: 66px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: #e7f1ff;
  color: var(--showcase-blue);
}
.showcase-panel-title > i.green { background: #e7f7ed; color: var(--showcase-green); }
.showcase-panel-title > i.red { background: #ffe9ec; color: var(--showcase-red); }
.showcase-panel-title.compact { margin-bottom: 18px; }
.showcase-panel-title.compact h2 { font-size: 24px; }

.vehicle-showcase-body {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  grid-template-rows: 1fr 64px;
  gap: 22px 26px;
  min-height: 340px;
  align-items: end;
}
.vehicle-showcase-image-wrap { display: flex; align-items: flex-end; justify-content: center; min-height: 235px; }
.vehicle-showcase-image { width: min(100%, 330px); height: auto; filter: drop-shadow(0 28px 28px rgba(15, 23, 42, 0.14)); }
.vehicle-showcase-info { align-self: center; }
.vehicle-showcase-info h3 { margin: 0 0 10px; color: #0f172a; font-size: 25px; font-weight: 1000; letter-spacing: -0.03em; }
.vehicle-code-chip { display: inline-flex; align-items: center; margin-bottom: 12px; padding: 8px 13px; border-radius: 999px; background: #e6f1ff; color: var(--showcase-blue); font-size: 15px; font-weight: 1000; }
.vehicle-showcase-info p { display: flex; align-items: center; gap: 11px; margin: 10px 0; color: #4d5869; font-size: 14px; font-weight: 700; }
.showcase-primary-button,
.showcase-secondary-button { display: flex; align-items: center; justify-content: center; min-height: 64px; border-radius: 10px; font-size: 17px; font-weight: 1000; text-decoration: none; }
.showcase-primary-button { background: linear-gradient(135deg, #075bd0, #2687ff); color: #fff; box-shadow: 0 18px 34px rgba(18, 104, 223, 0.24); }
.showcase-secondary-button { border: 1px solid #dce4ef; background: #fff; color: var(--showcase-blue); }

.showcase-select { margin-left: auto; padding: 14px 18px; border: 1px solid #e1e7f0; border-radius: 10px; background: #fff; color: #111827; font-size: 14px; font-weight: 900; }
.showcase-icon-button { display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid #e1e7f0; border-radius: 10px; background: #fff; color: #111827; }
.showcase-cost-list { display: grid; gap: 19px; margin-top: 8px; }
.showcase-cost-row { display: grid; grid-template-columns: 100px 1fr 74px; align-items: center; gap: 20px; min-height: 33px; }
.showcase-cost-row span { color: #4b5563; font-size: 14px; font-weight: 700; }
.showcase-cost-row strong { color: #111827; font-size: 15px; font-weight: 1000; text-align: right; }
.showcase-cost-track { height: 11px; overflow: hidden; border-radius: 999px; background: #e9eaec; }
.showcase-cost-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #22a85b 0%, #22a85b 42%, #f7ba08 66%, #f06023 100%); }
.showcase-total-row { display: flex; align-items: center; justify-content: space-between; margin-top: 31px; padding: 21px 24px; border: 1px solid #cfecdb; border-radius: 11px; background: linear-gradient(135deg, #f5fff8, #edfbf2); color: var(--showcase-green); font-size: 18px; font-weight: 1000; }
.showcase-total-row strong { font-size: 25px; letter-spacing: -0.03em; }

.showcase-side-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 28px; }
.showcase-status-pill { margin-left: auto; padding: 11px 18px; border-radius: 13px; font-size: 15px; font-weight: 1000; white-space: nowrap; }
.showcase-status-pill.danger { background: #ffe7ea; color: var(--showcase-red); }
.showcase-status-pill.success { background: #e7f8ed; color: var(--showcase-green); }
.showcase-alert-box,
.showcase-validation-box { position: relative; display: grid; gap: 8px; min-height: 130px; padding: 25px 150px 25px 20px; border: 1px solid #ffd2d7; border-radius: 14px; background: #fff; }
.showcase-validation-box { border-color: #ccebd7; }
.showcase-alert-box strong,
.showcase-validation-box strong { color: #111827; font-size: 17px; font-weight: 1000; }
.showcase-alert-box span,
.showcase-validation-box span { color: #525d6d; font-size: 16px; font-weight: 700; }
.showcase-alert-box p { margin: 3px 0 0; color: var(--showcase-red); font-size: 16px; font-weight: 800; }
.showcase-alert-box a,
.showcase-validation-box a { position: absolute; right: 19px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; min-width: 125px; height: 46px; padding: 0 15px; border: 1px solid currentColor; border-radius: 10px; background: #fff; color: var(--showcase-red); font-size: 15px; font-weight: 1000; text-decoration: none; }
.showcase-validation-box a { color: var(--showcase-green); }
.showcase-empty { margin: 0; color: var(--showcase-muted); font-size: 16px; font-weight: 750; }

.showcase-sync-bar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 20px;
  align-items: center;
  margin-top: 28px;
  padding: 18px 20px 18px 88px;
  border: 1px solid #d7e6fb;
  border-radius: 12px;
  background: linear-gradient(135deg, #edf6ff, #f7fbff);
  color: #172033;
  box-shadow: 0 16px 35px rgba(18, 104, 223, 0.07);
}
.showcase-sync-bar span { color: var(--showcase-blue); font-size: 15px; font-weight: 1000; }
.showcase-sync-bar small { color: #4f5b6d; font-size: 13px; font-weight: 700; }
.showcase-sync-bar a { grid-column: 2; grid-row: 1 / span 2; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 21px; border-radius: 8px; background: linear-gradient(135deg, #075bd0, #2687ff); color: #fff; font-size: 14px; font-weight: 1000; text-decoration: none; box-shadow: 0 15px 28px rgba(18, 104, 223, 0.2); }
.showcase-chart-icon { position: absolute; left: 20px; bottom: 18px; display: grid; width: 44px; height: 44px; place-items: center; border-radius: 999px; background: #e0efff; color: var(--showcase-blue); font-size: 24px; font-weight: 1000; }

@media (max-width: 1500px) {
  .showcase-grid { height: auto; }
  .app-shell .showcase-topbar { height: 156px; }
  .app-shell .showcase-topbar-inner { padding: 28px 26px 0; gap: 22px; }
  .showcase-brand { min-width: 178px; margin-top: 12px; }
  .vehicle-tabs, .vehicle-tab-group, .vehicle-tab-summary { height: 82px; }
  .vehicle-menu { top: 99px; }
  .showcase-action { gap: 6px; }
  .app-shell > .stage { min-height: calc(100vh - 156px); padding: 34px 32px 18px; }
  .showcase-stats { margin-left: 0; gap: 18px; }
  .showcase-stat-card { min-height: 205px; padding: 26px 24px 22px; }
  .showcase-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .showcase-side-stack { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
}

@media (max-width: 1080px) {
  .app-shell .showcase-topbar { height: auto; min-height: 148px; }
  .app-shell .showcase-topbar-inner { display: flex; align-items: flex-start; overflow-x: auto; overflow-y: visible; padding-bottom: 24px; }
  .showcase-brand { flex: 0 0 178px; }
  .vehicle-tabs { flex: 0 0 auto; }
  .showcase-actions { flex: 0 0 auto; }
  .showcase-stats { grid-template-columns: repeat(2, 1fr); }
  .showcase-grid { grid-template-columns: 1fr; }
  .showcase-side-stack { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-shell > .stage { padding: 24px 18px; }
  .showcase-stats { grid-template-columns: 1fr; }
  .vehicle-showcase-body { grid-template-columns: 1fr; grid-template-rows: auto; }
  .showcase-cost-row { grid-template-columns: 76px 1fr 58px; gap: 10px; }
  .showcase-alert-box,
  .showcase-validation-box { padding-right: 20px; }
  .showcase-alert-box a,
  .showcase-validation-box a { position: static; transform: none; justify-self: start; margin-top: 10px; }
  .showcase-sync-bar { grid-template-columns: 1fr; padding-left: 20px; }
  .showcase-sync-bar a { grid-column: 1; grid-row: 3; justify-self: start; }
  .showcase-chart-icon { display: none; }
}
