/*
  EPG Metra - feuille de style principale
  v36 : commentaires de structure, variables d’espacement et correctifs responsive.
  Les règles historiques demeurent présentes pour ne pas briser les autres pages PHP.
*/

:root {
  --bg: #070707;
  --panel: #1a1b1d;
  --text: #f2f3f4;
  --muted: #b9bcc2;
  --border: rgba(209, 213, 219, 0.22);
  --primary: #d24d19;
  --primary-dark: #a8350f;
  --accent: #172554;
  --warning-bg: #3b2f14;
  --warning-border: #b98517;
  --success-bg: #12351f;
  --success-border: #3f8f55;
  --danger-bg: #3f1717;
  --danger-border: #b45353;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
  --tap-size: 48px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --content-max: 1680px;
}

html {
  scroll-behavior: smooth;
}


* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto;
}

.hero {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.brand-block {
  flex: 1 1 auto;
}


.top-login-card {
  flex: 0 0 330px;
  align-self: flex-start;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.inline-login-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.inline-login-title {
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 2px;
}

.inline-login-form label span {
  font-size: 13px;
  margin-bottom: 5px;
}

.inline-login-form input {
  min-height: 40px;
  padding: 8px 10px;
}

.inline-login-button {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
}

.admin-small-link {
  color: #93c5fd;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  justify-self: start;
}

.admin-small-link:hover {
  text-decoration: underline;
}

.top-login-card .merchant-status {
  margin-top: 0;
}

.epg-logo {
  display: block;
  width: min(260px, 72vw);
  height: auto;
  margin: 0 0 14px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.45));
}

.metra-center-logo {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(240px, 26vw);
  min-width: 170px;
  text-align: center;
  pointer-events: none;
}

.metra-center-logo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

h1, h2 {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.05;
}

h2 {
  font-size: 22px;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 760px;
  line-height: 1.45;
}

.source-card {
  min-width: 245px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

#sourceStatus {
  color: var(--muted);
  font-size: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

.grid {
  display: grid;
  gap: 16px;
}

.controls-grid {
  grid-template-columns: repeat(3, minmax(170px, 1fr));
}

label span {
  display: block;
  font-weight: 700;
  margin-bottom: 7px;
}

select, input[type="file"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 15px;
  background: #0b1220;
  color: var(--text);
}

select:disabled {
  color: #64748b;
  background: #0f172a;
}

.hidden {
  display: none !important;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

button, .link-button {
  border: 0;
  border-radius: 11px;
  min-height: 44px;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-dark);
}

.secondary {
  background: #1f2937;
  color: var(--text);
}

.secondary:hover {
  background: #334155;
}

.message {
  border-radius: 14px;
  border: 1px solid var(--warning-border);
  background: var(--warning-bg);
  padding: 14px 16px;
  margin-bottom: 18px;
  line-height: 1.45;
}

.message.error {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.message.success {
  border-color: var(--success-border);
  background: var(--success-bg);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}

#matchSummary {
  margin: 6px 0 0;
  color: var(--muted);
}

.result-card {
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 16px;
}

.result-title {
  background: var(--accent);
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  font-weight: 700;
}

.result-title span {
  color: var(--muted);
  font-weight: 400;
}

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

.parts-table th, .parts-table td {
  text-align: left;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.parts-table th {
  width: 34%;
  background: #0b1220;
  font-size: 14px;
}

.value-empty {
  color: var(--muted);
  font-style: italic;
}

.part-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.part-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1f2937;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 9px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.part-chip:hover {
  background: #334155;
}

.raw-value {
  line-height: 1.5;
}


.related-block {
  margin-top: 22px;
}

.related-block h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.related-note {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.45;
}

.related-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.related-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.related-table th,
.related-table td {
  text-align: left;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  vertical-align: top;
  font-size: 14px;
}

.related-table thead th {
  border-top: 0;
  background: #0b1220;
  color: var(--text);
  white-space: nowrap;
}

.related-table th:nth-child(7),
.related-table td:nth-child(7),
.related-table th:nth-child(8),
.related-table td:nth-child(8),
.related-table th:nth-child(9),
.related-table td:nth-child(9),
.related-table th:nth-child(10),
.related-table td:nth-child(10),
.related-table th:nth-child(11),
.related-table td:nth-child(11) {
  min-width: 190px;
  width: 1%;
}

.parts-table td {
  min-width: 240px;
}

.related-table .selected-row td {
  background: rgba(37, 99, 235, 0.14);
}

.used-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.info-panel p, details p {
  color: var(--muted);
  line-height: 1.45;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 860px) {
  .hero, .results-header {
    flex-direction: column;
  }

  .metra-center-logo {
    position: static;
    transform: none;
    width: min(220px, 68vw);
    margin: -4px auto 10px;
    order: 2;
  }

  .brand-block {
    order: 1;
  }

  .top-login-card {
    order: 3;
  }

  .top-login-card,
  .source-card {
    width: 100%;
    flex-basis: auto;
  }

  .controls-grid {
    grid-template-columns: 1fr;
  }

  .parts-table th, .parts-table td {
    display: block;
    width: 100%;
  }

  .parts-table td {
    border-top: 0;
    padding-top: 0;
  }
}

.year-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.year-badge.ok {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--text);
}

.year-badge.outside {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--text);
}

.related-table .outside-year-row td {
  opacity: 0.86;
}

.grouped-year-row td {
  background: rgba(148, 163, 184, 0.06);
}

.reverse-panel h2 {
  margin-bottom: 6px;
}

.reverse-header p,
.reverse-result-header p,
.reverse-empty p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.reverse-search-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.reverse-input-label {
  min-width: 0;
}

select,
input[type="file"],
input[type="search"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 15px;
  background: #0b1220;
  color: var(--text);
}

input[type="search"]:disabled {
  color: #64748b;
  background: #0f172a;
}

.reverse-results {
  margin-top: 18px;
}

.reverse-result-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 14px;
}

.reverse-result-header h3 {
  margin: 0;
  font-size: 18px;
}

.reverse-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: #1f2937;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.reverse-empty {
  border: 1px solid var(--warning-border);
  background: var(--warning-bg);
  border-radius: 14px;
  padding: 14px 16px;
}

.reverse-table th:nth-child(6),
.reverse-table td:nth-child(6) {
  min-width: 230px;
}

.reverse-table th:nth-child(7),
.reverse-table td:nth-child(7) {
  min-width: 170px;
}

