.reports-page {
    margin-top: -14px;
    color: #1f2f46;
}

.reports-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 0 8px;
    border-bottom: 1px solid #dfe4ec;
}

.reports-tab {
    height: 36px;
    padding: 0;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #1f2f46;
    font-size: 13px;
    cursor: pointer;
}

.reports-tab.active {
    color: #1f6eea;
    border-bottom-color: #1f6eea;
}

.reports-tab-menu {
    position: relative;
}

.reports-tab-menu .reports-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.reports-tab-caret {
    color: #60708a;
    font-size: 11px;
}

.reports-tab-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 45;
    min-width: 190px;
    padding: 6px 0;
    border: 1px solid #dfe4ec;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.reports-tab-dropdown button {
    display: block;
    width: 100%;
    min-height: 30px;
    padding: 0 12px;
    border: none;
    background: transparent;
    color: #28364c;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

.reports-tab-dropdown button:hover,
.reports-tab-dropdown button.active {
    background: #edf4ff;
    color: #1f6eea;
}

.reports-tabs-legacy {
    display: none;
}

.reports-activity {
    padding: 10px 8px 24px;
}

.reports-report-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.reports-report-head h2 {
    margin: 0 0 4px;
    color: #1f2f46;
    font-size: 18px;
    line-height: 1.25;
}

.reports-caption {
    margin: 0 0 12px;
    color: #1f2f46;
    font-size: 13px;
}

.reports-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.reports-filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #c9d2df;
    border-radius: 4px;
    background: #fff;
    color: #1f2f46;
    font-size: 12px;
}

.reports-period-filter {
    position: relative;
}

.reports-event-filter {
    position: relative;
}

.reports-period-trigger {
    min-width: 180px;
    cursor: pointer;
}

.reports-event-trigger {
    min-width: 128px;
    cursor: pointer;
}

.reports-period-trigger svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    color: #1f2f46;
}

.reports-period-trigger.active {
    border-color: #1f6eea;
    box-shadow: 0 0 0 1px rgba(31, 110, 234, 0.16);
}

.reports-event-trigger.active {
    border-color: #1f6eea;
    box-shadow: 0 0 0 1px rgba(31, 110, 234, 0.16);
}

.reports-event-trigger-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 9px;
    line-height: 1;
}

.reports-filter-caret {
    margin-left: auto;
    color: #60708a;
}

.reports-period-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 50;
    width: 202px;
    padding: 7px 0;
    border: 1px solid #dfe4ec;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.reports-period-option {
    display: block;
    width: 100%;
    height: 26px;
    padding: 0 11px;
    border: none;
    background: transparent;
    color: #28364c;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

.reports-period-option:hover,
.reports-period-option.active {
    background: #dbe8f8;
}

.reports-period-divider {
    height: 1px;
    margin: 6px 0;
    background: #edf0f4;
}

.reports-custom-period {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
}

.reports-custom-period input {
    height: 30px;
    padding: 0 7px;
    border: 1px solid #c9d2df;
    border-radius: 4px;
    background: #fff;
    color: #1f2f46;
    font: inherit;
    font-size: 12px;
}

.reports-event-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    width: 250px;
    max-height: 352px;
    border: 1px solid #dfe4ec;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.reports-event-search {
    position: relative;
    padding: 10px 10px 7px;
}

.reports-event-search svg {
    position: absolute;
    top: 18px;
    left: 20px;
    width: 14px;
    height: 14px;
    color: #8a97a8;
    pointer-events: none;
}

.reports-event-search input {
    width: 100%;
    height: 30px;
    padding: 0 10px 0 30px;
    border: 1px solid #c9d2df;
    border-radius: 4px;
    outline: none;
    color: #1f2f46;
    font-size: 12px;
}

.reports-event-search input:focus {
    border-color: #1f6eea;
    box-shadow: 0 0 0 1px rgba(31, 110, 234, 0.12);
}

.reports-event-tree {
    flex: 1;
    overflow: auto;
    padding: 0 0 6px;
}

.reports-event-group-head {
    display: flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
}

.reports-event-group-head:hover,
.reports-event-item:hover {
    background: #edf4ff;
}

.reports-event-expand {
    width: 18px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    color: #1f2f46;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.reports-event-check {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: #28364c;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
}

.reports-event-check input {
    width: 14px;
    height: 14px;
    margin: 0;
    flex: 0 0 auto;
    accent-color: #1f6eea;
}

.reports-event-check span {
    min-width: 0;
}

.reports-event-items {
    display: flex;
    flex-direction: column;
}

.reports-event-item {
    min-height: 24px;
    padding: 0 10px 0 42px;
}

.reports-event-empty {
    padding: 14px 12px;
    color: #60708a;
    font-size: 12px;
    text-align: center;
}

.reports-event-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px 10px;
    border-top: 1px solid #edf0f4;
}

.reports-event-actions button {
    border: none;
    padding: 0;
    background: transparent;
    color: #1f6eea;
    font-size: 12px;
    cursor: pointer;
}

.reports-filter span {
    white-space: nowrap;
}

.reports-filter select {
    max-width: 180px;
    border: none;
    outline: none;
    background: transparent;
    color: #1f2f46;
    font: inherit;
}

.reports-apply-btn {
    height: 30px;
    padding: 0 14px;
    border: none;
    border-radius: 4px;
    background: #1f6eea;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.reports-status {
    min-height: 0;
    color: #60708a;
    font-size: 12px;
}

.reports-ad-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 12px;
}

.reports-ad-table th {
    height: 34px;
    padding: 0 12px;
    background: #e9eaed;
    color: #1f2f46;
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    border-bottom: 1px solid #d7dce5;
}

