/* ═══════════════════════════════════════════════════════
   Document Review Card — responsive mobile-first
   ═══════════════════════════════════════════════════════ */

.drc-card {
    background: transparent;
    border-radius: 12px;
    padding: 12px 0;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: var(--text, #eef3ee);
    font-size: 14px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.drc-card * { box-sizing: border-box; }

/* ─── HEADER ─── */
.drc-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 10px; padding-bottom: 8px;
    border-bottom: 1px solid var(--line, #ffffff10);
    flex-wrap: wrap;
}
.drc-head-left { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.drc-head-left i { color: var(--muted, #8b958b); }
.drc-badge {
    background: #EEE9FE; color: #6D3FE0; font-size: 10px;
    padding: 3px 8px; border-radius: 999px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 4px;
    white-space: nowrap;
}

.drc-date {
    width: 100%; padding: 8px 10px;
    border: 1px solid var(--line, #ffffff10); border-radius: 8px;
    font-size: 14px; margin-bottom: 12px;
    background: var(--card, #1d211d); color: var(--text, #eef3ee);
}

/* ─── STATS ─── */
.drc-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px; margin-bottom: 12px;
    width: 100%;
}
@media (max-width: 420px) {
    .drc-stats { grid-template-columns: 1fr; }
}
.drc-stat {
    background: var(--tile, #20241f);
    border-radius: 8px; padding: 8px 10px;
    min-width: 0; overflow: hidden;
}
.drc-stat label {
    font-size: 9px; text-transform: uppercase;
    color: var(--muted, #8b958b); font-weight: 700;
    letter-spacing: .04em; display: block;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drc-val { font-size: 13px; font-weight: 800; margin-top: 2px; word-break: break-word; }

/* ─── WARNINGS ─── */
.drc-warn {
    background: #FEF3E2; border: 1px solid #f3d3a0;
    border-radius: 8px; padding: 10px 12px; margin-bottom: 12px;
    font-size: 12px; color: #7a4a06;
}
.drc-warn-title { font-weight: 700; margin-bottom: 4px; }
.drc-warn ul { margin: 0; padding-left: 18px; }
.drc-warn li { margin-bottom: 2px; }

/* ─── SECTION TITLE ─── */
.drc-section-title {
    font-weight: 700; font-size: 13px; margin: 14px 0 8px;
    display: flex; align-items: center; gap: 6px;
    color: var(--text, #eef3ee);
}
.drc-section-title i { color: var(--muted, #8b958b); }
.drc-count {
    margin-left: auto; background: var(--tile, #20241f);
    color: var(--muted, #8b958b);
    font-size: 10px; padding: 2px 8px; border-radius: 999px;
}

/* ─── CUSTOMER BLOCK ─── */
.drc-cust {
    border: 1px solid var(--line, #ffffff10);
    border-left: 3px solid #25D366;
    border-radius: 10px; padding: 12px; margin-bottom: 12px;
    background: var(--card, #1d211d);
}
.drc-cust.is-credit { border-left-color: #D97706; }

.drc-cust-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    width: 100%;
}
.drc-cust-name {
    font-weight: 700; font-size: 14px;
    color: var(--text, #eef3ee);
    word-break: break-word;
}
.drc-pill {
    font-size: 9px; padding: 2px 8px; border-radius: 999px;
    font-weight: 700; white-space: nowrap;
}
.drc-pill-paid { background: #E9FBEF; color: #128C4A; }
.drc-pill-debt { background: #FEF3E2; color: #8a5307; }

.drc-cust-search { position: relative; margin-bottom: 8px; }

/* ─── MONEY — full stack ─── */
.drc-cust-money {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: var(--tile, #20241f);
    border-radius: 8px;
    margin-bottom: 10px;
    width: 100%;
}
.drc-money-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
}
.drc-money-lbl {
    font-size: 10px; text-transform: uppercase;
    color: var(--muted, #8b958b); font-weight: 700;
    letter-spacing: .03em; flex: 0 0 auto;
    white-space: nowrap;
}
.drc-money-val {
    font-weight: 800; color: #26d367; font-size: 13px;
    white-space: nowrap;
}
.drc-num {
    max-width: 130px;
    text-align: right;
    flex: 0 0 auto;
}
.drc-deni {
    font-size: 11px; font-weight: 700;
    text-align: right; padding-top: 4px;
    border-top: 1px dashed var(--line, #ffffff10);
    color: #D97706;
}
.drc-deni.is-ok { color: #26d367; }

/* ═══════════════════════════════════════════════════════
   ITEMS — FULL STACK
   ═══════════════════════════════════════════════════════ */
.drc-items {
    border-top: 1px dashed var(--line, #ffffff10);
    padding-top: 8px; margin-top: 4px;
}
.drc-item {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--line, #ffffff10);
    width: 100%;
}
.drc-item:last-child { border-bottom: none; }

/* ROW 1: Jina — full width */
.drc-it-name {
    display: block;
    width: 100%;
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #eef3ee);
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
    margin-bottom: 8px;
    padding: 0;
}

/* ROW 2: Qty × Price | Total */
.drc-it-row2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-bottom: 6px;
    flex-wrap: nowrap;
}
.drc-it-qtyprice {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}
.drc-qty {
    width: 55px;
    padding: 7px 8px;
    text-align: center;
    font-size: 13px;
    flex: 0 0 auto;
}
.drc-x {
    color: var(--muted, #8b958b);
    font-size: 12px;
    flex: 0 0 auto;
}
.drc-price-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
}
.drc-price {
    width: 100px;
    padding: 7px 8px;
    text-align: right;
    font-size: 13px;
}
.drc-it-total {
    font-weight: 800;
    font-size: 14px;
    color: #26d367;
    white-space: nowrap;
    flex: 0 0 auto;
    margin-left: auto;
}

/* ROW 3: Chips (W/R) */
.drc-chips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.drc-chip {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #E4F3EE;
    color: #0A4437;
    cursor: pointer;
    border: 1px solid #cfe7de;
    font-weight: 700;
    white-space: nowrap;
}
.drc-chip:active { background: #d3ece3; }

/* ROW 4: Match badge */
.drc-it-badge-wrap {
    display: block;
    width: 100%;
    position: relative;
    margin-top: 4px;
}
.drc-badge {
    font-size: 11px;
    padding: 5px 11px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.drc-badge-ok  { background: #E9FBEF; color: #128C4A; }
.drc-badge-ai  { background: #FEF3E2; color: #8a5307; border: 1px dashed #f3d3a0; }
.drc-badge-bad { background: #FDEAEA; color: #DC2626; }
.drc-badge:active { filter: brightness(0.95); }

/* ═══════════════════════════════════════════════════════
   INPUTS
   ═══════════════════════════════════════════════════════ */
.drc-input {
    padding: 7px 9px;
    border: 1px solid var(--line, #ffffff10);
    border-radius: 7px;
    font-size: 13px;
    width: 100%;
    font-family: inherit;
    background: var(--card, #1d211d);
    color: var(--text, #eef3ee);
    min-width: 0;
}
.drc-input:focus { outline: none; border-color: #26d367; }

/* ═══════════════════════════════════════════════════════
   AUTOCOMPLETE
   ═══════════════════════════════════════════════════════ */
.drc-autocomplete {
    position: absolute;
    z-index: 100;
    background: var(--card, #1d211d);
    border: 1px solid var(--line, #ffffff10);
    border-radius: 8px;
    box-shadow: 0 10px 30px -8px rgba(0,0,0,.5);
    max-height: 220px;
    overflow-y: auto;
    width: min(300px, 90%);
    margin-top: 4px;
    top: 100%;
    left: 0;
}
.drc-ac-item {
    padding: 9px 12px;
    cursor: pointer;
    font-size: 12.5px;
    border-bottom: 1px solid var(--line, #ffffff10);
    word-break: break-word;
}
.drc-ac-item:hover { background: var(--tile, #20241f); }
.drc-ac-item:last-child { border-bottom: none; }
.drc-ac-search {
    padding: 6px;
    border-bottom: 1px solid var(--line, #ffffff10);
}
.drc-ac-search input {
    width: 100%;
    font-size: 12.5px;
    padding: 6px 8px;
}
.drc-ac-loading, .drc-ac-empty {
    padding: 10px 12px;
    color: var(--muted, #8b958b);
    font-size: 12px;
}
.drc-muted { color: var(--muted, #8b958b); font-size: 11px; }

/* ═══════════════════════════════════════════════════════
   EXPENSES
   ═══════════════════════════════════════════════════════ */
.drc-expenses {
    border: 1px solid var(--line, #ffffff10);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 10px;
}
.drc-expense-row {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 4px 0;
    flex-wrap: wrap;
}
.drc-expense-row .drc-exp-desc { flex: 2 1 120px; min-width: 0; }
.drc-expense-row .drc-exp-amt  { flex: 0 0 90px; }
.drc-expense-row .drc-btn { flex: 0 0 auto; padding: 6px 8px; }

/* ═══════════════════════════════════════════════════════
   ACTIONS
   ═══════════════════════════════════════════════════════ */
.drc-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line, #ffffff10);
    flex-wrap: wrap;
}
.drc-btn {
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    white-space: nowrap;
}
.drc-btn-ghost {
    background: transparent;
    border-color: var(--line, #ffffff10);
    color: var(--muted, #8b958b);
}
.drc-btn-ghost:active { border-color: var(--text, #eef3ee); color: var(--text, #eef3ee); }
.drc-btn-primary { background: #128C4A; color: #fff; }
.drc-btn-primary:active { background: #0E5C4A; }

.drc-done {
    padding: 20px;
    text-align: center;
    font-weight: 700;
    color: #26d367;
}
.drc-done i { font-size: 20px; margin-right: 8px; }