/* طلب صرف — مكوّنات خاصة فوق تصميم المنصة (نفس هوية العهد) */
.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: 1fr 1.3fr; gap: 14px; }
.new-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; width: 100%; }
.new-btn:active { transform: scale(.97); }
.new-btn svg { width: 38px; height: 38px; stroke: #fff; }
.new-btn small { font-family: var(--font); font-size: 12px; font-weight: 400; opacity: .9; }
.chaincard { background: linear-gradient(135deg, var(--ink), #2c4a43); color: #fff; border: 0; position: relative; overflow: hidden; }
.chaincard .g { position: absolute; width: 190px; height: 173px; left: -40px; bottom: -60px; color: #fff; opacity: .06; }
.chaincard .lab { color: var(--copper-l); font-size: 12.5px; margin-bottom: 8px; }
.chaincard .warn { background: rgba(255, 255, 255, .1); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; }
.flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; position: relative; }
.flow .node { background: rgba(255, 255, 255, .1); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; line-height: 1.35; }
.flow .node b { display: block; font-size: 13px; }
.flow .node small { color: #cfdcd8; }
.flow .node.pay { background: var(--copper); }
.flow .arr { color: var(--copper-l); font-size: 14px; }
.chaincard .stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: #cfdcd8; margin-top: 12px; }
.chaincard .stats b { color: #fff; font-family: var(--display); font-size: 16px; }

/* القوائم */
.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: 1fr auto; gap: 11px; align-items: center; padding: 11px 14px; 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 .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; margin-top: 2px; }
.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 .no { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--faint); direction: ltr; unicode-bidi: isolate; }
.dots { display: inline-flex; gap: 3px; align-items: center; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); display: inline-block; }
.dots i.approved { background: var(--ok); } .dots i.current { background: var(--s3); box-shadow: 0 0 0 3px rgba(209, 122, 34, .18); }
.dots i.returned, .dots i.rejected { background: var(--s4); } .dots i.skipped, .dots i.cancelled { background: transparent; border: 1px dashed var(--line2); }
.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.pending { background: #fdf3e6; color: #a35f12; } .st.returned { background: #fde9e4; color: #b03a24; }
.st.rejected { background: #c0392b; color: #fff; } .st.approved { background: #e8eef7; color: #2f5d8a; } .st.paid { background: #e3f3ea; color: #1d6b40; }
.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.warn { background: #fdf3e6; color: #a35f12; } .chip.bad { background: #fdecea; color: #a23224; font-weight: 600; } .chip.ok { background: #e3f3ea; color: #1d6b40; }
.chip.kind { background: #f3ece5; color: var(--copper); font-weight: 600; }
a.chip { text-decoration: none; cursor: pointer; } a.chip:hover { background: #e2e9e7; color: var(--ink); }
.empty { text-align: center; color: var(--faint); padding: 34px 10px; }
.total-line { font-size: 13px; color: var(--muted); } .total-line b { color: var(--ink); font-family: var(--display); font-size: 15px; }

/* تفاصيل الطلب */
.rq-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.rq-head h3 { font-size: 17px; }
.rq-amount { background: var(--sunk); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.rq-amount .big { font-family: var(--display); font-size: 28px; font-weight: 600; }
.rq-amount .big small { font-size: 13px; color: var(--muted); font-weight: 400; margin-inline-start: 4px; }
.rq-amount .words { font-size: 13px; color: var(--muted); }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px; margin-bottom: 12px; }
.kv div { font-size: 13px; min-width: 0; }
.kv span { display: block; font-size: 11.5px; color: var(--faint); }
.kv .full { grid-column: 1 / -1; white-space: pre-wrap; }
.kv .iban { direction: ltr; unicode-bidi: isolate; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; word-break: break-all; }
.timeline { display: grid; gap: 0; margin: 6px 0 14px; }
.tl { display: grid; grid-template-columns: 26px 1fr; gap: 10px; position: relative; padding-bottom: 12px; }
.tl::before { content: ''; position: absolute; top: 24px; bottom: 0; inset-inline-start: 12px; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--sunk); color: var(--faint); font-size: 13px; font-weight: 700; }
.tl.approved .dot, .tl.done .dot { background: #e3f3ea; color: var(--ok); }
.tl.current .dot { background: #fdf3e6; color: var(--s3); box-shadow: 0 0 0 4px rgba(209, 122, 34, .15); }
.tl.returned .dot, .tl.rejected .dot { background: #fdecea; color: var(--s4); }
.tl.skipped .dot, .tl.cancelled .dot { background: transparent; border: 1.5px dashed var(--line2); }
.tl.pay .dot { background: #f3ece5; color: var(--copper); }
.tl.pay.done .dot { background: var(--copper); color: #fff; }
.tl .who { font-size: 13.5px; } .tl .who b { font-weight: 600; }
.tl .meta { font-size: 11.5px; color: var(--muted); }
.tl .nt-note { font-size: 12.5px; background: var(--sunk); border-radius: 8px; padding: 6px 9px; margin-top: 4px; white-space: pre-wrap; }
.act-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; margin-bottom: 12px; background: #fcfcfc; }
.act-box h4 { font-size: 14px; }
.act-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.ok { background: var(--ok); color: #fff; border-color: transparent; }
.btn.ok:hover { background: #287a4c; }
.btn.copper { background: var(--copper); color: #fff; border-color: transparent; }
.notebox { border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.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; }
.hist summary { cursor: pointer; font-size: 12.5px; }
.files { display: flex; gap: 6px; flex-wrap: wrap; }
.files .chip button { border: 0; background: none; cursor: pointer; color: var(--s4); padding: 0 0 0 2px; font-size: 13px; line-height: 1; }

/* المحرر */
.form { display: grid; gap: 11px; }
.amount-in { font-family: var(--display); font-weight: 600; font-size: 20px !important; direction: ltr; text-align: left; }
.words-live { font-size: 12.5px; color: var(--copper); min-height: 1.4em; }
.sect { border: 1px dashed var(--line2); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.sect h4 { font-size: 13px; color: var(--muted); font-family: var(--font); font-weight: 600; }
.plan { background: var(--sunk); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
.plan .flow .node { background: var(--card); border: 1px solid var(--line); }
.plan .flow .node small { color: var(--muted); }
.plan .flow .node.pay { background: var(--copper); color: #fff; border-color: transparent; }
.plan .flow .node.pay small { color: #fff; }
.plan .flow .node.skip { opacity: .5; text-decoration: line-through; }
.plan .flow .arr { color: var(--copper); }

/* الإعدادات */
.chain-ed { display: grid; gap: 8px; }
.chain-row { display: grid; grid-template-columns: 26px 1.1fr 1.3fr 0.8fr auto; gap: 6px; align-items: center; }
.chain-row .n { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.chain-row input, .chain-row select { padding: 7px 9px; font-size: 13px; }
.chain-row .btns { display: flex; gap: 2px; }
.chain-row .btns button { border: 1px solid var(--line); background: var(--card); border-radius: 6px; cursor: pointer; padding: 3px 7px; font-size: 12px; }
.chain-end { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.chain-end .n { width: 24px; height: 24px; border-radius: 50%; background: var(--copper); color: #fff; display: grid; place-items: center; font-size: 12px; }
.perm-grid { display: grid; gap: 6px; }
.role-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.co-row { display: grid; grid-template-columns: 60px 1fr auto auto; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.co-row img { width: 60px; height: 40px; object-fit: contain; background: #fff; border-radius: 6px; }
.table-scroll { overflow-x: auto; }
table.t td, table.t th { white-space: nowrap; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: #fafafa; }
table.t td.wrap-cell { white-space: normal; min-width: 200px; max-width: 380px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: end; margin-bottom: 12px; }
.sig { width: 100%; height: 170px; border: 1.5px dashed var(--line2); border-radius: 10px; background: #fff; touch-action: none; display: block; }
.sig-now { max-height: 70px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.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); }
.flash { animation: flash 1.6s ease-out; }
.banner-stuck { background: #fdecea; color: #a23224; border-radius: 10px; padding: 10px 14px; font-size: 13px; }

@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; }
  .hero { grid-template-columns: 1fr; }
  .modal { padding: 0; align-items: end; }
  .modal-card { border-radius: 18px 18px 0 0; max-height: 94vh; width: 100%; padding: 16px; }
  .kv { grid-template-columns: 1fr; }
  .chain-row { grid-template-columns: 24px 1fr 1fr; }
  .chain-row .min, .chain-row .btns { grid-column: 2 / -1; }
  .chain-row .btns { justify-content: flex-end; }
}
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-start { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.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; }
.notebox details summary { cursor: pointer; margin-top: 4px; }