.reports-ad-table td {
    height: 42px;
    padding: 0 12px;
    border-bottom: 1px solid #edf0f4;
    color: #1f2f46;
    font-size: 13px;
    vertical-align: middle;
}

.reports-ad-table tfoot td {
    border-top: 2px solid #d7dce5;
    border-bottom: none;
    background: #f7f8fa;
}

.reports-ad-num {
    text-align: right;
}

.reports-ad-expense {
    color: #d93025;
    font-weight: 500;
}

.reports-table-wrap {
    overflow: auto;
}

.reports-table {
    width: 100%;
    min-width: 880px;
    border-collapse: collapse;
    table-layout: fixed;
}

.reports-table th {
    height: 34px;
    padding: 0 8px;
    border-right: 1px solid #d7dce5;
    background: #e9eaed;
    color: #1f2f46;
    font-size: 12px;
    font-weight: 400;
    text-align: left;
}

.reports-table th:last-child {
    border-right: none;
}

.reports-table td {
    height: 42px;
    padding: 0 8px;
    border-bottom: 1px solid #edf0f4;
    color: #1f2f46;
    font-size: 12px;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reports-table th:nth-child(1),
.reports-table td:nth-child(1) {
    width: 170px;
}

.reports-table th:nth-child(2),
.reports-table td:nth-child(2),
.reports-table th:nth-child(3),
.reports-table td:nth-child(3) {
    width: 130px;
}

.reports-table th:nth-child(4),
.reports-table td:nth-child(4) {
    width: 120px;
}

.reports-table th:nth-child(5),
.reports-table td:nth-child(5) {
    width: 150px;
}

.reports-link {
    border: none;
    padding: 0;
    background: transparent;
    color: #1f6eea;
    font: inherit;
    cursor: pointer;
}

.reports-link:hover {
    text-decoration: underline;
}

.reports-event-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    margin-right: 4px;
    border-radius: 50%;
    background: #12a150;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.reports-empty {
    text-align: center;
    color: #60708a;
}

.reports-total {
    padding: 14px 6px 0;
    color: #1f2f46;
    font-size: 13px;
}

.reports-panel-empty {
    padding: 26px 8px;
}

.reports-cashflow-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 8px;
    margin: 6px 0 12px;
}

.reports-cashflow-metric {
    min-height: 66px;
    padding: 10px 12px;
    border: 1px solid #dfe4ec;
    border-radius: 6px;
    background: #fff;
}

.reports-cashflow-metric span {
    display: block;
    margin-bottom: 7px;
    color: #60708a;
    font-size: 12px;
}

.reports-cashflow-metric strong {
    color: #1f2f46;
    font-size: 18px;
    line-height: 1.2;
}

.reports-money {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.reports-money.income,
.reports-cashflow-metric strong.income {
    color: #128346;
}

.reports-money.expense,
.reports-cashflow-metric strong.expense {
    color: #c73737;
}

.reports-cashflow-table th:nth-child(1),
.reports-cashflow-table td:nth-child(1) {
    width: 260px;
}

.reports-cashflow-table th:nth-child(2),
.reports-cashflow-table td:nth-child(2),
.reports-cashflow-table th:nth-child(3),
.reports-cashflow-table td:nth-child(3) {
    width: 100px;
}

.reports-subtitle {
    margin: 18px 0 8px;
    color: #1f2f46;
    font-size: 14px;
}

.reports-cashflow-operations-table {
    min-width: 980px;
}

@media (max-width: 760px) {
    .reports-page {
        margin-top: 0;
    }

    .reports-tabs,
    .reports-activity {
        padding-left: 14px;
        padding-right: 14px;
    }

    .reports-filter {
        width: 100%;
        justify-content: space-between;
    }

    .reports-period-filter,
    .reports-event-filter,
    .reports-period-trigger,
    .reports-event-trigger,
    .reports-custom-period,
    .reports-custom-period input {
        width: 100%;
    }

    .reports-custom-period {
        height: auto;
        align-items: stretch;
        flex-direction: column;
    }

    .reports-period-menu {
        width: 100%;
    }

    .reports-event-menu {
        left: 0;
        right: auto;
        width: 100%;
    }

    .reports-filter select {
        max-width: min(220px, 55vw);
    }

    .reports-report-head {
        align-items: stretch;
        flex-direction: column;
    }

    .reports-cashflow-summary {
        grid-template-columns: 1fr;
    }
}

/* ── Отчёт по статусам ─────────────────────────────────────── */
.reports-status-wrap {
    overflow-x: auto;
    margin-top: 12px;
}

.reports-status-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.reports-status-table th {
    height: 34px;
    padding: 0 12px;
    background: #e9eaed;
    color: #1f2f46;
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    border-bottom: 1px solid #d7dce5;
    white-space: nowrap;
}

.reports-status-table td {
    height: 40px;
    padding: 0 12px;
    border-bottom: 1px solid #edf0f4;
    color: #1f2f46;
    font-size: 13px;
    vertical-align: middle;
    white-space: nowrap;
}

.reports-status-table tbody tr:hover td {
    background: #f5f7fb;
}

.reports-status-table tfoot td {
    border-top: 2px solid #d7dce5;
    border-bottom: none;
    background: #f7f8fa;
}

.reports-status-num {
    text-align: right;
    width: 80px;
}

.reports-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 7px;
    vertical-align: middle;
    flex-shrink: 0;
}

.reports-status-stage {
    color: #667085;
    font-size: 12px;
}

.reports-status-bar-th {
    width: 160px;
    min-width: 120px;
}

.reports-status-bar-cell {
    padding: 0 12px;
    width: 160px;
    min-width: 120px;
}

.reports-status-bar-track {
    height: 8px;
    border-radius: 4px;
    background: #edf0f4;
    overflow: hidden;
}

.reports-status-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    min-width: 2px;
}

