.page-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modern-report-shell {
    display: grid;
    gap: 14px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.modern-report-shell > * {
    min-width: 0;
}

.container-card {
    background: #fff;
    border: 1px solid #c7d4eb;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 14px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}

.container-card:last-child {
    margin-bottom: 0;
}

.page-actions,
.table-toolbar,
.action-group,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.page-actions,
.table-toolbar {
    justify-content: space-between;
    gap: 12px;
}

.page-header {
    margin: 0;
}

.page-header h2,
.page-header h3,
.section-title {
    margin: 0 0 6px 0;
}

.page-subtext,
.summary-text {
    margin: 0;
    color: #48617f;
}

.filter-grid,
.metric-grid,
.summary-grid {
    display: grid;
    gap: 12px;
}

.filter-grid {
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    align-items: end;
}

.metric-grid {
    grid-template-columns: repeat(5, minmax(160px, 1fr));
}

.summary-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-field label {
    margin: 0;
    width: auto;
    text-align: left;
    font-weight: 600;
    color: #24466f;
}

.filter-control,
.filter-field input,
.filter-field select {
    width: 100%;
    box-sizing: border-box;
    padding: 0 8px;
    min-height: 32px;
    height: 32px;
    border: 1px solid #aaa;
    border-radius: 4px;
    background: #fff;
    color: #444;
    font-size: 16px;
    line-height: 28px;
}

.filter-field .select2-container {
    width: 100% !important;
}

.filter-field .select2-container .select2-selection--single,
.filter-field .select2-container .select2-selection--multiple {
    min-height: 32px;
    border: 1px solid #aaa;
    border-radius: 4px;
}

.filter-field .select2-container .select2-selection--single {
    height: 32px;
}

.filter-field .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 30px;
    padding-left: 8px;
    color: #444;
    font-size: 16px;
}

.filter-field .select2-container .select2-selection--single .select2-selection__arrow {
    height: 30px;
}

.filter-field .select2-container .select2-selection--multiple {
    padding: 2px 6px;
}

.filter-field .select2-container .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0;
}

.filter-field .select2-container .select2-search--inline .select2-search__field {
    margin-top: 0;
    font-size: 16px;
    line-height: 24px;
}

.form-actions {
    margin-top: 12px;
}

.segmentation-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.segmentation-save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #173a76;
    font-weight: 600;
}

.segmentation-save label {
    margin: 0;
    width: auto;
    text-align: left;
    white-space: nowrap;
    color: inherit;
    font-weight: inherit;
}

.metric-card {
    background: #f8fbff;
    border: 1px solid #d7e2f1;
    border-radius: 8px;
    padding: 10px 12px;
}

.metric-card strong {
    display: block;
    color: #173a76;
    margin-bottom: 6px;
}

.front-primary-btn,
.front-secondary-btn {
    border-radius: 4px;
    padding: 7px 14px;
    text-decoration: none;
    border: 1px solid #808080;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    box-sizing: border-box;
    line-height: 1.2;
    cursor: pointer;
}

.front-primary-btn {
    background: #064AB5;
    color: #fff;
}

.front-secondary-btn {
    background: #e7eef9;
    color: #1d3f6e;
}

.front-grid-action {
    background: #064AB5;
    padding: 5px 10px 4px;
    border: 1px solid #808080;
    color: #ffffff;
    border-radius: 4px;
    font-size: 16px;
    min-width: 40px;
    text-align: center;
    margin: 0;
    line-height: normal;
    font-weight: 600;
    cursor: pointer;
}

.front-grid-action:hover {
    background: #333;
    color: #fff;
}

.front-pill-links {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.front-pill-links a {
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #bfcde6;
    color: #1d3f6e;
    background: #f6f8fd;
    font-weight: 600;
}

.front-pill-links a.active {
    background: #2d63a8;
    border-color: #2d63a8;
    color: #fff;
}

.front-dtr-details {
    display: grid;
    gap: 0;
    margin: 2px 0;
    padding: 10px 12px;
    border: 1px solid #d7e2f1;
    border-radius: 10px;
    background: #f8fbff;
}

.front-dtr-detail {
    display: grid;
    grid-template-columns: 8.75rem minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid #e4ebf6;
}

.front-dtr-detail:last-child {
    border-bottom: 0;
}

.front-dtr-label {
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.3;
    text-transform: uppercase;
}

.front-dtr-value {
    min-width: 0;
    color: #1f2937;
    font-size: 0.95rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.front-dtr-value .front-secondary-btn,
.front-dtr-value .front-grid-action {
    margin: 0;
}

@media screen and (max-width: 960px) {
    .filter-grid,
    .metric-grid,
    .summary-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 520px) {
    .front-dtr-detail {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
