/* ===== لوحة الألوان المقترحة (مؤقتة وقابلة للتعديل من هنا فقط) ===== */
:root {
  --navy: #12284a;
  --navy-2: #1d3f6e;
  --teal: #0e8a8a;
  --teal-dark: #0a6d6d;
  --teal-soft: #e2f3f1;
  --bg: #f5f2ec;
  --card: #ffffff;
  --ok: #1f8a4c;
  --ok-soft: #e4f4ea;
  --warn: #c2650c;
  --warn-soft: #fdf0e0;
  --bad: #c62e2e;
  --bad-soft: #fce8e8;
  --ink: #1b2230;
  --muted: #667085;
  --line: #ebe5da;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(18, 40, 74, .05), 0 6px 20px rgba(18, 40, 74, .06);
  --font: "Tajawal", "Cairo", "Noto Sans Arabic", "Segoe UI", Tahoma, "Geeza Pro", Arial, sans-serif;
  --nav-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6;
  color: var(--ink); background: var(--bg); direction: rtl;
  padding-bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden; overflow-x: clip;
}
h1, h2, h3, h4 { color: var(--navy); line-height: 1.35; margin: 0 0 .5rem; }
h2 { font-size: 1.2rem; font-weight: 800; } h3 { font-size: 1.05rem; font-weight: 800; } h4 { font-size: .98rem; }
p { margin: .3rem 0 .6rem; }
a { color: var(--teal-dark); }
bdi.num, .num { font-variant-numeric: tabular-nums; unicode-bidi: isolate; direction: ltr; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden, [hidden] { display: none !important; }
:focus-visible { outline: 3px solid #f2b84b; outline-offset: 2px; }

/* ===== الرأس ===== */
.topbar {
  position: sticky; top: 0; z-index: 30; color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  display: flex; align-items: center; gap: .65rem; padding: .6rem .9rem;
  padding-top: calc(.6rem + env(safe-area-inset-top, 0px));
  box-shadow: 0 2px 12px rgba(18, 40, 74, .18);
}
.brand { flex: 1; min-width: 0; }
.brand .t { font-weight: 900; font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; letter-spacing: 0; }
.brand .s { font-size: .8rem; opacity: .82; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .bian { color: #8fe0dc; font-weight: 800; }
.iconbtn { background: rgba(255,255,255,.1); border: 0; color: #fff; border-radius: 12px; width: 44px; height: 44px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.trial-pill { flex: none; font-size: .74rem; font-weight: 800; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }

.trial-note { display: flex; gap: .55rem; align-items: flex-start; background: #fff7ea; border: 1px solid #f3dcb7; color: #7a4a0c; border-radius: 14px; padding: .6rem .8rem; font-size: .88rem; margin-bottom: .9rem; line-height: 1.55; }
.trial-note b { color: #8a4b05; }
.example-banner { background: var(--warn-soft); border-bottom: 1px solid #f0cf9e; padding: .55rem .9rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .9rem; }
.example-banner b { color: var(--warn); }
.example-banner .grow { flex: 1 1 180px; }

/* ===== التنقل السفلي ===== */
.nav {
  position: fixed; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); right: 8px; left: 8px; z-index: 30;
  background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 8px 28px rgba(18, 40, 74, .16);
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px; gap: 4px;
}
.nav button { background: none; border: 0; font: inherit; color: var(--muted); height: calc(var(--nav-h) - 12px); border-radius: 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .76rem; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.nav button svg { width: 22px; height: 22px; }
.nav button[aria-current="page"] { color: var(--teal-dark); background: var(--teal-soft); }

main { max-width: 1120px; margin: 0 auto; padding: 1rem .9rem 1.5rem; }
.footer { text-align: center; padding: 1.4rem .8rem 1.6rem; color: var(--muted); font-size: .88rem; max-width: 1120px; margin: 0 auto; }
.footer .motto { color: var(--navy); font-weight: 900; font-size: 1.05rem; }

/* ===== عناصر عامة ===== */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: .9rem; border: 1px solid var(--line); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.card-title h3 { margin: 0; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.btn {
  font: inherit; font-size: .98rem; min-height: 46px; padding: .45rem 1rem; border-radius: 12px; border: 1px solid var(--teal);
  background: var(--teal); color: #fff; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; text-decoration: none;
}
.btn:hover { background: var(--teal-dark); }
.btn.secondary { background: #fff; color: var(--teal-dark); border-color: #bfe0dc; }
.btn.secondary:hover { background: var(--teal-soft); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--teal-dark); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.sm { min-height: 44px; padding: .3rem .8rem; font-size: .92rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }

.seg { display: flex; background: #ebe6dc; border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; font: inherit; font-size: .92rem; font-weight: 700; border: 0; background: transparent; border-radius: 11px; min-height: 42px; padding: 0 .6rem; cursor: pointer; color: var(--muted); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--teal-dark); box-shadow: 0 1px 4px rgba(18,40,74,.12); }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 800; white-space: nowrap; line-height: 1.6; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn, .badge.below { background: var(--warn-soft); color: var(--warn); }
.badge.bad, .badge.deficit, .badge.error { background: var(--bad-soft); color: var(--bad); }
.badge.info, .badge.lock { background: #e9eef7; color: var(--navy); }

/* ===== بطاقة الملخص الرئيسية ===== */
.hero { background: linear-gradient(140deg, var(--navy) 0%, var(--navy-2) 70%, #23527f 100%); color: #fff; border-radius: 22px; padding: 1rem; margin-bottom: .8rem; box-shadow: 0 10px 30px rgba(18, 40, 74, .25); }
.hero .mnav { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.hero .mnav button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 1.3rem; cursor: pointer; }
.hero .mnav .lbl { font-weight: 800; font-size: 1.05rem; text-align: center; }
.hero .mnav .lbl small { display: block; font-size: .76rem; font-weight: 600; opacity: .8; }
.hero .big-k { margin-top: .8rem; font-size: .85rem; opacity: .85; }
.hero .big-v { font-size: 2.1rem; font-weight: 900; line-height: 1.15; margin: .1rem 0 .35rem; overflow-wrap: anywhere; }
.hero .big-v.neg { color: #ffb4b4; }
.hero .chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 800; padding: .2rem .65rem; border-radius: 999px; }
.hero .chip.ok { background: rgba(77, 212, 140, .2); color: #a9f0c8; }
.hero .chip.below { background: rgba(255, 170, 80, .22); color: #ffd39e; }
.hero .chip.deficit { background: rgba(255, 110, 110, .25); color: #ffc4c4; }
.hero .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; margin-top: .85rem; }
.hero .stat { background: rgba(255,255,255,.1); border-radius: 14px; padding: .5rem .55rem; min-width: 0; }
.hero .stat span { display: block; font-size: .74rem; opacity: .8; }
.hero .stat b { display: block; font-size: .98rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; }
.hero .meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; align-items: center; }
.hero .meta .tag { font-size: .76rem; background: rgba(255,255,255,.12); padding: .15rem .55rem; border-radius: 999px; }
.hero .hbtn { font: inherit; font-size: .84rem; font-weight: 800; border: 0; border-radius: 10px; padding: .35rem .7rem; min-height: 36px; background: #fff; color: var(--navy); cursor: pointer; }
.hero .hbtn.ghost { background: rgba(255,255,255,.14); color: #fff; }

/* ===== قوائم القيم ===== */
.kv { display: grid; grid-template-columns: 1fr auto; margin: 0; }
.kv dt { color: var(--muted); padding: .55rem 0; border-bottom: 1px solid #f1ece4; font-size: .93rem; }
.kv dd { margin: 0; padding: .55rem 0; border-bottom: 1px solid #f1ece4; font-weight: 800; text-align: left; color: var(--ink); }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.kv .strong { color: var(--navy); font-weight: 900; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.tile { background: #f8f6f1; border-radius: 14px; padding: .6rem .7rem; min-width: 0; }
.tile span { display: block; font-size: .8rem; color: var(--muted); }
.tile b { display: block; font-size: 1.05rem; color: var(--navy); font-weight: 900; overflow: hidden; text-overflow: ellipsis; }
.tile.wide { grid-column: 1 / -1; }
.tile.accent { background: var(--teal-soft); }
.tile.st-deficit { background: var(--bad-soft); } .tile.st-deficit b { color: var(--bad); }
.tile.st-below { background: var(--warn-soft); }
.tile.st-ok { background: var(--ok-soft); }

.status { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; border-radius: 14px; margin: .5rem 0; font-size: .93rem; line-height: 1.6; }
.status .ic { font-weight: 900; flex: none; width: 1.55rem; height: 1.55rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: .85rem; margin-top: .1rem; }
.status.ok { background: var(--ok-soft); } .status.ok .ic { background: var(--ok); }
.status.warn, .status.below { background: var(--warn-soft); } .status.warn .ic, .status.below .ic { background: var(--warn); }
.status.bad, .status.deficit, .status.error { background: var(--bad-soft); } .status.bad .ic, .status.deficit .ic, .status.error .ic { background: var(--bad); }
.status.info { background: #edf1f8; } .status.info .ic { background: var(--navy); }

.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li { padding: .5rem 0; border-bottom: 1px solid #f1ece4; display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; font-size: .92rem; }
.alert-list li:last-child { border-bottom: 0; }
.note { background: #f1ede5; border-radius: 12px; padding: .6rem .8rem; color: var(--muted); font-size: .88rem; margin: .6rem 0; line-height: 1.6; }

/* ===== النماذج ===== */
label.f { display: block; margin-bottom: .85rem; }
.f > span.l, label.f > span.l { display: block; font-weight: 800; color: var(--navy); margin-bottom: .3rem; font-size: .95rem; }
label.f > small, .hint { display: block; color: var(--muted); font-size: .84rem; margin-top: .25rem; line-height: 1.5; }
input[type=text], input[type=search], select, textarea {
  font: inherit; font-size: 16px; width: 100%; min-height: 48px; padding: .5rem .8rem; border-radius: 12px;
  border: 1px solid #d9d1c3; background: #fff; color: var(--ink); transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,138,138,.15); }
input.amt { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: .2px; }
input.amt::placeholder { text-align: right; direction: rtl; font-weight: 400; }
.amt-wrap { position: relative; }
.amt-wrap .cur-tag { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); font-size: .78rem; color: var(--muted); pointer-events: none; }
.amt-wrap input.amt { padding-right: 4.6rem; }
input:disabled, select:disabled { background: #f2efe9; color: var(--muted); }
textarea { min-height: 80px; }
.field-err { color: var(--bad); font-size: .84rem; font-weight: 800; display: block; margin-top: .25rem; }
input.invalid { border-color: var(--bad); background: #fff8f8; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.mpick { display: grid; grid-template-columns: 1.4fr 1fr; gap: .45rem; }
.check { display: flex; gap: .55rem; align-items: flex-start; padding: .45rem 0; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; margin-top: .2rem; accent-color: var(--teal); }
.form-section { font-size: .8rem; font-weight: 800; color: var(--teal-dark); margin: .4rem 0 .6rem; padding-bottom: .3rem; border-bottom: 1px dashed var(--line); }

/* ===== قوائم العملاء والبنود ===== */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: .5rem; flex-wrap: wrap; margin: .2rem 0 .8rem; }
.page-head h2 { margin: 0; }
.page-head p { margin: .1rem 0 0; color: var(--muted); font-size: .88rem; }
.search { position: relative; margin-bottom: .8rem; }
.search input { padding-right: 2.6rem; }
.search svg { position: absolute; right: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; margin-bottom: .9rem; }
.summary-strip .tile b { font-size: .95rem; }
.item { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: .65rem; border: 1px solid var(--line); overflow: hidden; }
.item > .head { width: 100%; background: none; border: 0; font: inherit; text-align: right; padding: .8rem .9rem; display: flex; gap: .7rem; align-items: center; cursor: pointer; color: inherit; }
.avatar { flex: none; width: 42px; height: 42px; border-radius: 13px; background: var(--teal-soft); color: var(--teal-dark); display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.05rem; }
.avatar.out { background: #eef0fa; color: #3b4a8a; }
.item .who { flex: 1; min-width: 0; }
.item .who .nm { display: block; font-weight: 800; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .who .sub { display: flex; gap: .35rem; align-items: center; margin-top: .15rem; flex-wrap: wrap; }
.item .amt-side { text-align: left; flex: none; }
.item .amt-side span { display: block; font-size: .74rem; color: var(--muted); }
.item .amt-side b { font-size: 1rem; color: var(--navy); }
.item .chev { color: var(--muted); transition: transform .2s; flex: none; }
.item.open .chev { transform: rotate(180deg); }
.progress { height: 6px; background: #efeae1; border-radius: 99px; overflow: hidden; margin: 0 .9rem .75rem; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), #36b3a8); border-radius: 99px; }
.item > .body { padding: .2rem .9rem .95rem; border-top: 1px solid var(--line); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin-top: .75rem; }
.actions .full { grid-column: 1 / -1; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 1.4rem 0 .6rem; }
.section-title h2, .section-title h3 { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 1.3rem .8rem; background: #fff; border-radius: var(--radius); border: 1px dashed #d8cfbf; margin-bottom: .8rem; font-size: .92rem; }

/* ===== الرسوم ===== */
.chart { width: 100%; height: auto; display: block; touch-action: manipulation; }
.chart text { font-family: var(--font); }
.chart .hit { cursor: pointer; fill: transparent; }
.chart .hit.on { fill: rgba(14, 138, 138, .1); }
.legend { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .82rem; color: var(--muted); margin: .2rem 0 .3rem; }
.legend i { display: inline-block; width: 16px; height: 4px; border-radius: 2px; vertical-align: middle; margin-inline-end: .3rem; }
.pickinfo { background: #f4f8f8; border-radius: 12px; padding: .6rem .8rem; margin-top: .5rem; font-size: .9rem; min-height: 3.2rem; }
.charts { display: grid; gap: 1rem; }

/* ===== التقرير ===== */
.period-bar { display: grid; grid-template-columns: 44px 1fr 44px; gap: .4rem; align-items: center; }
.period-bar button { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--navy); font-size: 1.2rem; cursor: pointer; }
.period-bar .lbl { text-align: center; font-weight: 800; color: var(--navy); line-height: 1.3; }
.period-bar .lbl small { display: block; color: var(--muted); font-weight: 600; font-size: .78rem; }
.mcards details { background: #fff; border: 1px solid var(--line); border-radius: 16px; margin-bottom: .55rem; box-shadow: var(--shadow); overflow: hidden; }
.mcards summary { list-style: none; display: flex; align-items: center; gap: .6rem; padding: .75rem .9rem; cursor: pointer; }
.mcards summary::-webkit-details-marker { display: none; }
.mcards .mname { flex: 1; min-width: 0; font-weight: 800; color: var(--navy); }
.mcards .mname small { display: block; font-weight: 600; color: var(--muted); font-size: .76rem; }
.mcards .mclose { text-align: left; }
.mcards .mclose b { display: block; font-size: 1rem; }
.mcards .mclose b.neg { color: var(--bad); }
.mcards details[open] summary { border-bottom: 1px solid var(--line); background: #fbfaf7; }
.mcards .mbody { padding: .4rem .9rem .8rem; }
.mcards .grp { font-size: .8rem; font-weight: 800; color: var(--teal-dark); margin: .6rem 0 .1rem; }
.mcards .kv dt, .mcards .kv dd { padding: .35rem 0; font-size: .9rem; }
.rep-table { display: none; }
.tablewrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: #fff; max-width: 100%; }
table.rep { border-collapse: collapse; font-size: .9rem; min-width: 100%; }
table.rep th, table.rep td { padding: .5rem .6rem; border-bottom: 1px solid #f0ebe2; white-space: nowrap; text-align: left; }
table.rep th:first-child, table.rep td:first-child { text-align: right; background: #fff; min-width: 11rem; white-space: normal; }
table.rep thead th { background: var(--navy); color: #fff; font-weight: 700; }
table.rep thead th:first-child { background: var(--navy); }
table.rep tr.grp td { background: #f6f2ea; color: var(--navy); font-weight: 800; }
table.rep tr.tot td, table.rep tr.tot th { font-weight: 800; color: var(--navy); background: #fbf9f5; }
table.rep tr.bal td, table.rep tr.bal th { font-weight: 800; background: var(--teal-soft); }
table.rep td.neg { color: var(--bad); }
table.rep td.zero { color: #b0a99f; }

/* ===== النوافذ (لوحات سفلية على الهاتف) ===== */
.overlay { position: fixed; inset: 0; background: rgba(13, 25, 45, .5); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; box-shadow: 0 -6px 30px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal > header { padding: .5rem 1rem .7rem; background: #fff; border-radius: 22px 22px 0 0; border-bottom: 1px solid var(--line); }
.modal > header .hrow { display: flex; align-items: center; gap: .5rem; }
.modal > header h2 { margin: 0; flex: 1; font-size: 1.05rem; }
.modal > header .x { background: #f2efe9; border: 0; font-size: 1.3rem; width: 40px; height: 40px; border-radius: 12px; cursor: pointer; color: var(--muted); }
.modal .handle { width: 42px; height: 5px; border-radius: 99px; background: #d9d3c8; margin: 0 auto .5rem; }
.modal .mbody { padding: 1rem; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.modal > footer { padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--line); display: flex; gap: .5rem; }
.modal > footer .btn { flex: 1 1 0; }
.sticky-sum { position: sticky; top: -1rem; margin: -1rem -1rem .8rem; padding: .7rem 1rem; background: #fff; border-bottom: 1px solid var(--line); z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: .25rem .9rem; font-size: .88rem; }
.sticky-sum div { display: flex; justify-content: space-between; gap: .3rem; }
.sticky-sum .full { grid-column: 1 / -1; }
.mcard { background: #fff; border-radius: 14px; padding: .75rem .85rem; margin-bottom: .55rem; border: 1px solid var(--line); }
.mcard.locked { background: #f5f3ef; }
.mcard.cur { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.mcard h4 { margin: 0 0 .45rem; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; font-size: .98rem; }
.mcard .pair .small { display: block; margin-bottom: .2rem; color: var(--muted); font-size: .8rem; }
.preview { background: #fff; border-radius: 14px; padding: .75rem .9rem; border: 1px solid var(--line); margin: .6rem 0; }

.drawer-ov { position: fixed; inset: 0; background: rgba(13,25,45,.45); z-index: 50; }
.drawer { position: fixed; top: 0; bottom: 0; right: 0; width: min(320px, 86vw); background: #fff; z-index: 51; padding: 1rem; overflow-y: auto; box-shadow: -6px 0 30px rgba(0,0,0,.2); border-radius: 22px 0 0 22px; }
.drawer h2 { display: flex; justify-content: space-between; align-items: center; }
.drawer .menu { list-style: none; padding: 0; margin: 0 0 1rem; }
.drawer .menu li button { width: 100%; text-align: right; font: inherit; font-weight: 700; background: none; border: 0; border-radius: 12px; min-height: 52px; padding: .3rem .6rem; cursor: pointer; color: var(--ink); font-size: .98rem; }
.drawer .menu li button:hover { background: #f6f3ee; }
.drawer .menu li button.danger { color: var(--bad); }

.toast { position: fixed; bottom: calc(var(--nav-h) + 26px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: .65rem 1.1rem; border-radius: 14px; z-index: 80; box-shadow: 0 6px 20px rgba(0,0,0,.25); width: max-content; max-width: 92vw; font-size: .92rem; font-weight: 700; }
.toast.err { background: var(--bad); }
.toast.warn { background: var(--warn); }

.welcome { max-width: 620px; margin: 0 auto; }
.welcome .hero-w { text-align: center; padding: 1.2rem .8rem 1rem; }
.welcome .hero-w .logo { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 20px; background: linear-gradient(135deg, var(--navy), var(--teal)); color: #fff; font-weight: 900; font-size: 1.15rem; margin-bottom: .6rem; box-shadow: 0 8px 22px rgba(14,138,138,.3); }
.welcome .hero-w .big { font-size: 1.8rem; font-weight: 900; color: var(--navy); margin: 0; }
.welcome .hero-w .sub { color: var(--teal-dark); font-weight: 800; margin: .1rem 0 .4rem; }

/* ===== الحاسوب ===== */
@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .nav { position: sticky; top: 64px; bottom: auto; right: auto; left: auto; margin: .8rem auto 0; max-width: 640px; }
  .nav button { flex-direction: row; gap: .45rem; font-size: .95rem; height: 46px; }
  .hero .big-v { font-size: 2.5rem; }
  .overlay { align-items: center; }
  .modal { border-radius: 22px; max-height: 88vh; }
  .modal > footer { border-radius: 0 0 22px 22px; }
  .modal .handle { display: none; }
  .twocol { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; align-items: start; }
  .charts { grid-template-columns: 1fr 1fr; }
  .toast { bottom: 24px; }
  .items-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; align-items: start; }
  .summary-strip { grid-template-columns: repeat(6, 1fr); }
}
@media (min-width: 900px) {
  .rep-cards { display: none; }
  .rep-table { display: block; }
}
@media (max-width: 380px) {
  .hero .big-v { font-size: 1.8rem; }
  .hero .stat b { font-size: .88rem; }
  .trial-pill { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print { body * { display: none !important; } }
