.certificados-cmx-container {
    max-width: 700px;
    margin: 20px auto;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.cmx-admin-page .button,
.cmx-admin-page button.button,
.cmx-admin-page input[type="submit"].button {
    min-height: 36px;
    padding: 7px 13px;
    border: 1px solid #17588c;
    border-radius: 7px;
    color: #fff;
    background: #17588c;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
    text-shadow: none;
    box-shadow: none;
    cursor: pointer;
}

.cmx-admin-page .button:hover,
.cmx-admin-page button.button:hover,
.cmx-admin-page input[type="submit"].button:hover {
    border-color: #103f67;
    color: #fff;
    background: #103f67;
}

.cmx-admin-page .button:focus-visible,
.cmx-admin-page button.button:focus-visible,
.cmx-admin-page input[type="submit"].button:focus-visible,
.cmx-admin-page a:focus-visible {
    outline: 3px solid #8ac8f2;
    outline-offset: 2px;
}

.cmx-admin-page .button:disabled,
.cmx-admin-page button.button:disabled {
    border-color: #8795a5;
    color: #fff;
    background: #8795a5;
    cursor: not-allowed;
}

.cmx-admin-page .button-link-delete {
    border-color: #8f2929;
    color: #fff;
    background: #a43131;
}

.cmx-admin-page .button-link-delete:hover,
.cmx-admin-page .button-link-delete:focus {
    border-color: #701e1e;
    color: #fff;
    background: #7d2424;
}

.cmx-status-edit-form {
    display: grid;
    justify-items: start;
    gap: 8px;
    margin: 0 0 12px;
}

.cmx-status-edit-form label {
    display: grid;
    gap: 5px;
    color: #334860;
    font-size: 12px;
    font-weight: 700;
}

.cmx-status-edit-form select {
    min-height: 36px;
    max-width: 100%;
    padding: 6px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #18304e;
    background: #fff;
}

.cmx-status-edit-form select:focus {
    border-color: #347db6;
    outline: 3px solid #b9ddf8;
}

.cmx-form-group {
    margin-bottom: 15px;
}

.cmx-form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.cmx-input, .cmx-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.cmx-button {
    background: #0073aa;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.cmx-button:hover {
    background: #005177;
}

.cmx-notice {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.cmx-success {
    background: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
}

.cmx-error {
    background: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
}

.cmx-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.cmx-table th, .cmx-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
}

.cmx-table th {
    background: #002b5c;
    color: #fff;
}

.cmx-table tbody tr:nth-child(even) {
    background: #f2f2f2;
}

.cmx-status-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    line-height: 1.2;
    color: #fff;
    text-transform: uppercase;
}

.cmx-status-active {
    background: #2e7d32;
}

.cmx-status-warning {
    background: #986514;
}

.cmx-status-expired {
    background: #b71c1c;
}

.cmx-status-cancelled {
    background: #a53d3d;
}

.cmx-status-suspended {
    background: #5b3b87;
}

.certificados-cmx-container.cmx-certificate-verification {
    width: min(100%, 980px);
    max-width: 980px;
    margin: clamp(16px, 3vw, 32px) auto;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.cmx-certificate-detail {
    overflow: hidden;
    border: 1px solid #d5dce5;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 42px rgb(22 46 77 / 12%);
}

.cmx-certificate-detail-header {
    position: relative;
    padding: clamp(24px, 5vw, 42px) 20px;
    color: #fff;
    background: linear-gradient(130deg, #102d50 0%, #174e78 70%, #167e8b 100%);
    text-align: center;
}

.cmx-certificate-detail-eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    color: #c7edf0;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.cmx-certificate-detail-header h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(24px, 4vw, 34px);
    line-height: 1.2;
}

.cmx-certificate-detail-header .cmx-certificate-number {
    display: inline-grid;
    gap: 5px;
    margin: 22px 0 0;
    padding: 10px 18px;
    border: 1px solid rgb(255 255 255 / 28%);
    border-radius: 10px;
    background: rgb(255 255 255 / 10%);
}

.cmx-certificate-number span {
    color: #c7edf0;
    font-size: 10px;
    letter-spacing: .1em;
}

.cmx-certificate-number strong {
    color: #fff;
    font-size: 16px;
    overflow-wrap: anywhere;
}

.cmx-certificate-detail-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.cmx-certificate-detail-table th,
.cmx-certificate-detail-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #e8edf3;
    color: #31445e;
    font-size: 15px;
    line-height: 1.5;
    text-align: left;
    vertical-align: top;
}

