.customer-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 247, 236, 0.02), rgba(255, 247, 236, 0.006)),
    var(--card-soft);
  padding: 14px;
  box-shadow: 0 14px 34px -26px rgba(0, 0, 0, 0.38);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.customer-card + .customer-card {
  margin-top: 10px;
}

.customer-card:hover {
  border-color: rgba(214, 192, 168, 0.35);
  box-shadow: 0 22px 40px -28px rgba(0, 0, 0, 0.48);
  transform: translateY(-1px);
}

.customer-card.is-open {
  border-color: rgba(214, 192, 168, 0.42);
  box-shadow: 0 26px 46px -30px rgba(0, 0, 0, 0.52);
}

body.light .customer-card {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 16px 36px -26px rgba(15, 23, 42, 0.16);
}

body.light .customer-card:hover,
body.light .customer-card.is-open {
  border-color: rgba(15, 23, 42, 0.18);
  box-shadow: 0 22px 40px -28px rgba(15, 23, 42, 0.18);
}

.customer-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.customer-card__identity {
  min-width: 0;
  flex: 1 1 auto;
}

.customer-card__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.customer-card__title {
  font-size: 15px;
  line-height: 1.2;
}

.customer-card__badge {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(246, 166, 35, 0.12);
  border: 1px solid rgba(246, 166, 35, 0.16);
}

body.light .customer-card__badge {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.18);
}

.customer-card__secondary,
.customer-card__meta {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
}

.customer-card__secondary {
  color: var(--text);
}

.customer-card__meta {
  color: var(--muted);
}

.customer-card__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  flex: 0 0 252px;
}

.customer-card__action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.customer-card__action-row .btn {
  min-width: 0;
}

.customer-card__action-row .btn.small-btn {
  padding: 7px 10px;
  font-size: 12px;
}

.customer-card__danger {
  color: var(--danger);
}

.customer-card__lane-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border: 1px solid rgba(214, 192, 168, 0.18);
  border-radius: 16px;
  background: rgba(255, 247, 236, 0.03);
  color: var(--text);
  box-shadow: none;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.12s ease;
  min-height: 44px;
  flex: 0 0 auto;
}

body.light .customer-card__lane-toggle {
  background: rgba(248, 250, 252, 0.92);
  border-color: rgba(15, 23, 42, 0.1);
}

.customer-card__lane-toggle:hover {
  border-color: rgba(214, 192, 168, 0.3);
  background: rgba(255, 247, 236, 0.045);
  transform: translateY(-1px);
}

body.light .customer-card__lane-toggle:hover {
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.98);
}

.customer-card__lane-toggle:active {
  transform: translateY(0);
}

.customer-card__lane-toggle:focus-visible {
  outline: 2px solid rgba(246, 166, 35, 0.55);
  outline-offset: 2px;
}

.customer-card__lane-toggle-inner {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
  gap: 12px;
}

.customer-card__lane-toggle-label {
  min-width: 0;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.customer-card__lane-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.customer-card__lane-toggle-icon svg {
  width: 16px;
  height: 16px;
  transition: transform 0.16s ease;
}

.customer-card__lane-toggle.is-open .customer-card__lane-toggle-icon svg {
  transform: rotate(180deg);
}

.customer-lane-sheet__grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.customer-lane-sheet__grid--cargo {
  grid-template-columns: minmax(0, 1.2fr) minmax(110px, 0.65fr) minmax(0, 0.9fr);
}

.customer-lane-sheet__grid--equipment {
  grid-template-columns: minmax(0, 1.1fr) minmax(120px, 0.55fr) minmax(0, 0.8fr);
}

.customer-lane-sheet__party-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.customer-lane-sheet__party-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(214, 192, 168, 0.12);
  background: rgba(255, 247, 236, 0.025);
}

body.light .customer-lane-sheet__party-card {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(15, 23, 42, 0.08);
}

