/* =====================================================================
   Booking Approval Engine — module styles
   Uses design-system-v1.css tokens (var(--ds-*)) throughout.
   ===================================================================== */

.bae-page { padding: 0; background: var(--ds-grey-50); }

/* ---- KPI cards ---- */
.bae-kpi-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.bae-kpi-card {
    flex: 1;
    min-width: 160px;
    background: #fff;
    border: 1px solid var(--ds-grey-200);
    border-left: 4px solid var(--ds-grey-300);
    border-radius: var(--ds-radius-md);
    padding: 14px 16px;
    cursor: default;
    box-shadow: var(--ds-shadow-card);
}
.bae-kpi-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--ds-grey-800);
    font-family: var(--ds-font-mono);
}
.bae-kpi-label {
    font-size: 11px;
    color: var(--ds-grey-500);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
}
.bae-kpi-confirm { border-left-color: var(--ds-color-success); }
.bae-kpi-confirm .bae-kpi-value { color: var(--ds-color-success-text); }
.bae-kpi-queue   { border-left-color: var(--ds-color-warning); }
.bae-kpi-queue .bae-kpi-value   { color: var(--ds-color-warning-text); }
.bae-kpi-neutral { border-left-color: #5c6bc0; cursor: default; }
.bae-kpi-neutral:hover { transform: none; box-shadow: var(--ds-shadow-card); }
.bae-kpi-manual  { border-left-color: #1565c0; }
.bae-kpi-manual .bae-kpi-value  { color: #1565c0; }

/* ---- Grid + loading ---- */
.bae-loading-bar { margin: 0; }

.bae-grid-section {
    margin: 6px 0px 0px;
    border: 1px solid var(--ds-grey-200);
    border-radius: var(--ds-radius-sm);
    background: #fff;
    overflow: hidden;
    position: relative;
}

/* ---- Checkbox label (native, replacing md-checkbox) ---- */
.bae-checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--ds-grey-700);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}
.bae-checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--ds-color-primary);
    cursor: pointer;
}

/* ---- Action row ---- */
.bae-action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border-top: 1px solid var(--ds-grey-200);
    flex-shrink: 0;
}
.bae-export-excel { color: var(--ds-color-success-text) !important; border-color: #a5d6a7 !important; }
.bae-export-pdf   { color: var(--ds-color-danger-text)  !important; border-color: #ef9a9a  !important; }

/* ---- Badges ---- */
.bae-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.bae-badge-confirm {
    background: var(--ds-color-success-bg);
    color: var(--ds-color-success-text);
    border: 1px solid #b7dfc1;
}
.bae-badge-queue {
    background: var(--ds-color-warning-bg);
    color: var(--ds-color-warning-text);
    border: 1px solid #ffcc80;
    cursor: pointer;
}
.bae-badge-pending {
    background: var(--ds-grey-100);
    color: var(--ds-grey-600);
    border: 1px solid var(--ds-grey-200);
}
.bae-badge-manual {
    background: var(--ds-color-primary-light);
    color: var(--ds-color-primary-dark);
    border: 1px solid #b3d4f5;
}
.bae-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--ds-radius-sm);
    background: var(--ds-grey-100);
    color: var(--ds-grey-600);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--ds-font-mono);
}
.bae-link { color: #0E6BB6; cursor: pointer; text-decoration: none; font-weight: 600; }

/* ---- Native table (replaces ui-grid in Tab 1 and Tab 2) ---- */
.bae-table-scroll { overflow-x: auto; width: 100%; }

.bae-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.bae-table thead tr {
    background: var(--ds-grey-50);
    border-bottom: 2px solid var(--ds-grey-200);
}
.bae-table th {
    padding: 7px 8px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--ds-grey-500);
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
    border-bottom: 2px solid var(--ds-grey-200);
}
.bae-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--ds-grey-100);
    vertical-align: middle;
    color: var(--ds-grey-800);
    white-space: nowrap;
}
.bae-table tbody tr:last-child td { border-bottom: none; }
.bae-table tbody tr:hover td { background: var(--ds-grey-50); }

