/* تقرير المصروفات — واجهة احترافية */

.exp-report {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.exp-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-subtle, #e2e8f0);
    background: #fff;
}

.exp-filters__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}

.exp-filters select,
.exp-filters input[type="search"] {
    min-height: 36px;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.82rem;
    background: #f8fafc;
    min-width: min(100%, 140px);
}

.exp-filters input[type="search"] {
    flex: 1;
    min-width: min(100%, 200px);
}

.exp-filters__clear {
    font-size: 0.78rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    color: var(--text-muted, #64748b);
}

.exp-filters__clear:hover {
    background: #f1f5f9;
}

.exp-kpi--total::before { background: linear-gradient(180deg, #f59e0b, #d97706); }
.exp-kpi--count::before { background: linear-gradient(180deg, #3b82f6, #2563eb); }
.exp-kpi--avg::before { background: linear-gradient(180deg, #8b5cf6, #7c3aed); }
.exp-kpi--max::before { background: linear-gradient(180deg, #ef4444, #dc2626); }
.exp-kpi--top::before { background: linear-gradient(180deg, #0d9488, #0f766e); }
.exp-kpi--cats::before { background: linear-gradient(180deg, #64748b, #475569); }

.exp-kpi--highlight {
    background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
}

/* Category breakdown */
.exp-cat-panel {
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-subtle, #e2e8f0);
    background: #fff;
}

.exp-cat-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.exp-cat-row {
    display: grid;
    grid-template-columns: minmax(100px, 140px) 1fr minmax(72px, 96px) minmax(48px, 56px);
    gap: 0.6rem;
    align-items: center;
}

.exp-cat-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.25;
}

.exp-cat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.exp-cat-bar-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.exp-cat-track {
    flex: 1;
    height: 12px;
    border-radius: 999px;
    background: #f1f5f9;
    overflow: hidden;
    min-width: 0;
}

.exp-cat-fill {
    height: 100%;
    border-radius: 999px;
    min-width: 2px;
    transition: width 0.35s ease;
}

.exp-cat-amount {
    font-size: 0.78rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.exp-cat-pct {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted, #64748b);
}

/* Payment methods grid */
.exp-pay-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
}

.exp-pay-card {
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(145deg, #fff 0%, #f8fafc 100%);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.exp-pay-card__method {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}

.exp-pay-card__value {
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.exp-pay-card__meta {
    font-size: 0.68rem;
    color: #94a3b8;
}

/* Daily trend */
.exp-trend {
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-subtle, #e2e8f0);
    background: #fff;
}

.exp-trend-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 4px;
    min-height: 110px;
    padding-top: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.exp-trend-item {
    flex: 1;
    min-width: 28px;
    max-width: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.exp-trend-bar {
    width: 100%;
    max-width: 32px;
    min-height: 4px;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(to top, #d97706, #f59e0b);
    transition: height 0.35s ease;
}

.exp-trend-label {
    font-size: 0.62rem;
    color: var(--text-muted, #94a3b8);
    text-align: center;
    line-height: 1.2;
}

.exp-trend-value {
    font-size: 0.62rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted, #64748b);
}

.exp-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.exp-category-badge__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.exp-dual-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.exp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
    .exp-cat-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .exp-cat-pct {
        text-align: right;
    }

    .exp-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .exp-filters select,
    .exp-filters input[type="search"] {
        width: 100%;
    }
}