@media (max-width: 860px) {
  .reverse-search-row,
  .reverse-result-header {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

button:disabled,
.link-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}


.quote-page .app-shell {
  width: min(840px, calc(100% - 32px));
}

.quote-panel .form-grid {
  display: grid;
  gap: 16px;
}

input[type="email"],
input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 15px;
  background: #0b1220;
  color: var(--text);
}

textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.4;
  font-family: Arial, Helvetica, sans-serif;
}

textarea.quote-results {
  min-height: 320px;
  font-family: Consolas, Monaco, monospace;
  white-space: pre;
}

.form-help {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.quote-status {
  margin-bottom: 18px;
}

.quote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.quick-summary,
.attention-box {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.quick-summary {
  background: rgba(37, 99, 235, 0.08);
}

.quick-summary h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.quick-vehicle {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.45;
}

.quick-parts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 9px;
}

.quick-parts li {
  display: grid;
  gap: 5px;
}

.attention-box {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.attention-box p {
  margin: 6px 0 0;
  color: var(--text);
  line-height: 1.45;
}

.form-grid.two-cols {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.full-span {
  grid-column: 1 / -1;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 24px;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
}

.checkbox-label span {
  margin: 0;
}

textarea.quote-notes {
  min-height: 110px;
}

.merchant-card {
  max-width: 560px;
  margin: 0 auto;
}

.merchant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

@media (max-width: 860px) {
  .results-actions {
    justify-content: flex-start;
  }

  .form-grid.two-cols {
    grid-template-columns: 1fr;
  }
}

.merchant-status {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(22, 163, 74, 0.10);
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  line-height: 1.45;
}

.merchant-status a {
  color: #93c5fd;
  font-weight: 700;
  text-decoration: none;
}

.merchant-price-level {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  background: #0f172a;
  font-size: 13px;
  font-weight: 700;
}

.part-with-price {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 2px 4px 2px 0;
  white-space: nowrap;
}

.part-price {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(22, 163, 74, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.part-price.missing {
  background: rgba(234, 179, 8, 0.14);
  border-color: rgba(234, 179, 8, 0.35);
  color: #fde68a;
}

.part-description {
  color: var(--muted);
  font-size: 12px;
  white-space: normal;
}

.merchant-profile {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #0b1220;
}

.merchant-profile p {
  margin: 6px 0;
}

/* Administration utilisateurs */
.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.admin-form-panel h2,
.admin-list-panel h2,
.note-panel h2 {
  margin-top: 0;
}

.admin-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.admin-check {
  align-self: end;
  min-height: 48px;
}

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

.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 800;
  font-size: 12px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.status-active {
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
}

.status-inactive {
  background: rgba(234, 179, 8, 0.14);
  border-color: rgba(234, 179, 8, 0.35);
  color: #fde68a;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.admin-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  vertical-align: top;
  font-size: 14px;
}

.admin-table thead th {
  border-top: 0;
  background: #0b1220;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.inline-form {
  display: inline;
  margin: 0;
}

.small-button {
  padding: 7px 10px;
  font-size: 13px;
}

.danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--text);
}

.danger:hover {
  background: #5f1d1d;
}

@media (max-width: 760px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: flex-start;
  }
}

/* v30 - panier, favoris, export, historique */
.cart-panel,
.favorites-panel {
  margin-top: 18px;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.cart-header p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.cart-actions,
.favorite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.cart-items,
.favorites-items {
  display: grid;
  gap: 10px;
}

.cart-item,
.favorite-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0b1220;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cart-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 12px;
  color: var(--muted);
  background: #0b1220;
}

.cart-check input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.small-button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.reverse-search-row-enhanced {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.7fr) auto auto auto auto;
}

.history-pre {
  margin: 0;
  max-width: 360px;
  white-space: pre-wrap;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  color: var(--text);
}

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .top-login-card,
  .controls-panel,
  .quote-actions,
  .results-actions,
  .cart-actions,
  .reverse-search-row,
  .message,
  .updatePanel,
  .favorites-panel,
  button,
  .admin-small-link {
    display: none !important;
  }
  .panel,
  .result-card,
  .related-table-wrap {
    box-shadow: none !important;
    border-color: #999 !important;
    background: #fff !important;
    color: #000 !important;
  }
  .related-table th,
  .parts-table th,
  .result-title {
    background: #eee !important;
    color: #000 !important;
  }
  a,
  .part-chip,
  .part-price,
  .raw-value,
  .value-empty,
  .related-note,
  .form-help,
  .subtitle,
  .eyebrow {
    color: #000 !important;
  }
}