/* Row tints */
.bae-table tbody tr.bae-row-queue td   { background: var(--ds-color-warning-bg); }
.bae-table tbody tr.bae-row-queue:hover td { background: #fff3cd; }
.bae-table tbody tr.bae-row-confirm td { background: var(--ds-color-success-bg); }
.bae-table tbody tr.bae-row-confirm:hover td { background: #d4edda; }
.bae-table tbody tr.bae-row-manual td  { background: var(--ds-color-primary-light); }
.bae-table tbody tr.bae-row-manual:hover td { background: #cce0f7; }

.bae-th-check, .bae-td-check { width: 36px; text-align: center; padding-right: 4px; }
.bae-th-action, .bae-td-icon { width: 90px; text-align: center; }
.bae-td-num { text-align: center; }
/* Narrow, lower-priority columns: smaller text + tighter padding so the full row
   fits without horizontal scrolling (origin, dest, commodity, customer/agent). */
.bae-table th.bae-td-compact,
.bae-table td.bae-td-compact { font-size: 12px; padding-left: 6px; padding-right: 6px; }
.bae-td-conditions { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.bae-td-nowrap { white-space: nowrap; }
.bae-empty-row { text-align: center; padding: 32px 16px; color: var(--ds-grey-400); font-style: italic; }

/* Utility: hide an element while keeping its markup/code in place (e.g. Flight column/filter). */
.bae-hidden { display: none !important; }
/* Let the filter bar wrap so the relocated action buttons never overflow on narrow widths. */
.bae-queue-tab .ds-filter-bar { flex-wrap: wrap; row-gap: 6px; }

/* ---- Pagination bar ---- */
.bae-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid var(--ds-grey-200);
    background: var(--ds-grey-50);
    font-size: 12px;
    flex-wrap: wrap;
}
.bae-pg-info { flex: 1; color: var(--ds-grey-500); white-space: nowrap; }
.bae-pg-controls { display: flex; align-items: center; gap: 2px; }
.bae-pg-btn {
    border: 1px solid var(--ds-grey-200);
    background: #fff;
    color: var(--ds-grey-700);
    padding: 3px 9px;
    border-radius: var(--ds-radius-xs);
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color .1s, color .1s;
}
.bae-pg-btn:hover:not([disabled]) { border-color: var(--ds-color-primary); color: var(--ds-color-primary); }
.bae-pg-btn[disabled] { opacity: .4; cursor: default; }
.bae-pg-cur { padding: 0 8px; font-weight: 600; font-size: 12px; color: var(--ds-grey-700); white-space: nowrap; }
.bae-pg-size-lbl { color: var(--ds-grey-400); }

/* ---- Rules tab ---- */
.bae-rules-tab {
    margin: 10px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--ds-grey-200);
    border-radius: var(--ds-radius-md);
    box-shadow: var(--ds-shadow-card);
}
.bae-rules-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    margin-bottom: 12px;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--ds-grey-200);
    border-radius: var(--ds-radius-md);
}
.bae-rules-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.bae-rules-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ds-color-primary);
}
.bae-rules-hint {
    font-size: 12px;
    color: var(--ds-grey-400);
}
.bae-rules-grid-wrap {
    border: 1px solid var(--ds-grey-200);
    border-radius: var(--ds-radius-sm);
    background: #fff;
    overflow: hidden;
}
.bae-rules-footer-note {
    margin-top: 10px;
    padding: 9px 12px;
    background: var(--ds-grey-100);
    border: 1px solid var(--ds-grey-200);
    border-radius: var(--ds-radius-sm);
    font-size: 12px;
    color: var(--ds-grey-600);
}

/* ---- Action icons (grid cells) ---- */
.bae-actions { display: flex; align-items: center; height: 100%; }
.bae-action-icon {
    cursor: pointer;
    margin: 0 8px;
    color: var(--ds-grey-500);
    font-size: 22px;
    width: 22px;
    height: 22px;
    line-height: 22px;
}
.bae-action-icon:hover { color: var(--ds-color-accent); }
.bae-action-delete { color: var(--ds-color-danger-text); }
.bae-action-delete:hover { color: var(--ds-color-danger); }

