/* ═══════════════════════════════════════════════════════════════
   Delivery Receipts — Phiếu Giao Hàng CSS
   ═══════════════════════════════════════════════════════════════ */

/* ── Page Header ── */
.dv-page-title {
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dv-page-subtitle {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
    display: block;
    margin-bottom: 12px;
}

/* ── Filter Bar ── */
.dv-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 12px;
}

.dv-quick-btn {
    text-transform: none;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 8px;
    min-width: auto;
    padding: 4px 10px;
}

/* ── Table ── */
.dv-table-container {
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}

.dv-list-scroll {
    max-height: calc(100vh - 260px);
    overflow-y: auto;
    overflow-x: auto;
}

.dv-detail-scroll {
    max-height: calc(100vh - 260px);
    overflow-y: auto;
    overflow-x: hidden;
}

.dv-table {
    width: 100%;
    border-collapse: separate; /* Required for sticky borders */
    border-spacing: 0;
    font-size: 0.82rem;
}

.dv-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #151e2b; /* Solid background so scrolling rows are hidden */
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.6);
    padding: 8px 10px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.08); /* Replaces border-bottom in collapse */
}

.dv-table td {
    padding: 7px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}

.dv-table tr:hover {
    background: rgba(79, 195, 247, 0.06);
}

.dv-table tr.dv-row-selected {
    background: rgba(79, 195, 247, 0.12);
    border-left: 3px solid #4fc3f7;
}

.dv-table tr.dv-row-clickable {
    cursor: pointer;
    transition: background 0.15s;
}

/* ── Status Badges ── */
.dv-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.dv-status-pending    { background: rgba(120,144,156,0.2); color: #b0bec5; }
.dv-status-verified   { background: rgba(255,152,0,0.15); color: #ffb74d; }
.dv-status-confirmed  { background: rgba(76,175,80,0.15); color: #81c784; }
.dv-status-rejected   { background: rgba(244,67,54,0.15); color: #e57373; }

/* ── Detail Panel ── */
.dv-detail-panel {
    padding: 16px;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    border: 1px solid rgba(79, 195, 247, 0.15);
    animation: dv-slideDown 0.3s ease;
}

@keyframes dv-slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dv-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.dv-detail-title {
    font-size: 1rem;
    font-weight: 600;
    color: #4fc3f7;
}

/* ── Compare Table (OCR vs POS) ── */
.dv-compare-table th {
    background: rgba(79, 195, 247, 0.08);
}

.dv-compare-table .dv-col-ocr {
    background: rgba(255, 152, 0, 0.06);
}

.dv-compare-table .dv-col-final {
    background: rgba(76, 175, 80, 0.06);
}

.dv-row-discrepancy {
    background: rgba(255, 152, 0, 0.08) !important;
    border-left: 3px solid #ff9800;
}

.dv-row-discrepancy-severe {
    background: rgba(244, 67, 54, 0.08) !important;
    border-left: 3px solid #f44336;
}

.dv-row-match {
    border-left: 3px solid transparent;
}

.dv-disc-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
}

.dv-disc-plus  { background: rgba(244,67,54,0.15); color: #ef5350; }
.dv-disc-minus { background: rgba(255,152,0,0.15); color: #ffa726; }
.dv-disc-ok    { background: rgba(76,175,80,0.12); color: #66bb6a; }

/* ── Upload Zone ── */
.dv-upload-zone {
    border: 2px dashed rgba(79, 195, 247, 0.3);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    background: rgba(79, 195, 247, 0.03);
}

.dv-upload-zone:hover {
    border-color: #4fc3f7;
    background: rgba(79, 195, 247, 0.08);
}

.dv-upload-icon {
    font-size: 40px;
    color: #4fc3f7;
    margin-bottom: 8px;
}

/* ── Stats Cards ── */
.dv-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.dv-stat-card {
    flex: 1;
    min-width: 120px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    text-align: center;
}

.dv-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
}

.dv-stat-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Inline Edit ── */
.dv-inline-input {
    width: 80px;
    text-align: right;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: inherit;
    padding: 3px 6px;
    font-size: 0.82rem;
}

.dv-inline-input:focus {
    outline: none;
    border-color: #4fc3f7;
    box-shadow: 0 0 0 2px rgba(79,195,247,0.2);
}

/* ── Text Helpers ── */
.dv-text-right  { text-align: right; }
.dv-text-center { text-align: center; }
.dv-text-mono   { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; }
.dv-text-muted  { color: rgba(255,255,255,0.35); }
.dv-text-warn   { color: #ffa726; }
.dv-text-danger { color: #ef5350; }
.dv-text-success{ color: #66bb6a; }
.dv-text-info   { color: #4fc3f7; }
.dv-font-bold   { font-weight: 600; }
.dv-nowrap      { white-space: nowrap; }

/* ── Action buttons ── */
.dv-action-bar {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── Image Preview ── */
.dv-image-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    object-fit: contain;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .dv-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .dv-stats {
        flex-direction: column;
    }
}

/* ── In-App Fullscreen ── */
.dv-inapp-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    background-color: #0f172a;
    padding: 16px;
    overflow-y: auto;
}