/* Ajouts v31 */
.smart-search-block {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}
.smart-search-label input {
  min-height: 46px;
  font-size: 16px;
}
.popular-vehicles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 18px;
  color: var(--muted);
}
.support-block {
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.65);
  border-radius: 16px;
  padding: 16px;
  margin: 16px 0;
}
.support-block h3 { margin-bottom: 8px; }
.support-block ul { margin: 8px 0 0 20px; }
.support-block li { margin: 6px 0; }
.support-actions, .kit-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.compare-grid > div { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: rgba(2, 6, 23, .45); }
.part-note { display: block; margin-top: 4px; font-size: 12px; color: #bfdbfe; max-width: 280px; }
.kit-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; }
.kit-output { margin-top: 14px; border: 1px solid var(--success-border); background: var(--success-bg); border-radius: 12px; padding: 12px; }
.status-panel h2 { margin-bottom: 12px; }
.status-timeline { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.status-step { border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; color: var(--muted); background: rgba(2, 6, 23, .45); }
.status-step.active { border-color: var(--success-border); color: var(--text); background: var(--success-bg); }
.small-link { color: #93c5fd; font-size: 12px; text-decoration: none; }
.small-link:hover { text-decoration: underline; }
.status-form { display: flex; gap: 6px; align-items: center; }
.status-form select { min-width: 150px; }
@media (max-width: 720px) {
  .smart-search-block { grid-template-columns: 1fr; }
  .popular-vehicles { display: grid; grid-template-columns: 1fr; }
  .popular-vehicles span { margin-bottom: 2px; }
  .results-actions, .action-row, .cart-actions, .quote-actions, .merchant-actions { display: grid; grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .related-table-wrap { overflow-x: auto; }
  .part-with-price { width: 100%; }
  .cart-check { min-width: 86px; }
}
@media print {
  .top-login-card, .controls-panel, .reverse-panel, .favorites-panel, .quote-actions, .results-actions, .cart-actions, .merchant-actions, .popular-vehicles, .smart-search-block { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .panel, .result-card, .support-block { border-color: #999 !important; box-shadow: none !important; background: #fff !important; color: #000 !important; }
  a { color: #000 !important; text-decoration: none !important; }
}


.validation-questionnaire {
  display: block;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background: rgba(15, 23, 42, 0.55);
}

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

.questionnaire-header h2 {
  font-size: 20px;
  margin-bottom: 6px;
}

.questionnaire-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.validation-status-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid var(--border);
}

.validation-status-badge.ready {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: #bbf7d0;
}

.validation-status-badge.review {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: #fde68a;
}

.validation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.validation-grid label,
.premium-audio-note {
  min-width: 0;
}

.premium-audio-note {
  display: block;
  margin-top: 14px;
}

.validation-advice {
  margin-top: 14px;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  line-height: 1.4;
}

.validation-advice.success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
}

.validation-advice.warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
}

@media (max-width: 860px) {
  .validation-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
  .questionnaire-header {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .validation-grid {
    grid-template-columns: 1fr;
  }
  .validation-status-badge {
    width: 100%;
    text-align: center;
  }
}

/* v34 - layout tableau de bord inspiré GLS */
body.dashboard-body {
  background: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  width: calc(100% - 24px);
  max-width: 1680px;
  margin: 12px auto;
  align-items: start;
}

.app-sidebar {
  position: sticky;
  top: 12px;
  min-height: calc(100vh - 24px);
  background: linear-gradient(180deg, #1326b5 0%, #0f1f99 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.sidebar-top {
  display: grid;
  gap: 18px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.sidebar-epg-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  padding: 6px;
}

.sidebar-brand-text {
  display: grid;
  gap: 3px;
}

.sidebar-brand-text strong {
  font-size: 18px;
  color: #fff;
}

.sidebar-brand-text span {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
}

.sidebar-link,
.sidebar-utility {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
}

.sidebar-link:hover,
.sidebar-utility:hover {
  background: rgba(255,255,255,0.10);
}

.sidebar-link.active {
  border-color: #ffd027;
  box-shadow: inset 0 0 0 1px #ffd027;
  background: rgba(0, 0, 0, 0.18);
}

.sidebar-icon {
  width: 22px;
  text-align: center;
  font-size: 18px;
}

.sidebar-bottom {
  display: grid;
  gap: 10px;
}

.dashboard-content {
  min-width: 0;
}

.dashboard-topbar {
  background: rgba(17, 24, 39, 0.96);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(160px, 260px) minmax(300px, 420px);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.topbar-title-wrap h1 {
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.05;
}

.topbar-title-wrap p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.topbar-kicker {
  margin-bottom: 6px;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 800;
}

.topbar-center-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.topbar-center-logo img {
  width: min(100%, 260px);
  height: auto;
  display: block;
  object-fit: contain;
}

.topbar-login-card {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

.compact-login-form {
  gap: 12px;
}

.compact-login-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.compact-login-grid label span,
.page-section-heading p,
.page-helper-panel p {
  color: var(--muted);
}

.content-page {
  display: grid;
  gap: 16px;
}

.content-page.hidden {
  display: none !important;
}

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

.page-section-heading h2 {
  margin-bottom: 5px;
}

.page-section-heading p {
  margin: 0;
  line-height: 1.45;
}

.enhanced-controls-grid {
  grid-template-columns: repeat(5, minmax(160px, 1fr));
}

.controls-panel,
.results-panel,
.reverse-panel,
.cart-panel,
.favorites-panel,
.info-panel,
.kit-panel,
.page-helper-panel {
  background: rgba(17, 24, 39, 0.96);
}

.results-toolbar {
  margin-bottom: 16px;
}

.results-toolbar,
.cart-actions {
  justify-content: flex-start;
}

.result-card,
.related-table-wrap,
.quick-summary,
.attention-box,
.reverse-result-block,
.cart-item,
.favorite-item,
.page-helper-panel {
  background: #0b1220;
}

.page-helper-panel h2 {
  margin-bottom: 8px;
}

.message {
  margin-bottom: 18px;
}

@media (max-width: 1260px) {
  .dashboard-topbar {
    grid-template-columns: 1fr;
  }

  .topbar-center-logo {
    justify-content: flex-start;
  }
}

@media (max-width: 1080px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    min-height: auto;
  }

  .sidebar-nav {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .sidebar-bottom {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .enhanced-controls-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .compact-login-grid,
  .enhanced-controls-grid,
  .sidebar-nav,
  .sidebar-bottom {
    grid-template-columns: 1fr;
  }

  .dashboard-shell {
    width: calc(100% - 12px);
    margin: 6px auto;
    gap: 12px;
  }

  .app-sidebar,
  .dashboard-topbar,
  .panel {
    border-radius: 16px;
  }

  .results-toolbar,
  .action-row,
  .cart-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media print {
  .app-sidebar,
  .dashboard-topbar,
  #page-search,
  #page-reverse,
  #page-favorites,
  .message,
  button,
  .results-toolbar,
  .cart-actions,
  .topbar-login-card {
    display: none !important;
  }

  .dashboard-shell {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .dashboard-content,
  .content-page {
    display: block !important;
  }

  #page-results,
  #page-cart {
    display: block !important;
  }
}

/* v35 - compteur panier, section active renforcée, mobile app */
.cart-count-badge {
  margin-left: auto;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #ffd027;
  color: #07111f;
  border: 2px solid rgba(255,255,255,0.42);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(0,0,0,0.28);
}

.sidebar-link {
  position: relative;
  overflow: hidden;
}

.sidebar-link.active {
  color: #07111f;
  border-color: #ffd027;
  background: linear-gradient(135deg, #ffd027 0%, #fff2a8 100%);
  box-shadow: 0 10px 24px rgba(0,0,0,0.28), 0 0 0 2px rgba(255,208,39,0.26);
  transform: translateX(4px);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 5px;
  border-radius: 0 999px 999px 0;
  background: #07111f;
}

.sidebar-link.active .cart-count-badge {
  background: #07111f;
  color: #ffd027;
  border-color: rgba(7,17,31,0.35);
}

.sidebar-link:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #ffd027;
  outline-offset: 2px;
}

@media (max-width: 760px) {
  body.dashboard-body {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
    background: #0b1220;
  }

  .dashboard-shell {
    width: 100%;
    margin: 0;
    display: block;
  }

  .dashboard-content {
    padding: 10px 10px 0;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 1000;
    min-height: auto;
    height: calc(76px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 28px rgba(0,0,0,0.45);
    background: linear-gradient(180deg, #1326b5 0%, #0f1f99 100%);
  }

  .sidebar-top {
    display: block;
  }

  .sidebar-brand,
  .sidebar-bottom {
    display: none;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    height: 100%;
  }

  .sidebar-link {
    min-height: 60px;
    height: 60px;
    padding: 6px 4px;
    border-radius: 16px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    font-size: 10px;
    line-height: 1.1;
    text-align: center;
  }

  .sidebar-link .sidebar-icon {
    font-size: 20px;
    width: auto;
  }

  .sidebar-link[data-page="favorites"],
  #navQuoteRequest {
    display: none;
  }

  .sidebar-link.active {
    transform: translateY(-5px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.45), 0 0 0 2px rgba(255,208,39,0.32);
  }

  .sidebar-link.active::before {
    left: 50%;
    right: auto;
    top: auto;
    bottom: 4px;
    width: 28px;
    height: 4px;
    transform: translateX(-50%);
    border-radius: 999px;
  }

  .cart-count-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    font-size: 11px;
    margin-left: 0;
  }

  .dashboard-topbar {
    border-radius: 0 0 22px 22px;
    margin: -10px -10px 12px;
    padding: 12px 12px 14px;
    grid-template-columns: 1fr;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 900;
  }

  .topbar-title-wrap h1 {
    font-size: 24px;
  }

  .topbar-title-wrap p {
    font-size: 13px;
  }

  .topbar-kicker {
    font-size: 11px;
  }

  .topbar-center-logo {
    display: none;
  }

  .topbar-login-card {
    padding: 10px;
    border-radius: 14px;
  }

  .inline-login-title {
    font-size: 14px;
  }

  .compact-login-grid {
    grid-template-columns: 1fr;
  }

  .compact-login-grid label span {
    font-size: 12px;
  }

  .compact-login-grid input {
    min-height: 38px;
  }

  .inline-login-button {
    min-height: 38px;
  }

  .panel {
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 18px;
  }

  .page-section-heading {
    margin-bottom: 14px;
  }

  .page-section-heading h2 {
    font-size: 20px;
  }

  select,
  input[type="search"],
  input[type="text"],
  input[type="password"],
  input[type="email"],
  textarea,
  button,
  .link-button {
    min-height: 48px;
    font-size: 16px;
  }

  .smart-search-block,
  .reverse-search-row-enhanced {
    grid-template-columns: 1fr;
  }

  .popular-vehicles .small-button {
    justify-content: flex-start;
  }

  .results-toolbar,
  .action-row,
  .cart-actions {
    gap: 8px;
  }

  .result-title {
    font-size: 14px;
  }

  .parts-table th,
  .parts-table td {
    padding-left: 12px;
    padding-right: 12px;
  }
}


/* v36 - accessibilité, performance visuelle et responsive final */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 2000;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 999px;
  background: #ffd027;
  color: #07111f;
  font-weight: 900;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
}

.dashboard-shell {
  max-width: var(--content-max);
}

button,
select,
input,
textarea,
a {
  -webkit-tap-highlight-color: rgba(255, 208, 39, 0.28);
}

button,
.link-button,
.sidebar-link {
  min-height: var(--tap-size);
}

.sidebar-link.active {
  isolation: isolate;
}

/* Indication active plus lisible sur PC : contraste + barre gauche. */
@media (min-width: 761px) {
  .sidebar-link.active {
    outline: 2px solid rgba(255, 208, 39, 0.42);
    outline-offset: 2px;
  }
}

/* Optimisation mobile : chaque page se comporte comme une vue d’application. */
@media (max-width: 760px) {
  body.dashboard-body {
    min-height: 100svh;
    overflow-x: hidden;
  }

  .dashboard-content {
    min-height: calc(100svh - 84px - var(--safe-bottom));
  }

  .content-page {
    animation: pageFadeIn 120ms ease-out;
  }

  .sidebar-nav {
    grid-template-columns: repeat(5, minmax(56px, 1fr));
  }

  .sidebar-link span:not(.sidebar-icon):not(.cart-count-badge) {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .result-card,
  .cart-item,
  .favorite-item,
  .reverse-result-block {
    overflow-wrap: anywhere;
  }

  .parts-table,
  .related-table,
  .reverse-table {
    min-width: 680px;
  }

  .table-scroll,
  .related-table-wrap,
  .reverse-table-wrap,
  .parts-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* v37 - Affichage des lignes de la base de données en colonnes.
   Remplace le tableau horizontal par des cartes verticales plus lisibles sur PC et mobile. */
.excel-lines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.excel-line-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.52);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.excel-line-card.selected-row {
  border-color: rgba(59, 130, 246, 0.75);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35), 0 16px 30px rgba(37, 99, 235, 0.18);
}

.excel-line-card.outside-year-row {
  opacity: 0.92;
}

.excel-line-header {
  padding: 14px 14px 12px;
  background: rgba(15, 23, 42, 0.92);
  border-bottom: 1px solid var(--border);
}

.excel-line-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.muted-badge {
  background: rgba(100, 116, 139, 0.25);
  color: var(--muted);
}

.excel-line-header h4 {
  margin: 0;
  font-size: 17px;
  color: var(--text);
}

.excel-line-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.excel-line-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.excel-line-meta div {
  padding: 12px 14px;
  min-width: 0;
}

.excel-line-meta div + div {
  border-left: 1px solid var(--border);
}

.excel-line-meta dt,
.excel-line-label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.excel-line-meta dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}

.excel-line-fields {
  display: grid;
  gap: 0;
}

.excel-line-field {
  padding: 12px 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.excel-line-field:first-child {
  border-top: 0;
}

.excel-line-value {
  min-width: 0;
}

.excel-line-value .part-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.excel-line-value .part-with-price {
  width: 100%;
}

@media (max-width: 820px) {
  .excel-lines-grid {
    grid-template-columns: 1fr;
  }

  .excel-line-card {
    border-radius: 14px;
  }

  .excel-line-meta {
    grid-template-columns: 1fr;
  }

  .excel-line-meta div + div {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

/* v38 - Lignes de la base de données en grille compacte.
   Les libellés restent à gauche et les colonnes d’années affichent uniquement les données brutes. */
.database-comparison-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.58);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

.database-comparison-grid {
  display: grid;
  grid-template-columns: minmax(210px, 250px) repeat(var(--db-col-count), minmax(135px, 1fr));
  min-width: calc(240px + (var(--db-col-count) * 150px));
}

.db-compare-cell {
  min-width: 0;
  padding: 10px 11px;
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.db-compare-label {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #111827;
  color: #f8fafc;
  font-weight: 850;
  white-space: nowrap;
}

.db-compare-corner {
  z-index: 3;
  color: #facc15;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}

.db-compare-head {
  text-align: center;
  background: rgba(15, 23, 42, 0.94);
  color: #e5e7eb;
  font-weight: 850;
}

.db-compare-head strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.db-compare-value {
  background: rgba(15, 23, 42, 0.42);
  color: #f8fafc;
  font-size: 13px;
}

.db-compare-head.exact-column,
.db-compare-value.exact-column {
  background: rgba(250, 204, 21, 0.14);
  border-left: 2px solid rgba(250, 204, 21, 0.78);
  border-right: 2px solid rgba(250, 204, 21, 0.78);
}

.db-compare-head.exact-column {
  color: #fde68a;
  box-shadow: inset 0 3px 0 rgba(250, 204, 21, 0.9);
}

.db-lines {
  display: grid;
  gap: 3px;
}

.db-empty {
  color: rgba(203, 213, 225, 0.45);
}

@media (max-width: 780px) {
  .database-comparison-grid {
    grid-template-columns: minmax(150px, 175px) repeat(var(--db-col-count), minmax(118px, 1fr));
    min-width: calc(170px + (var(--db-col-count) * 122px));
  }

  .db-compare-cell {
    padding: 9px 8px;
    font-size: 12px;
  }

  .db-compare-label {
    white-space: normal;
  }
}

/* v39 - Logos fixes à gauche pour les types de produits + libellés compacts. */
.db-product-type {
  white-space: normal;
  padding: 8px 9px;
}

.product-type-label {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.product-type-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.28);
  color: #fde68a;
  flex: 0 0 auto;
}

.product-type-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-type-text {
  display: grid;
  gap: 1px;
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.08;
  letter-spacing: 0.01em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.product-type-text.is-wrapped span {
  display: block;
}

@media (max-width: 780px) {
  .product-type-label {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 6px;
  }

  .product-type-icon {
    width: 23px;
    height: 23px;
    border-radius: 7px;
  }

  .product-type-icon svg {
    width: 16px;
    height: 16px;
  }

  .product-type-text {
    font-size: 10.5px;
  }
}


/* v40 - Année exacte affichée en première colonne; colonnes hors année assombries. */
.db-compare-head.side-year-column,
.db-compare-value.side-year-column {
  background: rgba(2, 6, 23, 0.70);
  color: rgba(226, 232, 240, 0.72);
}

.db-compare-head.side-year-column strong {
  color: rgba(226, 232, 240, 0.78);
}

.db-compare-value.side-year-column .db-lines,
.db-compare-head.side-year-column .db-lines {
  opacity: 0.78;
}

.db-compare-head.exact-column,
.db-compare-value.exact-column {
  background: rgba(250, 204, 21, 0.18);
  color: #fff7cc;
}

.db-col-exact {
  order: initial;
}


/* v41 - Résultat principal dans la recherche par pièce */
.reverse-main-result {
  margin: 16px 0;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  overflow: hidden;
  background: #0b1220;
}

.reverse-main-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(280px, 1.45fr);
}

.reverse-main-head {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  color: #f8fafc;
  font-weight: 900;
  background: #0f172a;
}

.reverse-main-type,
.reverse-main-piece {
  padding: 13px 14px;
  min-width: 0;
}

.reverse-main-type {
  color: #f8fafc;
  font-weight: 700;
}

.reverse-main-piece {
  display: grid;
  gap: 6px;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
}

.reverse-main-piece-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.reverse-part-description,
.reverse-part-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.reverse-part-note {
  color: #bfdbfe;
}

@media (max-width: 720px) {
  .reverse-main-grid {
    grid-template-columns: 1fr;
  }

  .reverse-main-head:nth-child(2) {
    display: none;
  }

  .reverse-main-piece {
    border-left: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
  }

  .reverse-main-type::before {
    content: "Type de pièce : ";
    color: var(--muted);
    font-weight: 800;
  }
}

/* v43 - mobile : la zone de connexion reste dans le flux normal de la page.
   Elle ne demeure plus collée dans le haut de l’écran lors du défilement. */
@media (max-width: 760px) {
  .dashboard-topbar {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
  }

  .topbar-login-card {
    position: static !important;
  }
}

/* v44 - miniature de pièce dans la recherche par pièce */
.reverse-main-piece-top {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.reverse-part-thumb-link {
  display: block;
  width: 110px;
  text-decoration: none;
}

.reverse-part-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #ffffff;
  padding: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.reverse-main-piece-meta {
  min-width: 0;
  display: grid;
  gap: 6px;
}

@media (max-width: 720px) {
  .reverse-main-piece-top {
    grid-template-columns: 1fr;
  }

  .reverse-part-thumb-link {
    width: 92px;
  }
}

/* v45 - miniature placée dans la case fixe "Type de pièce" */
.reverse-main-type {
  display: grid;
  gap: 10px;
  align-content: start;
}

.reverse-type-thumb-link {
  display: block;
  width: 118px;
  max-width: 100%;
  text-decoration: none;
}

.reverse-type-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #ffffff;
  padding: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.reverse-main-type-label {
  display: block;
  color: #f8fafc;
  font-weight: 900;
  line-height: 1.25;
}

@media (max-width: 720px) {
  .reverse-type-thumb-link {
    width: 96px;
  }
}


/* v46 - la case image reste toujours visible dans la colonne Type de pièce */
.reverse-type-thumb-link {
  display: block;
  width: 126px;
  max-width: 100%;
  text-decoration: none;
}

.reverse-type-image-box {
  display: grid;
  place-items: center;
  width: 126px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.30);
  background: #ffffff;
  padding: 8px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08), 0 8px 18px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.reverse-type-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.reverse-type-image-fallback {
  display: none;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #334155;
  font-weight: 900;
  text-align: center;
  line-height: 1.15;
  font-size: 13px;
  border: 1px dashed rgba(51, 65, 85, 0.32);
  border-radius: 10px;
  background: #f8fafc;
}

@media (max-width: 720px) {
  .reverse-type-thumb-link,
  .reverse-type-image-box {
    width: 104px;
  }
}

/* v47 - image no 1 Metra affichée dans la cellule fixe Type de pièce */
.reverse-main-type {
  display: grid !important;
  gap: 10px;
  align-content: start;
  justify-items: start;
}

.reverse-type-thumb-link,
.reverse-type-image-box {
  display: grid !important;
  width: 132px;
  max-width: 100%;
}

.reverse-type-image-box {
  place-items: center;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  background: #ffffff;
  padding: 8px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08), 0 8px 18px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.reverse-type-thumb {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

@media (max-width: 720px) {
  .reverse-type-thumb-link,
  .reverse-type-image-box {
    width: 108px;
  }
}

/* v48 - miniature de pièce réduite dans Recherche par pièce */
.reverse-type-thumb-link,
.reverse-type-image-box {
  width: 88px !important;
}

.reverse-type-image-box {
  padding: 6px !important;
  border-radius: 12px;
}

@media (max-width: 720px) {
  .reverse-type-thumb-link,
  .reverse-type-image-box {
    width: 72px !important;
  }

  .reverse-type-image-box {
    padding: 5px !important;
  }
}


/* v56 - Panier : quantités, coutant seulement dans cette page, et total */
.cart-item-detailed {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, auto) auto;
  gap: 12px;
  align-items: center;
}

.cart-item-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cart-qty-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cart-qty-input {
  width: 72px;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  text-align: center;
  font-weight: 800;
}

.cart-cost-info {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.cost-price {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.35);
}

.map-price {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(96, 165, 250, 0.28);
}

.cart-line-total {
  font-size: 0.82rem;
  color: #cbd5e1;
  white-space: nowrap;
}

.cart-total-row {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 1.05rem;
}

.inventory-summary {
  min-height: 220px;
}

@media (max-width: 780px) {
  .cart-item-detailed {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .cart-cost-info {
    justify-items: start;
  }

  .cart-total-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Page Kenwood v57 */
.kenwood-page .app-shell {
  max-width: 1280px;
}

.hero-header.kenwood-hero {
  display: grid;
  grid-template-columns: minmax(300px, 1.5fr) minmax(160px, 220px) minmax(260px, 1fr);
  gap: 32px;
  align-items: center;
  padding: 28px 32px;
}

.hero-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}

.hero-logo {
  max-width: 220px;
  height: auto;
  display: block;
  margin-bottom: 8px;
}

.hero-brand {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #5aa3ff;
}

.hero-title {
  margin: 0;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.05;
  font-weight: 800;
  color: #ffffff;
}

.no-wrap-brand {
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.hero-description {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  color: #f2f2f2;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  text-align: center;
}

.hero-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

.hero-info-card {
  width: 100%;
  max-width: 360px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 24px 28px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.26), rgba(15, 23, 42, 0.92));
  box-shadow: var(--shadow);
  text-align: left;
}

.hero-info-subtitle {
  font-size: clamp(22px, 2.2vw, 34px);
  line-height: 1.15;
  font-weight: 800;
  color: #ffffff;
}

.hero-info-text {
  font-size: 16px;
  line-height: 1.4;
  color: #e8e8e8;
}

.kenwood-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr auto auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 18px;
}

.kenwood-toolbar label {
  margin: 0;
}

.kenwood-back-link {
  text-align: center;
  text-decoration: none;
}

.kenwood-panel {
  overflow: hidden;
}

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

.kenwood-table th,
.kenwood-table td {
  white-space: nowrap;
}

.kenwood-table td:first-child strong {
  color: #93c5fd;
  font-size: 1.05rem;
}

@media (max-width: 980px) {
  .hero-header.kenwood-hero {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 22px;
  }

  .hero-left,
  .hero-actions,
  .hero-right {
    width: 100%;
  }

  .hero-left {
    align-items: flex-start;
    text-align: left;
  }

  .hero-actions {
    order: 3;
    align-items: stretch;
  }

  .hero-btn {
    width: 100%;
    max-width: 280px;
  }

  .hero-right {
    order: 2;
    justify-content: flex-start;
  }

  .hero-info-card {
    max-width: 100%;
  }

  .hero-title {
    font-size: clamp(30px, 7vw, 44px);
  }

  .kenwood-toolbar {
    grid-template-columns: 1fr;
  }
}

/* v58 - Thème Garage Carbone fidèle au visuel fourni */
:root {
  --bg: #050505;
  --panel: #1d1d1f;
  --panel-strong: #27272a;
  --panel-soft: #202124;
  --text: #f3f4f6;
  --muted: #c3c6cc;
  --muted-soft: #9ca3af;
  --border: rgba(188, 188, 188, 0.24);
  --border-strong: rgba(215, 215, 215, 0.42);
  --primary: #a92a08;
  --primary-dark: #7f1d04;
  --accent: #eab308;
  --warning-bg: rgba(91, 63, 12, 0.55);
  --warning-border: rgba(234, 179, 8, 0.58);
  --success-bg: rgba(20, 83, 45, 0.45);
  --success-border: rgba(74, 222, 128, 0.38);
  --danger-bg: rgba(97, 20, 20, 0.55);
  --danger-border: rgba(248, 113, 113, 0.45);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.62);
  --orange-gloss-top: #d14a17;
  --orange-gloss-mid: #a92a08;
  --orange-gloss-bottom: #7c1a03;
}

html {
  background: #050505;
}

body.theme-dark,
body.dashboard-body {
  color: var(--text);
  background-color: #050505;
  background-image:
    radial-gradient(circle at 72% 18%, rgba(255,255,255,0.045), transparent 28%),
    radial-gradient(circle at 22% 74%, rgba(255,255,255,0.025), transparent 32%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.035) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.018) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #050505 0%, #0a0a0b 100%);
  background-size: auto, auto, 18px 18px, 18px 18px, auto;
  background-attachment: fixed;
}

body.dashboard-body::after {
  content: "";
  position: fixed;
  right: 64px;
  bottom: 54px;
  width: 58px;
  height: 58px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.82;
  background: radial-gradient(circle, rgba(255,255,255,0.92) 0%, rgba(232,232,232,0.74) 23%, rgba(255,255,255,0.18) 48%, transparent 68%);
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
  filter: drop-shadow(0 0 16px rgba(255,255,255,0.18));
}

.dashboard-shell,
.app-shell {
  position: relative;
  z-index: 1;
}

.dashboard-shell {
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  width: calc(100% - 12px);
  max-width: 1920px;
  margin: 8px auto;
}

.app-sidebar {
  background:
    linear-gradient(180deg, rgba(39,39,42,0.98) 0%, rgba(27,27,29,0.98) 100%);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.09),
    inset 0 0 36px rgba(255,255,255,0.025),
    0 16px 34px rgba(0,0,0,0.68);
  border-radius: 14px;
  padding: 20px 12px;
}

.sidebar-brand {
  gap: 10px;
  padding: 6px 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.sidebar-epg-logo {
  width: 56px;
  height: auto;
  max-height: 24px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  padding: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.45));
}

.sidebar-brand-text strong {
  color: #f7f7f7;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.sidebar-brand-text span {
  color: #b8b8b8;
  font-size: 13px;
}

.sidebar-nav {
  gap: 14px;
}

.sidebar-link,
.sidebar-utility {
  border: 1px solid transparent;
  background: transparent;
  color: #f4f4f5;
  border-radius: 8px;
  min-height: 50px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 1px rgba(0,0,0,0.58);
}

.sidebar-link:hover,
.sidebar-utility:hover {
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.08);
}

.sidebar-link.active {
  color: #111111;
  border-color: rgba(255,214,62,0.88);
  background: linear-gradient(180deg, #f4bd22 0%, #e7a909 50%, #d59803 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.34),
    inset 0 -2px 0 rgba(128,86,0,0.22),
    0 8px 16px rgba(0,0,0,0.44);
  transform: none;
  outline: 0;
  text-shadow: 0 1px 0 rgba(255,255,255,0.28);
}

.sidebar-link.active::before {
  display: none;
}

.sidebar-link.active .sidebar-icon {
  filter: drop-shadow(0 1px 0 rgba(255,255,255,0.35));
}

.sidebar-icon {
  width: 28px;
  font-size: 22px;
}

.sidebar-bottom {
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 14px;
}

.dashboard-topbar,
.hero {
  background-color: rgba(15, 15, 16, 0.96);
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.006)),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 2px, transparent 2px 11px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.016) 0 2px, transparent 2px 11px),
    linear-gradient(180deg, #0f0f10 0%, #060606 100%);
  background-size: auto, 18px 18px, 18px 18px, auto;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 14px 34px rgba(0,0,0,0.62);
}

.dashboard-topbar {
  min-height: 210px;
  grid-template-columns: minmax(380px, 1fr) minmax(230px, 310px) minmax(300px, 410px);
  padding: 28px 26px;
  margin-bottom: 18px;
}

.topbar-kicker,
.eyebrow {
  color: #84bcff;
  font-weight: 900;
  letter-spacing: 0.10em;
  text-shadow: 0 2px 6px rgba(0,0,0,.75);
}

.topbar-title-wrap h1,
.hero h1 {
  color: #f7f7f7;
  letter-spacing: 0.035em;
  text-shadow: 0 3px 10px rgba(0,0,0,0.8);
}

.topbar-title-wrap p,
.subtitle {
  color: #d3d3d3;
  font-size: 20px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
}

.topbar-center-logo img {
  width: min(100%, 300px);
  filter: drop-shadow(0 5px 7px rgba(0,0,0,0.62));
}

.topbar-login-card,
.top-login-card,
.source-card,
.kenwood-brand-card {
  background: linear-gradient(180deg, rgba(43,43,46,0.96) 0%, rgba(27,27,29,0.98) 100%);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.075),
    0 12px 28px rgba(0,0,0,0.58);
  border-radius: 12px;
}

.inline-login-title {
  color: #f5f5f5;
  font-size: 20px;
  font-weight: 900;
}

.compact-login-grid label span,
.inline-login-form label span,
label span {
  color: #d7d7d9;
  font-weight: 800;
}

.panel,
.controls-panel,
.results-panel,
.reverse-panel,
.cart-panel,
.favorites-panel,
.info-panel,
.kit-panel,
.page-helper-panel,
.quote-panel,
.kenwood-panel,
.kenwood-toolbar,
.validation-questionnaire,
.support-block,
.quick-summary,
.attention-box,
.result-card,
.reverse-main-result,
.cart-item,
.favorite-item,
.merchant-profile {
  background-color: rgba(31,31,33,0.97);
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.055) 0%, rgba(255,255,255,0.012) 100%),
    repeating-linear-gradient(155deg, rgba(255,255,255,0.026) 0 1px, transparent 1px 15px),
    repeating-linear-gradient(22deg, rgba(255,255,255,0.014) 0 1px, transparent 1px 18px),
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.035), transparent 26%);
  border: 2px solid rgba(194,194,194,0.26);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.13),
    inset 0 0 0 1px rgba(0,0,0,0.55),
    0 14px 34px rgba(0,0,0,0.64);
}

