/* ═══════════════════════════════════════════════════════
   Expense Report — compact smart report (exr-*)
   ═══════════════════════════════════════════════════════ */

.exr-wrap {
    --exr-ink: #0f172a;
    --exr-muted: #64748b;
    --exr-line: #e2e8f0;
    --exr-bg: #eef2f7;
    --exr-navy: #1a3a5c;
    --exr-blue: #1565c0;
    --exr-accent: #f97316;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 48px);
    background: var(--exr-bg);
    font-size: 11px;
    color: var(--exr-ink);
}

.exr-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #0f2740 0%, var(--exr-navy) 50%, #24507a 100%);
    color: #fff;
    padding: 4px 10px;
    box-shadow: 0 2px 8px rgba(15, 39, 64, .25);
}
.exr-topbar-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.exr-topbar-icon {
    width: 22px; height: 22px; border-radius: 5px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    font-size: 11px;
}
.exr-topbar-title { display: block; font-size: 12px; font-weight: 800; line-height: 1.1; }
.exr-topbar-sub { display: block; font-size: 8px; opacity: .72; margin-top: 0; }
.exr-top-actions { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.exr-btn {
    display: inline-flex; align-items: center; gap: 3px;
    height: 24px; padding: 0 8px; border-radius: 4px;
    font-size: 9px; font-weight: 700; cursor: pointer;
    text-decoration: none; border: 1px solid transparent;
}
.exr-btn--ghost {
    background: rgba(255,255,255,.1); color: #fff;
    border-color: rgba(255,255,255,.28);
}
.exr-btn--ghost:hover { background: rgba(255,255,255,.18); color: #fff; }
.exr-btn--accent {
    background: var(--exr-accent); color: #fff;
    box-shadow: 0 1px 4px rgba(249, 115, 22, .3);
}
.exr-btn--accent:hover { background: #ea580c; color: #fff; }
.exr-btn--accent:disabled { opacity: .55; cursor: default; }
.exr-btn--excel { background: #ecfdf5; color: #15803d; border-color: #a7f3d0; }
.exr-btn--csv { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.exr-btn--print { background: #f8fafc; color: #475569; border-color: #cbd5e1; }
.exr-btn--sm { height: 22px; padding: 0 6px; }

.exr-body {
    flex: 1;
    padding: 4px 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

.exr-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
}
.exr-stat {
    display: flex; align-items: center; gap: 5px;
    background: #fff; border: 1px solid var(--exr-line);
    border-radius: 5px; padding: 3px 7px;
    min-height: 28px;
    box-shadow: none;
}
.exr-stat-ico {
    width: 16px; height: 16px; border-radius: 4px;
    display: grid; place-items: center; font-size: 10px; flex-shrink: 0;
}
.exr-stat-ico--blue { background: #e3f2fd; color: #1565c0; }
.exr-stat-ico--green { background: #ecfdf5; color: #15803d; }
.exr-stat-ico--amber { background: #fffbeb; color: #b45309; }
.exr-stat-ico--slate { background: #f1f5f9; color: #475569; }
.exr-stat-label {
    font-size: 8px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .03em; color: var(--exr-muted);
    margin-right: auto;
}
.exr-stat-val {
    font-size: 11px; font-weight: 800;
    font-variant-numeric: tabular-nums; line-height: 1;
    white-space: nowrap;
}

.exr-filter {
    background: #fff;
    border: 1px solid var(--exr-line);
    border-radius: 5px;
    padding: 4px 6px;
    box-shadow: none;
}
.exr-filter-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.exr-sep { color: var(--exr-muted); font-weight: 700; font-size: 10px; }
.exr-input {
    height: 24px; padding: 0 6px;
    border: 1px solid #cbd5e1; border-radius: 4px;
    font-size: 10px; color: var(--exr-ink); background: #fff;
    min-width: 0;
}
.exr-input--date { width: 118px; }
.exr-input--sm { width: 110px; max-width: 140px; }
.exr-input:focus {
    outline: none; border-color: #90caf9;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, .1);
}
.exr-presets {
    display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap;
}
.exr-preset {
    height: 20px; padding: 0 6px; border-radius: 999px;
    border: 1px solid var(--exr-line); background: #f8fafc;
    color: #475569; font-size: 8px; font-weight: 700; cursor: pointer;
}
.exr-preset:hover { background: #e3f2fd; border-color: #90caf9; color: var(--exr-navy); }
.exr-preset--on {
    background: var(--exr-navy); border-color: var(--exr-navy); color: #fff;
}
.exr-filter-actions {
    display: inline-flex; align-items: center; gap: 3px; margin-left: auto;
}

.exr-breakdown {
    display: flex; flex-wrap: wrap; gap: 3px; align-items: center;
}
.exr-chip {
    display: inline-flex; align-items: center; gap: 4px;
    height: 18px; padding: 0 6px; border-radius: 999px;
    background: #fff; border: 1px solid var(--exr-line);
    font-size: 8px; font-weight: 700; color: #334155;
}
.exr-chip strong { color: var(--exr-navy); font-variant-numeric: tabular-nums; }
.exr-chip-label { color: var(--exr-muted); font-weight: 600; margin-right: 2px; font-size: 8px; }

.exr-card {
    background: #fff;
    border: 1px solid var(--exr-line);
    border-radius: 7px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 39, 64, .04);
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.exr-card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 6px; padding: 3px 7px;
    border-bottom: 1px solid var(--exr-line); background: #f8fafc;
}
.exr-card-title { font-size: 9px; font-weight: 800; color: var(--exr-navy); }
.exr-count {
    font-size: 8px; font-weight: 800; color: var(--exr-navy);
    background: #e3f2fd; border-radius: 999px; padding: 1px 6px;
}

.exr-table-wrap { overflow: auto; flex: 1 1 auto; }
.exr-table {
    width: 100%; border-collapse: collapse; font-size: 10px;
}
.exr-table thead {
    background: var(--exr-navy);
    position: sticky; top: 0; z-index: 1;
}
.exr-table th {
    padding: 3px 6px; font-size: 8px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
    color: #bbdefb; text-align: left; white-space: nowrap;
}
.exr-table td {
    padding: 2px 6px; border-bottom: 1px solid #f1f5f9;
    vertical-align: middle; height: 24px;
}
.exr-table tbody tr:hover { background: #f0f7ff; }
.exr-td-no { color: var(--exr-muted); width: 28px; }
.exr-td-date { white-space: nowrap; color: var(--exr-muted); }
.exr-td-vchr { font-weight: 800; color: var(--exr-navy); white-space: nowrap; }
.exr-td-desc { max-width: 220px; }
.exr-desc-main {
    font-weight: 600; color: #334155;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.exr-desc-ref { display: block; font-size: 8px; color: #94a3b8; }
.exr-td-amt {
    font-weight: 800; text-align: right; white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.exr-th-amt { text-align: right; }

.exr-badge {
    display: inline-flex; align-items: center;
    padding: 1px 6px; border-radius: 999px;
    font-size: 8px; font-weight: 800; text-transform: uppercase;
}
.exr-badge--type { background: #eef2ff; color: #3730a3; }
.exr-badge--pay { background: #f1f5f9; color: #475569; }
.exr-badge--approved { background: #dcfce7; color: #166534; }
.exr-badge--draft { background: #fef3c7; color: #92400e; }
.exr-badge--rejected { background: #fee2e2; color: #991b1b; }
.exr-badge--other { background: #e2e8f0; color: #475569; }

.exr-loading, .exr-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 4px;
    padding: 28px 12px; color: var(--exr-muted); text-align: center;
}
.exr-spinner {
    width: 18px; height: 18px; border: 2px solid #cbd5e1;
    border-top-color: var(--exr-navy); border-radius: 50%;
    animation: exrspin .7s linear infinite;
}
@keyframes exrspin { to { transform: rotate(360deg); } }
.exr-empty-title { font-size: 12px; font-weight: 800; color: var(--exr-ink); }
.exr-empty-sub { font-size: 10px; max-width: 320px; }
.exr-empty-icon { font-size: 22px; color: #cbd5e1; }

.exr-foot {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 9px; background: #f0f7ff; border-top: 1px solid var(--exr-line);
    font-weight: 700;
}
.exr-foot-val { font-size: 13px; font-weight: 800; color: var(--exr-navy); font-variant-numeric: tabular-nums; }

.exr-pagination {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; flex-wrap: wrap;
    padding: 5px 9px;
    border-top: 1px solid var(--exr-line);
    background: #f8fafc;
}
.exr-page-info {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 9px; font-weight: 700; color: var(--exr-muted);
}
.exr-page-size {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 9px; font-weight: 700; color: var(--exr-muted);
}
.exr-page-size select {
    height: 22px; border: 1px solid var(--exr-line); border-radius: 4px;
    font-size: 10px; font-weight: 700; color: #334155; background: #fff; padding: 0 4px;
}
.exr-page-btns { display: inline-flex; gap: 2px; }
.exr-page-btn {
    min-width: 22px; height: 22px; padding: 0 5px;
    border: 1px solid var(--exr-line); background: #fff;
    border-radius: 4px; font-size: 10px; font-weight: 700;
    color: #475569; cursor: pointer;
}
.exr-page-btn:hover:not(:disabled) { background: #e3f2fd; border-color: #90caf9; color: var(--exr-navy); }
.exr-page-btn--active { background: var(--exr-navy); border-color: var(--exr-navy); color: #fff; }
.exr-page-btn:disabled { opacity: .4; cursor: default; }

@media (max-width: 900px) {
    .exr-stats { grid-template-columns: repeat(2, 1fr); }
    .exr-filter-actions { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
    .exr-stats { grid-template-columns: 1fr; }
}

@media print {
    .exr-topbar, .exr-filter, .exr-presets, .exr-filter-actions, .exr-pagination { display: none !important; }
    .exr-wrap { background: #fff; min-height: 0; }
    .exr-body { max-width: none; padding: 0; }
}
