/* ==========================================================
   BDC Sync Pages – Centralised styles (prefix: bdc-)
   DO NOT modify existing CSS files. All BDC-specific overrides
   live here. Referenced from index.html.
   ========================================================== */

/* ---- Tab container ---- */
.bdc-vendor-sync,
.bdc-customer-sync,
.bdc-pull-payments,
.bdc-pull-receipts {
    /* No height / overflow — the modal-body (overflow:auto) is the
       single scrollable container. */
}

/* ---- Kill the SECOND scrollbar ----
   Bootstrap's .modal class applies overflow-y:auto by default.
   The modal-body already scrolls, so the outer .modal must not.
   :has() targets the modal only when it contains a BDC component. */
.modal:has(.bdc-vendor-sync),
.modal:has(.bdc-customer-sync),
.modal:has(.bdc-pull-payments),
.modal:has(.bdc-pull-receipts) {
    overflow: hidden !important;
}

/* ---- Tabs: compact height ---- */
.bdc-vendor-sync > .nav-tabs,
.bdc-customer-sync > .nav-tabs,
.bdc-pull-payments > .nav-tabs,
.bdc-pull-receipts > .nav-tabs {
    flex-shrink: 0;
}

.bdc-vendor-sync > .nav-tabs .nav-link,
.bdc-customer-sync > .nav-tabs .nav-link,
.bdc-pull-payments > .nav-tabs .nav-link,
.bdc-pull-receipts > .nav-tabs .nav-link {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

/* ---- Tab content panel ---- */
.bdc-tab-content {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
}

/* ---- Grid wrapper ---- */
.bdc-grid-wrapper {
    /* No height/overflow here — the modal-body (overflow:auto) is the
       single scrollable container.  The grid renders at natural height
       and the modal body scrolls if content exceeds 90vh. */
}

/* Ensure table never exceeds wrapper width */
.bdc-grid-wrapper > table {
    table-layout: fixed;
    width: 100%;
}

/* ---- Toolbar row (select vendors + send) ---- */
.bdc-toolbar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.25rem;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

/* ---- Status message line under buttons ---- */
.bdc-status-line {
    font-size: 0.78rem;
    color: #6c757d;
    /*padding: 0.15rem 0.25rem 0;*/
}

/* ---- Section heading ---- */
.bdc-section-heading {
    font-weight: 600;
    font-size: 0.82rem;
    margin: 0.35rem 0 0.25rem 0;
}

/* ---- Sticky table header inside bdc-grid-wrapper ---- */
.bdc-grid-wrapper thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* ---- Action icon buttons (update / delete) ---- */
.bdc-icon-btn {
    padding: 0.1rem 0.35rem;
    line-height: 1;
    font-size: 0.85rem;
}

/* ---- Pull tab: buttons inline ---- */
.bdc-pull-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.25rem;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0.5rem;
}

/* ---- Search + Pagination bar spacing inside BDC pages ---- */
.bdc-search-bar {
    margin-bottom: 0.35rem;
}

.bdc-pagination-bar {
    margin-top: 0.25rem;
}

/* ---- Selected-items toggle dropdown ---- */
.bdc-selected-dropdown {
    position: relative;
    display: inline-block;
}

.bdc-selected-badge {
    cursor: pointer;
    user-select: none;
}

.bdc-selected-panel {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    min-width: 220px;
    max-width: 320px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.35rem;
    margin-top: 0.25rem;
}

.bdc-selected-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 0.35rem 0.35rem 0 0;
}

.bdc-selected-panel-header .btn-close-sm {
    font-size: 0.6rem;
    padding: 0.2rem;
}

.bdc-selected-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 180px;
    overflow-y: auto;
}

.bdc-selected-list li {
    padding: 0.25rem 0.5rem;
    font-size: 0.78rem;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bdc-selected-list li:last-child {
    border-bottom: none;
}

/* ---- View button: primary on hover (Pull tab) ---- */
.bdc-pull-actions .btn-outline-primary:hover,
.bdc-toolbar-row .btn-outline-primary:hover {
    color: #fff;
}

.bdc-pull-actions .btn-outline-primary:hover i,
.bdc-toolbar-row .btn-outline-primary:hover i {
    color: #fff;
}

/* ============================================================
   NEW: PullPayments revision – loader, messages, badges, icons
   ============================================================ */

/* ---- Error / Info messages (inline, small) ---- */
.bdc-msg-error {
    font-size: 0.75rem;
    color: #dc3545;
    font-weight: 500;
}

.bdc-msg-info {
    font-size: 0.75rem;
    color: #6c757d;
}

/* ---- Payment badge (shown after payment created) ---- */
.bdc-payment-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: #198754;
    background: #d1e7dd;
    border-radius: 3px;
    padding: 0.15rem 0.4rem;
    white-space: nowrap;
}

/* ---- Payment source icon ---- */
.bdc-source-icon {
    font-size: 0.8rem;
    min-width: 16px;
    text-align: center;
}

/* ---- Loader overlay (within tab content) ---- */
.bdc-loader-overlay {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.25rem;
    animation: bdc-fade-in 0.2s ease-in;
}

/* ---- Fade-in animation for rendered data ---- */
@keyframes bdc-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bdc-fade-in {
    animation: bdc-fade-in 0.25s ease-in;
}

/* ---- Popup transition (smooth open/close) ---- */
.bdc-popup-transition {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* ---- Bank dropdown empty state (red hint border) ---- */
.bdc-bank-empty .bdc-atd-input {
    border-color: #dc3545 !important;
    border-width: 1px !important;
    border-style: solid !important;
}