.panel {
  padding: 18px 20px;
}

.page-section-heading h2,
.cart-header h2,
.reverse-header h2,
.admin-form-panel h2,
.admin-list-panel h2,
.note-panel h2,
.kenwood-panel h2 {
  color: #f5f5f5;
  text-shadow: 0 2px 7px rgba(0,0,0,0.72);
}

.page-section-heading p,
.cart-header p,
.reverse-header p,
.info-panel p,
details p,
.form-help,
#matchSummary,
.related-note,
.quick-vehicle,
.questionnaire-header p,
.page-helper-panel p {
  color: #c7c7c9;
}

select,
input[type="file"],
input[type="search"],
input[type="email"],
input[type="text"],
input[type="password"],
textarea,
.cart-qty-input {
  background: linear-gradient(180deg, #242526 0%, #191a1b 100%);
  border: 1px solid rgba(205,205,205,0.28);
  border-radius: 8px;
  color: #f4f4f5;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 0 12px rgba(0,0,0,0.36),
    0 1px 0 rgba(255,255,255,0.035);
}

select:disabled,
input[type="search"]:disabled {
  color: #8c8f94;
  background: linear-gradient(180deg, #222324 0%, #171819 100%);
  opacity: 0.92;
}

input::placeholder,
textarea::placeholder {
  color: #8f9298;
}

button,
.link-button {
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,0.62);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 8px 18px rgba(0,0,0,0.42);
}

.primary,
.inline-login-button {
  color: #ffffff;
  border-color: rgba(239, 91, 34, 0.64);
  background:
    linear-gradient(180deg, var(--orange-gloss-top) 0%, var(--orange-gloss-mid) 52%, var(--orange-gloss-bottom) 100%);
}

.primary::before,
.inline-login-button::before,
.secondary::before,
.link-button.secondary::before {
  content: "";
  position: absolute;
  inset: 1px 2px auto 2px;
  height: 46%;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, rgba(255,255,255,0.20), rgba(255,255,255,0.035));
  pointer-events: none;
}

