.contact-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px var(--panel-gutter) 28px;
  font-size: var(--fs-sm);
  background: var(--surface);
  border-left: 1px solid var(--border);
}

.js-fit-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.contact-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -6px 0 14px;
}

.contact-panel__title {
  font-size: var(--fs-lg);
  font-weight: 700;
}

.contact-head {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.contact-head__avatar,
.booking-summary__avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  font-size: var(--fs-lg);
}

.contact-head__text {
  display: grid;
  justify-items: start;
  gap: 2px;
  min-width: 0;
}

.contact-head__name {
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.3;
}

.contact-head__role {
  font-size: var(--fs-md);
  color: var(--text-muted);
}

.identity-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--green-500);
  background: var(--green-100);
}

.identity-chip--pending {
  color: var(--gold-700);
  background: var(--surface-active);
  border: 1px dashed var(--gold-500);
}

.identity-chip--pending:hover {
  background: #f6eedd;
}

.booking-summary {
  display: grid;
  min-width: 0;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-xl);
  color: #fff;
  background: var(--booking-card);
  box-shadow: var(--shadow-md);
}

.booking-summary__head {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.booking-summary__avatar {
  box-shadow: 0 0 0 2px rgb(255 255 255 / 45%);
}

.booking-summary__identity {
  flex: 1;
  min-width: 0;
}

.booking-summary__toggle {
  flex-shrink: 0;
  align-self: flex-start;
  color: #fff;
  background: rgb(255 255 255 / 14%);
  border-color: transparent;
}

.booking-summary__toggle:hover {
  background: rgb(255 255 255 / 24%);
}

.booking-summary__toggle .icon {
  transition: transform var(--duration) var(--ease);
}

.booking-summary__toggle.is-open .icon {
  transform: rotate(180deg);
}

.booking-summary__caption,
.booking-summary__item dt {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 82%);
}

.booking-summary__name {
  max-width: 100%;
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.3;
}

.booking-summary__phone {
  font-size: var(--fs-md);
  font-weight: 600;
}

.booking-summary__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.booking-summary__item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgb(0 0 0 / 14%);
}

.booking-summary__item--wide {
  grid-column: 1 / -1;
}

.booking-summary__item dd {
  min-width: 0;
  margin: 0;
  font-weight: 700;
}

.booking-summary__note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  line-height: 1.4;
  background: rgb(255 255 255 / 16%);
}

.booking-summary__note .icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.booking-summary__invoice {
  display: grid;
  gap: 4px;
}

.booking-summary__invoice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.booking-summary__invoice-number {
  min-width: 0;
  font-weight: 700;
}

.booking-summary__invoice-amount {
  max-width: 100%;
  margin: 0;
  font-size: var(--fs-base);
}

.booking-summary__link {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.booking-summary__link .icon {
  flex-shrink: 0;
}

.booking-summary__link:hover {
  text-decoration-thickness: 2px;
}

.invoice-pill {
  height: 20px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 20px;
  text-transform: uppercase;
}

.invoice-pill--paid {
  color: var(--green-500);
  background: #fff;
}

.invoice-pill--unpaid {
  color: #fff;
  background: var(--red-500);
}

.booking-summary__history {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 6px;
  font-size: var(--fs-md);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.booking-summary__history:hover {
  text-decoration-thickness: 2px;
}

.panel-section {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.panel-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-section__head .section-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-section__count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface-muted);
}

.lead-rows {
  display: grid;
  margin: 0;
}

.lead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
}

.lead-row:last-child {
  border-bottom: 0;
}

.lead-row__label {
  flex-shrink: 0;
  color: var(--text-muted);
}

.lead-row__value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 6px;
  min-width: 0;
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.lead-row__hint {
  flex-basis: 100%;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
}

.copy-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
}

.copy-btn:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.source-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  text-align: left;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.source-card:hover {
  border-color: var(--gold-500);
}

.source-card__icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.source-card__icon .channel-icon {
  width: 19px;
  height: 19px;
}

.source-card__body {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.source-card__caption {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.source-card__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.source-card__campaign {
  overflow: hidden;
  font-size: var(--fs-sm);
  color: var(--gold-700);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-card__chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transform: rotate(-90deg);
}

.lead-fields {
  display: grid;
  gap: 10px;
}

.lead-field {
  display: grid;
  gap: 4px;
}

.lead-field__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.lead-fields__hint {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.lead-fields__hint a {
  font-weight: 600;
  color: var(--gold-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  font-weight: 600;
}

.tag-chip__remove {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: -4px;
  border-radius: 50%;
  opacity: 0.55;
}

.tag-chip__remove:hover {
  opacity: 1;
  background: rgb(0 0 0 / 8%);
}

.tag-chip--red {
  color: var(--red-500);
  background: var(--red-100);
}
.tag-chip--gold {
  color: var(--gold-700);
  background: #f6eedd;
}
.tag-chip--blue {
  color: var(--blue-500);
  background: var(--blue-100);
}
.tag-chip--green {
  color: var(--green-500);
  background: var(--green-100);
}
.tag-chip--orange {
  color: var(--orange-600);
  background: var(--orange-100);
}
.tag-chip--purple {
  color: var(--purple-500);
  background: var(--purple-100);
}

.tag-chip--add {
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
}

.tag-chip--add:hover,
.tag-chip--add[aria-expanded="true"] {
  color: var(--text);
  border-color: var(--gold-500);
}

.note-list {
  display: grid;
  gap: 10px;
}

.note-card {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.note-card__author {
  font-weight: 700;
  color: var(--gold-700);
}

.note-card__time {
  display: block;
  margin-top: 6px;
  font-size: var(--fs-sm);
  color: var(--text-faint);
}

.note-form {
  display: grid;
  gap: 10px;
}

.note-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.note-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  border-radius: var(--radius-md);
  font-weight: 600;
  color: var(--text-muted);
  border: 1px dashed var(--border);
}

.note-add:hover {
  color: var(--text);
  border-color: var(--gold-500);
}

.booking-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: #fdf8ee;
  border: 1px solid #ecdcbc;
}

.booking-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}

.booking-card__desc {
  font-size: var(--fs-md);
  color: var(--text-muted);
}

.timeline {
  display: grid;
}

.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  padding-bottom: 16px;
}

.timeline__item:not(:last-child)::before {
  position: absolute;
  top: 18px;
  bottom: 0;
  left: 8px;
  width: 2px;
  background: var(--border);
  content: "";
}

.timeline__ring {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--gold-500);
}

.timeline__ring--created {
  border-color: var(--green-500);
}
.timeline__ring--assigned {
  border-color: var(--blue-500);
}
.timeline__ring--status {
  border-color: var(--purple-500);
}
.timeline__ring--note {
  border-color: var(--orange-500);
}
.timeline__ring--danger {
  border-color: var(--red-500);
}

.timeline__text {
  line-height: 1.45;
}

.timeline__text strong {
  font-weight: 700;
}

.timeline__time {
  font-size: var(--fs-sm);
  color: var(--text-faint);
}
