:root {
    --lab-green: #42b978;
    --lab-green-dark: #2d9d61;
    --lab-blue: #0b1f3a;
    --lab-bg: #f4f7fa;
    --lab-text: #1f2937;
    --lab-muted: #6c757d;
    --lab-border: #dbe3ea;
    --lab-white: #ffffff;
}

* {
    letter-spacing: 0;
}

body {
    min-height: 100vh;
    background: var(--lab-bg);
    color: var(--lab-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    min-height: 100vh;
    height: 100vh;
    position: sticky;
    top: 0;
    flex: 0 0 280px;
    overflow-y: auto;
    padding: 24px;
    flex-direction: column;
    background: var(--lab-blue);
    color: var(--lab-white);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--lab-white);
    text-decoration: none;
    margin-bottom: 32px;
}

.sidebar-brand img,
.brand-mark {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.sidebar-brand strong {
    display: block;
    font-size: 1.1rem;
}

.sidebar-brand small {
    color: rgba(255, 255, 255, .68);
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.sidebar-nav a,
.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, .82);
    text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-logout:hover {
    background: rgba(66, 185, 120, .16);
    color: var(--lab-white);
}

.content {
    width: 100%;
    padding: 28px;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.eyebrow {
    margin-bottom: 4px;
    color: var(--lab-green-dark);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.content-header h1 {
    margin: 0;
    font-size: clamp(1.7rem, 2vw, 2.2rem);
    color: var(--lab-blue);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--lab-border);
    border-radius: 8px;
    background: var(--lab-white);
    color: var(--lab-muted);
}

.app-topbar {
    background: var(--lab-blue);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.summary-card,
.data-panel,
.form-panel {
    border: 1px solid var(--lab-border);
    border-radius: 8px;
    background: var(--lab-white);
    box-shadow: 0 10px 30px rgba(11, 31, 58, .06);
}

.summary-card {
    padding: 20px;
}

.summary-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: rgba(66, 185, 120, .12);
    color: var(--lab-green-dark);
    margin-bottom: 18px;
}

.summary-card p {
    margin: 0;
    color: var(--lab-muted);
}

.summary-card strong {
    display: block;
    margin-top: 4px;
    font-size: 2rem;
    color: var(--lab-blue);
}

.data-panel,
.form-panel {
    padding: 22px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-heading h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--lab-blue);
}

.panel-heading p {
    margin: 4px 0 0;
    color: var(--lab-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border-radius: 8px;
    font-weight: 700;
}

.btn-primary {
    border-color: var(--lab-green);
    background: var(--lab-green);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--lab-green-dark);
    background: var(--lab-green-dark);
}

.btn-secondary {
    border-color: #e6ebf0;
    background: #e6ebf0;
    color: var(--lab-blue);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    color: var(--lab-muted);
    font-size: .82rem;
    text-transform: uppercase;
}

.empty-state {
    padding: 32px !important;
    color: var(--lab-muted);
    text-align: center;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.search-bar input {
    flex: 1;
}

.search-bar select {
    min-width: 220px;
}

.table a {
    color: var(--lab-blue);
    font-weight: 700;
    text-decoration: none;
}

.table-actions,
.action-row {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
}

.code-pill,
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 800;
}

.code-pill {
    background: rgba(11, 31, 58, .08);
    color: var(--lab-blue);
}

.status-pill {
    background: rgba(66, 185, 120, .13);
    color: var(--lab-green-dark);
}

.status-muted {
    background: #eef1f4;
    color: var(--lab-muted);
}

.status-danger {
    background: rgba(220, 53, 69, .12);
    color: #b4232d;
}

.interpretation-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef1f4;
    color: var(--lab-muted);
    font-size: .82rem;
    font-weight: 800;
}

.interpretation-normal {
    background: transparent;
    color: inherit;
    padding-left: 0;
    padding-right: 0;
    font-weight: 600;
}

.interpretation-low {
    background: rgba(13, 110, 253, .12);
    color: #0b5ed7;
}

.interpretation-high,
.interpretation-abnormal {
    background: rgba(220, 53, 69, .12);
    color: #b4232d;
}

.interpretation-critical_low {
    background: rgba(13, 110, 253, .2);
    color: #073b8e;
    font-weight: 900;
}

.interpretation-critical_high {
    background: rgba(220, 53, 69, .12);
    color: #b4232d;
    font-weight: 900;
}