.cmx-certificate-detail-table th {
    width: 190px;
    background: #f7f9fc;
    font-weight: 650;
    text-transform: none;
    letter-spacing: normal;
}

.cmx-certificate-detail-table tr:last-child th,
.cmx-certificate-detail-table tr:last-child td {
    border-bottom: 0;
}

.cmx-certificate-detail-table td {
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .certificados-cmx-container.cmx-certificate-verification {
        width: 100%;
        margin: 14px 0;
    }

    .cmx-certificate-detail-header h2 {
        font-size: 20px;
    }

    .cmx-certificate-detail-table th,
    .cmx-certificate-detail-table td {
        font-size: 13px;
    }

    .cmx-certificate-detail-table th {
        width: 38%;
    }

    .cmx-certificate-detail-table th,
    .cmx-certificate-detail-table td {
        padding: 12px;
    }
}

.cmx-admin-page {
    max-width: 1440px;
    margin: 24px 24px 48px 0;
    color: #172b4d;
}

.cmx-admin-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 22px;
}

.cmx-admin-header h1 {
    margin: 3px 0 5px;
    color: #10294c;
    font-size: clamp(25px, 3vw, 32px);
    line-height: 1.2;
}

.cmx-admin-header > div > p:last-child,
.cmx-admin-section-heading p {
    margin: 4px 0 0;
    color: #63748a;
    font-size: 13px;
}

.cmx-admin-eyebrow {
    margin: 0;
    color: #1768a6;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.cmx-admin-version {
    padding: 8px 12px;
    border: 1px solid #dce5ef;
    border-radius: 999px;
    color: #52657d;
    background: #fff;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.cmx-admin-card {
    margin: 0 0 18px;
    padding: clamp(16px, 2.4vw, 25px);
    border: 1px solid #e0e7ef;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 7px 22px rgb(22 46 77 / 5%);
}

.cmx-admin-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.cmx-admin-section-heading h2 {
    margin: 0;
    color: #15345d;
    font-size: 18px;
    line-height: 1.35;
}

.cmx-admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.cmx-admin-form-grid label,
.cmx-admin-action-form label {
    display: block;
    color: #334860;
    font-size: 13px;
    font-weight: 650;
}

.cmx-admin-form-grid input,
.cmx-admin-form-grid textarea,
.cmx-admin-form-grid select,
.cmx-admin-action-form input,
.cmx-admin-action-form textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-height: 40px;
    margin-top: 6px;
    padding: 9px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    color: #18304e;
    background: #fff;
    font: inherit;
    font-weight: 400;
}

.cmx-admin-form-grid textarea,
.cmx-admin-action-form textarea {
    min-height: 70px;
    resize: vertical;
}

.cmx-admin-form-grid input:focus,
.cmx-admin-form-grid textarea:focus,
.cmx-admin-form-grid select:focus,
.cmx-admin-action-form input:focus,
.cmx-admin-action-form textarea:focus {
    border-color: #347db6;
    outline: 3px solid #b9ddf8;
}

.cmx-field-wide {
    grid-column: 1 / -1;
}

.cmx-field-hint {
    display: block;
    margin-top: 5px;
    color: #718198;
    font-size: 12px;
    font-weight: 400;
}

.cmx-admin-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e8edf3;
}

.cmx-admin-form-footer p {
    margin: 0;
    color: #718198;
    font-size: 12px;
}

.cmx-admin-page .notice {
    margin: 0 0 16px;
    border-radius: 8px;
}

.cmx-storage-note {
    margin: -8px 0 18px;
    color: #63748a;
    font-size: 13px;
    line-height: 1.5;
}

.cmx-storage-note code {
    overflow-wrap: anywhere;
}

.cmx-admin-table-scroll {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid #e5ebf2;
    border-radius: 9px;
}

.cmx-admin-table {
    min-width: 1050px;
    border: 0;
}

