:root {
    --ink: #1a2332;
    --muted: #5c6b7a;
    --line: #d5dde6;
    --bg: #eef2f6;
    --card: #ffffff;
    --head: #1565c0;
    --head-deep: #0d47a1;
    --accent: #1e88e5;
    --ingreso: #e3f2fd;
    --lineas: #e8f5e9;
    --congelado: #e0f7fa;
    --enmastado: #fff3e0;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
}

/* Embebido en iframe PHPRunner: sin “marco” gris/blanco sobrante */
html.embed,
body.embed {
    height: 100%;
    background: #fff;
}
body.embed .top {
    padding: 10px 12px;
}
body.embed .page-body {
    padding: 10px 12px 20px;
    max-width: none;
}
body.embed .filters {
    border-radius: 10px;
    margin-bottom: 12px;
}
body.embed .nav-back {
    display: none; /* el menú ya está en PHPRunner */
}

.top {
    background: linear-gradient(120deg, #0d47a1, #1565c0 55%, #0288d1);
    color: #fff;
    padding: 14px 22px 14px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.top-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding: 0;
    max-width: 160px;
    max-height: 64px;
}
.top-logo-link {
    display: block;
    line-height: 0;
    text-decoration: none;
    cursor: pointer;
}
.top-logo img {
    display: block;
    max-height: 48px;
    max-width: 140px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.top-content {
    flex: 1 1 auto;
    min-width: 0;
}
.top a { color: #bbdefb; text-decoration: none; font-size: 13px; }
.top a:hover { color: #fff; }
.top h1 { margin: 6px 0 4px; font-size: 22px; font-weight: 600; }
.top p { margin: 0; opacity: .9; font-size: 13px; }

.page-body { padding: 18px 20px 40px; max-width: 100%; }

.filters {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(21, 101, 192, .08);
}
.filters.filters-inline {
    grid-template-columns: 1.4fr 1fr 1fr auto;
}
.filters label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.filters input[type="text"],
.filters input[type="date"] {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #cfd8dc;
    border-radius: 10px;
    font-size: 14px;
    background: #fafbfc;
}
.filters input:focus {
    outline: none;
    border-color: #42a5f5;
    box-shadow: 0 0 0 3px rgba(66, 165, 245, .22);
    background: #fff;
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.filter-checks {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: center;
    padding: 0 0 10px;
    margin: 0 0 2px;
    border-bottom: 1px solid var(--line);
}
.filter-checks .check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    color: var(--ink);
    cursor: pointer;
    user-select: none;
    text-transform: uppercase;
    letter-spacing: .02em;
    white-space: nowrap;
}
.filter-checks input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}
.btn:hover { background: #1565c0; color: #fff; }
.btn-light {
    background: #fff;
    color: #1565c0;
    border: 1px solid rgba(21, 101, 192, .45);
}
.btn-light:hover { background: #e3f2fd; color: #0d47a1; }

.meta { color: var(--muted); font-size: 13px; margin: 0 0 10px; }

.filters.filters-unificado {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.filters.filters-unificado .filter-checks,
.filters.filters-unificado .actions { grid-column: 1 / -1; }
.filters select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #cfd8dc;
    border-radius: 10px;
    font-size: 14px;
    background: #fafbfc;
}
.filter-field > span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .02em;
}
details.multi { position: relative; }
details.multi > summary {
    list-style: none;
    cursor: pointer;
    border: 1px solid #cfd8dc;
    border-radius: 10px;
    padding: 9px 11px;
    background: #fafbfc;
    font-size: 14px;
}
details.multi > summary::-webkit-details-marker { display: none; }
details.multi .options {
    position: absolute;
    z-index: 30;
    left: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(21, 101, 192, .16);
    padding: 8px 12px;
    max-height: 240px;
    overflow: auto;
    min-width: 100%;
    white-space: nowrap;
}
details.multi .multi-acciones {
    display: flex;
    gap: 12px;
    position: sticky;
    top: -8px;
    background: #fff;
    padding: 2px 0 6px;
    margin: -2px 0 4px;
    border-bottom: 1px solid #e6eef5;
}
details.multi .multi-btn {
    border: 0;
    background: transparent;
    color: #1565c0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 0;
}
details.multi .multi-btn:hover { text-decoration: underline; }
details.multi .options label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink);
    font-size: 13px;
    cursor: pointer;
}
.kpi-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.kpi {
    background: #f2f7fd;
    border: 1px solid #deebf7;
    border-radius: 9px;
    padding: 10px 14px;
    min-width: 140px;
}
.kpi .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.kpi .val { font-size: 20px; font-weight: 700; color: #14519f; }
.kpi .sub { font-size: 12px; color: #14519f; margin-top: 2px; }
.badge-prod { display: inline-block; border-radius: 12px; padding: 3px 8px; font-size: 11px; font-weight: 700; }
.badge-fresco { background: #e5f5ef; color: #167251; }
.badge-reproceso { background: #f4eafe; color: #7743a3; }
.badge-fazon { background: #fff1dd; color: #93601c; }
tr.fila-reproceso td.barco-origen {
    font-family: Consolas, monospace;
    font-size: 12px;
    color: #1565c0;
    white-space: normal;
    max-width: 220px;
}
.section-title {
    margin: 8px 0 6px;
    font-size: 17px;
    font-weight: 600;
    color: var(--head-deep);
    text-transform: uppercase;
    letter-spacing: .02em;
}

.table-wrap {
    overflow: auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(26, 35, 50, .06);
}
/* Estilos anchos solo del listado (reporte); no aplicar a tablas del detalle. */
.table-wrap table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    font-size: 12.5px;
}
.table-wrap th, .table-wrap td {
    border-bottom: 1px solid var(--line);
    border-right: 1px solid #e8eef3;
    padding: 7px 9px;
    white-space: nowrap;
}
.table-wrap th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f7fafc;
    font-weight: 600;
    color: #334;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.table-wrap tr.groups th {
    top: 0;
    z-index: 3;
    text-align: center;
    color: #0d47a1;
    border-bottom: 2px solid #90caf9;
}
/* Segunda fila de encabezado (cuando hay groups + cols) */
.table-wrap thead tr.groups + tr.cols th { top: 28px; z-index: 2; }
.table-wrap th.th-ordenable { vertical-align: bottom; }
.th-acciones {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    max-width: 100%;
}
.th-num .th-acciones { display: flex; width: 100%; justify-content: flex-end; }
.th-sort {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    letter-spacing: inherit;
    text-transform: inherit;
    text-align: inherit;
    cursor: pointer;
    white-space: nowrap;
}
.th-sort:hover { color: #0d47a1; }
.th-sort.asc, .th-sort.desc { color: #0d47a1; }
.th-flecha { font-size: 10px; line-height: 1; opacity: .35; }
.th-sort.asc .th-flecha::after { content: "▲"; opacity: 1; }
.th-sort.desc .th-flecha::after { content: "▼"; opacity: 1; }
.th-ordenable:hover .th-sort:not(.asc):not(.desc) .th-flecha::after { content: "↕"; }
.th-filter-btn {
    margin: 0;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    opacity: .4;
}
.th-filter-btn:hover, .th-filter-btn.activo { opacity: 1; color: #0d47a1; }
.th-filter-pop {
    position: fixed;
    z-index: 80;
    padding: 6px;
    background: #fff;
    border: 1px solid #c5d0d8;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(21, 101, 192, .18);
}
.th-filter-pop[hidden] { display: none !important; }
.th-filter {
    display: block;
    width: 160px;
    box-sizing: border-box;
    margin: 0;
    padding: 4px 6px;
    border: 1px solid #c5d0d8;
    border-radius: 6px;
    background: #fff;
    color: #223;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.3;
}
.th-filter::placeholder { color: #90a4ae; text-transform: none; }
.th-filter:focus {
    outline: none;
    border-color: #64b5f6;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, .15);
}
.tabla-estado {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 13px;
    color: #455a64;
}
.tabla-estado[hidden] { display: none !important; }
.tabla-limpiar {
    border: 1px solid #90caf9;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 8px;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
}
.tabla-limpiar:hover { background: #bbdefb; }
.g-gen { background: #f5f7fa; }
.g-ing { background: var(--ingreso); }
.g-lin { background: var(--lineas); }
.g-con { background: var(--congelado); }
.g-enm { background: var(--enmastado); }
.table-wrap td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap tbody tr:hover td { background: #fafcff; }

.table-wrap tr.fila-total-list { background: #e3f2fd; font-weight: 700; }
.table-wrap tr.fila-total-list td { border-top: 2px solid #90caf9; }
.table-wrap tfoot tr.fila-total-list td {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: #e3f2fd;
}
.table-wrap td.total-label { font-weight: 700; color: #1565c0; }
.table-wrap td.estado-en-proceso { color: #1976d2; }
.table-wrap td.estado-completo { color: #2e7d32; font-weight: 700; }

.btn-ver-detalle {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid rgba(21, 101, 192, .35);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}
.btn-ver-detalle:hover { background: #bbdefb; }

body.vista-detalle .filters { display: none !important; }
.detalle-lote {
    background: #fff;
    border: 1px solid #d7e1ee;
    border-radius: 13px;
    padding: 19px;
    box-shadow: 0 3px 12px #193c6510;
}
.detalle-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 15px;
}
.detalle-top h2 {
    margin: 0 auto 0 0;
    font-size: 17px;
}
.detalle-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}
.detalle-chip {
    padding: 6px 10px;
    border-radius: 20px;
    background: #e9f3ff;
    color: #155ba1;
    font-size: 12px;
    font-weight: 600;
}
.detalle-grid {
    display: grid;
    gap: 12px;
}
.detalle-grid.fila-1 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.detalle-grid.fila-2 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 12px; }
.detalle-grid div {
    padding: 11px;
    background: #f3f7fb;
    border-radius: 8px;
}
.detalle-grid small {
    display: block;
    color: #536b86;
    font-size: 12px;
}
.detalle-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 15px;
    word-break: break-word;
}
.detalle-origen { margin: 0 0 16px; }
.detalle-origen th:nth-child(2),
.detalle-origen td:nth-child(2) { text-align: left; }
.detalle-origen a { color: #1565c0; font-weight: 600; }
.detalle-opcion {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #164780;
    cursor: pointer;
}
.detalle-opcion input { margin: 0; }
.detalle-arrastre { margin-top: 16px; }
.detalle-arrastre h3 { margin: 0 0 8px; font-size: 14px; }
.detalle-enmastado { display: none; margin-top: 8px; }
body.imprime-enmastado .detalle-enmastado { display: block; }
.detalle-enmastado h3 {
    margin: 8px 0 8px;
    font-size: 14px;
}
.detalle-tabla.detalle-presentacion th:nth-child(2),
.detalle-tabla.detalle-presentacion td:nth-child(2) { text-align: left; }
.detalle-arrastre .detalle-tabla th:nth-child(2),
.detalle-arrastre .detalle-tabla td:nth-child(2) { text-align: left; }

.detalle-tablas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
    align-items: start;
}
.detalle-tablas h3 {
    margin: 16px 0 8px;
    font-size: 14px;
}
.detalle-tablas h3:first-child { margin-top: 0; }
.detalle-nota {
    margin: 0 0 8px;
    font-size: 12px;
    color: #65788d;
}
.detalle-tabla {
    overflow: auto;
    border: 1px solid #d9e3ed;
    border-radius: 9px;
}
.detalle-tabla table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.detalle-tabla th,
.detalle-tabla td {
    padding: 10px;
    border-right: 1px solid #e4ebf3;
    border-bottom: 1px solid #e4ebf3;
    color: var(--ink);
    background: #fff;
    vertical-align: top;
}
.detalle-tabla th:first-child,
.detalle-tabla td.concepto { text-align: left; }
.detalle-tabla th:not(:first-child),
.detalle-tabla td.num {
    text-align: right;
    white-space: nowrap;
}
.detalle-tabla th {
    background: #e8f2fa;
    color: #164780;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
}
.detalle-tabla tfoot td {
    font-weight: 700;
    background: #e5f1fb;
}
@media (max-width: 900px) {
    .detalle-grid.fila-1,
    .detalle-grid.fila-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detalle-tablas { grid-template-columns: 1fr; }
}

.lote-menu { position: relative; display: inline-block; max-width: 100%; }
.lote-menu-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: #1565c0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-align: left;
    max-width: 100%;
    word-break: break-all;
}
.lote-menu-btn:hover { color: #0d47a1; }
.lote-menu-drop {
    position: absolute;
    left: 0;
    top: calc(100% + 4px);
    z-index: 40;
    min-width: 220px;
    max-width: 320px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(21, 101, 192, .18);
    padding: 6px;
}
.lote-menu-drop a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--ink);
    font-size: 13px;
}
.lote-menu-drop a:hover { background: #e3f2fd; }
.lote-menu-drop .lm-label { font-weight: 600; color: #1565c0; }
.lote-menu-drop .lm-hint { font-size: 11px; color: var(--muted); word-break: break-all; }
a.lote-origen-link { color: #1565c0; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
a.lote-origen-link:hover { color: #0d47a1; }

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.share-container { position: relative; display: inline-block; }
.share-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    min-width: 260px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    border: 1px solid var(--line);
    padding: 8px 0;
    z-index: 100;
}
.share-container.open .share-dropdown { display: block; }
.share-dropdown a,
.share-dropdown button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--ink);
    text-align: left;
    font-family: inherit;
    text-decoration: none;
}
.share-dropdown a:hover,
.share-dropdown button:hover { background: #e3f2fd; }
.share-dropdown .icon { font-size: 18px; width: 24px; text-align: center; }
.share-dropdown .label { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
.share-dropdown .hint { font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: normal; }
.share-dropdown hr { border: none; border-top: 1px solid #eee; margin: 6px 0; }
.share-msg { font-size: 13px; color: #1565c0; font-weight: 500; }

.card-search {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px 26px;
    box-shadow: 0 12px 30px rgba(13, 71, 161, .08);
    max-width: 760px;
}

.menu-page {
    min-height: 100vh;
    background:
        radial-gradient(900px 420px at 10% -10%, #bbdefb 0, transparent 55%),
        radial-gradient(700px 380px at 100% 0%, #b2ebf2 0, transparent 50%),
        var(--bg);
    padding: 0 0 40px;
}
.menu-inner { max-width: 920px; margin: 0 auto; padding: 22px 18px 0; }
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    padding: 18px 0 0;
}
a.menu-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid rgba(21, 101, 192, .18);
    border-radius: 16px;
    padding: 20px 18px;
    box-shadow: 0 12px 30px rgba(13, 71, 161, .08);
    transition: transform .15s ease, box-shadow .15s ease;
}
a.menu-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(13, 71, 161, .14);
}
a.menu-card.disabled { opacity: .55; pointer-events: none; }
.tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #1565c0;
    background: #e3f2fd;
    border-radius: 999px;
    padding: 3px 9px;
    margin-bottom: 10px;
}
.tag.wait { color: #6d4c41; background: #fff3e0; }
a.menu-card h2 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
a.menu-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.error {
    background: #ffebee;
    color: #b71c1c;
    border: 1px solid #ffcdd2;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
}

@media (max-width: 900px) {
    .filters,
    .filters.filters-inline { grid-template-columns: 1fr 1fr; }
}

.reporte-print-header {
    display: none;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1565c0;
}
.reporte-print-header .print-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}
.reporte-print-header .print-brand img {
    max-height: 52px;
    max-width: 160px;
    object-fit: contain;
    display: block;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.reporte-print-header h2 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: #0d47a1;
}
.reporte-print-header p {
    margin: 0;
    font-size: 11px;
    color: #5c6b7a;
}
.nav-back { white-space: nowrap; }

body.pdf-exporting .reporte-print-header {
    display: block !important;
}
body.pdf-exporting .th-filter-pop,
body.pdf-exporting .th-filter-btn,
body.pdf-exporting .tabla-estado,
body.pdf-exporting .th-flecha { display: none !important; }

@media print {
    @page { size: A4 landscape; margin: 8mm; }
    body { background: #fff !important; color: #000; }
    .top, .top-actions, .filters, .share-container, .share-msg, .meta, .col-ver,
    .subproducto-toggle, .section-title, .top-logo,
    .th-filter-pop, .th-filter-btn, .tabla-estado, .th-flecha { display: none !important; }
    .page-body { padding: 0 !important; max-width: none !important; }
    .reporte-print-header { display: block !important; }
    .reporte-print-header .print-brand img {
        max-height: 48px !important;
        max-width: 150px !important;
        visibility: visible !important;
    }
    .table-wrap {
        box-shadow: none !important;
        border: 1px solid #999 !important;
        overflow: visible !important;
        border-radius: 0 !important;
    }
    #reporte-pdf-root, #reporte-tabla { width: 100% !important; }
    table {
        font-size: 7.5pt !important;
        width: 100% !important;
        border-collapse: collapse !important;
    }
    th, td {
        padding: 2px 3px !important;
        white-space: nowrap !important;
    }
    thead { display: table-header-group; }
    tfoot { display: table-footer-group; }
    tr { page-break-inside: avoid; }
    .fila-total-list td { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.detalle-print-footer { display: none; }

@page detalle-doc {
    size: A4 portrait;
    margin: 14mm 12mm 16mm;
}
body.vista-detalle { page: detalle-doc; }

@media print {
    body.vista-detalle .top,
    body.vista-detalle .filters,
    body.vista-detalle .detalle-top,
    body.vista-detalle .detalle-opcion,
    body.vista-detalle .detalle-nota { display: none !important; }
    body.vista-detalle .detalle-enmastado { display: none !important; }
    body.vista-detalle.imprime-enmastado .detalle-enmastado { display: block !important; }
    body.vista-detalle .page-body { padding: 0 !important; }
    body.vista-detalle .detalle-lote {
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
        background: #fff !important;
    }
    body.vista-detalle .reporte-print-header {
        display: block !important;
        margin: 0 0 12px;
        padding-bottom: 8px;
        border-bottom: 2px solid #0d47a1;
    }
    body.vista-detalle .reporte-print-header h2 {
        font-size: 16pt !important;
        letter-spacing: .01em;
    }
    body.vista-detalle .reporte-print-header p {
        font-size: 10pt !important;
        color: #333 !important;
    }
    body.vista-detalle .detalle-chips { margin: 0 0 10px !important; }
    body.vista-detalle .detalle-chip {
        border: 1px solid #b7c9dc;
        background: #f3f7fb !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    body.vista-detalle .detalle-grid.fila-1 {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 6px !important;
        margin-bottom: 6px;
    }
    body.vista-detalle .detalle-grid.fila-2 {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 6px !important;
        margin-top: 0 !important;
        margin-bottom: 8px;
    }
    body.vista-detalle .detalle-grid div {
        background: #f7f9fb !important;
        border: 1px solid #d5dde6;
        border-radius: 0;
        padding: 5px 7px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    body.vista-detalle .detalle-grid small { font-size: 7.5pt !important; }
    body.vista-detalle .detalle-grid strong { font-size: 10pt !important; }
    body.vista-detalle .detalle-tablas { display: block !important; }
    body.vista-detalle .detalle-lote > h3,
    body.vista-detalle .detalle-tablas h3,
    body.vista-detalle .detalle-arrastre h3,
    body.vista-detalle .detalle-enmastado h3 {
        margin: 12px 0 4px !important;
        font-size: 11pt !important;
        color: #0d47a1 !important;
        border-bottom: 1.5px solid #0d47a1;
        padding-bottom: 2px;
        page-break-after: avoid;
    }
    body.vista-detalle .detalle-tabla {
        overflow: visible !important;
        border: 1px solid #8aa0b5 !important;
        border-radius: 0 !important;
        margin-bottom: 4px;
    }
    body.vista-detalle .detalle-tabla table { font-size: 9pt !important; }
    body.vista-detalle .detalle-tabla th,
    body.vista-detalle .detalle-tabla td {
        font-size: 9pt !important;
        padding: 4px 6px !important;
        white-space: normal !important;
        border-color: #c5d2e0 !important;
    }
    body.vista-detalle .detalle-tabla td.num,
    body.vista-detalle .detalle-tabla th:not(:first-child) {
        white-space: nowrap !important;
    }
    body.vista-detalle .detalle-tabla th {
        background: #e3eef8 !important;
        color: #0d47a1 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    body.vista-detalle .detalle-tabla tfoot td {
        background: #d6e6f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    body.vista-detalle .detalle-tabla tr { page-break-inside: avoid; }
    body.vista-detalle .detalle-print-footer {
        display: block !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        font-size: 8pt;
        color: #444;
        border-top: 1px solid #8aa0b5;
        padding-top: 3px;
    }
}