/* ---- Toggle switch ---- */
.bae-toggle { margin: 0; }
.bae-toggle .md-bar   { background-color: var(--ds-grey-300) !important; }
.bae-toggle .md-thumb { background-color: #fafafa !important; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.bae-toggle.md-checked .md-bar   { background-color: #a5d6a7 !important; }
.bae-toggle.md-checked .md-thumb { background-color: var(--ds-color-success) !important; }
.bae-toggle.md-checked .md-ink-ripple { color: var(--ds-color-success) !important; }

/* ---- Modal fields ---- */
.bae-field-error { color: var(--ds-color-danger-text); font-size: 11px; margin-top: 2px; }
.bae-modal-note  { font-size: 11px; color: var(--ds-grey-400); padding-left: 8px; }

/* ---- Capacity gate ---- */
.bae-capacity-gate { margin-top: 6px; }
.bae-capacity-hint { font-size: 11px; color: var(--ds-grey-400); margin-left: 8px; }
.bae-customer-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: var(--ds-color-primary-light);
    color: var(--ds-color-primary-dark);
}
.bae-customer-chip-x { cursor: pointer; opacity: 0.7; font-style: normal; line-height: 1; }
.bae-customer-chip-x:hover { opacity: 1; }

/* Customer picker: search field + compact "selected" field beside it. The selected field shows
   the first pick + a "+N" count and a caret that opens a popover of all removable chips. */
/* Field selector: size to its longest option ("Flight Load % (Volume)") + a little slack, instead
   of the wide flex="25" default. Specificity beats Angular Material's .flex-25. */
.bae-condition-row md-input-container.bae-cond-field {
    flex: 0 0 auto;
    width: 190px;
    max-width: 190px;
}

/* Customer cell: wider than the flex="35" default so the search + selected box have room, with a
   clear right margin so the selected box never sits next to the row's × (remove) button. */
.bae-condition-row .bae-customer-cell {
    flex: 0 0 46%;
    max-width: 46%;
    margin-right: 22px;
}
.bae-customer-cell { display: flex; align-items: center; gap: 6px; }
/* Search bar: uniform 57% of the cell. Firm min-width (not 0) so the input never collapses — a
   shrink-to-0 flex item makes md-autocomplete mis-measure and render an empty suggestions dropdown. */
.bae-customer-cell .bae-customer-autocomplete { flex: 0 0 57%; width: 57%; min-width: 170px; }
.bae-customer-selected {
    position: relative;
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 27px;
    padding: 0 6px;
    min-width: 0;
    border: 1px solid var(--ds-grey-300);
    border-radius: var(--ds-radius-sm);
    background: #fff;
}
.bae-customer-chip-solo {
    display: inline-block;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bae-customer-more { font-size: 11px; font-weight: 600; color: var(--ds-grey-500); }
.bae-customer-caret {
    cursor: pointer;
    font-style: normal;
    color: var(--ds-grey-600);
    font-size: 16px;
    line-height: 1;
    margin-left: 4px;
    padding: 0 2px;
    transition: transform .1s;
}
.bae-customer-caret:hover { color: var(--ds-color-primary); }
.bae-customer-caret.bae-open { transform: rotate(180deg); }
.bae-customer-popover {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 30;
    min-width: 200px;
    max-width: 320px;
    /* ~6 chips visible (title + 6 rows), then scroll. */
    max-height: 190px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--ds-grey-200);
    border-radius: var(--ds-radius-sm);
    box-shadow: var(--ds-shadow-card);
}
.bae-customer-popover .bae-customer-chip { max-width: 100%; }
.bae-customer-popover-title {
    width: 100%;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--ds-grey-500);
    margin-bottom: 2px;
}
.bae-capacity-warning {
    margin: 4px 0 8px;
    padding: 8px 12px;
    border-radius: var(--ds-radius-sm);
    background: var(--ds-color-warning-bg);
    color: var(--ds-color-warning-text);
    font-size: 12px;
    border: 1px solid #ffcc80;
}

/* ---- Conditions builder ---- */
.bae-conditions-section, .bae-test-section {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--ds-grey-200);
    border-radius: var(--ds-radius-sm);
    background: var(--ds-grey-50);
}
.bae-conditions-header { margin-bottom: 4px; }
.bae-section-title { font-size: 13px; font-weight: 600; color: var(--ds-grey-700); }
.bae-conditions-hint { font-size: 11px; color: var(--ds-grey-400); margin-bottom: 8px; }
.bae-condition-row {
    background: #fff;
    border: 1px solid var(--ds-grey-200);
    border-radius: var(--ds-radius-xs);
    padding: 4px 8px;
    margin-bottom: 6px;
}
/* Right-gap between the field/operator/value cells (class used in the condition row markup
   but previously undefined, so it was a no-op). */
.mr-r5 { margin-right: 5px; }
/* Keep every value/field/operator cell in a condition row on the same baseline — md-select and
   text-input md-input-containers otherwise compute slightly different heights. */