.customer-lane-sheet__party-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.customer-lane-sheet__party-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0;
}

.customer-lane-sheet__party-link {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
}

.customer-lane-sheet__party-link:hover {
  text-decoration: underline;
}

.customer-lane-sheet__party-link:disabled {
  opacity: 0.5;
  cursor: default;
  text-decoration: none;
}

@media (max-width: 760px) {
  .customer-lane-sheet__grid--cargo,
  .customer-lane-sheet__grid--equipment,
  .customer-lane-sheet__party-grid {
    grid-template-columns: 1fr;
  }
}

.customer-card__expanded {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(214, 192, 168, 0.12);
}

body.light .customer-card__expanded {
  border-top-color: rgba(15, 23, 42, 0.08);
}

.customer-card__expanded.is-open {
  display: block;
}

.customer-card__expanded-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.customer-card__section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.customer-card__section-label,
.customer-lane-sheet__section-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted);
}

.customer-lane-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.customer-lane-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(214, 192, 168, 0.12);
  background: rgba(255, 247, 236, 0.03);
}

body.light .customer-lane-row {
  background: rgba(248, 250, 252, 0.92);
  border-color: rgba(15, 23, 42, 0.08);
}

.customer-lane-row__copy {
  min-width: 0;
  flex: 1 1 auto;
}

.customer-lane-row__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.customer-lane-row__meta {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.customer-lane-row__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  justify-content: stretch;
  gap: 8px;
  flex: 0 0 300px;
}

.customer-lane-row__actions .btn {
  min-width: 0;
}

.customer-lane-empty {
  padding: 18px 16px;
  border-radius: 16px;
  border: 1px dashed rgba(214, 192, 168, 0.22);
  background: rgba(255, 247, 236, 0.02);
}

body.light .customer-lane-empty {
  background: rgba(248, 250, 252, 0.7);
  border-color: rgba(15, 23, 42, 0.12);
}

.customer-lane-empty__title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 5px;
}

.customer-card__footer-actions,
.customer-lane-sheet__footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.customer-lane-sheet {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 112px;
}

.customer-lane-sheet__section {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(214, 192, 168, 0.12);
  background: rgba(255, 247, 236, 0.03);
}

body.light .customer-lane-sheet__section {
  background: rgba(248, 250, 252, 0.92);
  border-color: rgba(15, 23, 42, 0.08);
}

.customer-lane-sheet__section-title {
  margin-bottom: 14px;
}

.customer-lane-sheet__footer {
  position: sticky;
  bottom: calc(-18px - env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(214, 192, 168, 0.12);
  background:
    linear-gradient(180deg, rgba(15, 14, 16, 0), rgba(15, 14, 16, 0.92) 22%, rgba(15, 14, 16, 0.98));
}

body.light .customer-lane-sheet__footer {
  border-top-color: rgba(15, 23, 42, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.94) 22%, rgba(255, 255, 255, 0.99));
}

.customer-lane-sheet__delete {
  color: var(--danger);
}

#laneCustomerInput[readonly] {
  opacity: 0.88;
}

@media (max-width: 768px) {
  .customer-card__top,
  .customer-lane-row,
  .customer-lane-sheet__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .customer-card__actions,
  .customer-lane-row__actions,
  .customer-card__footer-actions,
  .customer-lane-sheet__footer-actions {
    justify-content: stretch;
  }

  .customer-card__actions {
    flex: 1 1 auto;
  }

  .customer-card__action-row .btn,
  .customer-card__footer-actions .btn,
  .customer-lane-sheet__footer-actions .btn {
    flex: 1 1 140px;
  }

  .customer-lane-row__actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    flex: 1 1 auto;
  }
}

@media (max-width: 640px) {
  #sheetCustomers,
  #sheetCustomerLane {
    padding-top: 78px;
  }

  .customer-lane-sheet__footer {
    bottom: calc(-18px - env(safe-area-inset-bottom, 0px));
  }
}