.primary:hover,
.inline-login-button:hover {
  background: linear-gradient(180deg, #dc5521 0%, #b9300b 52%, #8d2105 100%);
}

.secondary,
.link-button.secondary,
.kenwood-back-link {
  color: #f4f4f5;
  border-color: rgba(255,255,255,0.13);
  background: linear-gradient(180deg, #66686d 0%, #4a4c50 52%, #34363a 100%);
}

.secondary:hover,
.link-button.secondary:hover,
.kenwood-back-link:hover {
  background: linear-gradient(180deg, #777a80 0%, #55575c 52%, #3d3f44 100%);
}

button:disabled,
.link-button[aria-disabled="true"] {
  filter: grayscale(0.15);
  opacity: 0.58;
}

.smart-search-block {
  grid-template-columns: minmax(280px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
}

.enhanced-controls-grid {
  grid-template-columns: repeat(3, minmax(210px, 280px)) repeat(2, minmax(180px, 240px));
}

.result-title,
.related-table thead th,
.parts-table th,
.admin-table thead th,
.reverse-main-head,
.results-table th {
  background: linear-gradient(180deg, rgba(36,37,39,0.98), rgba(22,23,24,0.98));
  color: #f3f4f6;
}

.related-table-wrap,
.admin-table-wrap,
.table-wrap,
.reverse-table-wrap,
.parts-table-wrap,
.kenwood-table-wrap {
  border-color: rgba(205,205,205,0.22);
  background: rgba(15,15,16,0.72);
}

.part-chip,
.summary-chip,
.status-step,
.pill,
.status-pill,
.cart-check,
.merchant-price-level {
  background: linear-gradient(180deg, #303134, #202124);
  border-color: rgba(255,255,255,0.16);
  color: #f3f4f6;
}

.used-badge,
.cart-count-badge {
  background: var(--accent);
  color: #111111;
  border-color: rgba(255,255,255,0.36);
}

.quick-summary {
  background-color: rgba(31,31,33,0.97);
}

.part-price,
.status-active,
.validation-status-badge.ready {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(74, 222, 128, 0.38);
  color: #bbf7d0;
}

.part-price.missing,
.status-inactive,
.validation-status-badge.review {
  background: rgba(234,179,8,0.16);
  border-color: rgba(234,179,8,0.40);
  color: #fde68a;
}

.message,
.reverse-empty {
  background: rgba(91, 63, 12, 0.58);
  border-color: rgba(234,179,8,0.52);
}

.message.error {
  background: rgba(97,20,20,0.58);
  border-color: rgba(248,113,113,0.48);
}

.message.success,
.kit-output {
  background: rgba(20,83,45,0.48);
  border-color: rgba(74,222,128,0.38);
}

.eyebrow {
  color: #84bcff;
}

.epg-logo {
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.65));
}

.kenwood-brand-card {
  text-align: right;
}

.kenwood-brand-card strong {
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.72);
}

.kenwood-table td:first-child strong,
.small-link,
.merchant-status a,
.admin-small-link {
  color: #84bcff;
}

@media (min-width: 761px) {
  .sidebar-link.active {
    outline: 0;
    outline-offset: 0;
  }
}

@media (max-width: 1080px) {
  .dashboard-shell {
    width: calc(100% - 16px);
  }
  .app-sidebar {
    background: linear-gradient(180deg, rgba(39,39,42,0.98) 0%, rgba(27,27,29,0.98) 100%);
  }
}

@media (max-width: 760px) {
  body.dashboard-body {
    background-color: #050505;
    background-image:
      repeating-linear-gradient(45deg, rgba(255,255,255,0.035) 0 2px, transparent 2px 9px),
      repeating-linear-gradient(-45deg, rgba(255,255,255,0.018) 0 2px, transparent 2px 9px),
      linear-gradient(180deg, #050505 0%, #0a0a0b 100%);
  }
  body.dashboard-body::after {
    display: none;
  }
  .app-sidebar {
    background: linear-gradient(180deg, rgba(39,39,42,0.98) 0%, rgba(27,27,29,0.98) 100%);
    border-color: rgba(255,255,255,0.16);
  }
  .dashboard-topbar {
    min-height: auto;
  }
  .sidebar-link.active {
    transform: translateY(-5px);
  }
  .smart-search-block,
  .enhanced-controls-grid {
    grid-template-columns: 1fr;
  }
}



.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.quote-page .hero,
.kenwood-page .hero {
  margin-bottom: 26px;
}

.quote-panel,
.kenwood-toolbar,
.kenwood-panel {
  margin-bottom: 22px;
}

.form-grid.two-cols {
  gap: 18px;
}

.quote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.panel h2 {
  margin-bottom: 8px;
}

@media (max-width: 760px) {
  .app-shell {
    width: calc(100% - 20px);
    margin: 16px auto 22px;
  }
  .hero {
    gap: 14px;
  }
  h1 {
    line-height: 1.15;
  }
  .subtitle {
    margin-top: 8px;
    font-size: 14px;
  }
  .page-header-actions,
  .quote-actions {
    gap: 10px;
  }
  .page-header-actions .secondary,
  .page-header-actions .primary,
  .quote-actions .secondary,
  .quote-actions .primary {
    flex: 1 1 calc(50% - 8px);
  }
}

/* v61 - Kenwood pricelist filters/table */
.kw-filter-group {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.kw-filter-group legend {
  color: var(--accent);
  font-weight: 700;
  padding: 0 6px;
}

.kw-filter-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
}

.kw-filter-group input[type="checkbox"] {
  accent-color: var(--accent);
}

.kenwood-toolbar {
  grid-template-columns: minmax(280px, 1fr) 2fr auto;
}

.kenwood-table td:nth-child(5) {
  font-weight: 700;
  color: #f4d35e;
}

@media (max-width: 980px) {
  .kenwood-toolbar {
    grid-template-columns: 1fr;
  }
}

/* v62 - Groupes Kenwood/JVC + colonnes marchand conditionnelles */
.kenwood-table.merchant-logged-out .kw-col-cost,
.kenwood-table.merchant-logged-out .kw-col-map,
.kenwood-table.merchant-logged-out td:nth-child(4),
.kenwood-table.merchant-logged-out td:nth-child(5) {
  display: none;
}

.kw-group-row td {
  padding-top: 18px;
  background: rgba(132, 188, 255, 0.08);
  border-top: 1px solid rgba(132, 188, 255, 0.35);
}

.kw-group-label {
  display: inline-block;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #84bcff;
}

@media (max-width: 760px) {
  .kw-group-row td {
    position: sticky;
    left: 0;
    z-index: 1;
  }

  .kw-group-label {
    font-size: 0.9rem;
  }
}


/* v65 - Lisibilité uniforme des champs et menus déroulants en thème sombre */
html {
  color-scheme: dark;
}

select,
input,
textarea {
  background-color: #111827 !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  border-radius: 8px;
}

select option {
  background-color: #111827;
  color: #f8fafc;
}

select option:checked,
select option:hover {
  background-color: #2563eb;
  color: #ffffff;
}

select:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: #eab308 !important;
  box-shadow: 0 0 0 2px rgba(234,179,8,0.25) !important;
}

.controls-grid select,
.reverse-search-row input,
.kenwood-toolbar input,
.quote-panel input,
.quote-panel textarea,
.validation-grid select,
.inline-login-form input {
  min-height: 44px;
  width: 100%;
}

button,
.link-button {
  min-height: 44px;
}