.bae-condition-row md-input-container { margin: 0; padding: 0; }
.bae-no-conditions { font-size: 12px; color: var(--ds-grey-400); font-style: italic; padding: 6px 2px; }

/* ---- Test result ---- */
.bae-test-result { margin-top: 10px; }
.bae-test-outcome {
    font-weight: 600;
    padding: 6px 10px;
    border-radius: var(--ds-radius-sm);
    display: inline-block;
    margin-bottom: 8px;
}
.bae-test-match   { background: var(--ds-color-success-bg); color: var(--ds-color-success-text); }
.bae-test-nomatch { background: var(--ds-color-warning-bg); color: var(--ds-color-warning-text); }
.bae-test-table, .bae-trace-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bae-test-table th, .bae-test-table td,
.bae-trace-table th, .bae-trace-table td {
    border: 1px solid var(--ds-grey-200);
    padding: 4px 8px;
    text-align: left;
}
.bae-test-table th, .bae-trace-table th {
    background: var(--ds-grey-50);
    color: var(--ds-grey-600);
    font-weight: 600;
}
.bae-test-pass md-icon, .bae-test-pass { color: var(--ds-color-success); }
.bae-test-fail md-icon, .bae-test-fail { color: var(--ds-color-danger); }
.bae-test-na   md-icon, .bae-test-na   { color: var(--ds-grey-300); }

/* ---- Audit slide-in panel ---- */
.bae-audit-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.35); z-index: 70;
}
.bae-audit-panel {
    position: fixed; top: 0; right: 0; height: 100%; width: 700px; max-width: 96vw;
    background: #fff; z-index: 71;
    box-shadow: -4px 0 20px rgba(11,66,114,.18);
    transform: translateX(100%);
    transition: transform .25s ease;
    overflow-y: auto;
}
.bae-audit-panel.bae-audit-panel-open { transform: translateX(0); }
.bae-audit-inner { padding: 16px 18px 40px; }
.bae-audit-header {
    border-bottom: 1px solid var(--ds-grey-200);
    padding-bottom: 10px;
    margin-bottom: 12px;
}
.bae-audit-title { font-size: 15px; font-weight: 700; color: var(--ds-grey-800); }
.bae-audit-awb {
    font-family: var(--ds-font-mono);
    font-size: 15px;
    font-weight: 700;
    color: var(--ds-color-accent);
    margin-top: 2px;
}
.bae-audit-meta { font-size: 12px; color: var(--ds-grey-400); margin-top: 2px; }
.bae-audit-no-record { text-align: center; padding: 30px 20px; color: var(--ds-grey-400); }
.bae-audit-decision {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px;
    text-align: left;
    padding: 10px 12px;
    border-radius: var(--ds-radius-md);
    font-weight: 600;
    margin-bottom: 14px;
}
.bae-audit-decision md-icon { margin-right: 6px; }
.bae-audit-decision-confirm { background: var(--ds-color-success-bg); color: var(--ds-color-success-text); }
.bae-audit-decision-queue   { background: var(--ds-color-warning-bg); color: var(--ds-color-warning-text); }
.bae-audit-decision-detail  { font-weight: 400; opacity: 0.85; font-size: 12px; }
.bae-audit-section { margin-bottom: 16px; }
.bae-audit-section-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
    color: var(--ds-grey-400); margin-bottom: 8px;
    border-bottom: 1px solid var(--ds-grey-200); padding-bottom: 4px;
}
.bae-fact-item { padding: 4px 0; display: flex; flex-direction: column; }
.bae-fact-label { font-size: 11px; color: var(--ds-grey-400); }
.bae-fact-value { font-size: 13px; color: var(--ds-grey-700); font-weight: 500; }
.bae-flight-not-found {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px;
    background: var(--ds-color-warning-bg);
    color: var(--ds-color-warning-text);
    border-radius: var(--ds-radius-sm);
    font-weight: 500;
}
.bae-capacity-bar-row { display: flex; align-items: center; margin-bottom: 8px; }
.bae-capacity-label { width: 90px; font-size: 12px; color: var(--ds-grey-600); }
.bae-progress-track {
    flex: 1; height: 12px;
    background: var(--ds-grey-200);
    border-radius: 6px;
    overflow: hidden;
    margin: 0 8px;
}
.bae-progress-fill { height: 100%; border-radius: 6px; transition: width .3s ease; }
.bae-load-green  { background: var(--ds-color-success); }
.bae-load-yellow { background: var(--ds-color-warning); }
.bae-load-red    { background: var(--ds-color-danger); }
.bae-capacity-pct { width: 70px; text-align: right; font-size: 12px; font-weight: 700; }
.bae-ok   { color: var(--ds-color-success); }
.bae-fail { color: var(--ds-color-danger); }

