/* Broadcast pages — aligned with IamCarla customer UI */

.bc-page {
  max-width: 920px;
  margin: 0 auto;
}

.bc-header-row {
  width: 100%;
}

.bc-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.bc-header-top .admin-dashboard-title {
  min-width: 0;
  flex: 1 1 auto;
  margin-bottom: 0;
}

.bc-header-row .admin-dashboard-subtitle {
  margin-top: 0.25rem;
}

.bc-header-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: nowrap;
  align-items: center;
  flex-shrink: 0;
}

.bc-card {
  background: var(--color-surface);
  border: 1px solid rgba(var(--brand-green-rgb), 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.bc-form-section {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--color-surface-cool);
}

.bc-form-section:last-of-type {
  border-bottom: none;
}

.bc-form-section h3 {
  margin: 0 0 0.35rem;
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--color-ink);
}

.bc-form-help {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.bc-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.bc-choice-card {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
}

.bc-choice-card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.bc-choice-card__body {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  min-height: 100%;
}

.bc-choice-card:hover .bc-choice-card__body {
  border-color: rgba(var(--brand-green-rgb), 0.45);
  background: rgba(var(--brand-green-rgb), 0.03);
}

.bc-choice-card input:checked + .bc-choice-card__body,
.bc-choice-card.is-selected .bc-choice-card__body {
  border-color: var(--brand-green);
  background: rgba(var(--brand-green-rgb), 0.08);
  box-shadow: 0 0 0 3px rgba(var(--brand-green-rgb), 0.12);
}

.bc-choice-card input:focus-visible + .bc-choice-card__body {
  outline: 2px solid var(--brand-green);
  outline-offset: 2px;
}

.bc-choice-card__icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--color-border-muted);
  border-radius: var(--radius-xs);
  margin-top: 0.1rem;
  position: relative;
  background: var(--color-surface);
}

.bc-choice-card--radio .bc-choice-card__icon {
  border-radius: var(--radius-pill);
}

.bc-choice-card input:checked + .bc-choice-card__body .bc-choice-card__icon {
  border-color: var(--brand-green);
  background: var(--brand-green);
}

.bc-choice-card input:checked + .bc-choice-card__body .bc-choice-card__icon::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.45rem;
  height: 0.45rem;
  background: var(--color-surface);
  border-radius: var(--radius-pill);
}

.bc-choice-card--radio input:checked + .bc-choice-card__body .bc-choice-card__icon::after {
  width: 0.35rem;
  height: 0.35rem;
}

.bc-choice-card__text {
  flex: 1;
  min-width: 0;
}

.bc-choice-card__title {
  display: block;
  font-weight: 600;
  color: var(--color-ink-slate);
  line-height: 1.35;
}

.bc-idle-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.bc-idle-select {
  display: inline-block;
  width: auto;
  min-width: 4.5rem;
  font-weight: 600;
  vertical-align: middle;
}

.bc-choice-card--idle .bc-choice-card__body {
  align-items: flex-start;
}

.bc-table-wrap .bc-delete-btn {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.bc-choice-card__desc {
  display: block;
  margin-top: 0.2rem;
  font-size: var(--font-size-caption);
  color: var(--color-text-muted);
  line-height: 1.4;
}

.bc-manual-box {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
}

.bc-manual-box h4 {
  margin: 0 0 0.75rem;
  font-size: var(--font-size-md);
  font-weight: 600;
}

.bc-lead-results {
  margin-top: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-form);
  border-radius: var(--radius-sm);
  max-height: 260px;
  overflow-y: auto;
  display: none;
}

.bc-lead-results.is-open {
  display: block;
}

.bc-lead-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-surface-cool);
  cursor: pointer;
}

.bc-lead-result-item:hover,
.bc-lead-result-item:focus-visible {
  background: rgba(var(--brand-green-rgb), 0.06);
  outline: none;
}

.bc-lead-result-item:last-child {
  border-bottom: 0;
}

.bc-selected-leads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.bc-lead-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  background: rgba(var(--brand-green-rgb), 0.12);
  color: var(--brand-green-ink);
  font-size: var(--font-size-sm);
}

.bc-lead-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: var(--font-size-base);
  line-height: 1;
  padding: 0;
}

