/* ── WC Analytics Reports — Frontend Styles v2 ───────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;600;700&display=swap');

/* ── Global CSS custom properties (available outside .wcar-front-wrap too) ── */
:root {
    --accent: #1e3a5f;
    --green:  #16a34a;
    --gold:   #b45309;
    --red:    #dc2626;
    --border: #e2e8f0;
    --bg:     #f8fafc;
    --radius: 8px;
    --shadow: 0 1px 4px rgba(0,0,0,.07);
}

/* ── Root / Theme vars ───────────────────────────────────────────────────── */
.wcar-front-wrap {
    font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    color: #1e293b;
    --accent:   #1e3a5f;
    --green:    #16a34a;
    --gold:     #b45309;
    --red:      #dc2626;
    --border:   #e2e8f0;
    --bg:       #f8fafc;
    --radius:   8px;
    --shadow:   0 1px 4px rgba(0,0,0,.07);
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.wcar-f-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.wcar-f-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 18px;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
    transition: color .15s, border-color .15s, background .15s;
    white-space: nowrap;
}
.wcar-f-tab:hover { color: var(--accent); background: #f1f5f9; }
.wcar-f-tab--active { color: var(--accent); border-bottom-color: var(--accent); background: #fff; }

/* ── Panels ──────────────────────────────────────────────────────────────── */
.wcar-f-panel { display: none; }
.wcar-f-panel--active { display: block; }

/* ── Section title ───────────────────────────────────────────────────────── */
.wcar-f-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* ── Search / card box ───────────────────────────────────────────────────── */
.wcar-f-search-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
}
.wcar-f-search-label {
    display: block;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    margin-bottom: 8px;
}
.wcar-f-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}

/* ── Inputs ──────────────────────────────────────────────────────────────── */
.wcar-f-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 9px 12px;
    font-family: inherit;
    font-size: .95rem;
    color: #1e293b;
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}
.wcar-f-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30,58,95,.1); }
.wcar-f-input--sm { width: auto; min-width: 130px; }

