/* Fase 9.4 — CSS verbatim de los bloques de estilo de Pages/SIRE/CentroDescargaCPE/CentroDescargaCpeMain.razor. Igual que hoy, es global mientras el componente está en pantalla:
   se enlaza con <link> donde estaba el bloque. Cambios: @@ → @ y capas D-51. */
:root {
    --em-cobalt: #1a4fba;
    --em-cobalt-deep: #0f3494;
    --em-cobalt-light: #2d6ae0;
    --em-cobalt-pale: #e8eef9;
    --em-cobalt-subtle: #f0f4fb;
}

.cp-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    font-family: -apple-system, Segoe UI, Arial, sans-serif;
    background: #f6f8fc;
}

.cp-overlay, .cp-error, .cp-main-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #4b5563;
}

.cp-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--em-cobalt-pale);
    border-top-color: var(--em-cobalt);
    border-radius: 50%;
    animation: cp-spin 0.8s linear infinite;
}

@keyframes cp-spin {
    to {
        transform: rotate(360deg);
    }
}

.cp-error {
    color: #b91c1c;
    font-weight: 600;
}

.cp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--em-cobalt), var(--em-cobalt-deep));
    color: #fff;
}

.cp-header-tipo {
    font-size: 12px;
    letter-spacing: .05em;
    text-transform: uppercase;
    opacity: .85;
}

.cp-header-serie {
    font-size: 18px;
    font-weight: 800;
    font-family: "Consolas", monospace;
}

.cp-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cp-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cp-btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    border: none;
    border-radius: 6px;
    background: rgba(255,255,255,.15);
    color: #fff;
    cursor: pointer;
}

    .cp-btn-back:hover {
        background: rgba(255,255,255,.28);
    }

.cp-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

    .cp-badge.ok {
        background: #d1fae5;
        color: #065f46;
    }

    .cp-badge.warn {
        background: #fef3c7;
        color: #92400e;
    }

    .cp-badge.err {
        background: #fee2e2;
        color: #991b1b;
    }

.cp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 31px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

.cp-btn-primary {
    background: #16a34a;
    color: #fff;
}

    .cp-btn-primary:hover {
        filter: brightness(1.06);
    }

    .cp-btn-primary:disabled {
        opacity: .6;
        cursor: default;
    }

.cp-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.cp-sidebar {
    width: 300px;
    flex: none;
    padding: 14px;
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid #e5e7eb;
}

.cp-card {
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.cp-card-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--em-cobalt);
    margin-bottom: 8px;
}

.cp-datarow {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12.5px;
    color: #4b5563;
    padding: 2px 0;
}

    .cp-datarow strong {
        color: #111827;
        font-weight: 600;
        text-align: right;
    }

.cp-hash {
    font-family: "Consolas", monospace;
    font-size: 10.5px;
    color: #111827;
    background: var(--em-cobalt-subtle);
    border-radius: 4px;
    padding: 6px 8px;
    word-break: break-all;
    margin-bottom: 6px;
}

.cp-mensaje {
    font-size: 12px;
    color: #4b5563;
}

.cp-file-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-radius: 5px;
    padding: 8px;
    cursor: pointer;
    margin-bottom: 4px;
}

    .cp-file-row:hover {
        background: var(--em-cobalt-subtle);
    }

    .cp-file-row.active {
        background: var(--em-cobalt-pale);
    }

.cp-file-icon {
    width: 18px;
    text-align: center;
}

    .cp-file-icon.pdf {
        color: #dc2626;
    }

    .cp-file-icon.xml {
        color: var(--em-cobalt);
    }

    .cp-file-icon.cdr {
        color: #374151;
    }

.cp-file-name {
    flex: 1;
    font-size: 12.5px;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cp-file-dl {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #374151;
}

    .cp-file-dl:hover {
        background: #e5e7eb;
    }

.cp-main {
    flex: 1;
    overflow: hidden;
    background: #eef1f7;
}

.cp-pdf-frame {
    width: 100%;
    height: 100%;
    border: none;
}

.cp-reader {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #0f172a;
}

.cp-reader-title {
    padding: 12px 18px;
    color: #cbd5e1;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cp-reader-body {
    flex: 1;
    margin: 0;
    padding: 16px 18px;
    overflow: auto;
    color: #a5f3fc;
    font-family: "Consolas", monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.cp-reader-empty {
    padding: 18px;
    color: #94a3b8;
    font-size: 13px;
}