.bc-lead-chip--warn {
  background: var(--color-warning-surface);
  color: var(--color-warning-deep);
}

.bc-lead-chip--warn .bi {
  font-size: var(--font-size-xs);
}

.bc-preview-panel {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: rgba(var(--brand-green-rgb), 0.08);
  border: 1px solid rgba(var(--brand-green-rgb), 0.18);
}

.bc-preview-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.bc-preview-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.bc-preview-stat__label {
  font-size: var(--font-size-caption);
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.bc-preview-stat__value {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--brand-green-strong);
  line-height: 1;
}

.bc-preview-hint {
  margin: 0.75rem 0 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.bc-preview-hint.is-error {
  color: var(--color-danger-strong);
}

.bc-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--color-surface-cool);
  background: var(--color-surface-empty);
}

/* Manual lead search */
.bc-lead-search-wrap {
  position: relative;
}

.bc-lead-search-icon {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-faint);
  pointer-events: none;
  z-index: 2;
}

.bc-lead-search-input {
  padding-left: 2.75rem !important;
}

.bc-lead-result-avatar {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-pill);
  background: rgba(var(--brand-green-rgb), 0.12);
  color: var(--brand-green-strong);
  font-weight: 700;
  font-size: var(--font-size-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bc-lead-result-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.bc-lead-result-item:disabled,
.bc-lead-result-item.is-selected {
  opacity: 0.55;
  cursor: default;
}

.bc-lead-result-name {
  font-weight: 600;
  color: var(--color-ink-slate);
  line-height: 1.3;
}

.bc-lead-result-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--font-size-caption);
  color: var(--color-text-muted);
  line-height: 1.3;
}

.bc-lead-result-meta .bi {
  font-size: var(--font-size-xs);
  opacity: 0.85;
}

.bc-lead-result-added {
  margin-left: 0.35rem;
  color: var(--brand-green-strong);
  font-weight: 600;
}

.bc-lead-result-warn {
  margin-left: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--color-warning-deep);
  font-weight: 600;
}

.bc-lead-result-warn .bi {
  font-size: var(--font-size-xs);
  opacity: 1;
}

.bc-lead-result-empty {
  padding: 0.85rem 1rem;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
}

/* Scheduling */
.bc-schedule-panel {
  margin-top: 1rem;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
}

.bc-schedule-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.bc-quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-muted);
  background: var(--color-surface);
  color: var(--color-text-emphasis);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.bc-quick-chip:hover {
  border-color: rgba(var(--brand-green-rgb), 0.5);
  color: var(--brand-green-strong);
}

.bc-quick-chip.is-active {
  border-color: var(--brand-green);
  background: rgba(var(--brand-green-rgb), 0.1);
  color: var(--brand-green-strong);
}

.bc-schedule-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.bc-schedule-field {
  flex: 1 1 180px;
  min-width: 150px;
}

.bc-schedule-field .form-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: 0.35rem;
}

.bc-schedule-summary {
  margin: 0.9rem 0 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--brand-green-strong);
}

.bc-schedule-summary.is-past {
  color: var(--color-danger-strong);
}

.bc-empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(var(--brand-green-rgb), 0.12);
}

.bc-empty-state i {
  font-size: var(--font-size-5xl);
  color: rgba(var(--brand-green-rgb), 0.45);
}

.bc-table-wrap {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(var(--brand-green-rgb), 0.12);
  overflow: hidden;
}

.bc-table-wrap td.bc-cell-preview {
  max-width: 220px;
}

.bc-progress--inline {
  height: 4px;
}

.bc-progress--detail {
  height: 10px;
}

.bc-status-badge.ic-badge {
  font-weight: 600;
}

.bc-confirm-modal .modal-content {
  border-radius: var(--radius-lg);
  border: 0;
}

.bc-confirm-preview {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  white-space: pre-wrap;
  word-break: break-word;
}

.bc-form-help.is-error {
  color: var(--color-danger-strong);
}


.btn-emerald .bi {
  color: white;
}

