/* رقي فلو — نظام التصميم. الألوان من دليل الهوية v8، والخط ثمانية. */
@font-face { font-family: "Thmanyah Sans"; src: url("../fonts/thmanyahsans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("../fonts/thmanyahsans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("../fonts/thmanyahsans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("../fonts/thmanyahsans-Black.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --teal: #015560;
  --teal-dark: #013840;
  --teal-50: #e6f0f1;
  --teal-100: #cfe2e4;
  --bronze: #816349;
  --bronze-light: #c9ae92;
  --cream: #f0ece1;
  --paper: #faf8f3;
  --surface: #ffffff;
  --ink: #17282b;
  --ink-2: #4a5a5d;
  --ink-3: #7b8789;
  --line: #e4e0d6;
  --line-2: #d6d1c4;
  --ok: #2f7a4f;    --ok-bg: #e7f3ec;
  --warn: #9a6512;  --warn-bg: #fbf1de;
  --bad: #a23b32;   --bad-bg: #f8e7e5;
  --info: #015560;  --info-bg: #e6f0f1;
  --mute-bg: #f1efe9;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(1, 56, 64, .06);
  --shadow: 0 1px 3px rgba(1, 56, 64, .08), 0 6px 18px rgba(1, 56, 64, .06);
  --shadow-lg: 0 12px 40px rgba(1, 56, 64, .18);
  --sidebar: 256px;
  --font: "Thmanyah Sans", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.65; color: var(--ink);
  background: var(--paper); font-feature-settings: "kern"; -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.06rem; }
p { margin: 0 0 .5em; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); } .small { font-size: .875rem; } .tiny { font-size: .78rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(1, 85, 96, .45); outline-offset: 2px; border-radius: 6px; }

/* ---------- الهيكل ---------- */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar); z-index: 30;
  background: var(--teal-dark); color: var(--cream); display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 18px; color: var(--cream); }
