/* KAIROS 1.5.2 · Historial de compras, productos recepcionados, columnas */
.kc-page{display:flex;flex-direction:column;gap:14px;min-width:0}
.kc-filters{display:flex;flex-wrap:wrap;gap:10px 12px;align-items:flex-end;padding:12px 14px}
.kc-filters label{display:flex;flex-direction:column;gap:4px;font-size:12px;font-weight:700;color:var(--muted,#64748b);min-width:140px}
.kc-filters label .control{min-width:0;height:38px}
.kc-filters .kc-grow{flex:1 1 220px}
.kc-split{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:14px;align-items:start}
.kc-card-head{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--border,#e2e8f0);flex-wrap:wrap}
.kc-card-head small{display:block;color:var(--muted,#64748b);font-size:12px;margin-top:2px}
.kc-card-head.kc-sub{border-top:1px solid var(--border,#e2e8f0);margin-top:6px}
.kc-head-actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
/* Barra propia: la tabla se mueve sola y el encabezado queda fijo */
.kc-scroll{overflow:auto;max-height:calc(100vh - 330px);min-height:180px;position:relative}
.kc-scroll-lg{max-height:calc(100vh - 300px)}
.kc-scroll-sm{max-height:340px;min-height:0}
.kc-table{width:100%;border-collapse:separate;border-spacing:0;font-size:13px}
.kc-table th{position:sticky;top:0;z-index:2;background:var(--surface-2,#f1f5f9);text-align:left;font-size:11.5px;text-transform:uppercase;letter-spacing:.02em;color:var(--muted,#475569);padding:9px 10px;border-bottom:1px solid var(--border,#e2e8f0);white-space:nowrap}
.kc-table td{padding:8px 10px;border-bottom:1px solid var(--border,#eef2f7);vertical-align:middle}
.kc-table tbody tr:hover td{background:rgba(255,105,10,.05)}
.kc-table tr.sel td{background:rgba(255,105,10,.11)}
.kc-docs tr.kc-doc{cursor:pointer}
.kc-docs td:nth-child(4),.kc-recv td:nth-child(3){white-space:nowrap}
.kc-table input[type=checkbox]{width:17px;height:17px;accent-color:#ff690a;cursor:pointer}
.kc-more{display:block;margin:10px auto}
.kc-detail-card{position:sticky;top:10px;max-height:calc(100vh - 200px);overflow:auto}
.kc-detail-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;padding:14px;flex-wrap:wrap}
.kc-detail-head h3{margin:0;font-size:17px}
.kc-detail-head small{color:var(--muted,#64748b)}
.kc-kv{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:0 14px 12px}
.kc-kv div{background:var(--surface-2,#f8fafc);border:1px solid var(--border,#e2e8f0);border-radius:10px;padding:8px 10px;min-width:0}
.kc-kv span{display:block;font-size:11px;color:var(--muted,#64748b);text-transform:uppercase;letter-spacing:.02em}
.kc-kv b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kc-kv .kc-total{color:#ff690a;font-size:16px}
.kc-edits{margin:12px 14px 14px;padding:10px 12px;border:1px dashed #f59e0b;border-radius:10px;background:rgba(245,158,11,.07);font-size:12.5px;display:flex;flex-direction:column;gap:6px}
.kc-edits small{display:block;color:var(--muted,#64748b)}
.kc-totals{display:flex;justify-content:flex-end;gap:14px;padding:12px 14px;border-top:1px solid var(--border,#e2e8f0);flex-wrap:wrap}
.kc-totals div{min-width:170px;padding:8px 12px;border-radius:10px;background:var(--surface-2,#f8fafc);border:1px solid var(--border,#e2e8f0)}
.kc-totals span{display:block;font-size:11px;text-transform:uppercase;color:var(--muted,#64748b)}
.kc-totals b{font-size:17px}.kc-totals .in{color:#16a34a}.kc-totals .out{color:#dc2626}
.kc-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 14px}
.kc-item{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--border,#e2e8f0);border-radius:9px;cursor:pointer;font-weight:600}
.kc-item input{width:17px;height:17px;accent-color:#ff690a}
.kc-foot{display:flex;justify-content:space-between;align-items:center;margin-top:12px;gap:10px}
.modal.modal-wide{max-width:min(980px,96vw);width:980px}
/* La tabla de recepción: la página ya no crece, la tabla tiene su propia barra */
body.receiving-page .kc-receiving td:nth-child(2){white-space:nowrap}
html[data-theme=dark] .kc-table th{background:#1c2430;color:#9fb0c3}
html[data-theme=dark] .kc-kv div,html[data-theme=dark] .kc-totals div{background:#18202b;border-color:#2a3442}
@media (max-width:1100px){.kc-split{grid-template-columns:1fr}.kc-detail-card{position:static;max-height:none}}
@media (max-width:700px){.kc-kv{grid-template-columns:repeat(2,minmax(0,1fr))}.kc-list{grid-template-columns:1fr}.kc-filters label{min-width:calc(50% - 8px);flex:1 1 calc(50% - 8px)}}
/* Teléfono: la página se mueve, no las tablas internas */
html.km .kc-scroll{max-height:none;min-height:0;overflow-x:auto;overflow-y:visible}
html.km .kc-detail-card{position:static;max-height:none}
html.km .kc-btn{display:none}
.receiving-shell a.btn,.kc-page a.btn{text-decoration:none}