.cmx-admin-table th {
    padding: 12px;
    color: #48617e;
    background: #f5f8fb;
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.cmx-admin-table td {
    padding: 13px 12px;
    vertical-align: top;
}

.cmx-admin-action-form,
.cmx-qr-generator {
    margin: 0 0 9px;
}

.cmx-certificate-link {
    margin: 0 0 9px;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.cmx-certificate-link a {
    font-weight: 700;
}

.cmx-delete-certificate-form {
    margin-top: 12px;
}

.cmx-delete-certificate-form .button-link-delete {
    border-color: #8f2929;
    color: #fff;
    background: #a43131;
    font-weight: 700;
}

.cmx-delete-certificate-form .button-link-delete:hover,
.cmx-delete-certificate-form .button-link-delete:focus {
    border-color: #701e1e;
    color: #fff;
    background: #7d2424;
}

.cmx-public-verification-page {
    width: min(100% - 32px, 1040px);
    margin: clamp(24px, 6vw, 64px) auto;
}

.cmx-admin-action-form summary,
.cmx-qr-generator summary {
    padding: 9px 10px;
    border: 1px solid #dbe5ef;
    border-radius: 7px;
    color: #15598d;
    background: #f8fbfe;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.cmx-admin-action-form[open] summary,
.cmx-qr-generator[open] summary {
    border-radius: 7px 7px 0 0;
}

.cmx-admin-action-form > form,
.cmx-qr-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dbe5ef;
    border-top: 0;
    border-radius: 0 0 7px 7px;
    background: #fff;
}

.cmx-admin-action-form .button,
.cmx-qr-panel .button {
    justify-self: start;
    margin: 0;
}

.cmx-qr-panel > p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.cmx-qr-panel > .cmx-qr-destination {
    overflow-wrap: anywhere;
}

.cmx-qr-result {
    display: grid;
    justify-items: start;
    gap: 10px;
    margin-top: 4px;
}

.cmx-qr-result[hidden] {
    display: none;
}

.cmx-qr-image {
    display: grid;
    width: 176px;
    min-height: 176px;
    padding: 9px;
    place-items: center;
    border: 1px solid #e1e8f0;
    border-radius: 9px;
    background: #fff;
}

.cmx-qr-image img {
    display: block;
    width: min(100%, 156px);
    height: auto;
}

.cmx-open-verification {
    font-size: 12px;
}

.cmx-qr-message {
    margin: 0;
    color: #a53d3d;
    font-size: 12px;
}

.cmx-certificate-detail-table .cmx-status-badge {
    white-space: nowrap;
}

@media (max-width: 782px) {
    .cmx-admin-page {
        margin: 18px 12px 32px 0;
    }

    .cmx-admin-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .cmx-admin-form-grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .cmx-field-wide {
        grid-column: auto;
    }

    .cmx-admin-form-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .cmx-admin-table-scroll {
        overflow: visible;
        border: 0;
    }

    .cmx-admin-table {
        min-width: 0;
        table-layout: auto;
        border-collapse: separate;
        border-spacing: 0 12px;
        background: transparent;
        box-shadow: none;
    }

    .cmx-admin-table thead {
        display: none;
    }

    .cmx-admin-table tbody,
    .cmx-admin-table tr {
        display: block;
        width: 100%;
    }

    .cmx-admin-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 12px;
        padding: 8px;
        border: 1px solid #e0e7ef;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 4px 14px rgb(22 46 77 / 5%);
    }

    .cmx-admin-table td {
        display: block;
        min-width: 0;
        padding: 9px 5px;
        border: 0;
        color: #233b58;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .cmx-admin-table td::before {
        display: block;
        margin-bottom: 4px;
        color: #718198;
        content: "";
        font-size: 10px;
        font-weight: 750;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .cmx-admin-table td:nth-child(1)::before { content: "Empresa"; }
    .cmx-admin-table td:nth-child(2)::before { content: "No. de certificado"; }
    .cmx-admin-table td:nth-child(3)::before { content: "Inicio"; }
    .cmx-admin-table td:nth-child(4)::before { content: "Vencimiento"; }
    .cmx-admin-table td:nth-child(5)::before { content: "Vigilancia"; }
    .cmx-admin-table td:nth-child(6)::before { content: "Estatus"; }
    .cmx-admin-table td:last-child {
        grid-column: 1 / -1;
        padding-top: 12px;
        border-top: 1px solid #e8edf3;
    }
    .cmx-admin-table td:last-child::before { content: "Acciones"; }
}

@media (max-width: 600px) {
    .cmx-admin-page {
        margin-right: 8px;
    }

    .cmx-admin-card {
        padding: 15px;
    }

    .cmx-admin-version {
        white-space: normal;
    }

    .cmx-admin-table tr {
        grid-template-columns: 1fr;
    }

    .cmx-admin-table td:last-child {
        grid-column: auto;
    }
}