.car-detail-page {
  position: fixed;
  inset: 50px 0 0 40px;
  z-index: 55;
  display: none;
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 18px 24px 72px;
  background: #f7f7f7;
  color: #222;
}

.car-detail-page.open {
  display: block;
}

html.detail-open,
body.detail-open {
  overflow: hidden;
}

body.detail-open .workspace {
  visibility: hidden;
}

body.detail-open .side { z-index: 80; }
body.detail-open .menu-toggle { z-index: 81; }

@media (min-width: 681px) {
  body.detail-open:has(.app.nav-open) .car-detail-page {
    inset-left: 230px;
  }
}

.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  margin: 0 0 16px;
  font-size: 15px;
  color: #006aa6;
}

.detail-back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-height: 30px;
  border: 1px solid #d6d6d6;
  border-radius: 4px;
  padding: 5px;
  background: linear-gradient(180deg, #fff 0%, #f5f5f5 100%);
  color: #006aa6;
  font: inherit;
  cursor: pointer;
}

.detail-back-button:hover {
  border-color: #b9d9ea;
  background: #f7fbfd;
}

.detail-path {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.detail-breadcrumb strong {
  color: #006aa6;
  font-weight: 500;
}

.detail-check-card {
  overflow: hidden;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  background: #fff;
}

.detail-passport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 12px 14px;
  border-bottom: 1px solid #d8d8d8;
  background: linear-gradient(180deg, #fff 0%, #f5f5f5 100%);
}

.detail-passport-main {
  min-width: 0;
}

.detail-passport-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-passport-actions .detail-delivery-button {
  min-height: 34px;
  padding: 6px 13px;
  font-size: 13px;
}

.detail-passport-actions .detail-delivery-button {
  min-width: 150px;
  background: #75af3b;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.12);
}

.detail-status-chip {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 142px;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid #d5d5d5;
  border-radius: 4px;
  background: #fff;
  color: #555;
  line-height: 1.1;
  text-transform: uppercase;
}

.detail-status-chip small {
  color: #8a8a8a;
  font-size: 10px;
  font-weight: 400;
  text-transform: none;
}

.detail-status-chip strong {
  font-size: 13px;
  font-weight: 700;
}

.detail-status-chip.not_confirmed { border-color: #efb1ad; background: #fff5f4; color: #d71919; }
.detail-status-chip.stock { border-color: #a9d8f2; background: #f3fbff; color: #2c7fab; }
.detail-status-chip.delivery { border-color: #c6dfae; background: #f7fff0; color: #5d962d; }
.detail-status-chip.accepted,
.detail-status-chip.completed { border-color: #b9ddb5; background: #f5fff3; color: #55942d; }
.detail-status-chip.airbag_check { border-color: #ccb8ef; background: #faf7ff; color: #7b55ca; }

.detail-action-shell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  border-left: 1px solid #d7d7d7;
}

.detail-action-shell em {
  color: #777;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.detail-save-state {
  min-width: 70px;
  color: #5a9d33;
  font-size: 12px;
  opacity: 0;
  transition: opacity .18s ease;
}

.detail-save-state.show {
  opacity: 1;
}

.detail-passport-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 13px;
  margin-top: 7px;
  color: #555;
  font-size: 13px;
}

.detail-passport-meta span {
  position: relative;
  white-space: nowrap;
}

.detail-passport-meta span + span::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -8px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #9a9a9a;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(330px, 430px);
  gap: 0;
  align-items: start;
}

.detail-main,
.detail-info {
  min-width: 0;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  background: #fff;
}

.detail-info {
  border-color: #9be6ff;
  padding: 16px 16px 26px;
}

.detail-check-card .detail-main,
.detail-check-card .detail-info {
  border: 0;
  border-radius: 0;
}

.detail-check-panel {
  min-height: 100%;
  border-left: 1px solid #d8d8d8 !important;
  padding: 14px 16px 22px;
}

.detail-panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 50px;
  padding: 7px 12px;
  border-bottom: 1px solid #ddd;
  background: #f5f5f5;
}

.detail-car-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
}

.detail-car-name {
  color: #222;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
}

.detail-car-body {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 2px 9px;
  border: 1px solid #d2d2d2;
  border-radius: 3px;
  background: #fff;
  color: #5f6368;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.detail-toolbar .primary,
.detail-toolbar .secondary,
.detail-pdf-head .secondary,
.detail-image-preview .secondary {
  min-height: 30px;
  padding: 5px 12px;
  font-size: 13px;
}

.detail-main h2,
.detail-info h2 {
  margin: 12px 16px 8px;
  color: #333;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0;
}

.detail-info h2 {
  margin: 0 0 10px;
}

.detail-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid #d8d8d8;
  background: #fbfbfb;
}

.detail-panel-head h2 {
  margin: 0;
  white-space: nowrap;
}

.detail-sheet-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  font-size: 14px;
}

