/* 3.9.4: ERP → Personal externo → Facturas */
.xi-panel { display: flex; flex-direction: column; gap: 14px; }
.xi-panel[hidden] { display: none; }
.xi-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.xi-head h3 { margin: 4px 0 2px; font-size: 22px; }
.xi-filters { display: flex; flex-wrap: wrap; gap: 12px; }
.xi-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: #5e6872; }
.xi-filters select { min-width: 180px; height: 38px; border: 1px solid #d5d9de; border-radius: 10px; padding: 0 10px; background: #fff; font: inherit; font-size: 13.5px; color: #1b1f23; }
.xi-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.xi-kpi { padding: 14px 16px; border: 1px solid #e3e6ea; border-radius: 14px; background: #fff; }
.xi-kpi .k { font-size: 11px; letter-spacing: .1em; color: #5e6872; font-weight: 800; }
.xi-kpi .v { margin-top: 6px; font-size: 25px; font-weight: 800; letter-spacing: -.01em; }
.xi-kpi .s { margin-top: 4px; font-size: 12.5px; color: #5e6872; }
.xi-kpi.green { border-color: #a9d7be; background: #f1faf5; }
.xi-kpi.green .k, .xi-kpi.green .v { color: #11613a; }
.xi-kpi.amber { border-color: #f2d49b; background: #fffaf0; }
.xi-kpi.amber .k, .xi-kpi.amber .v { color: #7a4b00; }
.xi-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 14px; align-items: start; }
.xi-table-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.xi-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.xi-table th { padding: 9px 10px; text-align: left; font-size: 11px; letter-spacing: .06em; color: #5e6872; font-weight: 800; border-bottom: 1px solid #e3e6ea; background: #f7f8f9; white-space: nowrap; }
.xi-table td { padding: 9px 10px; border-bottom: 1px solid #eef0f2; vertical-align: top; }
.xi-table .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xi-table tr.is-guide { background: #fffaf0; }
.xi-table tr.is-review { background: #fff8f8; }
.xi-sub { margin-top: 2px; font-size: 11.5px; color: #5e6872; }
.xi-st { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.xi-st.ok { background: #e6f4ec; color: #11613a; }
.xi-st.bad { background: #fcebec; color: #a3070d; }
.xi-st.guide { background: #fff3dc; color: #7a4b00; }
.xi-st.blue { background: #eaf1fb; color: #1f4e9a; }
.xi-red { color: #a3070d; }
.xi-editor td { background: #f7f8f9; }
.xi-edit-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.xi-edit-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 700; color: #5e6872; }
.xi-edit-grid input, .xi-edit-grid select, .xi-edit-actions input { height: 36px; border: 1px solid #d5d9de; border-radius: 9px; padding: 0 9px; font: inherit; font-size: 13.5px; background: #fff; }
.xi-edit-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.xi-edit-actions .xi-grow { flex: 1; }
.xi-edit-actions input { width: 220px; }
.btn.danger { border-color: #e3a3a6; color: #a3070d; }
.xi-side { display: flex; flex-direction: column; gap: 14px; }
.xi-bars { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; font-size: 13px; }
.xi-bar-row { display: flex; justify-content: space-between; gap: 10px; }
.xi-bar-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xi-bar { height: 8px; margin-top: 4px; border-radius: 4px; background: #eef0f2; overflow: hidden; }
.xi-bar span { display: block; height: 100%; border-radius: 4px; background: #1f2428; }
.xi-who { margin-top: 8px; display: flex; flex-direction: column; }
.xi-who label { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #eef0f2; font-size: 13.5px; }
.xi-who label.is-off { opacity: .55; }
.xi-who input { width: 18px; height: 18px; accent-color: #cf0912; }
.xi-who small { margin-left: auto; color: #5e6872; font-size: 12px; }
@media (max-width: 1200px) { .xi-grid { grid-template-columns: 1fr; } .xi-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .xi-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .xi-kpis { grid-template-columns: 1fr; } .xi-filters select { min-width: 140px; } }
.xi-head { margin-bottom: 4px; }
.xi-head .small { margin-top: 4px; }
.xi-head a.btn { text-decoration: none; display: inline-flex; align-items: center; min-height: 42px; }
.xi-table td:first-child { white-space: nowrap; }
.xi-table td:nth-child(3) { min-width: 150px; }
.xi-who-title { margin-top: 10px; font-size: 12px; font-weight: 800; color: #5b636b; letter-spacing: .04em; text-transform: uppercase; }
.xi-owner { font-style: normal; color: #6b737b; font-size: 12px; }