.history-row td {
    background: #fbfcfd;
}

.history-list {
    margin: 10px 0 0;
    padding-left: 18px;
    color: var(--lab-muted);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field-wide {
    grid-column: 1 / -1;
}

.form-control,
.form-select,
input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--lab-border);
    border-radius: 8px;
}

textarea {
    min-height: 96px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.detail-layout {
    display: grid;
    gap: 18px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
}

.detail-grid div {
    padding: 12px;
    border: 1px solid var(--lab-border);
    border-radius: 8px;
    background: #fbfcfd;
}

.detail-grid dt {
    color: var(--lab-muted);
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.detail-grid dd {
    margin: 3px 0 0;
    color: var(--lab-blue);
}

.test-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.test-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--lab-border);
    border-radius: 8px;
    background: #fbfcfd;
    font-weight: 700;
}

.test-option input {
    width: 18px;
    min-height: 18px;
}

.test-search {
    margin-bottom: 14px;
}

.test-tree {
    display: grid;
    gap: 14px;
}

.test-area {
    border: 1px solid var(--lab-border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.test-area h3,
.result-area-block h3 {
    margin: 0;
    padding: 10px 14px;
    background: rgba(11, 31, 58, .08);
    color: var(--lab-blue);
    font-size: 1rem;
}

.test-parent {
    border-top: 1px solid var(--lab-border);
}

.test-parent-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fbfcfd;
}

.tree-toggle,
.tree-spacer {
    width: 28px;
    height: 28px;
}

.tree-toggle {
    border: 1px solid var(--lab-border);
    border-radius: 8px;
    background: #fff;
    color: var(--lab-blue);
}

.test-check {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-weight: 700;
}

.test-check input {
    width: 18px;
    height: 18px;
}

.test-children {
    display: grid;
    gap: 6px;
    padding: 8px 14px 12px 50px;
}

.test-parent.is-collapsed .test-children {
    display: none;
}

.child-check {
    color: var(--lab-text);
    font-weight: 600;
}

.result-area-block {
    margin-top: 18px;
    border: 1px solid var(--lab-border);
    border-radius: 8px;
    overflow: hidden;
}

.result-area-block.is-validated {
    background: #f7f9fb;
}

.result-area-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    background: rgba(11, 31, 58, .05);
}

.result-area-heading h3 {
    margin: 0 0 4px;
    color: var(--lab-blue);
    font-size: 1rem;
}

.area-actions {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.result-area-heading .area-observation-box {
    flex: 1 1 320px;
    min-width: 260px;
    padding: 9px 11px;
    border-left: 3px solid var(--lab-green);
    background: #f3fbf6;
    border-radius: 6px;
}

.result-area-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--lab-border);
    background: #fbfcfd;
}

.area-observation-box {
    padding: 12px 14px;
    border-top: 1px solid var(--lab-border);
    border-left: 3px solid var(--lab-green);
    background: #f3fbf6;
}

.area-observation-box label,
.annul-box label {
    display: block;
    color: var(--lab-muted);
    font-size: .78rem;
    font-weight: 800;
}

.area-observation-box textarea,
.annul-box input,
.master-annul-box input,
.general-observations-body textarea {
    width: 100%;
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid var(--lab-border);
    border-radius: 8px;
}

.master-annul-box {
    display: flex;
    align-items: center;
    gap: 6px;
}

.master-annul-box label {
    margin: 0;
    color: var(--lab-muted);
    font-size: .78rem;
    font-weight: 800;
}

.master-annul-box input {
    width: 150px;
}

.result-profile-block h4 {
    margin: 0;
    padding: 10px 14px;
    color: var(--lab-green-dark);
    font-size: .95rem;
    background: #fbfcfd;
    border-top: 1px solid var(--lab-border);
}

.result-entry-table input,
.result-entry-table textarea {
    width: 100%;
    min-width: 130px;
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid var(--lab-border);
    border-radius: 8px;
}

.result-entry-table input:disabled,
.result-entry-table textarea:disabled,
.area-observation-box textarea:disabled,
.general-observations-body textarea:disabled {
    background: #eef2f5;
    color: #6f7a88;
    opacity: .72;
}

.general-observations-form {
    margin-top: 18px;
}

.general-observations-body {
    padding: 12px 14px;
}

.result-row-alert td {
    background: #fffafa;
}

.calculated-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #eef7f2;
    color: var(--lab-green-dark);
    font-size: .72rem;
    font-weight: 700;
}

