/* Statistics Arrays Prototype */
.statistics-array-card .card-header {
    background: #f8fafc;
}

.statistics-array-container {
    overflow: auto;
    max-height: 66vh;
    border: 1px solid #dbe3ea;
    border-radius: 6px;
}

.statistics-array-table {
    min-width: max-content;
    font-size: 0.75rem;
}

    .statistics-array-table th,
    .statistics-array-table td {
        white-space: nowrap;
        padding: 0.35rem 0.5rem;
    }

    .statistics-array-table thead tr:first-child th {
        position: sticky;
        top: 0;
        z-index: 9;
        background: #1f5fa3;
        color: #fff;
        border-color: #2c6aae;
    }

    .statistics-array-table thead tr:nth-child(2) th {
        position: sticky;
        top: 34px;
        z-index: 9;
        background: #2c6aae;
        color: #fff;
        border-color: #3b79bb;
    }

    .statistics-array-table thead th.statistics-cipher-group {
        text-align: center;
        font-weight: 700;
    }

    .statistics-array-table tbody tr:nth-child(even) {
        background-color: #f8fbff;
    }

    .statistics-array-table th:nth-child(1),
    .statistics-array-table td:nth-child(1) {
        position: sticky;
        left: 0;
        width: 120px;
        min-width: 120px;
        z-index: 8;
    }

    .statistics-array-table th:nth-child(2),
    .statistics-array-table td:nth-child(2) {
        position: sticky;
        left: 120px;
        width: 95px;
        min-width: 95px;
        z-index: 8;
    }

    .statistics-array-table tbody td:nth-child(1),
    .statistics-array-table tbody td:nth-child(2) {
        background: #f2f6fb;
    }

    .statistics-array-table tbody tr:nth-child(even) td:nth-child(1),
    .statistics-array-table tbody tr:nth-child(even) td:nth-child(2) {
        background: #eaf1f9;
    }

.statistics-value-negative {
    color: #c0392b;
}

.statistics-value-net {
    font-weight: 700;
    color: #1d3557;
}

/* Reports - Forms table prototype preview */
.spravki-list {
    padding: 0 !important;
}

.spravki-table-wrap {
    overflow-x: auto;
    width: 100%;
}

