/* العهد — مكوّنات خاصة فوق تصميم المنصة */
.hide-m { }
.badge { position: absolute; top: -4px; left: -4px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--s4); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
#btn-bell { position: relative; }
.wrap { max-width: 1100px; padding-bottom: 110px; }

/* شريط التبويبات (أعلى في الكمبيوتر، أسفل في الجوال) */
.tabs-bar { display: flex; gap: 4px; padding: 8px 22px 0; max-width: 1100px; margin: 0 auto; }
.tabs-bar button { position: relative; border: 0; background: none; padding: 9px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); display: flex; align-items: center; gap: 7px; font-weight: 500; }
.tabs-bar button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.tabs-bar .badge { position: static; }

/* بطاقة الرصيد */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.balance { background: linear-gradient(135deg, var(--ink), #2c4a43); color: #fff; border: 0; position: relative; overflow: hidden; }
.balance .g { position: absolute; width: 170px; height: 170px; left: -40px; bottom: -60px; color: #fff; opacity: .06; animation: spin 40s linear infinite; }
.balance .lab { color: var(--copper-l); font-size: 12.5px; }
.balance .big { font-family: var(--display); font-size: 34px; font-weight: 600; margin: 2px 0; }
.balance .big small { font-size: 14px; color: #cfdcd8; font-weight: 400; margin-inline-start: 4px; }
.balance .row { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: #cfdcd8; }
.balance .row b { color: #fff; }
.balance .warn { background: rgba(255, 255, 255, .1); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; margin-top: 8px; }
.capture { display: grid; gap: 10px; align-content: center; text-align: center; }
.cam-btn { border: 0; cursor: pointer; border-radius: 16px; padding: 22px 14px; background: var(--copper); color: #fff; display: grid; justify-items: center; gap: 6px; font: inherit; font-family: var(--display); font-size: 18px; font-weight: 600; box-shadow: 0 10px 24px -12px rgba(176, 131, 94, .9); transition: transform .12s; }
.cam-btn:active { transform: scale(.97); }
.cam-btn svg { width: 40px; height: 40px; stroke: #fff; }
.cam-btn small { font-family: var(--font); font-size: 12px; font-weight: 400; opacity: .9; }
.linkbtn { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; }

/* القوائم */
.seg { display: inline-flex; background: var(--sunk); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; font-size: 12.5px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg .n { font-weight: 700; margin-inline-start: 3px; }
.list { display: grid; gap: 8px; }
.item { display: grid; grid-template-columns: auto 52px 1fr auto; gap: 11px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; transition: border-color .15s, transform .1s; }
.item:hover { border-color: var(--line2); }
.item:active { transform: scale(.995); }
.item.nocheck { grid-template-columns: 52px 1fr auto; }
.item .thumb { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; background: var(--sunk); }
.item .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .s { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.item .amt { text-align: left; font-family: var(--display); font-weight: 600; font-size: 15px; white-space: nowrap; }
.item .amt small { display: block; font-family: var(--font); font-size: 10.5px; color: var(--faint); font-weight: 400; }
.item input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ink); }
.st { display: inline-block; padding: 0 8px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.st.draft { background: #eef0ef; color: #4b5753; } .st.submitted { background: #fdf3e6; color: #a35f12; } .st.returned { background: #fde9e4; color: #b03a24; }
.st.rejected { background: #c0392b; color: #fff; } .st.approved { background: #e8eef7; color: #2f5d8a; } .st.posted { background: #e3f3ea; color: #1d6b40; }
.miss { color: var(--s4); font-size: 11.5px; }
.empty { text-align: center; color: var(--faint); padding: 34px 10px; }

/* شريط الإرسال/الاعتماد الثابت */
.actionbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 25; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: center; justify-content: center; animation: rise .2s; }
.actionbar .sum { font-size: 13px; color: var(--muted); }
.actionbar .sum b { color: var(--ink); font-family: var(--display); }

/* المحرر */
.editor { display: grid; grid-template-columns: minmax(240px, 0.9fr) 1.3fr; gap: 16px; }
.editor .img { position: relative; background: var(--sunk); border-radius: 12px; overflow: hidden; align-self: start; cursor: zoom-in; }
.editor .img img { width: 100%; display: block; max-height: 70vh; object-fit: contain; }
.editor .src { position: absolute; top: 8px; right: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 20px; background: var(--sunk); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.chip.ok { background: #e3f3ea; color: #1d6b40; } .chip.ai { background: #f3ece5; color: var(--copper); font-weight: 600; } .chip.warn { background: #fdf3e6; color: #a35f12; }
.fields { display: grid; gap: 11px; align-content: start; }
.amounts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; background: var(--sunk); padding: 10px; border-radius: 10px; }
.amounts input { font-family: var(--display); font-weight: 600; font-size: 16px; direction: ltr; text-align: left; }
.notebox { border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.notebox.red { background: #fdecea; color: #a23224; } .notebox.amber { background: #fff7ee; color: #7a4e22; border: 1px solid #f0d8bd; } .notebox.green { background: #ecf7f0; color: #1d6b40; }
.notebox ul { margin: 4px 0 0; padding-inline-start: 18px; }
.hist { font-size: 12px; color: var(--muted); display: grid; gap: 4px; border-top: 1px dashed var(--line); padding-top: 8px; }
.picker { position: relative; }
.picker-list { position: absolute; z-index: 5; inset-inline: 0; top: 100%; margin-top: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 40px -18px rgba(0, 0, 0, .35); max-height: 260px; overflow: auto; }
.picker-list button { display: block; width: 100%; text-align: start; border: 0; background: none; padding: 9px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--sunk); }
.picker-list button:hover { background: var(--sunk); }
.picker-list .h { padding: 6px 12px; font-size: 11px; color: var(--faint); background: #fafafa; }

/* الاعتماد */
.emp-card .card-head { margin-bottom: 8px; }
.emp-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.emp-meta b { color: var(--ink); }
table.je { width: 100%; border-collapse: collapse; font-size: 12px; }
table.je th { background: var(--ink); color: #fff; padding: 7px 6px; text-align: start; font-weight: 600; }
table.je td { padding: 7px 6px; border-bottom: 1px solid var(--sunk); vertical-align: top; }
table.je td.n { text-align: left; direction: ltr; font-weight: 600; white-space: nowrap; }
table.je tr.tot td { background: var(--sunk); font-weight: 700; }
.je-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.je-head div { background: var(--sunk); border-radius: 8px; padding: 7px 10px; font-size: 12px; color: var(--muted); }
.je-head b { display: block; color: var(--ink); font-size: 13px; }
.table-scroll { overflow-x: auto; }
table.t td, table.t th { white-space: nowrap; }
.ok-ic { color: var(--ok); font-weight: 700; } .bad-ic { color: var(--s4); font-weight: 700; }

/* شاشة القراءة */
.scan { position: fixed; inset: 0; z-index: 70; background: rgba(26, 43, 39, .55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.scan-card { background: var(--card); border-radius: 18px; padding: 26px 30px; width: min(340px, 100%); display: grid; gap: 12px; justify-items: center; text-align: center; }
.scan-wheel { position: relative; width: 110px; height: 110px; }
.scan-wheel .g1 { position: absolute; width: 70px; height: 70px; top: 26px; left: 10px; color: var(--ink); animation: spin 2.2s linear infinite; }
.scan-wheel .g2 { position: absolute; width: 42px; height: 42px; top: 12px; left: 64px; color: var(--copper); animation: spin 1.3s linear infinite reverse; }
.scan-line { position: absolute; inset-inline: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--copper), transparent); animation: scanl 1.4s ease-in-out infinite alternate; border-radius: 2px; }
@keyframes scanl { from { top: 6%; } to { top: 92%; } }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; font-size: 13px; color: var(--faint); text-align: start; }
.steps li::before { content: '○'; margin-inline-end: 7px; }
.steps li.doing { color: var(--ink); } .steps li.doing::before { content: '◐'; color: var(--copper); }
.steps li.done { color: var(--ok); } .steps li.done::before { content: '✓'; }

.viewer { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .88); display: grid; place-items: center; cursor: zoom-out; padding: 10px; }
.viewer img { max-width: 100%; max-height: 100%; border-radius: 6px; }
.menu { position: fixed; z-index: 40; top: 56px; inset-inline-end: 14px; width: min(360px, calc(100vw - 28px)); max-height: 70vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .3); padding: 12px; display: grid; gap: 8px; animation: rise .2s; }
.nt { padding: 8px 10px; border-radius: 9px; background: var(--sunk); font-size: 13px; cursor: pointer; }
.nt.unread { background: #fbf6f1; border-inline-start: 3px solid var(--copper); }
.nt b { display: block; } .nt time { font-size: 11px; color: var(--faint); }
.perm-grid { display: grid; gap: 6px; }
.flash { animation: flash 1.6s ease-out; }

@media (max-width: 760px) {
  .hide-m { display: none; }
  .wrap { padding: 12px 12px 130px; }
  .top { padding: 8px 12px; }
  .tabs-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 26; background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .tabs-bar button { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 8px; box-shadow: none !important; }
  .tabs-bar button.on { background: transparent; color: var(--copper); }
  .tabs-bar button .badge { position: absolute; top: 0; left: 8px; }
  .actionbar { bottom: calc(58px + env(safe-area-inset-bottom)); }
  .hero { grid-template-columns: 1fr; }
  .editor { grid-template-columns: 1fr; }
  .editor .img img { max-height: 38vh; }
  .modal { padding: 0; align-items: end; }
  .modal-card { border-radius: 18px 18px 0 0; max-height: 94vh; width: 100%; padding: 16px; }
  .je-head { grid-template-columns: 1fr 1fr; }
  .amounts { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .amounts input { font-size: 15px; padding: 8px; }
}

/* رفع متعدد، يدوي، PDF، طلبات التصفية */
.cap-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cap-row .btn { justify-content: center; padding: 10px 8px; }
.thumb.nofile { display: grid; place-items: center; align-content: center; gap: 0; color: var(--faint); font-size: 10px; }
.thumb.nofile svg { width: 20px; height: 20px; }
.editor .img.noimg { cursor: default; min-height: 160px; display: grid; place-items: center; }
.editor .img.noimg svg { width: 26px; height: 26px; }
.file-row { display: flex; gap: 6px; flex-wrap: wrap; }
.selall { font-size: 13px; margin: -4px 0 10px; }
.batch { border: 1px dashed var(--line2); border-radius: 12px; padding: 8px; display: grid; gap: 6px; }
.batch-h { font-size: 12.5px; color: var(--muted); padding: 2px 4px; }
.batch-h b { color: var(--ink); }

.inv-list { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.inv-list summary { cursor: pointer; }
.inv-list div { padding: 3px 0; border-bottom: 1px dashed var(--sunk); }

.to-draft { margin-top: 6px; }