.calculation-alert {
    margin-top: 14px;
}

.report-custom-table input,
.report-custom-table textarea,
.manual-row-form input,
.manual-row-form select,
.manual-row-form textarea {
    width: 100%;
}

.correction-field {
    margin-top: 8px;
}

.correction-field label {
    display: block;
    color: var(--lab-muted);
    font-size: .78rem;
    font-weight: 800;
}

.bulk-actions {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.status-pending {
    background: #eef2f5;
    color: #4a5565;
}

.status-saved {
    background: rgba(72, 181, 116, .12);
    color: var(--lab-green-dark);
}

.status-validated {
    background: rgba(11, 31, 58, .12);
    color: var(--lab-blue);
}

.report-page {
    background: #e9eef3;
    color: #172033;
}

.report-sheet {
    position: relative;
    width: min(100%, 920px);
    min-height: 1120px;
    margin: 24px auto;
    padding: 30px 34px;
    background: #fff;
    box-shadow: 0 18px 60px rgba(11, 31, 58, .16);
    font-size: .86rem;
}

.report-sheet::before {
    content: "";
    position: absolute;
    top: 48%;
    left: 50%;
    z-index: 0;
    width: min(46vw, 310px);
    height: min(46vw, 310px);
    background: url("../img/pelika-icon-watermark.0560fa961aeb.png") center / contain no-repeat;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.report-print-table {
    position: relative;
    z-index: 1;
    width: 100%;
    border-collapse: collapse;
}

.report-print-table > thead > tr > td,
.report-print-table > tbody > tr > td {
    padding: 0;
}

.report-grid,
.report-signature {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.report-header {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 18px;
}

.report-brand {
    display: flex;
    align-items: center;
}

.report-brand img {
    width: 62px;
    height: 62px;
    object-fit: contain;
}

.report-brand .report-brand-logo {
    width: 250px;
    height: auto;
    max-height: 72px;
}

.report-brand h1 {
    margin: 0;
    color: var(--lab-blue);
    font-size: 1.45rem;
}

.report-title {
    margin: 0;
    color: var(--lab-blue);
    font-size: 1.18rem;
    font-weight: 800;
    text-align: center;
}

.report-brand p,
.report-grid p,
.report-footer,
.report-signature p {
    margin: 4px 0;
    color: var(--lab-muted);
}

.report-grid {
    margin: 10px 0 12px;
}

.report-grid > div {
    flex: 1;
    padding: 6px 9px;
    border: 1px solid var(--lab-border);
    border-radius: 8px;
}

.report-grid h2 {
    margin: 0 0 4px;
    color: var(--lab-blue);
    font-size: .84rem;
}

.report-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.report-col-test {
    width: 31%;
}

.report-col-result {
    width: 18%;
}

.report-col-unit {
    width: 13%;
}

.report-col-reference {
    width: 38%;
}

.report-table th,
.report-table td {
    padding: 2px 4px;
    border-bottom: 1px solid var(--lab-border);
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.report-table th {
    color: var(--lab-blue);
    font-size: .62rem;
    text-transform: uppercase;
}

.report-area {
    margin-top: 7px;
    break-inside: auto;
    page-break-inside: auto;
}

.report-area-short {
    break-inside: avoid;
    page-break-inside: avoid;
}

.report-area h2 {
    margin: 0 0 4px;
    padding: 3px 5px;
    background: rgba(11, 31, 58, .08);
    color: var(--lab-blue);
    font-size: .82rem;
    break-after: avoid;
    page-break-after: avoid;
}

.report-area h3 {
    margin: 5px 0 2px;
    color: var(--lab-green-dark);
    font-size: .78rem;
    break-after: avoid;
    page-break-after: avoid;
}

.report-profile {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 4px;
}

.report-result-value {
    color: #111827;
    font-weight: 700;
    white-space: nowrap;
}

.report-result-value.interpretation-low {
    color: #1f5fbf;
    font-weight: 800;
}

.report-result-value.interpretation-critical_low {
    color: #0d3d8f;
    font-weight: 900;
}

.report-result-value.interpretation-high,
.report-result-value.interpretation-abnormal {
    color: #b4232d;
    font-weight: 800;
}

.report-result-value.interpretation-critical_high {
    color: #8f121c;
    font-weight: 900;
}

.report-area-note,
.report-profile-note,
.report-general-note {
    margin-top: 4px;
    padding: 3px 5px;
    border-left: 4px solid var(--lab-green);
    background: #f3fbf6;
    font-size: .74rem;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

.report-area-note p,
.report-area-note ul,
.report-profile-note ul,
.report-general-note p {
    margin: 4px 0 0;
}

.report-profile-note {
    margin-bottom: 4px;
    background: #f3fbf6;
}

.report-general-note {
    margin-top: 8px;
}

.report-area-validation {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--lab-border);
    color: var(--lab-muted);
    font-size: .7rem;
}

.report-signature {
    justify-content: flex-end;
    margin-top: 28px;
    text-align: center;
}

.signature-line {
    width: 250px;
    border-top: 1px solid #172033;
    margin: 38px 0 6px;
}

.report-footer {
    margin-top: 22px;
    padding-top: 8px;
    border-top: 1px solid var(--lab-border);
    text-align: center;
    font-size: .78rem;
}

@media print {
    @page {
        size: Letter;
        margin: 8mm 9mm 12mm;

        @bottom-right {
            content: "Pag. " counter(page) " / " counter(pages);
            color: #172033;
            font-size: 7.4pt;
            font-family: "Segoe UI", Arial, sans-serif;
            text-align: right;
            vertical-align: bottom;
            padding-bottom: 2mm;
        }
    }

    .report-page {
        background: #fff;
    }

    .report-sheet {
        position: relative;
        width: auto;
        min-height: auto;
        margin: 0;
        padding: 0;
        box-shadow: none;
        font-size: 8.4pt;
    }

    .report-sheet::before {
        position: fixed;
        top: 53%;
        width: 70mm;
        height: 70mm;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .report-print-table {
        width: 100%;
        border-collapse: collapse;
    }

    .report-print-table > thead {
        display: table-header-group;
    }

    .report-print-table > tbody {
        display: table-row-group;
    }

    .report-print-header {
        padding-bottom: 2mm;
    }

    .report-header {
        grid-template-columns: 42mm 1fr 42mm;
        gap: 4mm;
    }

    .report-brand img {
        width: 14mm;
        height: 14mm;
    }

    .report-brand .report-brand-logo {
        width: 42mm;
        max-height: 14mm;
        height: auto;
    }

    .report-title {
        font-size: 13pt;
        font-weight: 800;
        text-align: center;
    }

    .report-brand h1 {
        font-size: 15pt;
    }

    .report-brand p,
    .report-grid p {
        margin: 1px 0;
    }

    .report-grid {
        margin: 2mm 0 3mm;
        gap: 5mm;
    }

    .report-grid > div {
        padding: 2mm 2.5mm;
        border-radius: 4px;
    }

    .report-table th,
    .report-table td {
        padding: 1.2mm 1.6mm;
        line-height: 1.15;
    }

    .report-area-note,
    .report-profile-note,
    .report-general-note {
        border-left: 1.4mm solid #42b978;
        background: #f3fbf6 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .report-header,
    .report-grid {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .report-area {
        break-inside: auto;
        page-break-inside: auto;
    }

    .report-profile {
        break-inside: avoid-page;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .report-area-short {
        break-inside: avoid-page;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .report-table tr,
    .report-profile-note,
    .report-area-note,
    .report-area-validation,
    .report-general-note {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .report-body {
        padding-bottom: 0;
    }

    .report-signature {
        display: flex;
        break-inside: avoid;
        page-break-inside: avoid;
        margin-top: 8mm;
    }

    .signature-line {
        margin-top: 14mm;
    }

    .report-footer {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-top: 4mm;
    }

    .no-print {
        display: none !important;
    }
}

.login-page {
    background: var(--lab-blue);
}

.login-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(100%, 420px);
    padding: 32px;
    border-radius: 8px;
    background: var(--lab-white);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .26);
}

.login-logo {
    display: block;
    width: 110px;
    height: 110px;
    object-fit: contain;
    margin: 0 auto 14px;
}

.login-logo-wide {
    width: min(100%, 315px);
    height: auto;
    max-height: 135px;
    margin-bottom: 18px;
}

.login-panel h1 {
    text-align: center;
    color: var(--lab-blue);
}

.login-copy {
    margin-bottom: 24px;
    color: var(--lab-muted);
    text-align: center;
}

.site-page {
    background: #f7faf8;
}

.site-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 78px;
    padding: 14px clamp(18px, 5vw, 72px);
    border-bottom: 1px solid rgba(219, 227, 234, .86);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(12px);
}

.site-brand img {
    width: min(220px, 44vw);
    height: auto;
    max-height: 58px;
    object-fit: contain;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 22px;
}

.site-nav a {
    color: var(--lab-blue);
    font-size: .94rem;
    font-weight: 800;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus {
    color: var(--lab-green-dark);
}

.site-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(360px, .78fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: center;
    min-height: calc(100vh - 78px);
    padding: clamp(44px, 7vw, 88px) clamp(18px, 5vw, 72px) clamp(34px, 5vw, 66px);
    background:
        linear-gradient(135deg, rgba(66, 185, 120, .16), rgba(255, 255, 255, .18) 34%, rgba(255, 184, 77, .12)),
        radial-gradient(circle at 76% 18%, rgba(46, 125, 184, .16), transparent 28%),
        #f7faf8;
}

.site-hero h1 {
    max-width: 860px;
    margin: 0;
    color: var(--lab-blue);
    font-size: clamp(2.15rem, 5vw, 5.2rem);
    line-height: .98;
}

.site-lead {
    max-width: 720px;
    margin: 24px 0 0;
    color: #405063;
    font-size: clamp(1.04rem, 1.4vw, 1.28rem);
    line-height: 1.7;
}

.site-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.platform-preview {
    border: 1px solid rgba(219, 227, 234, .96);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(11, 31, 58, .13);
    overflow: hidden;
}

.preview-topline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--lab-border);
    background: var(--lab-blue);
    color: #fff;
}

.preview-topline span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--lab-green);
    box-shadow: 0 0 0 5px rgba(66, 185, 120, .18);
}

.preview-topline strong {
    flex: 1;
}

.preview-topline em {
    color: rgba(255, 255, 255, .78);
    font-size: .82rem;
    font-style: normal;
    font-weight: 800;
}

.preview-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
}

.preview-stats article {
    min-height: 132px;
    padding: 14px;
    border: 1px solid var(--lab-border);
    border-radius: 8px;
    background: #fbfcfd;
}

.preview-stats i {
    display: inline-flex;
    margin-bottom: 18px;
    color: var(--lab-green-dark);
    font-size: 1.32rem;
}

.preview-stats span,
.preview-worklist span {
    display: block;
    color: var(--lab-muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.preview-stats strong,
.preview-worklist strong {
    display: block;
    margin-top: 4px;
    color: var(--lab-blue);
    font-size: .96rem;
}

.preview-worklist {
    display: grid;
    gap: 10px;
    padding: 0 16px 16px;
}

.preview-worklist div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 52px;
    padding: 12px 14px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(66, 185, 120, .1), rgba(11, 31, 58, .05));
}

.site-band,
.workflow-section,
.site-cta {
    padding: clamp(46px, 6vw, 82px) clamp(18px, 5vw, 72px);
}

.site-band {
    background: #fff;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 28px;
}

.section-heading h2,
.site-cta h2 {
    margin: 0;
    color: var(--lab-blue);
    font-size: clamp(1.9rem, 3vw, 3.2rem);
    line-height: 1.05;
}

.section-heading p:not(.eyebrow),
.site-cta p {
    margin: 14px 0 0;
    color: #526174;
    font-size: 1.04rem;
    line-height: 1.65;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.feature-grid article {
    min-height: 224px;
    padding: 24px;
    border: 1px solid var(--lab-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 36px rgba(11, 31, 58, .05);
}

.feature-grid i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 18px;
    border-radius: 8px;
    background: rgba(66, 185, 120, .12);
    color: var(--lab-green-dark);
    font-size: 1.38rem;
}

.feature-grid h3,
.workflow-grid strong {
    color: var(--lab-blue);
}

.feature-grid h3 {
    margin: 0 0 10px;
    font-size: 1.12rem;
}

.feature-grid p,
.workflow-grid p {
    margin: 0;
    color: #526174;
    line-height: 1.58;
}

.workflow-section {
    background: #eef5f7;
}

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.workflow-grid article {
    position: relative;
    min-height: 190px;
    padding: 22px;
    border: 1px solid rgba(219, 227, 234, .9);
    border-radius: 8px;
    background: #fff;
}

.workflow-grid span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: var(--lab-blue);
    color: #fff;
    font-weight: 900;
}

.workflow-grid strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.06rem;
}

.site-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: var(--lab-blue);
    color: #fff;
}

.site-cta .eyebrow {
    color: #8de1b3;
}

.site-cta h2,
.site-cta p {
    color: #fff;
}

.site-cta p {
    max-width: 720px;
    color: rgba(255, 255, 255, .76);
}

@media (max-width: 991.98px) {
    .app-shell {
        display: block;
        min-height: auto;
    }

    .content {
        padding: 18px;
    }

    .content-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-header {
        position: static;
        align-items: stretch;
        flex-direction: column;
    }

    .site-nav {
        justify-content: space-between;
        width: 100%;
    }

    .site-hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .platform-preview {
        max-width: 720px;
    }

    .feature-grid,
    .workflow-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-cta {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    .summary-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .panel-heading,
    .result-area-heading,
    .form-actions,
    .search-bar,
    .action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .panel-heading .btn,
    .result-area-heading .btn,
    .form-actions .btn,
    .search-bar .btn,
    .action-row .btn {
        width: 100%;
    }

    .area-actions {
        align-items: stretch;
        justify-content: stretch;
    }

    .detail-grid,
    .test-grid {
        grid-template-columns: 1fr;
    }

    .site-nav {
        flex-wrap: wrap;
        gap: 12px;
    }

    .site-header > .btn,
    .site-actions .btn,
    .site-cta .btn {
        width: 100%;
    }

    .preview-stats,
    .feature-grid,
    .workflow-grid {
        grid-template-columns: 1fr;
    }

    .preview-worklist div {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
}

/* Control de calidad interno */
.qc-setup-panel,
.qc-analyte-heading,
.qc-run-context,
.qc-run-summary,
.qc-level-grid,
.qc-chart,
.data-panel + .data-panel {
    margin-bottom: 20px;
}

.qc-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.qc-icon-warning {
    background: rgba(240, 154, 42, .14);
    color: #a35b00;
}

.qc-icon-danger {
    background: rgba(180, 35, 45, .12);
    color: #b4232d;
}

.status-warning {
    background: rgba(240, 154, 42, .16);
    color: #8a4d00;
}

.qc-analyte-heading,
.qc-run-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.qc-analyte-heading h2,
.qc-run-context h2,
.qc-run-summary h2 {
    margin: 0;
    color: var(--lab-blue);
}

.qc-analyte-heading p:last-child,
.qc-run-context p:last-child,
.qc-run-summary p:last-child {
    margin: 6px 0 0;
    color: var(--lab-muted);
}

.qc-level-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.qc-level-card {
    margin: 0;
}

.qc-level-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.qc-level-title span {
    color: var(--lab-blue);
    font-size: 1.2rem;
    font-weight: 900;
}

.qc-level-title strong {
    color: var(--lab-green-dark);
    font-size: .82rem;
}

.qc-level-card > p {
    margin: 8px 0 18px;
    color: var(--lab-muted);
}

.qc-level-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.qc-level-card dl div {
    padding: 10px;
    border-radius: 8px;
    background: #f7f9fb;
}

.qc-level-card dt {
    color: var(--lab-muted);
    font-size: .75rem;
    text-transform: uppercase;
}

.qc-level-card dd {
    margin: 4px 0 0;
    color: var(--lab-blue);
    font-weight: 900;
}

.qc-empty-card {
    grid-column: 1 / -1;
    margin: 0;
}

.qc-chart {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--lab-border);
    border-radius: 8px;
    background: #fbfcfd;
}

.qc-chart svg {
    display: block;
    width: 100%;
    min-width: 720px;
}

.qc-grid-line {
    stroke: #dbe3ea;
    stroke-width: 1;
}

.qc-grid-2 {
    stroke: #f09a2a;
    stroke-dasharray: 5 5;
}

.qc-grid-3 {
    stroke: #b4232d;
    stroke-dasharray: 5 5;
}

.qc-axis-label {
    fill: #6c757d;
    font-size: 11px;
    font-weight: 700;
}

.qc-point-excluded {
    opacity: .35;
    stroke: #b4232d;
    stroke-width: 3;
}

.qc-chart-legend {
    display: flex;
    gap: 18px;
    margin-top: 12px;
    color: var(--lab-muted);
    font-size: .85rem;
    font-weight: 800;
}

.qc-chart-legend span::before {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 50%;
    content: "";
}

.qc-legend-1::before { background: #2d9d61; }
.qc-legend-2::before { background: #2e7db8; }
.qc-legend-3::before { background: #f09a2a; }

.qc-checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding-top: 24px;
}

.qc-checkbox-field .form-check-input {
    width: 1.1rem;
    min-height: 1.1rem;
    margin: 0;
}

.qc-safety-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(240, 154, 42, .35);
    border-radius: 8px;
    background: rgba(240, 154, 42, .08);
    color: #704000;
}

.qc-safety-note i {
    margin-top: 3px;
    font-size: 1.25rem;
}

.qc-safety-note p {
    margin: 0;
}

.qc-safety-danger {
    border-color: rgba(180, 35, 45, .3);
    background: rgba(180, 35, 45, .08);
    color: #8d1821;
}

.qc-safety-danger strong {
    display: block;
    margin-bottom: 3px;
}

.qc-run-status {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(66, 185, 120, .13);
    color: var(--lab-green-dark);
    font-weight: 900;
}

.qc-run-warning .qc-run-status {
    background: rgba(240, 154, 42, .16);
    color: #8a4d00;
}

.qc-run-rejected .qc-run-status {
    background: rgba(180, 35, 45, .12);
    color: #b4232d;
}

.qc-import-heading,
.qc-report-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.qc-hash {
    display: inline-block;
    max-width: min(620px, 78vw);
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.qc-import-table .form-select {
    min-width: 270px;
}

.qc-confirm-panel {
    display: grid;
    gap: 18px;
}

.qc-confirm-panel .form-check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--lab-blue);
    font-weight: 800;
}

.qc-confirm-panel .form-check-input {
    width: 1.2rem;
    min-height: 1.2rem;
    margin-top: 2px;
}

.qc-report-filter-grid {
    grid-template-columns: repeat(6, minmax(125px, 1fr));
}

.qc-print-report {
    display: grid;
    gap: 20px;
}

.qc-report-header {
    padding: 22px 24px;
    border: 1px solid var(--lab-border);
    border-left: 5px solid var(--lab-green);
    border-radius: 10px;
    background: #fff;
}

.qc-report-header h2 {
    margin: 2px 0 6px;
    color: var(--lab-blue);
}

.qc-report-header p {
    margin: 0;
}

.qc-report-meta {
    display: grid;
    gap: 5px;
    color: var(--lab-muted);
    font-size: .82rem;
    text-align: right;
}

.qc-report-summary,
.qc-report-section {
    margin: 0;
}

.qc-report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.qc-report-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

.qc-report-list div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px solid var(--lab-border);
}

.qc-report-list dd {
    margin: 0;
    color: var(--lab-blue);
    font-weight: 900;
}

.qc-signature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 70px;
    margin-top: 38px;
}