.bae-trace-rule { border: 1px solid var(--ds-grey-200); border-radius: var(--ds-radius-sm); margin-bottom: 6px; }
.bae-trace-rule-header {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    padding: 8px 36px 8px 10px; /* right padding leaves room for the expand icon */
    cursor: pointer; font-size: 13px; font-weight: 500;
    background: var(--ds-grey-50);
    text-align: center;
}
/* Centered label group (icon + rule name + status badge) */
.bae-trace-rule-center {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    justify-content: flex-start;
}
.bae-trace-rule-header md-icon { font-size: 18px; vertical-align: middle; }
/* Expand/collapse chevron anchored to the right edge */
.bae-trace-expand-icon {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    font-size: 20px !important; color: var(--ds-grey-400);
}
.bae-trace-status { font-size: 11px; font-weight: 700; }
.bae-matched   { color: var(--ds-color-success); }
.bae-unmatched { color: var(--ds-grey-400); }
.bae-trace-conditions { padding: 6px 10px 10px; }
.bae-trace-outcome {
    display: flex; align-items: center; justify-content: flex-start; gap: 6px;
    text-align: left;
    margin-top: 8px; padding: 8px 10px;
    background: var(--ds-grey-100);
    border-radius: var(--ds-radius-sm);
    font-size: 12px; color: var(--ds-grey-700);
}
.bae-audit-actions { margin-top: 18px; }
.bae-confirm-btn { width: 100%; }

/* ---- Routing summary block (top of audit panel, no title) ---- */
.bae-routing-wrap {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ds-grey-200);
}
.bae-routing-summary {
    display: flex; align-items: center; gap: 10px;
    padding: 2px 0 8px;
}
.bae-routing-summary strong {
    font-size: 14px; font-weight: 700;
    color: var(--ds-grey-800); font-family: var(--ds-font-mono);
}
.bae-routing-arrow { color: var(--ds-grey-400); font-size: 18px; }
/* Compact table variant for the panel — column dividers + centered content */
.bae-routing-table th {
    font-size: 10px; padding: 5px 6px;
    text-align: center;
    border-right: 1px solid var(--ds-grey-200);
}
.bae-routing-table th:last-child { border-right: none; }
.bae-routing-table td {
    font-size: 12px; padding: 5px 6px;
    text-align: center;
    border-right: 1px solid var(--ds-grey-100);
}
.bae-routing-table td:last-child { border-right: none; }

/* =====================================================================
   Rule Config tab — card layout
   ===================================================================== */
.bae-rules-list-wrap { position: relative; padding: 4px 0; }

.bae-rule-card {
    display: flex;
    align-items: stretch;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--ds-grey-200);
    border-left: 4px solid var(--ds-grey-300);
    border-radius: var(--ds-radius-md);
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: var(--ds-shadow-card);
    transition: box-shadow .15s;
}
.bae-rule-card:hover { box-shadow: 0 4px 12px rgba(11,66,114,.12); }
.bae-rule-card-confirm { border-left-color: var(--ds-color-success); }
.bae-rule-card-queue   { border-left-color: var(--ds-color-warning); }
.bae-rule-card-off     { opacity: .6; }

.bae-rule-card-body { flex: 1; min-width: 0; }
.bae-rule-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.bae-rule-name {
    font-size: 14px; font-weight: 700; color: var(--ds-color-accent);
    cursor: pointer; text-decoration: none;
}
.bae-rule-name:hover { text-decoration: underline; }
.bae-rule-card-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    font-size: 12px; color: var(--ds-grey-700); margin-bottom: 4px;
}
.bae-meta-label {
    font-size: 10px; font-weight: 700; letter-spacing: .5px;
    color: var(--ds-grey-400); text-transform: uppercase; margin-right: 2px;
}
.bae-meta-sep { color: var(--ds-grey-300); }
.bae-rule-card-cond {
    font-size: 12px; color: var(--ds-grey-600);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: var(--ds-font-mono);
}
.bae-rule-card-side {
    display: flex; flex-direction: column; align-items: flex-end;
    justify-content: space-between; gap: 6px; flex-shrink: 0;
}

