/* =========================================================
   NEXENG REPORT STANDARD v1.1
   Archivo: /assets/css/nexeng-report.css
   Uso: formato profesional para memorias de cálculo PDF
   ========================================================= */
:root {
    --nxr-blue: #0284c7;
    --nxr-blue-dark: #075985;
    --nxr-cyan: #06b6d4;
    --nxr-ink: #0f172a;
    --nxr-muted: #64748b;
    --nxr-line: #d8e3ef;
    --nxr-soft: #f4f8fc;
    --nxr-soft-2: #eaf5fb;
    --nxr-warn: #b45309;
    --nxr-ok: #047857;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    color: var(--nxr-ink);
    background: #eef3f8;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

body {
    padding: 28px;
}

.nxr-page {
    max-width: 980px;
    margin: 0 auto 24px;
    background: #ffffff;
    border: 1px solid var(--nxr-line);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

.nxr-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: start;
    padding: 30px 34px 24px;
    border-bottom: 4px solid var(--nxr-blue);
    background:
        radial-gradient(circle at 4% 0%, rgba(14, 165, 233, 0.16), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.nxr-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.nxr-mark {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #ffffff;
    font-weight: 950;
    letter-spacing: -0.06em;
    font-size: 1.55rem;
    background: linear-gradient(135deg, var(--nxr-blue), var(--nxr-cyan));
}

.nxr-brand-title strong {
    display: block;
    font-size: 1.22rem;
    letter-spacing: 0.20em;
    line-height: 1.1;
}

.nxr-brand-title span {
    display: block;
    margin-top: 4px;
    color: var(--nxr-muted);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
}

.nxr-report-title {
    margin-top: 22px;
}

.nxr-report-title h1 {
    margin: 0;
    color: var(--nxr-blue-dark);
    font-size: 1.7rem;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.nxr-report-title p {
    margin: 8px 0 0;
    color: var(--nxr-muted);
    font-size: 0.98rem;
}

.nxr-meta-box {
    min-width: 230px;
    padding: 16px 18px;
    border: 1px solid var(--nxr-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
}

.nxr-meta-row {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(216, 227, 239, 0.8);
    font-size: 0.84rem;
}

.nxr-meta-row:last-child { border-bottom: 0; }
.nxr-meta-row span { color: var(--nxr-muted); font-weight: 750; }
.nxr-meta-row strong { text-align: right; font-weight: 850; }

.nxr-body {
    padding: 28px 34px 34px;
}

.nxr-section {
    margin: 0 0 26px;
    break-inside: avoid;
}

.nxr-section h2 {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--nxr-line);
    color: var(--nxr-blue-dark);
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.nxr-section p {
    margin: 0 0 10px;
    color: #334155;
    font-size: 0.92rem;
}

.nxr-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.nxr-kpi {
    min-height: 88px;
    padding: 14px 14px 12px;
    border: 1px solid var(--nxr-line);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, var(--nxr-soft));
}

.nxr-kpi span {
    display: block;
    color: var(--nxr-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nxr-kpi strong {
    display: block;
    margin-top: 7px;
    color: var(--nxr-ink);
    font-size: 1.08rem;
    line-height: 1.18;
}

.nxr-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    padding: 16px 18px;
    border: 1px solid var(--nxr-line);
    border-radius: 16px;
    background: var(--nxr-soft);
}

.nxr-info-item {
    display: grid;
    grid-template-columns: 135px 1fr;
    gap: 10px;
    font-size: 0.88rem;
}

.nxr-info-item span { color: var(--nxr-muted); font-weight: 800; }
.nxr-info-item strong { font-weight: 750; }

.nxr-table-wrap {
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--nxr-line);
    border-radius: 16px;
}

.nxr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.77rem;
}

.nxr-table th {
    padding: 9px 8px;
    text-align: left;
    color: #083344;
    background: var(--nxr-soft-2);
    border-bottom: 1px solid var(--nxr-line);
    font-weight: 900;
}

.nxr-table td {
    padding: 8px;
    border-bottom: 1px solid #edf3f8;
    vertical-align: top;
}

.nxr-table tr:nth-child(even) td { background: #fbfdff; }
.nxr-table tr:last-child td { border-bottom: 0; }
.nxr-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.nxr-table .center { text-align: center; }

.nxr-note-box {
    padding: 16px 18px;
    border: 1px solid var(--nxr-line);
    border-left: 5px solid var(--nxr-blue);
    border-radius: 16px;
    background: #f8fbff;
}

.nxr-list {
    margin: 0;
    padding-left: 18px;
    color: #334155;
    font-size: 0.9rem;
}

.nxr-list li { margin: 5px 0; }

.nxr-disclaimer {
    margin-top: 30px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #713f12;
    font-size: 0.82rem;
}

.nxr-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 34px;
    border-top: 1px solid var(--nxr-line);
    color: var(--nxr-muted);
    font-size: 0.78rem;
}

.nxr-screen-actions {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    background: rgba(238, 243, 248, 0.92);
    backdrop-filter: blur(10px);
}

.nxr-screen-actions button {
    min-height: 42px;
    border: 1px solid rgba(2, 132, 199, 0.28);
    border-radius: 999px;
    padding: 0 18px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--nxr-blue), var(--nxr-cyan));
    font-weight: 850;
    cursor: pointer;
}

.nxr-screen-actions button.secondary {
    color: var(--nxr-blue-dark);
    background: #ffffff;
}

@media print {
    @page {
        size: letter portrait;
        margin: 12mm;
    }

    html, body {
        background: #ffffff !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .nxr-screen-actions { display: none !important; }

    .nxr-page {
        max-width: none;
        margin: 0;
        border: 0;
        box-shadow: none;
    }

    .nxr-header {
        padding: 0 0 18px;
    }

    .nxr-body {
        padding: 22px 0 20px;
    }

    .nxr-footer {
        padding: 10px 0 0;
    }

    .nxr-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .nxr-table-wrap {
        overflow: visible;
    }

    .nxr-table {
        font-size: 0.68rem;
    }

    .nxr-kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 760px) {
    body { padding: 10px; }
    .nxr-header { grid-template-columns: 1fr; padding: 22px; }
    .nxr-body { padding: 22px; }
    .nxr-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nxr-info-grid { grid-template-columns: 1fr; }
    .nxr-info-item { grid-template-columns: 1fr; gap: 2px; }
    .nxr-footer { padding: 14px 22px; flex-direction: column; }
}