/* ثروت للاستيراد والتصدير — واجهة عربية RTL */
@font-face { font-family: Cairo; font-weight: 400; font-display: swap; src: url(/fonts/cairo-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Cairo; font-weight: 600; font-display: swap; src: url(/fonts/cairo-arabic-600-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Cairo; font-weight: 700; font-display: swap; src: url(/fonts/cairo-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Cairo; font-weight: 800; font-display: swap; src: url(/fonts/cairo-arabic-800-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Cairo; font-weight: 400; font-display: swap; src: url(/fonts/cairo-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF; }
@font-face { font-family: Cairo; font-weight: 700; font-display: swap; src: url(/fonts/cairo-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF; }

:root {
  --brand: #0F4C5C;
  --brand-2: #14627A;
  --brand-dark: #0A3440;
  --accent: #E8962B;
  --accent-soft: #FFF4E3;
  --bg: #F3F6F8;
  --card: #FFFFFF;
  --text: #1C2B33;
  --muted: #6B7C86;
  --line: #E2E8EC;
  --ok: #1E8E5A;
  --ok-soft: #E5F5EC;
  --bad: #C8372D;
  --bad-soft: #FCEBEA;
  --warn: #B7791F;
  --warn-soft: #FEF5E2;
  --radius: 16px;
  --shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 1px 2px rgba(12,48,60,.06), 0 12px 28px -14px rgba(12,48,60,.28);
  --glass: rgba(255,255,255,.62);
  --glass-border: rgba(255,255,255,.75);
  --sidebar: 248px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Cairo, 'Segoe UI', Tahoma, sans-serif; color: var(--text); font-size: 15px; line-height: 1.6;
  background:
    radial-gradient(900px 520px at 105% -8%, rgba(20,98,122,.20), transparent 60%),
    radial-gradient(760px 480px at -8% 108%, rgba(232,150,43,.16), transparent 58%),
    radial-gradient(600px 400px at 45% 50%, rgba(255,255,255,.55), transparent 70%),
    linear-gradient(180deg, #E9F0F3 0%, #E3EBEF 100%);
  background-attachment: fixed; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.3; }
h1 { font-size: 1.4rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
.num, .ltr { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }

/* ---------- الهيكل ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: linear-gradient(180deg, #0B3945 0%, #0F4C5C 55%, #0D4351 100%); color: #fff; position: fixed; inset: 0 0 0 auto; overflow-y: auto; z-index: 40; display: flex; flex-direction: column; transition: transform .28s ease; box-shadow: -10px 0 30px -12px rgba(5,30,38,.45); }
.sidebar .brand { padding: 18px 16px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand img { width: 100%; height: auto; display: block; }
.sidebar nav { padding: 10px 10px; flex: 1; }
.sidebar .group { color: rgba(255,255,255,.42); font-size: .7rem; margin: 16px 8px 6px; font-weight: 700; letter-spacing: .3px; }
/* تابات بارزة 3D */
.sidebar a { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.86); padding: 8px 14px; margin-bottom: 5px; border-radius: 10px; font-weight: 600; font-size: .92rem;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 2px 0 rgba(0,0,0,.22), 0 4px 8px -4px rgba(0,0,0,.35);
  transition: transform .12s, background .15s, box-shadow .15s; }
.sidebar a:hover { text-decoration: none; background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.05)); transform: translateY(-1px); }
.sidebar a:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 1px 0 rgba(0,0,0,.25); }
.sidebar a.active { color: #fff; background: linear-gradient(180deg, #F3A945, #D9821C);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 3px 0 #A35F10, 0 8px 16px -6px rgba(217,130,28,.65); }
.sidebar a .pill { margin-inline-start: auto; background: var(--bad); color: #fff; border-radius: 99px; font-size: .7rem; padding: 0 7px; box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.sidebar .dev { padding: 12px 16px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: .72rem; color: rgba(255,255,255,.55); text-align: center; }
.sidebar .dev img { height: 26px; width: auto; display: block; margin: 6px auto 0; }
.main { flex: 1; margin-inline-start: var(--sidebar); min-width: 0; display: flex; flex-direction: column; transition: margin .28s ease; }
.topbar { background: rgba(255,255,255,.66); -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%); border-bottom: 1px solid rgba(255,255,255,.8); box-shadow: 0 6px 20px -14px rgba(12,48,60,.4); padding: 10px 20px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; }
.topbar .title { font-weight: 800; font-size: 1.05rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; cursor: pointer; color: var(--brand); border: 1px solid #D3DEE3;
  background: linear-gradient(180deg, #fff, #EDF3F6); box-shadow: inset 0 1px 0 #fff, 0 2px 0 #C9D6DC, 0 5px 10px -6px rgba(0,0,0,.25); }
.menu-btn:active { transform: translateY(1px); box-shadow: inset 0 1px 0 #fff, 0 1px 0 #C9D6DC; }
.menu-btn svg, .bell svg { width: 20px; height: 20px; }
.topbar .who { font-size: .85rem; color: var(--muted); text-align: left; line-height: 1.3; }
.bell { position: relative; display: inline-flex; color: var(--brand); padding: 6px; border-radius: 10px; }
.bell:hover { background: rgba(15,76,92,.08); }
.bell b { position: absolute; top: -2px; left: -4px; background: var(--bad); color: #fff; border-radius: 99px; font-size: .66rem; padding: 0 6px; line-height: 1.5; }
.content { padding: 22px; flex: 1; max-width: 1440px; width: 100%; }
.footer { text-align: center; padding: 14px; font-size: .78rem; color: var(--muted); }
.footer img { height: 20px; vertical-align: middle; margin-inline-start: 4px; }
.backdrop { display: none; }

/* السايد بار بيتقفل ويتفتح */
@media (min-width: 901px) {
  body.sb-collapsed .sidebar { transform: translateX(100%); box-shadow: none; }
  body.sb-collapsed .main { margin-inline-start: 0; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(100%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(5,25,32,.45); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); z-index: 35; }
  .main { margin-inline-start: 0; }
  .content { padding: 14px; }
  .topbar .who { display: none; }
}

/* ---------- شريط النسخة التجريبية ---------- */
:root { --trial-h: 0px; }
body.has-trial { --trial-h: 38px; padding-top: var(--trial-h); }
.trial-bar { position: fixed; top: 0; inset-inline: 0; height: 38px; z-index: 60; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 12px;
  background: linear-gradient(90deg, #0B3945, #14627A 50%, #0B3945); color: #fff; font-size: .86rem; font-weight: 600; box-shadow: 0 4px 14px -6px rgba(0,0,0,.45); white-space: nowrap; overflow: hidden; }
.trial-bar .tb-label { background: linear-gradient(180deg, #F4AC4C, #DB861E); color: #fff; padding: 1px 10px; border-radius: 99px; font-size: .76rem; box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 0 #A2600F; }
.trial-bar .tb-time { font-size: 1.05rem; letter-spacing: 1px; background: rgba(255,255,255,.12); padding: 0 10px; border-radius: 8px; font-family: Consolas, monospace; }
.trial-bar .tb-dev { opacity: .75; font-size: .76rem; }
.trial-bar.urgent { background: linear-gradient(90deg, #7E1E18, #C8372D 50%, #7E1E18); }
body.has-trial .sidebar { top: var(--trial-h); }
body.has-trial .topbar, body.has-trial .rep-top { top: var(--trial-h); }
body.has-trial .login-wrap { min-height: calc(100vh - var(--trial-h)); }
@media (max-width: 640px) { .trial-bar .tb-dev, .trial-bar > span:nth-child(2) { display: none; } }

/* ---------- عناصر (كروت زجاجية 3D) ---------- */
.card { background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stat { background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.stat .lbl { color: var(--muted); font-size: .8rem; font-weight: 600; }
.stat .val { font-size: 1.4rem; font-weight: 800; direction: ltr; text-align: right; color: #13303A; }
.stat .sub { font-size: .76rem; color: var(--muted); }
.stat.bad .val { color: var(--bad); }
.stat.ok .val { color: var(--ok); }

/* أزرار بارزة 3D */
.btn { --b: var(--brand); --b2: #1B6E86; --edge: #082C36; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid rgba(0,0,0,.08); color: #fff; padding: 8px 16px; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; font-size: .9rem; white-space: nowrap;
  background: linear-gradient(180deg, var(--b2), var(--b));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 3px 0 var(--edge), 0 8px 14px -8px rgba(0,0,0,.45);
  transition: transform .1s, box-shadow .1s, filter .15s; position: relative; top: 0; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 0 var(--edge), 0 3px 6px -4px rgba(0,0,0,.4); }
.btn.accent { --b: #DB861E; --b2: #F4AC4C; --edge: #A2600F; }
.btn.ok { --b: #187A4C; --b2: #26A066; --edge: #0F5534; }
.btn.danger { --b: #B22D24; --b2: #D6493E; --edge: #7E1E18; }
.btn.light { color: var(--brand); border-color: #D2DDE2; background: linear-gradient(180deg, #FFFFFF, #ECF2F5); box-shadow: inset 0 1px 0 #fff, 0 3px 0 #C6D3D9, 0 8px 14px -10px rgba(0,0,0,.35); }
.btn.light:active { box-shadow: inset 0 1px 0 #fff, 0 1px 0 #C6D3D9; }
.btn.sm { padding: 4px 11px; font-size: .8rem; border-radius: 8px; }
.btn.lg { padding: 12px 20px; font-size: 1.05rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.flash { padding: 10px 14px; border-radius: 9px; margin-bottom: 12px; font-weight: 600; }
.flash.success { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.flash.info { background: #E8F3F7; color: var(--brand); }

/* ---------- نماذج ---------- */
form .row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 12px; }
label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 4px; color: #33464F; }
input, select, textarea { width: 100%; font: inherit; padding: 8px 11px; border: 1px solid #CBD5DB; border-radius: 9px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(20, 98, 122, .25); border-color: var(--brand-2); }
input[type=number], .ltr-input { direction: ltr; text-align: right; }
input[readonly] { background: #F4F7F9; }
textarea { min-height: 70px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.filters > div { min-width: 140px; }
.filters input, .filters select { padding: 6px 10px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 3px; }

/* ---------- جداول ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: rgba(232,240,244,.75); font-weight: 700; color: #3B4F59; white-space: nowrap; font-size: .8rem; }
tbody tr:hover { background: rgba(255,255,255,.55); }

/* ---------- النظرة العامة ---------- */
.ov-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.ov-head h1 { margin: 0; font-size: 1.5rem; letter-spacing: -.2px; }
.ov-head .sub { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { padding: 16px 18px 14px; }
.kpi .k-lbl { font-size: .78rem; color: var(--muted); font-weight: 700; }
.kpi .k-val { font-size: 1.65rem; font-weight: 800; color: #10303A; direction: ltr; text-align: right; line-height: 1.25; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-val small { font-size: .78rem; color: var(--muted); font-weight: 600; margin-left: 4px; }
.kpi .k-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: .76rem; color: var(--muted); }
.delta { font-weight: 700; direction: ltr; unicode-bidi: isolate; padding: 1px 8px; border-radius: 99px; font-size: .74rem; }
.delta.up { color: var(--ok); background: rgba(30,142,90,.12); }
.delta.down { color: var(--bad); background: rgba(200,55,45,.10); }
.delta.flat { color: var(--muted); background: rgba(107,124,134,.12); }
.mini { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 0; overflow: hidden; }
.mini > a, .mini > div { padding: 14px 16px; border-inline-start: 1px solid rgba(15,76,92,.08); color: inherit; display: block; }
.mini > :first-child { border-inline-start: 0; }
.mini > a:hover { background: rgba(255,255,255,.5); text-decoration: none; }
.mini .m-lbl { font-size: .76rem; color: var(--muted); font-weight: 700; }
.mini .m-val { font-size: 1.15rem; font-weight: 800; direction: ltr; text-align: right; font-variant-numeric: tabular-nums; margin-top: 2px; }
.ov-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: .78rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.seg { display: inline-flex; background: rgba(15,76,92,.07); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a { padding: 3px 12px; border-radius: 8px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.seg a.on { background: #fff; color: var(--brand); box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 2px 6px -2px rgba(0,0,0,.2); text-decoration: none; }
.rank td:first-child { color: var(--muted); width: 26px; }
.tag { font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 6px; }
.tag.paid { color: var(--ok); background: rgba(30,142,90,.1); }
.tag.part { color: var(--warn); background: rgba(183,121,31,.12); }
.tag.due { color: var(--bad); background: rgba(200,55,45,.1); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mini { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ov-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .mini { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi .k-val { font-size: 1.3rem; } }
tfoot td { font-weight: 800; background: #F5F8FA; }
td.n, th.n { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.low td { background: var(--bad-soft); }
.empty { text-align: center; color: var(--muted); padding: 26px; }

.badge { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: .76rem; font-weight: 700; background: #E8EEF1; color: #3B4F59; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.brand { background: #E3F0F4; color: var(--brand); }
.code { font-family: Consolas, monospace; direction: ltr; unicode-bidi: isolate; font-size: .85rem; background: #EEF3F5; padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
.thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; background: #EEF3F5; display: block; }

.bar { height: 9px; background: #E8EEF1; border-radius: 99px; overflow: hidden; min-width: 70px; }
.bar > i { display: block; height: 100%; background: var(--brand-2); border-radius: 99px; }
.bar.bad > i { background: var(--bad); }
.bar.accent > i { background: var(--accent); }
.hbar { display: grid; grid-template-columns: minmax(90px, 1.2fr) 3fr auto; gap: 10px; align-items: center; margin-bottom: 8px; font-size: .88rem; }
.hbar .bar { height: 14px; }

/* ---------- بنود الفواتير ---------- */
.lines td { padding: 6px; }
.lines input, .lines select { padding: 6px 8px; }
.lines .del { background: none; border: 0; color: var(--bad); font-size: 1.2rem; cursor: pointer; }
.totals { display: grid; gap: 6px; max-width: 360px; margin-inline-start: auto; }
.totals div { display: flex; justify-content: space-between; gap: 10px; }
.totals .grand { font-size: 1.2rem; font-weight: 800; color: var(--brand); border-top: 2px solid var(--line); padding-top: 6px; }

/* ---------- تسجيل الدخول ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #1B6F86 0, var(--brand-dark) 60%); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 28px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-card .logo { display: block; width: 260px; max-width: 100%; margin: 0 auto 6px; }
.login-card .sub { text-align: center; color: var(--muted); margin-bottom: 18px; font-weight: 600; }
.login-dev { text-align: center; margin-top: 18px; color: rgba(255,255,255,.7); font-size: .8rem; }
.login-dev img { height: 34px; display: block; margin: 6px auto 0; }

/* ---------- تطبيق المندوب ---------- */
.rep-body { background: var(--bg); padding-bottom: 76px; }
.rep-top { background: linear-gradient(135deg, var(--brand-dark), var(--brand-2)); color: #fff; padding: 12px 14px 14px; position: sticky; top: 0; z-index: 30; }
.rep-top .row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rep-top img.mark { height: 34px; }
.rep-top .t { font-weight: 800; font-size: 1.05rem; }
.rep-top a { color: #fff; }
.rep-main { padding: 12px; max-width: 720px; margin: 0 auto; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 16px 10px; text-align: center; color: var(--text); font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tile:hover { text-decoration: none; background: #FAFCFD; }
.tile .i { font-size: 1.8rem; }
.tile.primary { background: var(--accent); color: #fff; grid-column: span 2; flex-direction: row; justify-content: center; font-size: 1.1rem; }
.bottom-nav { position: fixed; bottom: 0; inset-inline: 0; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { text-align: center; padding: 7px 2px 6px; font-size: .72rem; color: var(--muted); font-weight: 700; }
.bottom-nav a .i { display: block; font-size: 1.3rem; line-height: 1.2; }
.bottom-nav a.active { color: var(--brand); }
.list-item { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 10px; align-items: center; color: var(--text); }
.list-item:hover { text-decoration: none; }
.list-item .t { font-weight: 700; }
.list-item .s { font-size: .8rem; color: var(--muted); }
.list-item .v { font-weight: 800; direction: ltr; white-space: nowrap; }

/* ---------- مستند للطباعة / PDF ---------- */
.doc { background: #fff; max-width: 820px; margin: 0 auto; padding: 26px; border-radius: var(--radius); box-shadow: var(--shadow); }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; border-bottom: 3px solid var(--accent); padding-bottom: 12px; margin-bottom: 14px; }
.doc-head img { height: 64px; }
.doc-head .meta { text-align: left; font-size: .88rem; }
.doc-title { font-size: 1.3rem; font-weight: 800; color: var(--brand); }
.doc-info { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin-bottom: 14px; font-size: .92rem; }
.doc-foot { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: .75rem; color: var(--muted); }
.doc-foot img { height: 22px; }

@media (max-width: 640px) {
  .doc { padding: 14px; }
  .doc-head img { height: 40px; }
  .doc-title { font-size: 1.05rem; }
  .doc-info { grid-template-columns: 1fr; }
  .doc table { font-size: .82rem; }
  .doc th, .doc td { padding: 6px 5px; }
}
/* وضع توليد PDF: عرض ثابت مهما كان حجم الشاشة */
.doc.pdf-mode { width: 780px !important; max-width: none !important; padding: 26px !important; box-shadow: none; }
.doc.pdf-mode .doc-head img { height: 64px; }
.doc.pdf-mode .doc-title { font-size: 1.3rem; }
.doc.pdf-mode .doc-info { grid-template-columns: 1fr 1fr; }
.doc.pdf-mode table { font-size: .9rem; }

@media print {
  .sidebar, .topbar, .no-print, .bottom-nav, .rep-top, .footer, .flash { display: none !important; }
  .main { margin: 0 !important; }
  .content, .rep-main { padding: 0 !important; max-width: none; }
  body, .rep-body { background: #fff; padding: 0; }
  .card, .doc { box-shadow: none; padding: 0; }
  a { color: inherit; }
  tr { page-break-inside: avoid; }
}