/* =====================================================================
   Rule modal — chips, conditions group, action cards
   ===================================================================== */
.bae-modal-col { padding-right: 10px; box-sizing: border-box; }

/* Source options not yet supported (everything except All + FFR) — clearly faded */
.bae-opt-disabled { opacity: .45 !important; font-style: italic; }

/* Rule name shown to non-admins (view-only) — not a clickable link */
.bae-rule-name-static { cursor: default; text-decoration: none; }

/* Discard-changes confirmation rendered over the rule modal */
.bae-rule-dialog { position: relative; }
.bae-discard-overlay {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 20; border-radius: inherit;
}
.bae-discard-box {
    background: #fff; border-radius: var(--ds-radius-md);
    box-shadow: var(--ds-shadow-card);
    padding: 20px 24px; width: 380px; max-width: 90%;
}
.bae-discard-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.bae-discard-msg { font-size: 13px; color: var(--ds-grey-700); margin-bottom: 16px; }
.bae-discard-actions { display: flex; justify-content: flex-end; gap: 6px; }

.bae-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 6px; min-height: 22px; }
.bae-chip {
    display: inline-flex; align-items: center;
    padding: 2px 10px; border-radius: 12px;
    background: var(--ds-color-primary-light);
    color: var(--ds-color-primary-dark);
    border: 1px solid #b3d4f5;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}

.bae-conditions-group {
    margin-top: 14px; padding: 12px;
    border: 1px solid var(--ds-grey-200);
    border-radius: var(--ds-radius-sm);
    background: var(--ds-grey-50);
}
.bae-group-tag {
    margin-left: 8px; padding: 1px 8px; border-radius: 10px;
    background: var(--ds-color-primary-light); color: var(--ds-color-primary-dark);
    font-size: 10px; font-weight: 700; letter-spacing: .5px; vertical-align: middle;
}

.bae-action-cards { gap: 12px; margin-top: 6px; }
.bae-action-card {
    flex: 1; min-width: 220px;
    border: 2px solid var(--ds-grey-200);
    border-radius: var(--ds-radius-md);
    padding: 12px 14px; cursor: pointer;
    background: #fff; transition: border-color .15s, background .15s;
}
.bae-action-card:hover { border-color: var(--ds-grey-300); }
.bae-action-card-title {
    display: flex; align-items: center; gap: 6px;
    font-size: 14px; font-weight: 700; color: var(--ds-grey-700);
}
.bae-action-card-title md-icon { font-size: 20px; color: inherit; }
.bae-action-card-desc { font-size: 12px; color: var(--ds-grey-500); margin-top: 4px; }
.bae-action-card-confirm.selected {
    border-color: var(--ds-color-success);
    background: var(--ds-color-success-bg);
}
.bae-action-card-confirm.selected .bae-action-card-title { color: var(--ds-color-success-text); }
.bae-action-card-queue.selected {
    border-color: var(--ds-color-warning);
    background: var(--ds-color-warning-bg);
}
.bae-action-card-queue.selected .bae-action-card-title { color: var(--ds-color-warning-text); }

.bae-rule-status { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--ds-grey-200); }


.bae-filter-bar {
    background: #fff;
    border: 1px solid var(--ds-grey-200);
    border-radius: var(--ds-radius-sm);
    margin: 8px 0px 0;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.bae-customer-autocomplete { box-sizing: border-box; width: 57%; }
.bae-customer-autocomplete md-autocomplete-wrap { height: auto; box-shadow: none; }
.bae-customer-autocomplete input,
.bae-customer-autocomplete input[type="search"] {
    height: 27px;
    line-height: normal;
    padding: 0 8px;
    font-size: 13px;
    text-transform: none;
    border: 1px solid var(--ds-grey-300);
    border-radius: var(--ds-radius-sm);
    background: #fff;
    box-sizing: border-box;
}
.bae-customer-autocomplete input:hover { border-color: var(--ds-color-primary); }
.bae-customer-autocomplete input:focus { border-color: var(--ds-color-primary); outline: none; }
.bae-customer-autocomplete input::placeholder { color: var(--ds-grey-400); text-transform: none; }

.bae-bold{
    font-weight: 600;
}

.bae-commodity-shc{
    width: 57%;
}


bae-condition-remove-button{
    margin: 0 6px;
    height: 40px;
    min-width: 0;
    line-height: 24px;
    padding: 15px;
    width: 40px;
    border-radius: 50%;
    border:none !important;
    background: none !important;
}