.validation-page {
    background: #f8fafc;
    min-height: 100vh;
    margin: 0;
}

.page-topbar {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 18px;
    padding: 14px 18px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.page-topbar .back-link {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.page-topbar .back-link:hover {
    color: #0d6efd;
}

.page-topbar .current-page {
    color: #0f172a;
    font-weight: 600;
}

.section-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.section-card-header.compact-header {
    padding: 0.5rem 1rem 0.35rem;
    border-bottom: 1px solid #eef2f7;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.section-card-header.compact-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0d6efd;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    line-height: 1.2;
}

.compact-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    border-bottom: none;
}

.compact-tabs .nav-item {
    margin: 0;
}

.compact-tabs .nav-link {
    border: 1px solid #dbe7f3;
    background: #ffffff;
    color: #64748b;
    border-radius: 999px;
    padding: 0.58rem 1rem;
    font-weight: 600;
    font-size: 0.94rem;
    line-height: 1.2;
    transition: all 0.2s ease;
}

.compact-tabs .nav-link:hover {
    color: #0d6efd;
    background: #f4f9ff;
    border-color: #cfe2ff;
}

.compact-tabs .nav-link.active {
    background: #0d6efd;
    color: #ffffff;
    border-color: #0d6efd;
}

.section-card-body {
    padding: 0.95rem 1.25rem 1.25rem;
}

.tab-content,
.tab-pane {
    margin: 0;
    padding: 0;
}

.document-card,
.rules-card {
    background: #fbfdff;
    border: 1px solid #e8eef5;
    border-radius: 18px;
    padding: 1.4rem;
    transition: all 0.25s ease;
}

.document-card:hover,
.rules-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.document-card-title,
.rules-card-title {
    font-size: 1.12rem;
    font-weight: 700;
    color: #0d6efd;
    margin-bottom: 1rem;
    line-height: 1.45;
}

.document-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.document-meta-box {
    background: #ffffff;
    border: 1px solid #e9eef5;
    border-radius: 14px;
    padding: 0.9rem 1rem;
}

.document-meta-box.inline-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.document-meta-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
}

.document-meta-value {
    color: #0f172a;
    font-weight: 600;
    line-height: 1.5;
}

.document-description {
    color: #334155;
    line-height: 1.75;
    font-size: 1rem;
    margin-bottom: 1.1rem;
}

.document-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-soft-primary,
.btn-soft-warning,
.btn-soft-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 0.75rem 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-soft-primary {
    background: #eff6ff;
    color: #0d6efd;
    border-color: #cfe2ff;
}

.btn-soft-primary:hover {
    background: #dbeafe;
    color: #0b5ed7;
}

.btn-soft-warning {
    background: #fff8e1;
    color: #c58a00;
    border-color: #fde68a;
}

.btn-soft-warning:hover {
    background: #fef3c7;
    color: #b45309;
}

.btn-soft-success {
    background: #ecfdf3;
    color: #15803d;
    border-color: #bbf7d0;
}

.btn-soft-success:hover {
    background: #dcfce7;
    color: #166534;
}

.ordin-link {
    color: #0d6efd;
    text-decoration: none;
    font-weight: 700;
}

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

.validation-table {
    margin-bottom: 0;
    background: #ffffff;
    table-layout: fixed;
    width: 100%;
}

.validation-table thead th {
    background: #f8fbff;
    color: #0f172a;
    font-weight: 700;
    vertical-align: middle;
    border-color: #e8eef5;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.validation-table tbody td {
    vertical-align: middle;
    border-color: #e8eef5;
    color: #334155;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.validation-table th,
.validation-table td {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
}

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

.validation-table th:nth-child(2),
.validation-table td:nth-child(2),
.validation-table th:nth-child(3),
.validation-table td:nth-child(3) {
    max-width: 0;
}

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

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

.badge-soft-danger,
.badge-soft-warning,
.badge-soft-neutral {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: normal;
    text-align: center;
}

.badge-soft-danger {
    background: #fff1f2;
    color: #dc3545;
    border: 1px solid #f5c2c7;
}

.badge-soft-warning {
    background: #fff8e1;
    color: #c58a00;
    border: 1px solid #fde68a;
}

.badge-soft-neutral {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #dbe7f3;
}

.empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 1.4rem;
    text-align: center;
    background: #f8fafc;
    color: #475569;
}

.empty-state-icon {
    color: #94a3b8;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 992px) {
    .document-meta-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .validation-page {
        padding-top: 1rem;
    }

    .page-topbar {
        padding: 12px 14px;
        border-radius: 16px;
    }

    .section-card-header.compact-header {
        padding: 0.45rem 0.9rem 0.3rem;
        gap: 0.25rem;
    }

    .section-card-header.compact-header h2 {
        font-size: 1.2rem;
    }

    .section-card-body {
        padding: 0.85rem 1rem 1rem;
    }

    .compact-tabs {
        gap: 0.45rem;
    }

    .compact-tabs .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0.9rem;
    }

    .document-card,
    .rules-card {
        padding: 1rem;
    }

    .document-card-title,
    .rules-card-title {
        font-size: 1rem;
    }

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

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

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

.sub-tabs-wrapper {
    margin-top: 1.25rem;
}

.sub-tabs {
    justify-content: flex-start;
}

.rules-table-mobile-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.validation-table-beta-rules {
    table-layout: fixed !important;
    width: 100% !important;
}

.validation-table-beta-rules .col-no {
    width: 50px;
}

.validation-table-beta-rules .col-description {
    width: 18%;
}

.validation-table-beta-rules .col-rulevalue {
    width: calc(100% - 50px - 130px - 130px - 18%);
}

.validation-table-beta-rules .col-alert,
.validation-table-beta-rules .col-version {
    width: 130px;
}

.validation-table-beta-rules th,
.validation-table-beta-rules td {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    vertical-align: top;
}

.validation-table-beta-rules th:nth-child(4),
.validation-table-beta-rules td:nth-child(4),
.validation-table-beta-rules th:nth-child(5),
.validation-table-beta-rules td:nth-child(5) {
    text-align: center;
}

.validation-table-beta-rules .badge-soft-danger,
.validation-table-beta-rules .badge-soft-warning,
.validation-table-beta-rules .badge-soft-neutral {
    min-width: 96px;
    justify-content: center;
}

@media (max-width: 768px) {
    .validation-table-beta-rules {
        table-layout: auto !important;
        min-width: 900px;
        width: 900px !important;
    }

    .validation-table-beta-rules .col-no {
        width: 60px;
    }

    .validation-table-beta-rules .col-description {
        width: 220px;
    }

    .validation-table-beta-rules .col-rulevalue {
        width: 360px;
    }

    .validation-table-beta-rules .col-alert,
    .validation-table-beta-rules .col-version {
        width: 130px;
    }

    .validation-table-beta-rules th,
    .validation-table-beta-rules td {
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
        font-size: 0.92rem;
    }

    .validation-table-beta-rules .badge-soft-danger,
    .validation-table-beta-rules .badge-soft-warning,
    .validation-table-beta-rules .badge-soft-neutral {
        min-width: 88px;
        font-size: 0.78rem;
    }
}