.brand img { width: 46px; height: auto; }
.brand b { display: block; font-size: 1.2rem; font-weight: 900; letter-spacing: 0; }
.brand span { display: block; font-size: .78rem; color: var(--bronze-light); }
.nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-label { font-size: .72rem; color: rgba(240, 236, 225, .5); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
  color: rgba(240, 236, 225, .82); font-weight: 500; text-decoration: none;
}
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: rgba(240, 236, 225, .12); color: #fff; box-shadow: inset -3px 0 0 var(--bronze-light); }
.nav a .count { margin-inline-start: auto; background: var(--bronze); color: #fff; border-radius: 99px; font-size: .72rem; padding: 0 8px; line-height: 20px; }
.side-user { border-top: 1px solid rgba(240, 236, 225, .1); padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.side-user .who { flex: 1; min-width: 0; }
.side-user .who b { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who span { display: block; font-size: .75rem; color: var(--bronze-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user button { background: none; border: 0; color: rgba(240, 236, 225, .7); cursor: pointer; padding: 6px; border-radius: 8px; }
.side-user button:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--bronze); color: #fff; font-weight: 700; font-size: .9rem;
}
.avatar.lg { width: 48px; height: 48px; font-size: 1.05rem; }
.avatar.light { background: var(--teal-50); color: var(--teal); }

.main { margin-inline-start: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
body { overflow-x: hidden; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(250, 248, 243, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 12px 32px; min-height: 64px;
}
.topbar .crumbs { flex: 1; min-width: 0; }
.topbar .crumbs .trail { font-size: .8rem; color: var(--ink-3); }
.topbar .crumbs .trail a { color: var(--ink-3); }
.topbar .crumbs h1 { font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .mobile-brand { display: none; }
.icon-btn {
  position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot {
  position: absolute; top: 6px; inset-inline-end: 6px; min-width: 18px; height: 18px; border-radius: 99px; padding: 0 5px;
  background: var(--bad); color: #fff; font-size: .7rem; line-height: 18px; text-align: center; font-weight: 700;
}
.content { padding: 28px 32px 64px; width: 100%; max-width: 1240px; }
.content.narrow { max-width: 860px; }

.bottom-nav { display: none; }

/* ---------- البطاقات والشبكات ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { flex: 1; }
.card-body { padding: 18px 22px; }
.grid { display: grid; gap: 20px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; }
.section-title h2 { font-size: 1.1rem; flex: 1; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent; font-weight: 700; cursor: pointer; white-space: nowrap;
  text-decoration: none !important; transition: background .15s, border-color .15s, color .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-secondary { background: var(--surface); color: var(--teal); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--teal); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--mute-bg); color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: #e6c3bf; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-bronze { background: var(--bronze); color: #fff; }
.btn-bronze:hover { background: #6d523c; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .88rem; border-radius: 8px; }
.btn-lg { min-height: 50px; padding: 0 26px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- الشارات والحالات ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: .8rem;
  font-weight: 700; white-space: nowrap; background: var(--mute-bg); color: var(--ink-2); line-height: 1.6;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.bronze { background: #f3ebe2; color: var(--bronze); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--mute-bg); color: var(--ink-2); font-size: .78rem; }

/* ---------- النماذج ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: .92rem; }
.field .hint { font-size: .8rem; color: var(--ink-3); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.6; }
.input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(1, 85, 96, .15); }
.input.ltr { text-align: left; }
.input-wrap { position: relative; }
.input-wrap .input { padding-inline-end: 46px; }
.input-wrap .reveal { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; color: var(--ink-3); padding: 6px; }
.form-error { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 10px 14px; font-size: .92rem; margin-bottom: 14px; }
.form-ok { background: var(--ok-bg); color: var(--ok); border-radius: 10px; padding: 10px 14px; font-size: .92rem; margin-bottom: 14px; }
.checks { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; font-size: .84rem; }
.checks li { display: flex; align-items: center; gap: 8px; color: var(--ink-3); }
.checks li::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; }
.checks li.ok { color: var(--ok); }
.checks li.ok::before { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 3px #fff; }
.meter { height: 6px; border-radius: 99px; background: var(--mute-bg); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; background: var(--bad); transition: width .2s, background .2s; }
.check-line { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check-line input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--teal); flex: none; }

.seg { display: inline-flex; background: var(--mute-bg); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-weight: 700; color: var(--ink-2); font-size: .9rem; }
.seg button.on { background: var(--surface); color: var(--teal); box-shadow: var(--shadow-sm); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: 5px 14px; cursor: pointer; font-size: .88rem; font-weight: 500; color: var(--ink-2); }
.chip:hover { border-color: var(--teal); color: var(--teal); }
.chip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip .n { opacity: .7; margin-inline-start: 4px; font-size: .78rem; }

/* ---------- القوائم والجداول ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 22px; color: inherit; text-decoration: none !important; }
a.item:hover, button.item:hover { background: #fcfbf8; }
button.item { width: 100%; border: 0; background: none; text-align: start; cursor: pointer; }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 700; display: block; }
.item .s { font-size: .84rem; color: var(--ink-3); display: block; }
.chev { color: var(--ink-3); width: 18px; height: 18px; flex: none; }
.action-card .chev { color: inherit; opacity: .7; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: start; font-weight: 700; color: var(--ink-2); font-size: .8rem; padding: 10px 14px; background: #fbfaf6; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.center, .table th.center { text-align: center; }

.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.empty svg { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--line-2); }
.empty b { display: block; color: var(--ink-2); margin-bottom: 4px; }
.skeleton { background: linear-gradient(90deg, #eeebe3 25%, #f6f4ee 50%, #eeebe3 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; height: 16px; }
@keyframes sk { to { background-position: -200% 0; } }
.loading-page { padding: 40px 0; display: grid; gap: 12px; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--info-bg); color: var(--teal-dark); font-size: .92rem; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.notice.warn { background: var(--warn-bg); color: #6f4a0f; }
.notice.ok { background: var(--ok-bg); color: #1f5536; }
.notice.bad { background: var(--bad-bg); color: #7c2b24; }
.notice b { display: block; }

/* ---------- الرئيسية ---------- */
.hello { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.hello h1 { font-size: 1.75rem; font-weight: 900; color: var(--teal-dark); }
.hello .date { color: var(--ink-3); font-size: .92rem; }
.action-card {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius-lg);
  background: var(--teal); color: #fff; text-decoration: none !important; box-shadow: var(--shadow);
}
.action-card:hover { background: var(--teal-dark); }
.action-card .ic { width: 46px; height: 46px; border-radius: 12px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; flex: none; }
.action-card .ic svg { width: 24px; height: 24px; }
.action-card .grow { flex: 1; }
.action-card b { display: block; font-size: 1.05rem; }
.action-card span { font-size: .86rem; opacity: .85; }
.action-card.admin { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.action-card.admin .ic { background: var(--teal-50); color: var(--teal); }
.action-card.admin:hover { border-color: var(--teal); background: var(--surface); }
.meeting-hero { padding: 20px 22px; display: flex; gap: 18px; align-items: center; }
.date-block { width: 70px; flex: none; text-align: center; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.date-block .m { background: var(--bronze); color: #fff; font-size: .74rem; padding: 3px 0; font-weight: 700; }
.date-block .d { font-size: 1.7rem; font-weight: 900; color: var(--teal-dark); line-height: 1.5; }
.date-block .w { font-size: .72rem; color: var(--ink-3); padding-bottom: 4px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.stat b { display: block; font-size: 1.5rem; font-weight: 900; color: var(--teal-dark); line-height: 1.3; }
.stat span { font-size: .8rem; color: var(--ink-3); }

/* ---------- التقويم ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cal-head h2 { flex: 1; font-size: 1.1rem; }
.cal-head .hijri { font-size: .82rem; color: var(--ink-3); font-weight: 500; display: block; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-grid .dow { text-align: center; font-size: .78rem; color: var(--ink-3); padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.cal-cell { min-height: 104px; border-inline-start: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; }
.cal-cell:nth-child(7n + 1) { border-inline-start: 0; }
.cal-cell.out { background: #fbfaf7; }
.cal-cell.out .dn { color: var(--line-2); }
.cal-cell .dn { display: flex; justify-content: space-between; align-items: baseline; font-size: .86rem; font-weight: 700; color: var(--ink-2); }
.cal-cell .dn small { font-size: .7rem; color: var(--ink-3); font-weight: 400; }
.cal-cell.today .dn > span:first-child { background: var(--teal); color: #fff; border-radius: 99px; min-width: 26px; text-align: center; padding: 0 6px; }
.cal-ev { display: block; font-size: .76rem; padding: 3px 7px; border-radius: 6px; background: var(--teal-50); color: var(--teal-dark); font-weight: 700; line-height: 1.4; text-decoration: none !important; border-inline-start: 3px solid var(--teal); }
.cal-ev.ga { background: #f3ebe2; color: var(--bronze); border-color: var(--bronze); }
.cal-ev.held { opacity: .7; }

/* ---------- المحضر ---------- */
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.doc-head { padding: 24px 28px 18px; border-bottom: 1px solid var(--line); }
.doc-head h2 { font-size: 1.35rem; color: var(--teal-dark); font-weight: 900; }
.doc-meta { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; margin-top: 14px; font-size: .92rem; }
.doc-meta dt { color: var(--ink-3); }
.doc-meta dd { margin: 0; }
.doc-intro { padding: 16px 28px; background: #fcfbf7; border-bottom: 1px solid var(--line); font-size: .95rem; color: var(--ink-2); }
.doc-section { padding: 6px 0 10px; border-bottom: 1px solid var(--line); }
.doc-section:last-child { border-bottom: 0; }
.doc-section > h3 { display: flex; align-items: center; gap: 10px; padding: 18px 28px 8px; color: var(--teal); font-size: 1.05rem; }
.doc-section > h3 .bn { background: var(--teal); color: #fff; border-radius: 8px; font-size: .78rem; padding: 2px 10px; }
.doc-para { padding: 4px 28px 8px; color: var(--ink-2); font-size: .95rem; }
.decision { margin: 10px 20px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--surface); transition: border-color .15s, background .15s; }
.decision.voted { border-color: #cfe2d6; background: #fbfdfb; }
.decision.recused { background: #faf9f6; }
.decision.focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(1, 85, 96, .12); }
.decision .dh { display: flex; align-items: flex-start; gap: 12px; }
.decision .no { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--teal-50); color: var(--teal); font-weight: 900; display: grid; place-items: center; font-size: .9rem; }
.decision.voted .no { background: var(--ok-bg); color: var(--ok); }
.decision .dt { flex: 1; min-width: 0; }
.decision .dt .title { font-weight: 700; font-size: .84rem; color: var(--ink-3); display: block; margin-bottom: 2px; }
.decision .dt .text { font-size: .98rem; }
.decision ul { margin: 6px 0 0; padding-inline-start: 22px; font-size: .94rem; color: var(--ink-2); }
.decision .vote-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); padding-inline-start: 46px; }
.vote-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 9px; padding: 6px 14px; cursor: pointer; font-weight: 700; font-size: .9rem; color: var(--ink-2); }
.vote-btn svg { width: 16px; height: 16px; }
.vote-btn:hover:not([disabled]) { border-color: var(--ink-3); }
.vote-btn.on.approve { background: var(--ok); border-color: var(--ok); color: #fff; }
.vote-btn.on.reject { background: var(--bad); border-color: var(--bad); color: #fff; }
.vote-btn.on.abstain { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.vote-btn[disabled] { cursor: default; opacity: .9; }
.tally { display: inline-flex; gap: 10px; font-size: .8rem; color: var(--ink-3); margin-inline-start: auto; }
.tally b { color: var(--ink-2); }
.note-input { width: 100%; margin-top: 8px; }
.budget-table { margin: 10px 0 2px; font-size: .84rem; }
.budget-table td:not(:first-child), .budget-table th:not(:first-child) { text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; }
.budget-table tr.group td { font-weight: 700; background: #fbfaf6; }
.budget-table tr.total td { font-weight: 900; color: var(--teal-dark); border-top: 2px solid var(--line-2); }

.sticky-bar {
  position: sticky; bottom: 0; z-index: 15; margin-top: 20px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 12px 16px; display: flex; align-items: center; gap: 14px;
}
.progress { height: 8px; border-radius: 99px; background: var(--mute-bg); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .3s; }
.sig-list { list-style: none; margin: 0; padding: 0; }
.sig-list li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.sig-list li:last-child { border-bottom: 0; }
.sig-list .grow { flex: 1; min-width: 0; }
.sig-img { height: 44px; width: auto; max-width: 120px; object-fit: contain; }
.matrix th, .matrix td { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: start; }
.mx { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-size: .78rem; font-weight: 900; }
.mx.approve { background: var(--ok-bg); color: var(--ok); }
.mx.reject { background: var(--bad-bg); color: var(--bad); }
.mx.abstain { background: var(--mute-bg); color: var(--ink-2); }
.mx.recused { color: var(--ink-3); font-weight: 400; }
.mx.none { color: var(--line-2); }

/* لوحة التوقيع */
.sigpad { position: relative; border: 2px dashed var(--line-2); border-radius: 12px; background: #fff; touch-action: none; }
.sigpad canvas { width: 100%; height: 200px; display: block; cursor: crosshair; border-radius: 10px; }
.sigpad .base { position: absolute; inset-inline: 24px; bottom: 44px; border-bottom: 1px solid var(--line-2); pointer-events: none; }
.sigpad .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); pointer-events: none; font-size: .95rem; }
.sig-preview { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px; display: grid; place-items: center; min-height: 110px; }
.sig-preview img { max-height: 120px; }

/* ---------- المهام ---------- */
.task-due { font-size: .8rem; color: var(--ink-3); white-space: nowrap; }
.task-due.late { color: var(--bad); font-weight: 700; }
.people { display: inline-flex; }
.people .avatar { width: 28px; height: 28px; font-size: .72rem; border: 2px solid #fff; margin-inline-start: -8px; }
.people .avatar:first-child { margin-inline-start: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 22px 18px 0; border-inline-start: 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 0; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--teal); }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 4px; top: 20px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }

/* ---------- المكتبة ---------- */
.lib-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search svg { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.search .input { padding-inline-start: 42px; }
.folder-head { padding: 10px 22px; background: #fbfaf6; border-bottom: 1px solid var(--line); font-size: .82rem; color: var(--ink-2); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.folder-head svg { width: 16px; height: 16px; color: var(--bronze); }
.file-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: .68rem; font-weight: 900; color: #fff; letter-spacing: .02em; }
.file-ic.pdf { background: #b5473b; } .file-ic.docx { background: #2f5d9e; } .file-ic.xlsx { background: #2f7a4f; }
.file-ic.pptx { background: #c0652b; } .file-ic.html { background: var(--teal); } .file-ic.img { background: var(--bronze); }
.file-ic.other { background: #8a9496; }

/* ---------- عن الجمعية ---------- */
.about-hero { background: var(--teal-dark); color: var(--cream); border-radius: var(--radius-lg); padding: 34px 32px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; overflow: hidden; position: relative; }
.about-hero img { width: 300px; max-width: 70%; }
.about-hero .slogan { font-size: 1.3rem; color: var(--bronze-light); font-weight: 700; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.facts > div { padding: 12px 22px; border-bottom: 1px solid var(--line); }
.facts dt { font-size: .8rem; color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 700; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.swatch { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.swatch i { display: block; height: 64px; }
.swatch div { padding: 8px 10px; font-size: .8rem; }

/* ---------- الدخول ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-brand { background: var(--teal-dark); color: var(--cream); display: flex; flex-direction: column; justify-content: center; padding: 56px; position: relative; overflow: hidden; }
.auth-brand img.logo { width: 320px; max-width: 80%; }
.auth-brand h2 { font-size: 2rem; font-weight: 900; margin-top: 36px; }
.auth-brand p { color: var(--bronze-light); font-size: 1.1rem; margin-top: 6px; }
.auth-brand ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; color: rgba(240, 236, 225, .85); }
.auth-brand li { display: flex; gap: 10px; align-items: center; }
.auth-brand li svg { width: 20px; height: 20px; color: var(--bronze-light); }
.auth-brand .mark { position: absolute; inset-inline-end: -120px; bottom: -80px; width: 480px; opacity: .06; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.6rem; font-weight: 900; color: var(--teal-dark); }
.auth-card .lead { color: var(--ink-2); margin: 6px 0 24px; }
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps i { flex: 1; height: 4px; border-radius: 99px; background: var(--line); }
.steps i.on { background: var(--teal); }

/* ---------- النوافذ والإشعارات ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 16px; box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); color: var(--ink); background: var(--surface); }
dialog.modal.wide { width: min(760px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(1, 30, 35, .45); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; font-size: 1.15rem; }
.modal-body { padding: 20px 22px; overflow-y: auto; max-height: calc(100vh - 220px); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-start; padding: 14px 22px; border-top: 1px solid var(--line); background: #fcfbf8; }
.invite-code { font-size: 1.8rem; font-weight: 900; letter-spacing: .12em; text-align: center; padding: 16px; border-radius: 12px; background: var(--cream); color: var(--teal-dark); direction: ltr; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.msg-box { white-space: pre-wrap; background: #fbfaf6; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: .9rem; }

.popover { position: absolute; top: 56px; inset-inline-end: 24px; width: 360px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 40; overflow: hidden; }
.popover .item { padding: 12px 16px; }
.popover .item.unread { background: #f6faf9; }
.popover .item .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--teal-50); color: var(--teal); display: grid; place-items: center; flex: none; }
.popover .item .ic svg { width: 18px; height: 18px; }

.toasts { position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(50%); z-index: 100; display: grid; gap: 8px; }
.toast { background: var(--teal-dark); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 500; display: flex; align-items: center; gap: 10px; animation: tin .2s ease-out; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); }
.toast svg { width: 18px; height: 18px; flex: none; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- الطباعة ---------- */
.print-only { display: none; }
@media print {
  .sidebar, .topbar, .bottom-nav, .no-print, .sticky-bar, .toasts { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  .print-only { display: block; }
  body { background: #fff; font-size: 12px; }
  .card, .doc { box-shadow: none; border-color: #ccc; }
  .table th { position: static; }
  tr, .decision { break-inside: avoid; }
}

/* ---------- الجوال ---------- */
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-inline-start: 0; padding-bottom: 72px; }
  .topbar { padding: 10px 16px; min-height: 58px; }
  .topbar .crumbs h1 { font-size: 1.08rem; }
  .topbar .mobile-brand { display: block; width: 34px; }
  .content { padding: 18px 16px 48px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: 1fr; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; inset-inline: 0; z-index: 25;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--ink-3); text-decoration: none; background: none; border: 0; padding: 4px 0; cursor: pointer; position: relative; }
  .bottom-nav svg { width: 22px; height: 22px; }
  .bottom-nav .active { color: var(--teal); font-weight: 700; }
  .bottom-nav .count { position: absolute; top: 0; inset-inline-end: 22%; background: var(--bad); color: #fff; border-radius: 99px; font-size: .62rem; min-width: 16px; line-height: 16px; padding: 0 4px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { padding: 32px 24px; }
  .auth-brand h2, .auth-brand ul, .auth-brand .mark { display: none; }
  .auth-brand img.logo { width: 200px; }
  .auth-brand p { font-size: .95rem; }
  .doc-head, .doc-intro { padding-inline: 16px; }
  .doc-section > h3, .doc-para { padding-inline: 16px; }
  .decision { margin: 10px 10px; padding: 12px; }
  .decision .vote-row { padding-inline-start: 0; }
  .doc-meta { grid-template-columns: 1fr; gap: 0 0; }
  .doc-meta dt { margin-top: 8px; }
  .cal-cell { min-height: 64px; padding: 4px; }
  .cal-ev { font-size: 0; padding: 0; height: 6px; border-radius: 3px; border: 0; background: var(--teal); }
  .cal-ev.ga { background: var(--bronze); }
  .cal-cell .dn small { display: none; }
  .sticky-bar { bottom: 76px; flex-wrap: wrap; }
  .popover { inset-inline-end: 8px; }
  .meeting-hero { padding: 16px; }
  .item { padding: 12px 16px; }
  .card-head, .card-body { padding-inline: 16px; }
  .hide-sm { display: none !important; }
  .backdrop { position: fixed; inset: 0; background: rgba(1, 30, 35, .4); z-index: 29; }
}
@media (min-width: 861px) { .show-sm { display: none !important; } }

/* أحجام الأيقونات داخل النصوص */
.meeting-hero .row svg, .row.small svg { width: 16px; height: 16px; flex: none; }
.badge svg { width: 13px; height: 13px; }
.badge:has(svg)::before { display: none; }
.tag { text-decoration: none !important; }

img.avatar { object-fit: cover; background: var(--cream); padding: 0; }
.avatar.xl { width: 96px; height: 96px; font-size: 1.6rem; }

/* ---------- v0.2: المرفقات والفروق والمحرر ---------- */
.decision.pending { border-color: #ecd7a9; background: #fffcf4; }
.mx.unconfirmed { opacity: .45; outline: 1px dashed currentColor; }
.attachment { padding: 8px 28px 22px; border-bottom: 1px solid var(--line); }
.attachment:last-child { border-bottom: 0; }
.attachment > h3 { display: flex; align-items: center; gap: 10px; padding: 14px 0 8px; color: var(--teal); font-size: 1.02rem; }
.attachment > h3 .bn, .x-att .bn { background: var(--bronze); color: #fff; border-radius: 8px; font-size: .78rem; padding: 2px 10px; }
.att-img { max-width: 100%; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; }
.att-h { margin: 12px 0 4px; font-size: .95rem; color: var(--teal-dark); }
.att-p { margin: 4px 0; font-size: .95rem; }
.att-li { margin: 2px 0; font-size: .94rem; padding-inline-start: 8px; }
.att-table { font-size: .85rem; margin: 8px 0; }
.att-signers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.diff-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.diff { border-inline-start: 4px solid var(--line-2); padding: 8px 12px; background: #fbfaf6; border-radius: 8px; font-size: .9rem; }
.diff.add { border-color: var(--ok); } .diff.remove { border-color: var(--bad); } .diff.change { border-color: var(--warn); }
.diff-before { color: var(--bad); margin-top: 4px; white-space: pre-wrap; }
.diff-after { color: var(--ok); margin-top: 4px; white-space: pre-wrap; }
.ed-block { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fdfcf9; }
.decision-ed { border-color: var(--teal-100); background: #f8fbfb; }
.reader p { padding: 0 28px; margin: 6px 0; line-height: 1.85; }
.reader h2, .reader h3, .reader h4 { padding: 0 28px; margin: 22px 0 8px; color: var(--teal-dark); }
.reader .att-li { padding: 0 36px; }
.reader .table-wrap { padding: 0 28px; }
.reader blockquote { margin: 8px 28px; padding: 8px 14px; border-inline-start: 3px solid var(--bronze-light); background: #fbfaf6; }
.reader-toc { margin: 18px 28px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf6; }
.reader-toc ul { margin: 6px 0 0; padding-inline-start: 18px; columns: 2; font-size: .88rem; }
.reader > *:last-child { margin-bottom: 24px; }

/* ---------- المحضر النهائي (شاشة وطباعة A4) ---------- */
.x-wrap { background: #e9e6de; padding: 24px; border-radius: 14px; overflow-x: auto; }
.x-page { position: relative; width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff; box-shadow: var(--shadow); color: #1b2a2d; font-size: 11.5pt; line-height: 1.7; }
.x-lh { position: absolute; inset: 0; width: 210mm; height: 297mm; z-index: 0; }
.x-frame { position: relative; z-index: 1; width: 100%; border-collapse: collapse; table-layout: fixed; }
.x-body { overflow-wrap: break-word; }
.x-table.fixed { table-layout: fixed; }
.x-frame > thead > tr > td, .x-frame > tfoot > tr > td, .x-frame > tbody > tr > td { padding: 0 19mm; }
.x-top { height: 66mm; } .x-bottom { height: 46mm; }
.x-page:not(.has-lh) .x-top { height: 20mm; } .x-page:not(.has-lh) .x-bottom { height: 18mm; }
.x-title { font-size: 16pt; text-align: center; color: var(--teal-dark); margin: 0 0 10px; font-weight: 900; }
.x-sec { font-size: 12.5pt; color: var(--teal); margin: 14px 0 6px; border-bottom: 1px solid #d9e5e6; padding-bottom: 2px; break-after: avoid; }
.x-body p { margin: 4px 0; text-align: justify; }
.x-dec { margin: 4px 0 6px; break-inside: avoid; }
.x-dec ul { margin: 2px 0; padding-inline-start: 22px; }
.x-table { width: 100%; border-collapse: collapse; margin: 6px 0 10px; font-size: 10pt; break-inside: auto; }
.x-table th, .x-table td { border: 1px solid #b9c9cb; padding: 4px 6px; vertical-align: middle; }
.x-table th { background: #eef4f4; font-weight: 700; color: var(--teal-dark); }
.x-table td.c { text-align: center; }
.x-table tr { break-inside: avoid; }
.x-meta th { width: 28%; text-align: start; }
.x-sigs td.x-sigcell { width: 34%; height: 18mm; text-align: center; }
.x-sig { max-height: 16mm; max-width: 100%; margin: 0 auto; }
.x-seal-row { display: flex; align-items: center; gap: 12px; margin: 6px 0 12px; }
.x-seal { width: 30mm; height: 30mm; opacity: .92; }
.x-att { break-before: page; }
.x-att-h { font-size: 12pt; color: var(--bronze); margin: 0; }
.x-att-t { font-size: 13pt; color: var(--teal-dark); margin: 2px 0 8px; }
.x-img { width: 100%; margin: 6px 0; }
.x-body .att-table { font-size: 9.5pt; }
.x-body .att-table th, .x-body .att-table td { border: 1px solid #b9c9cb; padding: 3px 6px; }
.x-body .table-wrap { overflow: visible; }
.x-body .budget-table { font-size: 9pt; }
.x-body .budget-table td, .x-body .budget-table th { border: 1px solid #b9c9cb; padding: 2px 6px; }
@media print {
  @page { size: A4; margin: 0; }
  .x-wrap { background: none; padding: 0; border-radius: 0; overflow: visible; }
  .x-page { width: 210mm; min-height: 0; box-shadow: none; margin: 0; }
  html, body { width: 210mm; }
  .x-lh { position: fixed; top: 0; left: 0; right: 0; width: 210mm; height: 297mm; }
  .notice, .sticky-bar { display: none !important; }
  .content { max-width: none !important; }
}

/* ===== النسخة التجريبية ===== */
.trial-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 16px;background:#8a5a12;color:#fff;font-size:13px;line-height:1.5}
.trial-bar svg{width:16px;height:16px;flex:none}
.trial-bar b{font-weight:700}
.x-trial{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:5}
.x-trial span{transform:rotate(-32deg);font-size:46px;font-weight:700;color:rgba(160,40,40,.16);border:4px solid rgba(160,40,40,.16);padding:6px 26px;border-radius:12px;white-space:nowrap}
@media screen{.x-trial{position:absolute;flex-direction:column;justify-content:flex-start;gap:200mm;padding-top:110mm;overflow:hidden}}
@media print{.x-trial span+span{display:none}}
@media print{.trial-bar{display:none!important}}

.x-sigs{break-inside:avoid;page-break-inside:avoid}
.x-sealcell{text-align:center;vertical-align:middle}
.x-sealcell .x-seal{width:20mm;height:20mm;max-width:100%}
.x-sealcell{padding:2px!important}
.x-att{font-size:10.5pt;line-height:1.6}
.x-att .x-table td,.x-att .x-table th{padding-top:3px;padding-bottom:3px}

/* ---------- الهوية البصرية ---------- */
.id-hero { background: var(--teal-dark); color: var(--cream); border-radius: var(--radius-lg); padding: 24px 26px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 14px; }
.id-hero img { width: 220px; max-width: 60%; }
.id-hero .slogan { font-size: 1.2rem; color: var(--bronze-light); font-weight: 700; }
.btn-light { background: var(--cream); color: var(--teal-dark); border-color: var(--cream); }
.btn-light:hover { background: #fff; }
.id-quick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.id-quick .chip { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.id-quick .chip svg { width: 15px; height: 15px; }
.id-swatch { text-align: right; font: inherit; color: inherit; cursor: pointer; padding: 0; }
.id-swatch:hover { border-color: var(--teal); }
.id-section { margin-bottom: 16px; overflow: hidden; }
.id-sec-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.id-sec-head h2 { font-size: 1.05rem; }
.id-sec-head p { margin: 2px 0 0; }
.id-num { background: var(--teal-50); color: var(--teal); font-weight: 700; border-radius: 8px; padding: 2px 9px; font-size: .9rem; }
.id-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; padding: 16px 18px; }
.id-tile { position: relative; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); overflow: hidden; }
.id-tile:hover { border-color: var(--teal); box-shadow: var(--shadow); }
.id-open { display: flex; flex-direction: column; width: 100%; padding: 0 0 10px; border: 0; background: none; text-align: right; font: inherit; color: inherit; cursor: pointer; }
.id-thumb { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: #fff; border-bottom: 1px solid var(--line);
  background-image: linear-gradient(45deg, #f3f1ec 25%, transparent 25%), linear-gradient(-45deg, #f3f1ec 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f3f1ec 75%), linear-gradient(-45deg, transparent 75%, #f3f1ec 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.id-thumb.dark { background: var(--teal-dark); }
.id-thumb.light { background: var(--cream); }
.id-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.id-play { position: absolute; inset-inline-start: 8px; bottom: 8px; background: rgba(1, 56, 64, .85); color: #fff; border-radius: 99px; width: 28px; height: 28px; display: grid; place-items: center; }
.id-play svg { width: 15px; height: 15px; }
.id-kind { font-weight: 700; font-size: .95rem; color: var(--teal); background: var(--teal-50); border-radius: 8px; padding: 6px 12px; }
.id-kind.pdf { color: var(--bad); background: var(--bad-bg); }
.id-name { padding: 8px 10px 0; font-weight: 500; font-size: .86rem; line-height: 1.45; word-break: break-word; padding-inline-end: 38px; }
.id-sub { padding: 2px 10px 0; padding-inline-end: 44px; font-size: .74rem; color: var(--ink-3); line-height: 1.5; }
.id-dl { position: absolute; inset-inline-end: 6px; bottom: 6px; background: var(--surface); border: 1px solid var(--line); }
.id-preview { display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; min-height: 220px; max-height: 62vh; overflow: auto; padding: 10px; }
.id-preview.dark { background: var(--teal-dark); }
.id-preview.light { background: var(--cream); }
.id-preview img, .id-preview video { max-width: 100%; max-height: 58vh; object-fit: contain; }
.id-preview .id-thumb { width: 200px; border: 0; }
.id-pdf { width: 100%; height: 58vh; border: 0; background: #fff; }
.id-facts { display: flex; gap: 22px; flex-wrap: wrap; margin: 12px 0 0; }
.id-facts dt { font-size: .76rem; color: var(--ink-3); }
.id-facts dd { margin: 0; font-weight: 700; font-size: .9rem; }
.id-rules summary { cursor: pointer; }
.id-rules ul { margin: 10px 0 0; padding-inline-start: 20px; color: var(--ink-2); font-size: .92rem; }
@media (max-width: 860px) {
  .id-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
  .id-hero { padding: 18px; }
  .id-hero .btn { width: 100%; justify-content: center; }
  .id-sec-head .btn span { font-size: .8rem; }
  .id-colors .swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .id-colors .swatch i { height: 34px; }
  .id-colors .swatch div div:last-child { display: none; }
}

/* ---------- المالية (v0.4) ---------- */
.fin-tabs { display: flex; gap: 4px; margin: -4px 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.fin-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; color: var(--ink-2); font-weight: 700; font-size: .92rem; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; text-decoration: none !important; }
.fin-tabs a svg { width: 17px; height: 17px; }
.fin-tabs a:hover { color: var(--teal); }
.fin-tabs a.on { color: var(--teal); border-bottom-color: var(--teal); }
.fin-trial { margin-bottom: 16px; }
.fin-stats .fin-stat { display: flex; flex-direction: column; gap: 2px; border-top: 3px solid var(--teal); }
.fin-stat.ok { border-top-color: var(--ok); } .fin-stat.bad { border-top-color: var(--bad); } .fin-stat.warn { border-top-color: #c98a1e; }
.fin-stat b { font-size: 1.35rem; }
.fin-stat small { font-size: .76rem; color: var(--ink-3); }
.cur { font-size: .62em; font-weight: 500; color: var(--ink-3); }
.fin-table td.n, .fin-table th.n { text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fin-table td.n.neg, .fin-table td.neg { color: var(--bad); font-weight: 700; }
.fin-table tr.click { cursor: pointer; }
.fin-table tr.click:hover td { background: #fbfaf6; }
.fin-table tr.muted-row td { color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.2); }
.fin-table tr.group td { font-weight: 700; background: #fbfaf6; font-size: .86rem; color: var(--teal-dark); }
.fin-table tr.total td { font-weight: 900; color: var(--teal-dark); border-top: 2px solid var(--line-2); }
.fin-table .ic-inline, .fin-behalf .ic-inline { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; }
.fin-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fin-kind { border: 1.5px solid var(--line-2); background: var(--surface); border-radius: 12px; padding: 12px; cursor: pointer; text-align: start; font-size: .9rem; color: var(--ink-2); }
.fin-kind:hover { border-color: var(--teal); }
.fin-kind.on { border-color: var(--teal); background: var(--teal-50); color: var(--teal-dark); box-shadow: inset 0 0 0 1px var(--teal); }
.fin-kind-help { margin-top: 4px; }
.fin-sub { background: var(--paper); border: 1px dashed var(--line-2); border-radius: 12px; padding: 14px 14px 0; margin-bottom: 16px; }
.field .req { color: var(--bad); }
.fin-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.fin-head .fin-amount { margin-top: 10px; }
.fin-amount { font-size: 2rem; font-weight: 900; color: var(--teal-dark); line-height: 1.2; }
.fin-amount.sm { font-size: 1.3rem; }
.fin-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.fin-attach { gap: 8px; border-top: 1px solid var(--line); }
.fin-attach .input { flex: 1; min-width: 160px; }
.fin-attach select.input { flex: 0 1 180px; }
.fin-chain { list-style: none; margin: 0; padding: 16px 22px; display: grid; gap: 0; }
.fin-chain li { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.fin-chain li:last-child { padding-bottom: 0; }
.fin-chain li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 13px; top: 28px; bottom: 2px; width: 2px; background: var(--line); }
.fin-chain .dot { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-2); color: #fff; }
.fin-chain .dot svg { width: 15px; height: 15px; }
.fin-chain li.done .dot { background: var(--ok); border-color: var(--ok); }
.fin-chain li.done:not(:last-child)::after { background: var(--ok); }
.fin-chain li.current .dot { border-color: #c98a1e; box-shadow: 0 0 0 4px var(--warn-bg); }
.fin-chain li.current b { color: #8a5a0e; }
.fin-turn { border: 2px solid var(--teal); }
.fin-behalf-card { border: 2px dashed #c98a1e; background: #fffaf0; }
.fin-behalf { color: #8a5a0e; background: var(--warn-bg); border-radius: 6px; padding: 4px 8px; margin: 4px 0; display: inline-block; }
.progress.hot > i { background: #c98a1e; }
.fin-seg { flex-wrap: wrap; }
.fin-coa { max-height: 520px; overflow-y: auto; }
.fin-statement .budget-table td:first-child { white-space: normal; }

/* أمر الصرف للطباعة */
.fin-order { background: #fff; max-width: 820px; margin: 0 auto; padding: 36px 40px; border: 1px solid var(--line); border-radius: 6px; position: relative; }
.fin-order header { display: flex; align-items: center; gap: 16px; border-bottom: 3px solid var(--teal); padding-bottom: 14px; margin-bottom: 18px; }
.fin-order header img { width: 64px; }
.fin-order header > div:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.fin-order header b { font-size: 1.2rem; color: var(--teal-dark); }
.fin-order header .no { text-align: center; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 14px; display: flex; flex-direction: column; }
.fin-order header .no span { font-size: .75rem; color: var(--ink-3); }
.fin-order h3 { margin: 22px 0 8px; font-size: 1rem; color: var(--teal-dark); }
.fin-order-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.fin-order-table th, .fin-order-table td { border: 1px solid var(--line-2); padding: 7px 10px; text-align: start; vertical-align: top; }
.fin-order-table tbody th { width: 30%; background: #fbfaf6; font-weight: 700; }
.fin-order-table thead th { background: var(--teal-50); }
.fin-order-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 10px; }
.fin-order-signs div { display: flex; flex-direction: column; gap: 46px; font-size: .88rem; }
.fin-order-signs i { border-bottom: 1px solid var(--ink-2); }
.fin-order footer { margin-top: 30px; font-size: .75rem; color: var(--ink-3); text-align: center; }
.fin-order-trial { position: absolute; top: 40%; inset-inline: 0; text-align: center; font-size: 2.4rem; font-weight: 900; color: rgba(162, 59, 50, .14); transform: rotate(-18deg); pointer-events: none; }
@media print {
  .fin-tabs, .fin-trial { display: none !important; }
  .fin-order { border: 0; padding: 0; max-width: none; }
}
@media (max-width: 860px) {
  .fin-kinds { grid-template-columns: 1fr; }
  .fin-order { padding: 20px 16px; }
  .fin-amount { font-size: 1.6rem; }
}
.fin-stat b span { font-size: inherit; color: inherit; }
.fin-stat b .cur { font-size: .55em; color: var(--ink-3); }
.fin-controls .input { width: auto; min-width: 0; }
.fin-controls select.input { max-width: 260px; }
.fin-rule { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 0; background: var(--paper); }
.fin-rule-members { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 860px) { .fin-rule-members { grid-template-columns: 1fr; } }

/* v0.5: في الجوال يفتح الدرج من اليسار، جهة زرّي «القائمة» و«المزيد» */
@media (max-width: 860px) {
  .sidebar { inset-inline-start: auto; inset-inline-end: 0; transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .nav a.active { box-shadow: inset 3px 0 0 var(--bronze-light); }
}
/* الإقرارات */
.res-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.res-choice { border: 1.5px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 10px; cursor: pointer; font-weight: 700; color: var(--ink-2); }
.res-choice.on.approve { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.res-choice.on.reject { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.res-choice.on.abstain, .res-choice.on.recused { background: var(--mute-bg); border-color: var(--ink-3); color: var(--ink); }
.res-sig { max-height: 46px; max-width: 160px; }
