:root {
  --primary: #0d4a36;
  --primary-2: #17694c;
  --accent: #b8902f;
  --accent-soft: #f6efdc;
  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --text: #18241f;
  --muted: #5e6b65;
  --border: #dce5df;
  --ok: #1e8a4c;
  --ok-bg: #e5f5ec;
  --warn: #b26a00;
  --warn-bg: #fff3dc;
  --bad: #c0392b;
  --bad-bg: #fdecea;
  --info: #1d6b5c;
  --info-bg: #e5f2ee;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 40, 40, .06), 0 4px 16px rgba(16, 40, 40, .06);
  --font: 'Tajawal', 'Segoe UI', Tahoma, 'Arial', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-2); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
svg.ico { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.alert svg.ico { width: 20px; height: 20px; margin-top: 2px; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- الهيكل */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; background: linear-gradient(180deg, #0d4a36 0%, #08301f 100%); color: #e6f0eb;
  display: flex; flex-direction: column; position: fixed; inset: 0 0 0 auto; z-index: 20;
  box-shadow: inset 1px 0 0 rgba(184,144,47,.35);
}
.brand { padding: 22px 18px 18px; border-bottom: 1px solid rgba(184,144,47,.25); display: flex; gap: 12px; align-items: center; }
.brand-img { width: 48px; height: 48px; object-fit: contain; flex: none; background: #fff; border-radius: 12px; padding: 4px; }
.brand-logo { width: 42px; height: 42px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; color: var(--primary); font-weight: 800; font-size: 20px; flex: none; }
.brand-title { font-weight: 800; font-size: 16px; }
.brand-sub { font-size: 12px; opacity: .7; }
.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a {
  color: #d6e4e2; padding: 10px 14px; border-radius: 9px; display: flex; align-items: center; gap: 12px; font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset -3px 0 0 var(--accent); }
.nav .ico { width: 20px; height: 20px; flex: none; opacity: .9; }
.nav .badge-count { margin-inline-start: auto; background: var(--accent); color: var(--primary); border-radius: 20px; font-size: 12px; font-weight: 800; padding: 0 8px; }
.side-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.side-foot .who { font-weight: 700; color: #fff; }
.side-foot .role { opacity: .7; font-size: 12px; }

.main { flex: 1; margin-right: 250px; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 10; background: rgba(243,246,244,.92); backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 20px; font-weight: 800; flex: 1; }
.content { padding: 24px 28px 60px; max-width: 1400px; }

.icon-btn { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.dot { position: absolute; top: -4px; left: -4px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 0 6px; min-width: 18px; text-align: center; }

.bottom-nav { display: none; }

/* ---------- عناصر */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h3 { font-size: 16px; font-weight: 800; flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 16px; }
.hidden { display: none !important; }

.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi .value { font-size: 26px; font-weight: 800; margin-top: 6px; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi::after { content: ''; position: absolute; inset: 0 0 auto auto; width: 4px; height: 100%; background: var(--kpi-c, var(--primary-2)); }

.btn {
  font-family: inherit; font-size: 14px; font-weight: 700; border-radius: 9px; padding: 9px 16px; border: 1px solid transparent;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px; justify-content: center; white-space: nowrap;
  background: var(--primary); color: #fff; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-light { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-light:hover { background: var(--surface-2); filter: none; }
.btn-accent { background: var(--accent); color: #1d1a0d; }
.btn-ok { background: var(--ok); }
.btn-bad { background: var(--bad); }
.btn-ghost { background: transparent; color: var(--primary-2); padding: 6px 10px; }
.btn-ghost:hover { background: var(--surface-2); filter: none; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 20px; white-space: nowrap; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-muted { background: #eef1f0; color: var(--muted); }
.b-travel { background: #efe7fb; color: #6a3fb5; }

.progress { height: 8px; background: #e7ecea; border-radius: 10px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--primary-2), #2e9a6e); border-radius: 10px; }
.progress.low > div { background: var(--bad); }

/* ---------- الجداول */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: right; font-weight: 700; color: var(--muted); font-size: 13px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #fafcfb; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.rejected td { opacity: .55; text-decoration: line-through; }
.tbl tr.rejected td.keep { text-decoration: none; opacity: 1; }
.tbl tfoot td { font-weight: 800; background: var(--surface-2); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 48px; height: 48px; opacity: .35; display: block; margin: 0 auto 10px; }

/* ---------- النماذج */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; color: #34413f; }
.field label .req { color: var(--bad); }
.input, select.input, textarea.input {
  width: 100%; font-family: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text); outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(20,92,94,.12); }
textarea.input { min-height: 70px; resize: vertical; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.switch-row { display: flex; gap: 8px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; padding: 3px; background: var(--surface-2); gap: 2px; }
.seg button { font-family: inherit; border: none; background: transparent; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-weight: 700; color: var(--muted); font-size: 14px; }
.seg button.on { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.section-title { font-weight: 800; font-size: 14px; color: var(--primary-2); margin: 6px 0 -4px; grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.travel-box { grid-column: 1 / -1; background: #f7f3fd; border: 1px dashed #c8b3ea; border-radius: 10px; padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 16px; }

.drop {
  border: 2px dashed var(--border); border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); cursor: pointer; background: var(--surface-2);
}
.drop:hover { border-color: var(--primary-2); color: var(--primary-2); }
.file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.file-chip { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.file-chip .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; color: var(--primary-2); }
.file-chip button { border: none; background: none; cursor: pointer; color: var(--bad); font-size: 16px; }

/* ---------- النوافذ */
.modal-back { position: fixed; inset: 0; background: rgba(10, 25, 25, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 680px; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: pop .18s; }
.modal.wide { max-width: 900px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h3 { flex: 1; font-size: 18px; font-weight: 800; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { transform: translateY(10px); opacity: 0 } }

#toast-root { position: fixed; bottom: 24px; left: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 500; animation: pop .2s; max-width: 360px; }
.toast.err { background: var(--bad); }
.toast.ok { background: var(--ok); }

.notif-panel { position: absolute; top: 48px; left: 0; width: 360px; max-height: 460px; overflow-y: auto; z-index: 50; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; cursor: pointer; }
.notif-item.unread { background: #f3faf8; }
.notif-item .t { font-size: 12px; color: var(--muted); }

/* ---------- تفاصيل العهدة */
.hero { padding: 22px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.hero h2 { font-size: 22px; font-weight: 800; }
.meta-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 20px; margin-top: 14px; }
.meta-list div { font-size: 14px; }
.meta-list b { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.balance-box { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-radius: 12px; padding: 20px; }
.balance-box .big { font-size: 34px; font-weight: 800; }
.balance-box .lbl { opacity: .8; font-size: 13px; }
.balance-box .split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; font-size: 13px; }
.balance-box .split b { display: block; font-size: 16px; }
.balance-box .progress { background: rgba(255,255,255,.2); margin-top: 12px; }
.balance-box .progress > div { background: var(--accent); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; }
.tabs button { font-family: inherit; border: none; background: none; padding: 14px 14px 12px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; font-size: 14px; white-space: nowrap; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--accent); }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert-warn { background: var(--warn-bg); color: #7a4a00; }
.alert-bad { background: var(--bad-bg); color: #8a2318; }
.alert-info { background: var(--info-bg); color: #155447; }

/* ---------- الرسوم */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 110px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 12px; background: #edf1ef; border-radius: 10px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--primary-2); border-radius: 10px; }
.bar-row .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cols-chart { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 10px; }
.cols-chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; font-size: 11px; color: var(--muted); }
.cols-chart .col .b { width: 100%; max-width: 38px; background: linear-gradient(180deg, #2e8c8e, var(--primary-2)); border-radius: 6px 6px 2px 2px; min-height: 2px; }

/* ---------- الدخول */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-side { background: radial-gradient(circle at 85% 15%, rgba(184,144,47,.22), transparent 45%), linear-gradient(160deg, #0d4a36 0%, #062a1c 100%); color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; border-left: 4px solid var(--accent); }
.login-logo { width: 110px; height: 110px; object-fit: contain; background: #fff; border-radius: 22px; padding: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.login-org { margin-top: 16px; color: #e4c77a; font-weight: 700; letter-spacing: .3px; }
.login-side h1 { font-size: 34px; font-weight: 800; margin-top: 18px; }
.login-side p { opacity: .8; font-size: 16px; max-width: 420px; }
.login-side ul { padding: 0; list-style: none; margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.login-side li::before { content: '✓'; color: var(--accent); font-weight: 800; margin-left: 10px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }

/* ---------- كشوف الطباعة */
.report-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.paper {
  background: #fff; width: 210mm; min-height: 297mm; margin: 0 auto 24px; padding: 14mm 14mm 12mm; box-shadow: var(--shadow);
  color: #000; font-family: 'Tajawal', 'Simplified Arabic', 'Traditional Arabic', Arial, sans-serif; font-size: 13px;
}
.paper .p-org { text-align: center; font-weight: 800; font-size: 18px; }
.paper .p-title { text-align: center; font-weight: 800; font-size: 17px; text-decoration: underline; margin: 4px 0 12px; }
.paper .p-meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.paper .p-type { font-weight: 800; font-size: 15px; }
.paper table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.paper th, .paper td { border: 1px solid #000; padding: 4px 6px; text-align: center; font-size: 12.5px; }
.paper th { background: #e3e8ef; font-weight: 800; }
.paper td.r { text-align: right; }
.paper tr.strong td { font-weight: 800; }
.paper .words { text-align: center; font-weight: 800; margin-top: 8px; font-size: 13px; }
.paper .sigs { display: flex; justify-content: space-between; margin-top: 26px; font-weight: 800; text-align: center; }
.paper .sigs > div { min-width: 40%; }
.paper .sigs .line { margin-top: 26px; font-weight: 400; letter-spacing: 2px; }
.paper .center-sig { text-align: center; font-weight: 800; margin-top: 24px; }
.paper .decl-title { text-align: center; font-weight: 800; font-size: 15px; margin-top: 18px; text-decoration: underline; }
.paper input.cell-in { width: 100%; border: none; border-bottom: 1px dashed #8aa; background: #f6fbff; font-family: inherit; font-size: 12px; text-align: center; padding: 2px; }
.pending-mark { color: var(--warn); font-size: 10px; }

/* ---------- مكونات الإصدار الثاني */
.sync-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 20px; cursor: pointer; white-space: nowrap; }
.sync-badge.off { background: #3d4a44; color: #fff; }
.sync-badge.wait { background: var(--warn-bg); color: var(--warn); }
.kpi-grid { display: grid; grid-template-columns: 1.25fr repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi-hero { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border: none; }
.kpi-hero .label, .kpi-hero .sub { color: rgba(255,255,255,.78); }
.kpi-hero::after { background: var(--accent); }
.kpi .sub { line-height: 1.5; }
a.kpi:hover { box-shadow: 0 6px 22px rgba(13,74,54,.13); }
.welcome-card { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border: none; position: relative; overflow: hidden; }
.welcome-card::after { content: ''; position: absolute; inset: auto -40px -60px auto; width: 180px; height: 180px; border-radius: 50%; border: 22px solid rgba(184,144,47,.25); }
.wallet-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wchip { background: var(--accent-soft); color: #6e5414; border-radius: 20px; padding: 2px 10px; font-size: 12px; }
.wallets { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 14px; }
.wallet { background: rgba(255,255,255,.1); border-radius: 10px; padding: 8px 10px; font-size: 12px; display: flex; flex-direction: column; }
.wallet b { font-size: 17px; }
.wallet small { opacity: .75; font-size: 11px; }
.wallet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.wallet-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.wallet-card.base { border-color: var(--accent); background: var(--accent-soft); }
.wallet-card .amt { font-size: 22px; font-weight: 800; margin: 2px 0; }
.queue-card { border-color: #f0c66b; }
.queue-card .card-head { background: var(--warn-bg); border-radius: var(--radius) var(--radius) 0 0; }
.fx-box { grid-column: 1 / -1; background: var(--accent-soft); border: 1px dashed #d9bd73; border-radius: 10px; padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 16px; }
.check-row { display: flex; gap: 24px; flex-wrap: wrap; }
.check-row input[type=checkbox] { width: 18px; height: 18px; }
.rate-box { background: var(--info-bg); color: #155447; border-radius: 10px; padding: 12px 14px; text-align: center; }
.alert-ok { background: var(--ok-bg); color: #145c33; }
.logo-preview { width: 110px; height: 110px; border: 1px dashed var(--border); border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); }
.logo-preview img { max-width: 96px; max-height: 96px; object-fit: contain; }
.sign-pad-wrap { border: 2px dashed var(--border); border-radius: 12px; background: #fff; }
.sign-pad-wrap canvas { width: 100%; height: auto; display: block; touch-action: none; cursor: crosshair; }
.sign-current { border: 1px solid var(--border); border-radius: 12px; min-height: 120px; display: grid; place-items: center; background: #fff; padding: 10px; }
.sign-current img { max-width: 100%; max-height: 140px; }
.sign-preview { display: flex; align-items: center; gap: 14px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--surface-2); }
.sign-preview img { max-height: 70px; max-width: 200px; }

/* رأس الكشوف الرسمي */
.paper .p-head { display: grid; grid-template-columns: 1fr 110px 1fr; align-items: center; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 8px; }
.paper .p-head-r { font-weight: 800; font-size: 13px; line-height: 1.6; }
.paper .p-head-c { text-align: center; }
.paper .p-head-c img { max-width: 90px; max-height: 90px; object-fit: contain; }
.paper .p-head-l { text-align: left; font-size: 12px; font-weight: 700; line-height: 1.8; }
.paper .p-sub { font-weight: 800; margin-top: 14px; text-align: center; text-decoration: underline; }
.paper .fx-note { font-size: 10.5px; color: #444; }
.paper .sig-img img { max-height: 58px; max-width: 170px; margin: 4px auto 0; display: block; }
.paper .sig-name { font-weight: 400; font-size: 12px; margin-top: 2px; }
.paper .e-stamp { display: flex; gap: 14px; align-items: center; border: 2px solid #1d6b3f; color: #134a2b; border-radius: 10px; padding: 10px 14px; margin-top: 18px; font-size: 12px; line-height: 1.7; }
.paper .e-stamp .qr svg { width: 92px; height: 92px; display: block; }
.paper .e-stamp .e-title { font-weight: 800; font-size: 14px; display: flex; gap: 6px; align-items: center; }

/* التحقق بخطوتين والأجهزة والنسخ */
.tf-icon { width: 54px; height: 54px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 10px; }
.tf-icon svg.ico { width: 30px; height: 30px; }
.code-input { text-align: center; font-size: 26px !important; letter-spacing: 8px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tf-steps { padding-inline-start: 20px; margin: 12px 0 6px; line-height: 1.9; }
.tf-qr { display: grid; place-items: center; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: 12px; margin: 6px auto; width: fit-content; }
.tf-qr svg { width: 200px; height: 200px; display: block; }
.tf-secret { letter-spacing: 2px; user-select: all; }
.rec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
.rec-grid span { background: var(--surface-2); border: 1px dashed var(--border); border-radius: 8px; padding: 8px; text-align: center; font-weight: 800; font-size: 17px; letter-spacing: 1px; }
.dev-list { display: flex; flex-direction: column; gap: 8px; }
.dev { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.dev.cur { border-color: var(--ok); background: var(--ok-bg); }
.dev-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; color: var(--primary-2); }
.bk-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.bk-stats > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.bk-stats b { font-size: 18px; }
.bk-stats span { font-size: 12px; color: var(--muted); }

@media (max-width: 1250px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .bk-stats { grid-template-columns: 1fr 1fr; } }

@media print {
  .paper .e-stamp { break-inside: avoid; }
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .sidebar, .topbar, .bottom-nav, .report-toolbar, .no-print, #toast-root { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  .paper { box-shadow: none; margin: 0; page-break-after: always; width: auto; min-height: auto; }
  .paper:last-child { page-break-after: auto; }
  .paper input.cell-in { border: none; background: none; }
}

/* ---------- الهاتف */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  body { font-size: 14px; }
  .sidebar { display: none; }
  .main { margin-right: 0; padding-bottom: 74px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-grid .kpi-hero { grid-column: 1 / -1; }
  .fx-box { grid-template-columns: 1fr; }
  .sync-badge { font-size: 11px; padding: 4px 8px; }
  .paper .p-head { grid-template-columns: 1fr 70px 1fr; }
  .paper .p-head-c img { max-width: 64px; }
  .login-logo { width: 80px; height: 80px; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 17px; }
  .content { padding: 16px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form-grid, .travel-box { grid-template-columns: 1fr; }
  .meta-list { grid-template-columns: 1fr 1fr; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border);
    z-index: 30; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; position: relative; }
  .bottom-nav a.active { color: var(--primary); font-weight: 800; }
  .bottom-nav svg { width: 22px; height: 22px; }
  .bottom-nav .dot { top: 0; left: 50%; margin-left: -22px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { padding: 32px 24px; }
  .login-side h1 { font-size: 24px; }
  .login-side ul { display: none; }
  .bar-row { grid-template-columns: 110px 1fr 80px; }
  .modal-back { padding: 0; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 94vh; overflow-y: auto; }
  .notif-panel { position: fixed; top: 60px; left: 8px; right: 8px; width: auto; }
  .tbl.cardify thead { display: none; }
  .tbl.cardify tr { display: block; border-bottom: 1px solid var(--border); padding: 10px 14px; }
  .tbl.cardify td { display: flex; justify-content: space-between; gap: 10px; border: none; padding: 3px 0; }
  .tbl.cardify td::before { content: attr(data-l); color: var(--muted); font-size: 12px; font-weight: 700; }
  .tbl.cardify td.no-label::before { content: none; }
  .tbl.cardify tfoot tr { display: block; }
  .paper { width: 100%; min-height: auto; padding: 14px; }
  .kpi .value { font-size: 21px; }
  #toast-root { left: 12px; right: 12px; bottom: 84px; }
}