.detail-file-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 4px 0 0;
  border: 0;
  background: transparent;
  color: #555;
  font-size: 13px;
}

.detail-sheet-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 10px;
  text-decoration: none;
  cursor: pointer;
}

.detail-sheet-button input {
  display: none;
}

.detail-viewer {
  overflow: hidden;
  margin: 16px;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  background: #fff;
}

.detail-pdf-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid #d8d8d8;
  background: #fbfbfb;
}

.detail-viewer iframe {
  display: block;
  width: 100%;
  height: min(72vh, 760px);
  border: 0;
  background: #fff;
}

.detail-image-preview {
  position: relative;
  display: grid;
  min-height: min(72vh, 720px);
  place-items: center;
  background: #f5f5f5;
}

.detail-image-preview img {
  max-width: 90%;
  max-height: 68vh;
  border: 8px solid #fff;
  background: #fff;
}

.detail-image-preview .secondary {
  position: absolute;
  top: 14px;
  right: 14px;
}

.detail-hint {
  margin: 0 30px 28px;
  padding: 10px 12px;
  border: 1px solid #d8d8d8;
  border-top: 0;
  border-radius: 0 0 6px 6px;
  color: #666;
  font-size: 12px;
}

.detail-info table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 13px;
}

.detail-info th,
.detail-info td {
  height: 34px;
  padding: 7px 8px;
  border: 0;
  border-bottom: 1px solid #e5e5e5;
  text-align: left;
  vertical-align: middle;
}

.detail-info tr:last-child th,
.detail-info tr:last-child td {
  border-bottom: 0;
}

.detail-check-panel tr:last-child th,
.detail-check-panel tr:last-child td {
  border-bottom: 1px solid #e5e5e5;
}

.detail-info th {
  width: 38%;
  background: transparent;
  color: #222;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-inline-control {
  box-sizing: border-box;
  width: 100%;
  min-height: 32px;
  border: 1px solid #d4d4d4;
  border-radius: 3px;
  background: #fff;
  color: #222;
  font: 400 13px/1.2 Arial, sans-serif;
  padding: 4px 7px;
}

.detail-inline-control:focus {
  border-color: #48b9dc;
  box-shadow: 0 0 0 2px rgba(72,185,220,.14);
  outline: 0;
}

.detail-readonly-value {
  display: block;
  min-height: 18px;
  color: #222;
  font-size: 13px;
  line-height: 1.35;
}

.detail-delivery-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  min-width: 140px;
  border: 0;
  border-radius: 4px;
  padding: 6px 14px;
  background: #75af3b;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.detail-delivery-button input {
  display: none;
}

.detail-delivery-button .fa-ico {
  width: 18px;
  height: 18px;
  font-size: 17px;
}

.detail-delivery-button.is-static {
  cursor: default;
}

.detail-back-mobile {
  display: none;
  margin-top: 14px;
}

@media (max-width: 980px) {
  .car-detail-page {
    inset: calc(52px + env(safe-area-inset-top)) 0 calc(68px + env(safe-area-inset-bottom)) 0;
    padding: 14px;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .detail-passport {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-passport-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .detail-check-panel {
    border-top: 1px solid #d8d8d8 !important;
    border-left: 0 !important;
  }

  .detail-side-panel {
    border-top: 1px solid #d8d8d8 !important;
  }

  .detail-viewer,
  .detail-hint {
    margin-right: 14px;
    margin-left: 14px;
  }

  .detail-viewer iframe,
  .detail-image-preview {
    height: 54vh;
  }

  .detail-back-mobile {
    display: block;
    width: 100%;
  }
}

@media (max-width: 680px) {
  .detail-breadcrumb {
    margin-bottom: 10px;
    font-size: 14px;
  }

  .detail-main h2,
  .detail-info h2 {
    font-size: 18px;
  }

  .detail-toolbar {
    flex-wrap: wrap;
  }

  .detail-info th,
  .detail-info td {
    display: block;
    width: 100%;
    height: auto;
  }

  .detail-info th {
    border-bottom: 0;
  }
}