.spravki-table {
    width: 100%;
    min-width: 100%;
    table-layout: auto;
}

    .spravki-table thead th {
        font-size: 0.8rem;
        font-weight: 700;
        color: #495057;
        background: #f8fafc;
        border-bottom: 1px solid #d9e1ea;
        white-space: nowrap;
        padding: 0.35rem 0.45rem;
    }

    .spravki-table td {
        vertical-align: middle;
        border-color: #edf0f4;
        font-size: 0.78rem;
        padding: 0.28rem 0.45rem;
    }

    .spravki-table .col-no {
        width: 36px;
        text-align: center;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .spravki-table .col-state {
        width: 78px;
    }

    .spravki-table .col-code {
        width: 92px;
    }

    .spravki-table .col-actions {
        width: 156px;
    }

    .spravki-table thead th:first-child,
    .spravki-table tbody td:first-child {
        padding-left: 0.18rem;
    }

.spravki-table .spravka-link {
    font-weight: 500;
    line-height: 1.2;
}

.spravki-table .static-text {
    color: #325f9f;
}

.spr-state {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

    .spr-state.error {
        background: #dc3545;
    }

    .spr-state.warning {
        background: #ff8c00;
    }

    .spr-state.snapshot {
        background: #e7c4cf;
    }

.spravki-table .spr-code {
    font-weight: 600;
    color: #1f2a3d;
    letter-spacing: 0.01em;
}

.spravki-table .spravka-actions {
    display: inline-flex;
    gap: 0.22rem;
    white-space: nowrap;
}

.spravki-table .action-btn {
    width: 24px;
    height: 24px;
    min-height: 24px;
    padding: 0;
    border: 1px solid #d7dde4;
    border-radius: 5px;
    background: #fff;
    color: #465d75;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    line-height: 1;
}

.spravki-table .action-btn.delete {
    color: #b02a37;
}

.spravki-table .action-btn.add {
    color: #1f8f42;
    font-size: 0.9rem;
}

.spravki-table .spr-action-placeholder {
    display: inline-block;
    width: 20px;
}

/* Global full-width layout */
.page-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.main-content .page-content > .container-fluid {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
}

body[data-layout="horizontal"] .container-fluid,
body[data-layout="horizontal"] .navbar-header {
    max-width: 100% !important;
    width: 100% !important;
}

body[data-layout="horizontal"] .page-title-box {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
    background-color: transparent !important;
    border-bottom: none !important;
}

/* Reports page - compact top area */
.reports-compact-header {
    padding: 0.55rem 0.8rem;
    margin-top: -0.45rem;
    margin-bottom: 0.55rem;
}

.reports-compact-header .page-title {
    font-size: 1.05rem;
    margin-bottom: 0;
}

.reports-compact-header .page-subtitle {
    display: none;
}

.reports-compact-filters {
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.7rem;
}

.reports-compact-filters .filters-title {
    font-size: 0.98rem;
    margin-bottom: 0.55rem;
}

.reports-compact-filters .row.g-3 {
    --bs-gutter-x: 0.6rem;
    --bs-gutter-y: 0.45rem;
}

.reports-compact-filters .filter-label {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.reports-compact-filters .search-input,
.reports-compact-filters .form-control,
.reports-compact-filters .form-select {
    min-height: 32px;
    padding-top: 0.22rem;
    padding-bottom: 0.22rem;
    font-size: 0.82rem;
}

.reports-compact-filters .form-check-label,
.reports-compact-filters .text-muted {
    font-size: 0.8rem;
}

.reports-compact-filters .mt-3 {
    margin-top: 0.5rem !important;
}

.reports-compact-filters .mb-3 {
    margin-bottom: 0 !important;
}

.reports-compact-filters .btn {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

.advanced-search-panel {
    border: 1px dashed #d7dde4;
    border-radius: 6px;
    padding: 0.55rem;
    background: #fafcff;
}

.history-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.history-description {
    font-size: 0.84rem;
    color: #5f6b7a;
}

.history-versions-table thead th,
.history-forms-table thead th {
    font-size: 0.8rem;
    white-space: nowrap;
}

.history-versions-table tbody td,
.history-forms-table tbody td {
    font-size: 0.82rem;
}

.reports-compact-filters .select2-container--default .select2-selection--multiple {
    min-height: 32px;
    border: 1px solid #ced4da;
    border-radius: 0.45rem;
    padding: 1px 6px;
}

.reports-compact-filters .select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin-top: 3px;
    margin-bottom: 2px;
    font-size: 0.78rem;
}

.reports-compact-filters .select2-container {
    width: 100% !important;
}

.reports-fields-toolbar .btn {
    min-width: 120px;
}

.reports-add-field-menu {
    max-height: 380px;
    overflow-y: auto;
    min-width: 300px;
}

.reports-add-field-menu .dropdown-item {
    font-size: 0.82rem;
    white-space: normal;
}

.respondent-reports-page h5 {
    font-size: 1rem;
}

.respondent-reports-card .card-body {
    padding: 0.65rem;
}

.respondent-reports-filters {
    border: 1px solid #dfe3ea;
    border-radius: 0.4rem;
    padding: 0.55rem;
    margin-bottom: 0.55rem;
    background: #fff;
}

.respondent-reports-filters .filter-label {
    font-size: 0.74rem;
    font-weight: 600;
    margin-bottom: 0.12rem;
}

.respondent-reports-filters .form-control,
.respondent-reports-filters .form-select {
    min-height: 26px;
    font-size: 0.74rem;
    padding-top: 0.08rem;
    padding-bottom: 0.08rem;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

.respondent-reports-filters .form-check-label,
.respondent-reports-filters .text-muted {
    font-size: 0.74rem;
}

.respondent-reports-table {
    width: 100%;
    table-layout: fixed;
}

.respondent-reports-table th,
.respondent-reports-table td {
    font-size: 0.72rem;
    line-height: 1.1;
    padding: 0.16rem 0.2rem;
    vertical-align: middle;
    white-space: normal;
    word-break: break-word;
}

.respondent-reports-table .notes-cell {
    white-space: normal;
}

.respondent-reports-table-wrap {
    overflow-x: visible;
}

@media (max-width: 1400px) {
    .respondent-reports-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .respondent-reports-table {
        min-width: 1650px;
        table-layout: auto;
    }

    .respondent-reports-table th,
    .respondent-reports-table td {
        white-space: nowrap;
        word-break: normal;
    }
}

@media (max-width: 1500px) {
    .split-view {
        min-height: 62vh;
    }

    .left-pane {
        min-width: 300px;
    }

    .right-pane {
        min-width: 280px;
        margin-left: 0.5rem;
    }

    .details-header {
        padding: 0.8rem 1rem;
    }

    .details-body {
        padding: 0.75rem 0.9rem 0.9rem;
    }

    .reports-compact-filters {
        padding: 0.55rem 0.65rem;
    }

    .reports-compact-filters .row.g-3 {
        --bs-gutter-x: 0.45rem;
        --bs-gutter-y: 0.35rem;
    }

    .reports-compact-filters .filter-label,
    .reports-compact-filters .form-check-label,
    .reports-compact-filters .text-muted {
        font-size: 0.75rem;
    }

    .reports-compact-filters .search-input,
    .reports-compact-filters .form-control,
    .reports-compact-filters .form-select {
        min-height: 28px;
        font-size: 0.75rem;
        padding-top: 0.12rem;
        padding-bottom: 0.12rem;
    }

    .reports-table thead th {
        font-size: 0.74rem;
        padding: 0.38rem 0.32rem;
    }

    .reports-table tbody td {
        font-size: 0.74rem;
        padding: 0.32rem 0.28rem;
    }

    .reports-table .status-badge {
        font-size: 0.7rem;
        padding: 0.14rem 0.32rem;
    }

    .reports-table .correction-badge {
        min-width: 34px;
        font-size: 0.68rem;
        padding: 0.12rem 0.34rem;
    }

    .reports-table .company-name {
        line-height: 1.05;
    }
}

@media (max-width: 1280px) {
    .split-view {
        flex-direction: column;
    }

    .divider {
        display: none;
    }

    .left-pane,
    .right-pane {
        min-width: 0;
        width: 100%;
        flex-basis: auto !important;
    }

    .right-pane {
        margin-left: 0;
        margin-top: 0.6rem;
    }

    }

.prototype-control-report-select {
    min-height: 320px;
}

.prototype-employee-filter .select2-container {
    width: 100% !important;
}

.prototype-report-result {
    scroll-margin-top: 110px;
}

.prototype-grid-card {
    border: 1px solid #e8edf3 !important;
    border-radius: 0.75rem;
    background: #fff;
}

.prototype-grid-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.85rem;
}

.prototype-grid-export-btn {
    min-width: 130px;
}

.prototype-grid-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    margin-top: 0.9rem;
    border-top: 1px solid #edf1f5;
    flex-wrap: wrap;
}

.prototype-grid-footer__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #5f6b7a;
    flex-wrap: wrap;
}

.prototype-grid-page-size-label,
.prototype-grid-page-info {
    margin: 0;
    font-size: 0.95rem;
}

.prototype-grid-page-size {
    width: 92px;
    min-width: 92px;
}

.prototype-grid-pagination .page-link {
    color: #8a97ab;
    border-color: #dbe3ec;
    min-width: 40px;
    text-align: center;
    padding: 0.5rem 0.85rem;
}

.prototype-grid-pagination .page-item.active .page-link {
    background: #557e9d;
    border-color: #557e9d;
    color: #fff;
}

.prototype-grid-pagination .page-item.disabled .page-link {
    color: #c3ccd8;
    background: #fff;
}

.prototype-control-report-table {
    min-width: 1500px;
    font-size: 0.8rem;
}

.prototype-grid-table {
    margin-bottom: 0;
}

.prototype-grid-table thead th {
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    background: #f8fafc;
    color: #5f6b7a;
    font-weight: 600;
    border-top: 1px solid #edf1f5;
    border-bottom: 1px solid #edf1f5;
    border-right: 1px solid #f1f4f7;
    padding: 0.8rem 0.7rem;
}

.prototype-grid-table tbody td {
    text-align: center;
    color: #4f5d6f;
    border-bottom: 1px solid #edf1f5;
    border-right: 1px solid #f3f6f9;
    padding: 0.78rem 0.7rem;
    background: #fff;
}

.prototype-grid-table tbody tr:nth-child(even) td {
    background: #fbfcfe;
}

.prototype-grid-table tbody tr:hover td {
    background: #f4f9ff;
}

.prototype-grid-table tbody td:first-child {
    text-align: left;
    white-space: nowrap;
    color: #2d4f74;
    font-weight: 600;
}

.prototype-grid-summary-row td {
    background: #f3f7fb !important;
    color: #44566c;
    border-top: 1px solid #e3ebf3;
    font-weight: 700;
}

.prototype-control-report-table-employees tbody td:nth-child(2),
.prototype-control-report-table-employees tbody td:nth-child(3) {
    white-space: nowrap;
}

.prototype-control-report-table-employees tbody td:nth-child(3) {
    min-width: 260px;
}

.prototype-control-report-table-employees tbody td.text-start {
    color: #2563a6;
    font-weight: 500;
}
