/* File: css/reconciliation.css
   Quote Reconciliation dashboard — summary cards, status chips, match table. */

.config-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #664d03;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.summary-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #999;
    border-radius: 6px;
    padding: 12px 16px;
    cursor: pointer;
}
.summary-card .card-label { font-size: 0.8rem; color: #666; text-transform: uppercase; letter-spacing: 0.03em; }
.summary-card .card-count { font-size: 1.6rem; font-weight: 700; margin: 2px 0; }
.summary-card .card-amount { font-size: 0.9rem; color: #444; }
.summary-card.card-unbilled { border-left-color: #dc3545; }
.summary-card.card-partial { border-left-color: #fd7e14; }
.summary-card.card-probable { border-left-color: #ffc107; }
.summary-card.card-paid { border-left-color: #198754; }
.summary-card.card-invoiced { border-left-color: #0d6efd; }
.summary-card.card-closed { border-left-color: #6c757d; }

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.controls-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.controls-right input {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 240px;
}

.filter-group { display: flex; gap: 6px; flex-wrap: wrap; }
/* unified-styles.css sets button { color: white } globally — every white-
   background button here needs an explicit dark color or it renders blank. */
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 16px;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}
.filter-btn:hover { background: #f0f0f0; color: #333; transform: none; box-shadow: none; }
.filter-btn.active, .filter-btn.active:hover { background: #0d6efd; border-color: #0d6efd; color: #fff; }

.sync-state { font-size: 0.8rem; color: #777; margin-bottom: 8px; }

.recon-table { width: 100%; border-collapse: collapse; background: #fff; }
.recon-table th, .recon-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
    font-size: 0.9rem;
    vertical-align: top;
}
.recon-table th.num, .recon-table td.num { text-align: right; white-space: nowrap; }
.recon-table tr.quote-row:hover { background: #f8f9fa; }
.recon-table td.gap-bad { color: #dc3545; font-weight: 700; }
.recon-table td.gap-ok { color: #198754; }

.status-chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.chip-unbilled { background: #f8d7da; color: #842029; }
.chip-partial { background: #ffe5d0; color: #984c0c; }
.chip-probable_invoice { background: #fff3cd; color: #664d03; }
.chip-paid { background: #d1e7dd; color: #0f5132; }
.chip-invoiced { background: #cfe2ff; color: #084298; }
.chip-not_accepted { background: #e9ecef; color: #6c757d; }
.chip-resolved, .chip-ignored { background: #e2e3e5; color: #41464b; }
.chip-pending { background: #e9ecef; color: #6c757d; }

.detail-row td {
    background: #fbfbfd;
    font-size: 0.83rem;
    color: #555;
}
.detail-row .match-detail { margin-bottom: 4px; }
.detail-row .resolved-note { color: #0d6efd; }

.row-actions { display: flex; gap: 6px; }
.row-actions button, .link-btn {
    padding: 3px 8px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
}
.row-actions button:hover, .link-btn:hover {
    background: #f0f0f0;
    color: #333;
    transform: none;
    box-shadow: none;
}

/* Manual match panel */
.match-panel td {
    background: #f2f6ff;
    border-left: 3px solid #0d6efd;
    padding: 12px 14px;
}
.match-panel-head { margin-bottom: 8px; font-size: 0.9rem; }
.match-search {
    width: 100%;
    max-width: 560px;
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
}
.match-panel-body { display: flex; gap: 24px; flex-wrap: wrap; }
.cand-section { flex: 1 1 380px; min-width: 320px; }
.cand-title { font-weight: 700; font-size: 0.82rem; text-transform: uppercase; color: #555; margin-bottom: 6px; }
.cand-empty { color: #888; font-size: 0.85rem; padding: 4px 0; }
.cand-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #e4eaf5;
    font-size: 0.85rem;
    color: #444;
}
.cand-main { font-weight: 700; color: #222; }
.cand-matched {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    background: #cfe2ff;
    color: #084298;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.link-btn { flex-shrink: 0; }

.no-results { padding: 30px; text-align: center; color: #777; }
