/* «فواتير» — expense invoices read by AI, reviewed by the accountant */
.xi { display: grid; gap: 14px; }
.xi-drop { display: grid; justify-items: center; gap: 4px; padding: 22px 16px; border: 2px dashed #cbd5e1; border-radius: 16px; background: #f8fafc; cursor: pointer; text-align: center; transition: border-color .2s, background .2s; }
.xi-drop:hover, .xi-drop.is-over { border-color: var(--brand, #0f766e); background: #f0fdfa; }
.xi-drop b { font-size: 1rem; }
.xi-drop span { color: var(--muted); font-size: .82rem; }
.xi-drop small { color: var(--brand, #0f766e); font-weight: 700; min-height: 1em; }
.xi-drop .ic { width: 28px; height: 28px; color: var(--brand, #0f766e); }
.xi-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.xi-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.xi-tabs button { font: inherit; font-size: .82rem; font-weight: 700; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; transition: background .15s; }
.xi-tabs button b { display: inline-block; min-width: 1.4em; padding: 0 .3em; border-radius: 999px; background: #f1f5f9; font-size: .74rem; }
.xi-tabs button.is-on { background: #0f172a; color: #fff; border-color: #0f172a; }
.xi-tabs button.is-on b { background: rgba(255,255,255,.2); }
.xi-bar input, .xi-bar select { font: inherit; font-size: .84rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 10px; }
.xi-bar input { flex: 1 1 220px; }
.xi-scroll { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.xi-tbl { width: 100%; border-collapse: collapse; font-size: .84rem; }
.xi-tbl th { text-align: start; padding: .55rem .6rem; color: var(--muted); font-weight: 800; border-bottom: 1px solid var(--line); background: #f8fafc; white-space: nowrap; }
.xi-tbl td { padding: .55rem .6rem; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.xi-tbl td small { display: block; color: var(--muted); font-size: .72rem; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xi-tbl tbody tr { cursor: pointer; transition: background .15s; }
.xi-tbl tbody tr:hover, .xi-tbl tbody tr:focus { background: #f8fafc; outline: none; }
.xi-st { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.xi-st--NEW { background: #fef3c7; color: #92400e; }
.xi-st--APPROVED { background: #dcfce7; color: #166534; }
.xi-st--REJECTED { background: #fee2e2; color: #b91c1c; }
.xi-tag { display: inline-block; margin: 1px 0; padding: 1px 7px; border-radius: 999px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.xi-tag--bad { background: #fee2e2; color: #b91c1c; }
.xi-tag--warn { background: #ffedd5; color: #9a3412; }
.xi-tag--ok { background: #dcfce7; color: #166534; }
.xi-reading { color: var(--brand, #0f766e); font-weight: 700; }
.xi-empty { padding: 20px; text-align: center; }
.xi-bad { color: #b91c1c; font-size: .84rem; margin: 0; }
.xi-dlg { border: 0; border-radius: 16px; padding: 0; width: min(1180px, 97vw); height: min(92vh, 900px); box-shadow: 0 20px 50px rgba(15,23,42,.25); }
.xi-dlg[open] { display: grid; grid-template-rows: auto 1fr; }
.xi-dlg__head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.xi-dlg__head h3 { margin: 0; margin-inline-end: auto; font-size: 1rem; display: flex; gap: 8px; align-items: center; }
.xi-dlg__body { display: grid; grid-template-columns: 1fr 1fr; min-height: 0; }
.xi-file { background: #f1f5f9; min-height: 0; overflow: auto; border-inline-end: 1px solid var(--line); }
.xi-file iframe { width: 100%; height: 100%; border: 0; }
.xi-file img { display: block; max-width: 100%; margin: 0 auto; }
.xi-form { display: grid; gap: 10px; align-content: start; padding: 14px 16px; overflow: auto; }
.xi-form label { display: grid; gap: 4px; font-size: .8rem; font-weight: 700; }
.xi-form input, .xi-form select { font: inherit; font-size: .86rem; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 9px; min-width: 0; }
.xi-form input:disabled, .xi-form select:disabled { background: #f8fafc; color: #334155; }
.xi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.xi-summary { background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 12px; padding: 10px 12px; font-size: .84rem; }
.xi-summary p { margin: 4px 0 0; line-height: 1.7; }
.xi-flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .8rem; }
.xi-flags li { padding: 5px 10px; border-radius: 9px; }
.xi-f--bad { background: #fee2e2; color: #991b1b; }
.xi-f--warn { background: #ffedd5; color: #9a3412; }
.xi-f--ok { background: #f0fdf4; color: #166534; }
.xi-f--info { background: #f1f5f9; color: #334155; }
.xi-sub { font-size: .84rem; }
.xi-items { width: 100%; border-collapse: collapse; font-size: .8rem; }
.xi-items th { text-align: start; color: var(--muted); font-weight: 800; padding: 4px; }
.xi-items td { padding: 3px; }
.xi-items td:first-child { width: 46%; }
.xi-items input { width: 100%; padding: .35rem .45rem; }
.xi-acts { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.xi-danger { color: #b91c1c !important; }
.xi-log summary { cursor: pointer; font-size: .8rem; font-weight: 700; color: var(--muted); }
.xi-log ul { margin: 6px 0 0; padding-inline-start: 18px; font-size: .78rem; display: grid; gap: 4px; }
.xi-log small { display: block; color: var(--muted); word-break: break-word; }
@media (max-width: 860px) {
  .xi-dlg { height: 96vh; }
  .xi-dlg__body { grid-template-columns: 1fr; grid-template-rows: 42vh auto; overflow: auto; }
  .xi-file { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .xi-form { overflow: visible; }
  .xi-grid { grid-template-columns: 1fr; }
}
