/* Reports extras - filter bar, favourites, audience chips, enhanced preview, builder, archive */
.rx-top {
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rx-filterbar,
.rx-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 10px 14px;
}
.rx-filterbar label,
.rx-form label {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    color: var(--text-muted);
    gap: 3px;
}
.rx-filterbar input,
.rx-filterbar select,
.rx-form input,
.rx-form select,
.rx-toolbar input,
.rx-controls input[type='search'],
.rx-rule select,
.rx-rule input,
.rx-params input,
.rx-mailsel {
    padding: 7px 9px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
}
.rx-hint {
    font-size: 12px;
    color: var(--text-muted);
}
.rx-toolbar input[type='search'] {
    min-width: 220px;
    flex: 1 1 220px;
}
.rx-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}
.rx-chips button,
.rx-lang button {
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
}
.rx-chips button.on,
.rx-lang button.on {
    background: var(--primary-500, #6366f1);
    border-color: var(--primary-500, #6366f1);
    color: #fff;
}
.rx-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-inline-start: auto;
}
.rx-favs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rx-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
}
.rx-row > span {
    font-weight: 600;
    margin-inline-end: 4px;
}
.rx-chip {
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}
.rx-chip:hover {
    border-color: var(--primary-500, #6366f1);
}
.report-card {
    position: relative;
}
.rx-star {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
}
.rx-star.on {
    color: #f59e0b;
}
.rx-he {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-light);
    padding-top: 6px;
}
.rx-badge {
    font-size: 10px;
    background: #22c55e;
    color: #fff;
    border-radius: 6px;
    padding: 1px 6px;
    vertical-align: middle;
}
.rx-cacts {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
}
.rx-cacts button {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}
/* modal */
.rx-overlay {
    z-index: 10050;
}
.rx-modal {
    max-width: 1100px;
    width: 96vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}
.rx-modal.rx-wide {
    max-width: 1150px;
}
.rx-body {
    overflow-y: auto;
    max-height: 68vh;
}
.rx-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.rx-why {
    margin: 6px 0 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--bg-secondary, #f1f5f9);
    color: var(--text-secondary);
    font-size: 13px;
}
.rx-note {
    margin: 8px 0 14px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--bg-secondary, #f1f5f9);
    color: var(--text-secondary);
    font-size: 13px;
}
.rx-params,
.rx-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 8px 0;
}
.rx-controls input[type='search'] {
    flex: 1 1 200px;
}
.rx-cols {
    position: relative;
}
.rx-cols summary {
    cursor: pointer;
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}
.rx-colbox {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 8px 0;
    font-size: 13px;
}
.rx-cols .rx-colbox {
    position: absolute;
    z-index: 5;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px;
    width: 340px;
    max-height: 260px;
    overflow: auto;
    box-shadow: var(--shadow-md);
}
.rx-colbox label {
    display: flex;
    align-items: center;
    gap: 5px;
}
.rx-lang {
    display: inline-flex;
    gap: 4px;
}
.rx-count {
    font-size: 12px;
    color: var(--text-muted);
    margin-inline-start: auto;
}
.rx-filterline {
    font-size: 12px;
    color: var(--primary-500, #6366f1);
    min-height: 0;
    margin-bottom: 6px;
}
.rx-chartbox {
    margin: 10px 0 16px;
}
.rx-chartwrap {
    height: 280px;
    position: relative;
}
.rx-chartctl {
    font-size: 12px;
    margin-bottom: 4px;
}
.rx-table th.rx-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.rx-table th.asc::after {
    content: ' \25B2';
    font-size: 9px;
}
.rx-table th.desc::after {
    content: ' \25BC';
    font-size: 9px;
}
.rx-table td.num {
    text-align: right;
    white-space: nowrap;
}
.rx-table td.rx-flag {
    color: #dc2626;
    font-weight: 600;
}
.rx-sev-high {
    color: #dc2626;
    font-weight: 700;
}
.rx-sev-medium {
    color: #d97706;
    font-weight: 600;
}
.rx-sev-low {
    color: var(--text-muted);
}
.rx-empty {
    padding: 14px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}
.rx-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
}
.rx-left {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.rx-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin: 10px 0;
}
.rx-form .rx-full {
    flex: 1 1 100%;
}
.rx-form .rx-full input {
    width: 100%;
}
.rx-rules {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
}
.rx-rule {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.rx-paused {
    color: #d97706;
    font-weight: 600;
}
/* phone */
@media (max-width: 640px) {
    .rx-filterbar,
    .rx-toolbar {
        padding: 10px;
    }
    .rx-actions {
        margin-inline-start: 0;
    }
    .rx-modal {
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
    .rx-body {
        max-height: none;
        flex: 1 1 auto;
        min-height: 0;
    }
    .rx-footer {
        padding: 8px 10px;
    }
    .rx-footer .export-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    .rx-table,
    .rx-table thead,
    .rx-table tbody,
    .rx-table tr,
    .rx-table td {
        display: block;
    }
    .rx-table thead {
        display: none;
    }
    .rx-table tr {
        border: 1px solid var(--border-light);
        border-radius: 10px;
        margin-bottom: 10px;
        padding: 4px 8px;
    }
    .rx-table td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        border: 0;
        padding: 4px 0;
        text-align: right;
    }
    .rx-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        text-align: left;
    }
}
