/* Отчеты — графики потребления */

.report-charts {
    --rc-ink: #0f3e56;
    --rc-muted: #5a6b75;
    --rc-line: rgba(15, 62, 86, 0.12);
    --rc-cur: #1f8a70;
    --rc-prev: #e07a3d;
    --rc-bg: linear-gradient(165deg, #f7fafb 0%, #eef3f6 55%, #e8f0f4 100%);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    text-align: left;
    margin: 0 0 0.5rem;
    padding: 1rem 1rem 1.15rem;
    border: 1px solid var(--rc-line);
    border-radius: 12px;
    background: var(--rc-bg);
    overflow: visible;
}

.report-charts *,
.report-charts *::before,
.report-charts *::after {
    box-sizing: border-box;
}

.report-charts__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-bottom: 0.85rem;
}

.report-charts__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--rc-ink);
}

.report-charts__period-note {
    font-size: 0.85rem;
    color: var(--rc-muted);
}

.report-charts__period {
    margin-bottom: 0.75rem;
}

.report-charts__period-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 0.85rem;
}

.report-charts__label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--rc-muted);
}

.report-charts__period-fields > div {
    flex: 1 1 140px;
    min-width: 0;
}

.report-charts__period-fields .form-control {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.report-charts__period-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    flex: 1 1 auto;
}

.report-charts__btn {
    min-height: 38px;
}

.report-charts__period-meta {
    margin-top: 0.55rem;
    font-size: 0.88rem;
    color: var(--rc-ink);
    line-height: 1.45;
    word-break: break-word;
}

.report-charts__period-meta strong {
    font-weight: 700;
}

.report-charts__period-meta .rc-cur {
    color: var(--rc-cur);
}

.report-charts__period-meta .rc-prev {
    color: var(--rc-prev);
}

.report-charts__status {
    min-height: 1.25rem;
    margin-bottom: 0.55rem;
    font-size: 0.9rem;
    color: var(--rc-muted);
}

.report-charts__status.is-error {
    color: #b42318;
}

.report-charts__grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
}

.report-charts__card {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 0.85rem 0.9rem 1rem;
    border: 1px solid var(--rc-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 62, 86, 0.05);
}

.report-charts__card-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--rc-ink);
    margin-bottom: 0.15rem;
}

.report-charts__card-sub {
    font-size: 0.8rem;
    color: var(--rc-muted);
    margin-bottom: 0.55rem;
    word-break: break-word;
}

.report-charts__canvas-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.report-charts__canvas-wrap--line {
    height: 300px;
}

.report-charts__canvas-wrap--bars {
    height: 340px;
}

.report-charts__canvas-wrap--donut {
    height: 320px;
    max-width: 520px;
    margin: 0 auto;
}

.report-charts__canvas-wrap canvas {
    display: block;
    max-width: 100%;
}

.report-charts__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 1rem;
    color: var(--rc-muted);
    font-size: 0.95rem;
    text-align: center;
    background: #f7fafb;
    border-radius: 8px;
    border: 1px dashed var(--rc-line);
}

#reports .modal-body {
    min-height: 0 !important;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767px) {
    .report-charts {
        padding: 0.75rem;
    }

    .report-charts__canvas-wrap--line,
    .report-charts__canvas-wrap--bars,
    .report-charts__canvas-wrap--donut {
        height: 260px;
    }

    .report-charts__period-actions {
        width: 100%;
    }

    .report-charts__btn {
        flex: 1 1 auto;
    }

    #reports .modal-body {
        max-height: calc(100vh - 90px);
    }
}

@media (min-width: 992px) {
    .report-charts__canvas-wrap--line {
        height: 340px;
    }

    .report-charts__canvas-wrap--bars {
        height: 360px;
    }

    .report-charts__canvas-wrap--donut {
        height: 340px;
    }
}