/* ── Autocomplete ────────────────────────────────────────────────────────── */
.wcar-f-autocomplete-wrap { position: relative; margin-bottom: 14px; }
.wcar-f-autocomplete-list {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 9999; list-style: none; margin: 0; padding: 4px 0;
    max-height: 260px; overflow-y: auto;
}
.wcar-f-autocomplete-list li {
    padding: 10px 14px; cursor: pointer; font-size: .88rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex; flex-direction: column; gap: 2px;
    transition: background .1s;
}
.wcar-f-autocomplete-list li:last-child { border-bottom: none; }
.wcar-f-autocomplete-list li:hover,
.wcar-f-autocomplete-list li.wcar-f-ac-active { background: #eff6ff; }
.wcar-f-ac-name { font-weight: 600; color: #1e293b; }
.wcar-f-ac-meta { font-size: .78rem; color: #64748b; }
.wcar-f-hl { background: #fef9c3; border-radius: 2px; padding: 0 1px; }
.wcar-f-ac-spinner { padding: 12px 14px; color: #94a3b8; font-size: .85rem; }

/* ── Date row & buttons ──────────────────────────────────────────────────── */
.wcar-f-date-row {
    display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
}
.wcar-f-date-row label {
    display: flex; flex-direction: column; gap: 4px;
    font-size: .75rem; font-weight: 700; color: #64748b;
    text-transform: uppercase; letter-spacing: .05em;
}
.wcar-f-order-row {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 4px;
}
.wcar-f-order-search-row { margin-bottom: 4px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.wcar-f-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--accent); color: #fff;
    border: none; border-radius: 6px; padding: 9px 18px;
    font-family: inherit; font-size: .88rem; font-weight: 600;
    cursor: pointer; transition: opacity .15s, transform .1s;
    white-space: nowrap; text-decoration: none;
}
.wcar-f-btn:hover { opacity: .85; transform: translateY(-1px); color: #fff; }
.wcar-f-btn:active { transform: translateY(0); }
.wcar-f-btn:disabled { opacity: .38; cursor: not-allowed; transform: none; }
.wcar-f-btn--ghost {
    background: transparent; color: #64748b;
    border: 1px solid var(--border);
}
.wcar-f-btn--ghost:hover { background: #f1f5f9; color: #1e293b; }

/* ── KPI grid ────────────────────────────────────────────────────────────── */
.wcar-f-kpi-grid {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax( 160px, 1fr ) );
    gap: 12px;
    margin-bottom: 24px;
}
.wcar-f-kpi {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px;
    box-shadow: var(--shadow); text-align: center;
}
.wcar-f-kpi-label {
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: #64748b; margin-bottom: 6px;
}
.wcar-f-kpi-value { font-size: 1.25rem; font-weight: 700; color: #1e293b; }

/* ── Grand banner ────────────────────────────────────────────────────────── */
.wcar-f-grand-banner {
    display: flex; flex-wrap: wrap; gap: 20px;
    justify-content: space-around; align-items: center;
    background: #fffbeb; border: 1px solid #f59e0b;
    border-radius: var(--radius); padding: 12px 20px;
    margin-bottom: 16px; font-weight: 600; color: var(--gold);
}
.wcar-f-grand-banner div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wcar-f-grand-banner span { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.wcar-f-grand-banner strong { font-size: 1.15rem; }

/* ── Profit colours ──────────────────────────────────────────────────────── */
.wcar-f-profit-pos { color: var(--green) !important; }
.wcar-f-profit-neg { color: var(--red)   !important; }

/* ── Status badge ────────────────────────────────────────────────────────── */
.wcar-f-status {
    display: inline-block; padding: 2px 8px;
    border-radius: 999px; font-size: .72rem; font-weight: 700;
    background: #e2e8f0; color: #475569;
}
.wcar-f-status--wc-completed  { background: #dcfce7; color: #15803d; }
.wcar-f-status--wc-processing { background: #dbeafe; color: #1d4ed8; }
.wcar-f-status--wc-on-hold    { background: #fef9c3; color: #92400e; }
.wcar-f-status--wc-cancelled  { background: #fee2e2; color: #991b1b; }
.wcar-f-status--wc-refunded   { background: #f3e8ff; color: #6b21a8; }

/* ── Receipt card ────────────────────────────────────────────────────────── */
.wcar-f-receipt {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); margin-bottom: 16px;
    overflow: hidden; box-shadow: var(--shadow);
    page-break-inside: avoid;
}
.wcar-f-receipt-head {
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 12px 16px;
}
.wcar-f-meta-row {
    display: flex; gap: 20px; flex-wrap: wrap;
    font-size: .85rem; margin-bottom: 6px; align-items: center;
}
.wcar-f-meta-row a { color: var(--accent); text-decoration: none; }
.wcar-f-meta-row a:hover { text-decoration: underline; }
.wcar-f-customer-row {
    display: flex; gap: 14px; flex-wrap: wrap;
    font-size: .82rem; color: #000;
    font-weight: 700;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.wcar-f-table-wrap { overflow-x: auto; }
.wcar-f-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.wcar-f-table th,
.wcar-f-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.wcar-f-table td { color: #000; font-weight: 700; }
.wcar-f-table th {
    background: var(--bg); font-size: .7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; color: #64748b;
    white-space: nowrap;
}
.wcar-f-table tbody tr:hover { background: #f8fafc; }
.wcar-f-num { text-align: right !important; font-variant-numeric: tabular-nums; }
.wcar-f-amount { color: #000; font-weight: 700; }
.wcar-f-receipt-total td { font-weight: 700; background: #f0fdf4; }
.wcar-f-rank-1 { background: #fffbeb !important; }
.wcar-f-rank-1 td:first-child { border-left: 3px solid #f59e0b; }

/* ── Chart ───────────────────────────────────────────────────────────────── */
.wcar-f-chart-wrap {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px;
    margin-bottom: 20px; height: 280px; position: relative;
}
.wcar-f-chart-wrap canvas { height: 100% !important; }

/* ── Loading / empty / error ─────────────────────────────────────────────── */
.wcar-f-results { margin-top: 4px; }
.wcar-f-loading {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; padding: 36px; color: #94a3b8; font-size: .9rem;
}
.wcar-f-loading::before {
    content: ''; display: inline-block;
    width: 20px; height: 20px;
    border: 2px solid #e2e8f0; border-top-color: var(--accent);
    border-radius: 50%; animation: wcar-spin .7s linear infinite; flex-shrink: 0;
}
@keyframes wcar-spin { to { transform: rotate(360deg); } }
.wcar-f-empty { text-align: center; padding: 32px; color: #94a3b8; font-style: italic; }

/* ── Receipt Selection Toolbar ───────────────────────────────────────────── */
.wcar-f-receipt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.wcar-f-select-all-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .83rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    user-select: none;
}
.wcar-f-select-all-label input[type="checkbox"] {
    width: 15px; height: 15px;
    cursor: pointer;
    accent-color: var(--accent);
}
.wcar-f-receipt-count {
    font-weight: 400;
    font-style: normal;
    color: #64748b;
    font-size: .77rem;
}
.wcar-f-selected-count {
    font-size: .77rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 80px;
    text-align: right;
}

/* ── Clickable order-number link ─────────────────────────────────────────── */
.wcar-f-order-link {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1.5px dashed currentColor;
    transition: opacity .15s;
    cursor: pointer;
}
.wcar-f-order-link:hover { opacity: .72; }

/* ═══════════════════════════════════════════════════════════════════════════
   ORDER DETAIL MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

/* overlay */
.wcar-omodal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    background: rgba(0,0,0,.52);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(3px);
    animation: wcar-om-fade .18s ease;
}
.wcar-omodal-overlay[hidden] { display: none !important; }
@keyframes wcar-om-fade { from { opacity: 0; } to { opacity: 1; } }
body.wcar-om-open { overflow: hidden; }

/* dialog box */
.wcar-omodal-box {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 28px 72px rgba(0,0,0,.30);
    width: 100%;
    max-width: 740px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: wcar-om-rise .22s cubic-bezier(.22,1,.36,1);
    position: relative;
}
@keyframes wcar-om-rise {
    from { transform: translateY(22px) scale(.98); opacity: 0; }
    to   { transform: translateY(0)    scale(1);   opacity: 1; }
}
.wcar-omodal-box--busy .wcar-omodal-body { opacity: .35; pointer-events: none; }

/* header */
.wcar-omodal-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 10px;
    background: #fff;
}
.wcar-omodal-hd-l { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wcar-omodal-hd-r { display: flex; align-items: center; gap: 8px;  flex-shrink: 0;  }
.wcar-omodal-ttl  { margin: 0; font-size: 1.05rem; font-weight: 700; color: #1e293b; }
.wcar-om-badge    { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.wcar-om-ext {
    font-size: .76rem; font-weight: 600;
    color: var(--accent); text-decoration: none;
    padding: 4px 10px;
    border: 1.5px solid var(--accent);
    border-radius: 6px;
    transition: background .14s;
}
.wcar-om-ext:hover { background: #e8f0f8; }
.wcar-omodal-x {
    background: none; border: none; cursor: pointer;
    font-size: 1.35rem; color: #94a3b8;
    line-height: 1; padding: 3px 7px;
    border-radius: 6px; transition: background .14s, color .14s;
}
.wcar-omodal-x:hover { background: #fee2e2; color: #dc2626; }

/* tab bar */
.wcar-omodal-nav {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    flex-shrink: 0;
    background: #f8fafc;
}
.wcar-om-tab {
    background: none; border: none;
    border-bottom: 2.5px solid transparent;
    padding: 10px 18px;
    font-size: .84rem; font-weight: 600; color: #64748b;
    cursor: pointer; font-family: inherit;
    transition: color .14s, border-color .14s;
    margin-bottom: -1px;
}
.wcar-om-tab:hover         { color: var(--accent); }
.wcar-om-tab--on           { color: var(--accent); border-bottom-color: var(--accent); }

/* body / panes */
.wcar-omodal-body { overflow-y: auto; flex: 1; position: relative; }
.wcar-om-spin {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.75); z-index: 2;
}
.wcar-om-pane      { display: none; }
.wcar-om-pane--on  { display: block; }

/* sections */
.wcar-om-sec {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}
.wcar-om-sec:last-child  { border-bottom: none; }
.wcar-om-sec--muted      { background: #f8fafc; }
.wcar-om-sec-h {
    font-size: .71rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em;
    color: #64748b; margin-bottom: 10px;
}

/* 2-col form grid */
.wcar-om-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.wcar-om-grid label {
    display: flex; flex-direction: column;
    gap: 4px; font-size: .77rem;
    font-weight: 600; color: #475569;
}
.wcar-om-grid label input { margin-top: 2px; }

/* meta description list */
.wcar-om-dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 5px 18px;
    font-size: .83rem; margin: 0;
}
.wcar-om-dl dt { color: #64748b; font-weight: 600; white-space: nowrap; }
.wcar-om-dl dd { margin: 0; color: #1e293b; }

/* notes */
.wcar-om-notes-list {
    padding: 12px 20px;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wcar-om-note {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    background: #fff;
}
.wcar-om-note--cust { border-color: #93c5fd; background: #eff6ff; }
.wcar-om-note-hd {
    display: flex; gap: 8px; align-items: center;
    flex-wrap: wrap; margin-bottom: 5px;
}
.wcar-om-note-by   { font-size: .78rem; font-weight: 700; color: #1e293b; }
.wcar-om-note-date { font-size: .73rem; color: #94a3b8; }
.wcar-om-note-tag  {
    font-size: .67rem; font-weight: 700;
    padding: 1px 7px; border-radius: 20px;
    background: #3b82f6; color: #fff;
    text-transform: uppercase; letter-spacing: .05em;
}
.wcar-om-note-body { font-size: .82rem; color: #334155; white-space: pre-wrap; }
.wcar-om-add-note  {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}
.wcar-om-note-row {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-top: 8px; gap: 10px; flex-wrap: wrap;
}
.wcar-om-note-row label {
    display: flex; align-items: center;
    gap: 6px; font-size: .8rem; color: #475569;
    cursor: pointer;
}

/* footer */
.wcar-omodal-ft {
    display: flex; align-items: center;
    gap: 10px; padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: #f8fafc; flex-shrink: 0;
}
.wcar-om-msg          { font-size: .82rem; font-weight: 600; flex: 1; }
.wcar-om-msg--ok  { color: #16a34a; }
.wcar-om-msg--err { color: #dc2626; }

/* responsive */
@media (max-width: 620px) {
    .wcar-omodal-box { max-height: 100vh; border-radius: 0; }
    .wcar-om-grid    { grid-template-columns: 1fr; }
    .wcar-omodal-overlay { padding: 0; align-items: flex-end; }
}

/* ── Print ───────────────────────────────────────────────────────────────── */
/* @page rule is injected inline by the JS popup so it only affects receipts. */
@media print {
    /* ── Force ALL receipt text to bold black ─────────────────────────────── */
    * { color: #000 !important; font-weight: 700 !important; }

    .wcar-f-tabs, .wcar-f-search-box, .wcar-f-btn,
    .wcar-f-chart-wrap, .wcar-f-kpi-grid,
    .wcar-f-receipt-select-label,
    .wcar-f-receipt-status-row { display: none !important; }
    .wcar-f-panel { display: block !important; }
    .wcar-f-receipt, .wcar-front-wrap { box-shadow: none !important; border-color: #ccc !important; }
    .wcar-f-receipt--selected { border-color: #ccc !important; box-shadow: none !important; }
    .wcar-f-receipt--selected .wcar-f-receipt-head { background: var(--bg) !important; }
    .wcar-f-table th { background: #f0f0f0 !important; color: #000 !important; font-weight: 700 !important; }
    .wcar-f-profit-pos { color: #000 !important; }
    .wcar-f-profit-neg { color: #000 !important; }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media ( max-width: 640px ) {
    .wcar-f-date-row, .wcar-f-order-row { flex-direction: column; gap: 8px; align-items: stretch; }
    .wcar-f-input--sm { width: 100%; min-width: unset; }
    .wcar-f-table th, .wcar-f-table td { padding: 8px 10px; font-size: .8rem; }
    .wcar-f-kpi-grid { grid-template-columns: 1fr 1fr; }
    .wcar-f-grand-banner { flex-direction: column; gap: 12px; }
    .wcar-f-tab { padding: 8px 12px; font-size: .82rem; }
}

/* ── OpenPOS Reports panel ───────────────────────────────────────────────── */
.wcar-f-op-controls { display: flex; flex-direction: column; gap: 0; }
.wcar-f-op-row {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-bottom: 4px;
}
.wcar-f-op-row label {
    font-size: .78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: #64748b; white-space: nowrap;
}
.wcar-f-op-type {
    flex: 1; min-width: 200px; max-width: 320px;
    border: 1px solid var(--border); border-radius: 6px;
    padding: 9px 12px; font-family: inherit; font-size: .9rem;
    background: #fff; cursor: pointer;
}
.wcar-f-op-type:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(30,58,95,.1); }

/* ── Skeleton loader ─────────────────────────────────────────────────────── */
.wcar-f-skeleton-wrap {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.wcar-f-skeleton {
    border-radius: 6px;
    background: linear-gradient( 90deg, #f0f4f8 25%, #e2e8f0 50%, #f0f4f8 75% );
    background-size: 200% 100%;
    animation: wcar-shimmer 1.4s infinite;
}
.wcar-f-skeleton--banner {
    height: 64px;
    width: 100%;
    border-radius: 8px;
}
.wcar-f-skeleton--row {
    height: 42px;
    width: 100%;
}
.wcar-f-skeleton--short {
    width: 60%;
}
@keyframes wcar-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DEBIT SYSTEM v5
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Dollar rate row ─────────────────────────────────────────────────────── */
.wcar-f-debit-rate-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.wcar-f-debit-rate-row .wcar-f-input--sm { max-width: 150px; }

/* ── Status checkboxes ───────────────────────────────────────────────────── */
.wcar-f-status-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.wcar-f-status-check-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}
.wcar-f-status-check-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* ── Receipt status filter row ───────────────────────────────────────────── */
.wcar-f-receipt-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.wcar-f-receipt-status-row .wcar-f-search-label {
    white-space: nowrap;
    font-size: .75rem;
    color: #64748b;
    font-weight: 700;
}

/* ── Receipt "Select" checkbox (for selective printing) ──────────────────── */
.wcar-f-receipt-select-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    font-size: .72rem;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    padding: 2px 7px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    transition: background .15s, color .15s, border-color .15s;
}
.wcar-f-receipt-select-label:hover {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}
.wcar-f-receipt-select-label input[type="checkbox"] {
    width: 13px;
    height: 13px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* ── Selected receipt highlight ──────────────────────────────────────────── */
.wcar-f-receipt--selected {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px rgba(59,130,246,.16) !important;
}
.wcar-f-receipt--selected .wcar-f-receipt-head {
    background: #eff6ff;
}
.wcar-f-receipt--selected .wcar-f-receipt-select-label {
    color: var(--accent);
    border-color: var(--accent);
    background: #dbeafe;
    font-weight: 700;
}

/* ── Debit filters row ───────────────────────────────────────────────────── */
.wcar-f-debit-filters { margin-top: 4px; }

/* ── Actions bar (above the order table) ────────────────────────────────── */
.wcar-f-debit-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 10px;
}

/* ── Settle button ───────────────────────────────────────────────────────── */
.wcar-f-btn--settle {
    background: var(--green);
}
.wcar-f-btn--settle:hover { opacity: .85; }
.wcar-f-btn--settle:disabled { opacity: .35; cursor: not-allowed; }

/* ── Pay button ──────────────────────────────────────────────────────────── */
.wcar-f-btn--pay {
    background: #0891b2;
    padding: 7px 12px;
    font-size: .85rem;
}
.wcar-f-btn--pay:hover { opacity: .85; }

/* ── Inline payment row ──────────────────────────────────────────────────── */
.wcar-f-pay-row {
    display: flex;
    align-items: center;
    gap: 5px;
}
.wcar-f-pay-input {
    width: 110px !important;
    min-width: 80px;
    padding: 6px 8px !important;
    font-size: .82rem !important;
}
.wcar-f-pay-input.wcar-f-input--error {
    border-color: var(--red) !important;
    animation: wcar-shake .3s ease;
}
@keyframes wcar-shake {
    0%,100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}

/* ── USD column ──────────────────────────────────────────────────────────── */
.wcar-f-usd-col { color: #0369a1; font-weight: 600; }

/* ── Settled row & badge ─────────────────────────────────────────────────── */
.wcar-f-debit-settled {
    opacity: .65;
    background: #f0fdf4 !important;
}
.wcar-f-settled-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── Debit table checkbox column ─────────────────────────────────────────── */
.wcar-f-debit-table th:first-child,
.wcar-f-debit-table td:first-child {
    width: 36px;
    text-align: center;
    padding: 8px 6px;
}
.wcar-f-debit-table input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* ── Toast notification ──────────────────────────────────────────────────── */
.wcar-f-toast {
    position: sticky;
    top: 12px;
    z-index: 9999;
    margin: 0 0 12px;
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: .88rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
}
.wcar-f-toast--visible {
    opacity: 1;
    transform: translateY(0);
}
.wcar-f-toast--success { background: #dcfce7; color: #15803d; border-left: 4px solid #16a34a; }
.wcar-f-toast--error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #dc2626; }

/* ── Responsive debit table ──────────────────────────────────────────────── */
@media ( max-width: 768px ) {
    .wcar-f-debit-table { font-size: .75rem; }
    .wcar-f-debit-table .wcar-f-usd-col { display: none; }
    .wcar-f-pay-input { width: 80px !important; }
    .wcar-f-debit-actions-bar { flex-direction: column; align-items: flex-start; }
    .wcar-f-status-checks { gap: 4px; }
}
/* Alias — settle button is targeted by both class names */
.wcar-f-settle-btn { /* inherits from .wcar-f-btn--settle */ }

/* ── Settlement receipt print button ────────────────────────────────────── */
.wcar-f-receipt-print-btn {
    background: #0369a1;
    margin-top: 4px;
    animation: wcar-pulse-in .3s ease;
}
.wcar-f-receipt-print-btn:hover { opacity: .85; }
@keyframes wcar-pulse-in {
    from { opacity: 0; transform: scale(.95); }
    to   { opacity: 1; transform: scale(1);  }
}