.qc-signature-grid div {
    display: grid;
    gap: 5px;
    text-align: center;
}

.qc-signature-grid span {
    display: block;
    border-top: 1px solid var(--lab-blue);
}

.qc-signature-grid small {
    color: var(--lab-muted);
}

@media (max-width: 1399.98px) {
    .qc-report-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .qc-action-grid,
    .qc-level-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qc-report-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .qc-action-grid,
    .qc-level-grid {
        grid-template-columns: 1fr;
    }

    .qc-analyte-heading,
    .qc-run-summary,
    .qc-import-heading,
    .qc-report-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .qc-analyte-heading .action-row,
    .qc-analyte-heading .btn {
        width: 100%;
    }

    .qc-report-filter-grid,
    .qc-report-grid,
    .qc-signature-grid {
        grid-template-columns: 1fr;
    }

    .qc-report-meta {
        text-align: left;
    }
}

@media print {
    .no-print,
    .sidebar,
    .topbar,
    .app-sidebar,
    .app-header,
    .messages {
        display: none !important;
    }

    .app-shell,
    .app-main,
    .main-content,
    .content-wrapper {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .qc-print-report {
        gap: 10px;
        color: #111;
        font-size: 9pt;
    }

    .qc-report-header,
    .qc-report-section,
    .qc-report-summary .summary-card {
        box-shadow: none;
        break-inside: avoid;
    }

    .qc-report-header {
        padding: 10px 12px;
    }

    .qc-report-summary {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .qc-report-grid,
    .qc-signature-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .qc-print-report .table {
        font-size: 7.5pt;
    }

    .qc-print-report .data-panel {
        padding: 12px;
    }
}