@media (max-width: 768px) {
  /* Clear the fixed bottom tab bar (same pattern as mobile-pwa.css). !important
     because the templates' own .py-3 utility class sets padding-bottom !important. */
  .bc-mobile-page {
    padding-bottom: calc(var(--mobile-tab-bar-height) + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* PWA header: title + icon-only actions on one row; subtitle below */
  .bc-mobile-page .admin-dashboard-header {
    padding: 1.15rem 1rem !important;
  }

  .bc-mobile-page .bc-header-top {
    align-items: center;
    gap: 0.65rem;
  }

  .bc-mobile-page .bc-header-top .admin-dashboard-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bc-header-actions {
    flex-shrink: 0;
    gap: 0.45rem;
    margin-left: auto;
  }

  .bc-mobile-page .bc-header-row .admin-dashboard-subtitle {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    padding-right: 0.25rem;
  }

  .bc-header-actions .bc-header-btn,
  .bc-mobile-page .bc-header-top .bc-header-btn {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    padding: 0;
    border-radius: var(--radius-pill);
    gap: 0;
  }

  .bc-header-actions .bc-header-btn .ic-btn__label,
  .bc-mobile-page .bc-header-top .bc-header-btn .ic-btn__label {
    display: none;
  }

  .bc-header-actions .bc-header-btn .bi,
  .bc-mobile-page .bc-header-top .bc-header-btn .bi {
    font-size: var(--font-size-xl);
    line-height: 1;
  }

  .bc-lead-search-input {
    min-height: 44px;
  }

  #bc-detail .row.g-3 {
    row-gap: 0.6rem;
  }

  .bc-form-section,
  .bc-form-actions {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .bc-choice-grid {
    grid-template-columns: 1fr;
  }

  .bc-preview-stats {
    grid-template-columns: 1fr;
  }

  .bc-form-actions {
    flex-direction: column-reverse;
  }

  .bc-form-actions .ic-btn {
    width: 100%;
    min-height: 46px;
  }

  .bc-confirm-modal .ic-modal__footer {
    flex-direction: column-reverse;
  }

  .bc-confirm-modal .ic-modal__footer .ic-btn {
    width: 100%;
    min-height: 46px;
  }

  /* Data tables collapse into stacked cards (no horizontal scroll) */
  .bc-table-wrap {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .bc-table-wrap thead {
    display: none;
  }

  .bc-table-wrap tbody,
  .bc-table-wrap tr,
  .bc-table-wrap td {
    display: block;
    width: 100%;
  }

  .bc-table-wrap tr {
    background: var(--color-surface);
    border: 1px solid rgba(var(--brand-green-rgb), 0.14);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
  }

  .bc-table-wrap td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 0;
    text-align: right;
  }

  .bc-table-wrap td::before {
    content: attr(data-label);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--color-text-muted);
    text-align: left;
    flex-shrink: 0;
  }

  /* Title row: full-width heading, no label */
  .bc-table-wrap td.bc-cell-title {
    display: block;
    text-align: left;
    font-weight: 700;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid var(--color-surface-cool);
  }

  .bc-table-wrap td.bc-cell-title::before {
    content: none;
  }

  /* Preview row: full-width muted text */
  .bc-table-wrap td.bc-cell-preview {
    display: block;
    max-width: none !important;
    text-align: left;
    white-space: normal;
    color: var(--color-text-muted);
  }

  .bc-table-wrap td.bc-cell-preview::before {
    content: none;
  }

  /* Delivery progress bar spans the row width */
  .bc-table-wrap td .progress {
    flex: 1 1 auto;
    max-width: 60%;
  }

  /* Actions: full-width button row */
  .bc-table-wrap td.bc-cell-actions {
    justify-content: flex-start;
    margin-top: 0.4rem;
    border-top: 1px solid var(--color-surface-cool);
  }

  .bc-table-wrap td.bc-cell-actions::before {
    content: none;
  }

  .bc-table-wrap td.bc-cell-actions .btn {
    flex: 1 1 auto;
  }

  /* Empty-state row shouldn't look like a card cell */
  .bc-table-wrap td[colspan] {
    text-align: center;
  }

}

.bc-table-wrap .bc-cell-preview {
  max-width: 220px;
}

.bc-list-progress {
  height: 4px;
}

#bc-progress {
  height: 10px;
}

.bc-list-progress .progress-bar,
#bc-progress .progress-bar {
  width: var(--pct, 0%);
}
