/* ركاز — واجهة إدارة مكتب المحاماة */
@font-face { font-family: 'Plex'; font-weight: 400; font-display: swap; src: url(../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Plex'; font-weight: 500; font-display: swap; src: url(../fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Plex'; font-weight: 600; font-display: swap; src: url(../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Plex'; font-weight: 700; font-display: swap; src: url(../fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Plex'; font-weight: 400; font-display: swap; src: url(../fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Plex'; font-weight: 500; font-display: swap; src: url(../fonts/ibm-plex-sans-arabic-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Plex'; font-weight: 600; font-display: swap; src: url(../fonts/ibm-plex-sans-arabic-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Plex'; font-weight: 700; font-display: swap; src: url(../fonts/ibm-plex-sans-arabic-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Amiri'; font-weight: 700; font-display: swap; src: url(../fonts/amiri-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Amiri'; font-weight: 700; font-display: swap; src: url(../fonts/amiri-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --navy: #172532; --navy-deep: #0F1A26; --navy-soft: #22364a;
  --emerald: #2F6B5E; --emerald-deep: #1E4A41; --emerald-soft: #3D7466; --emerald-tint: #E6F0ED;
  --gold: #AB936B; --gold-light: #C9B083; --gold-tint: #F5EFE3;
  --cream: #E7DDC6; --sand: #F4F1E8;
  --ink: #18222D; --muted: #5E6B78; --line: #E4DED0; --card: #FFFFFF;
  --danger: #A23B32; --danger-tint: #F8E9E7; --warn: #8A6414; --warn-tint: #FBF1DA; --ok: #2F6B5E; --ok-tint: #E6F0ED;
  --radius: 10px; --shadow: 0 1px 2px rgba(15,26,38,.06), 0 4px 14px rgba(15,26,38,.06);
  --side-w: 264px;
  --font: 'Plex', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.65; color: var(--ink); background: var(--sand); }
a { color: var(--emerald); text-decoration: none; }
a:hover { color: var(--emerald-deep); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.35; color: var(--navy); }
h1 { font-size: 1.55rem; font-weight: 700; } h2 { font-size: 1.2rem; font-weight: 700; } h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
img { max-width: 100%; }
[dir=ltr] .num, .ltr { direction: ltr; unicode-bidi: embed; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ===== هيكل الصفحة ===== */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; background: linear-gradient(to left, var(--navy-deep) var(--side-w), transparent var(--side-w)); }
[dir=ltr] .shell { background: linear-gradient(to right, var(--navy-deep) var(--side-w), transparent var(--side-w)); }
.side { background: var(--navy-deep); color: #D8DEE4; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.side::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='none' stroke='%23C9B083' stroke-width='1'%3E%3Crect x='16' y='16' width='32' height='32'/%3E%3Crect x='16' y='16' width='32' height='32' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='7'/%3E%3C/g%3E%3C/svg%3E"); }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; border-bottom: 1px solid rgba(201,176,131,.18); position: relative; }
.brand img { width: 64px; height: auto; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.brand b { display: block; font-family: 'Amiri', serif; font-size: 1.55rem; color: var(--gold-light); line-height: 1.1; }
.brand span { display: block; font-size: .78rem; color: #9FB0BE; }
.office-chip { margin: 12px 14px 4px; padding: 10px 12px; border-radius: 8px; background: rgba(255,255,255,.05); border: 1px solid rgba(201,176,131,.15); position: relative; }
.office-chip b { display: block; color: #fff; font-size: .92rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.office-chip small { color: #9FB0BE; font-size: .78rem; }
.nav { padding: 8px 10px 20px; position: relative; flex: 1; }
.nav h6 { margin: 16px 10px 6px; font-size: .72rem; font-weight: 600; letter-spacing: .4px; color: var(--gold); text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: #D8DEE4; font-size: .92rem; margin-bottom: 2px; border-inline-start: 3px solid transparent; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.on { background: rgba(47,107,94,.35); color: #fff; border-inline-start-color: var(--gold-light); }
.nav a.off { opacity: .45; pointer-events: none; }
.nav a .soon { margin-inline-start: auto; font-size: .68rem; padding: 0 6px; border-radius: 99px; background: rgba(201,176,131,.15); color: var(--gold-light); }
.nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.side-foot { padding: 12px 18px 18px; font-size: .75rem; color: #7F91A1; position: relative; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .burger { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--navy); }
.top .burger svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; }
.top .grow { flex: 1; }
.top .plan-pill { font-size: .8rem; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.top .plan-pill.trial { background: var(--gold-tint); border-color: var(--gold-light); color: #6E5A33; }
.top .plan-pill.active { background: var(--ok-tint); border-color: #B7D3CB; color: var(--emerald-deep); }
.top .plan-pill.readonly, .top .plan-pill.suspended { background: var(--danger-tint); border-color: #E3B9B4; color: var(--danger); }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; color: var(--navy); }
.icon-btn:hover { background: var(--sand); text-decoration: none; }
.icon-btn svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.icon-btn .badge { position: absolute; top: 3px; inset-inline-end: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .68rem; line-height: 17px; text-align: center; }
.lang-link { font-size: .85rem; font-weight: 600; color: var(--navy); padding: 6px 10px; border-radius: 6px; }
.lang-link:hover { background: var(--sand); text-decoration: none; }
.user-menu { position: relative; }
.user-menu > button { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; font: inherit; color: var(--ink); padding: 4px 6px; border-radius: 8px; }
.user-menu > button:hover { background: var(--sand); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--emerald); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .9rem; flex: none; }
.user-menu .who { text-align: start; line-height: 1.25; }
.user-menu .who b { display: block; font-size: .88rem; font-weight: 600; }
.user-menu .who small { font-size: .74rem; }
.dropdown { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 210px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 30; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: start; padding: 8px 12px; border-radius: 6px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--sand); text-decoration: none; }
.content { padding: 24px; max-width: 1180px; width: 100%; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* البحث العلوي */
.top-search { position: relative; flex: 0 1 380px; }
.top-search svg { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.top .top-search input { padding-inline-start: 36px; background: var(--sand); border-color: transparent; height: 38px; }
.top .top-search input:focus { background: #fff; }

/* ===== مكونات ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 18px; }
.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)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border-top: 3px solid var(--emerald); }
.stat.gold { border-top-color: var(--gold); } .stat.navy { border-top-color: var(--navy); } .stat.red { border-top-color: var(--danger); }
.stat .v { font-size: 1.7rem; font-weight: 700; color: var(--navy); line-height: 1.2; }
.stat .l { color: var(--muted); font-size: .86rem; }
.stat a { font-size: .82rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none; line-height: 1.4; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--emerald); color: #fff; } .btn-primary:hover { background: var(--emerald-deep); color: #fff; }
.btn-navy { background: var(--navy); color: #fff; } .btn-navy:hover { background: var(--navy-deep); color: #fff; }
.btn-gold { background: var(--gold); color: #fff; } .btn-gold:hover { background: #957E58; color: #fff; }
.btn-ghost { background: var(--card); color: var(--navy); border-color: var(--line); } .btn-ghost:hover { border-color: var(--gold-light); background: var(--gold-tint); color: var(--navy); }
.btn-danger { background: var(--card); color: var(--danger); border-color: #E3B9B4; } .btn-danger:hover { background: var(--danger-tint); color: var(--danger); }
.btn-sm { padding: 5px 11px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; border-inline-start-width: 4px; font-size: .92rem; }
.alert-ok { background: var(--ok-tint); border-color: #B7D3CB; color: var(--emerald-deep); }
.alert-error { background: var(--danger-tint); border-color: #E3B9B4; color: var(--danger); }
.alert-warn { background: var(--warn-tint); border-color: #E9D29C; color: var(--warn); }
.alert-info { background: #EEF3F7; border-color: #C9D6E1; color: var(--navy); }
.alert a { font-weight: 600; }

.tag { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--sand); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag.ok, .tag.active, .tag.approved { background: var(--ok-tint); color: var(--emerald-deep); border-color: #B7D3CB; }
.tag.trial, .tag.pending, .tag.invited { background: var(--gold-tint); color: #6E5A33; border-color: var(--gold-light); }
.tag.readonly, .tag.suspended, .tag.rejected, .tag.disabled { background: var(--danger-tint); color: var(--danger); border-color: #E3B9B4; }

/* النماذج */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label, .lbl { display: block; font-weight: 600; font-size: .88rem; color: var(--navy); margin-bottom: 5px; }
.field label .opt { font-weight: 400; color: var(--muted); font-size: .8rem; }
.field label .req { color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #D6CFBF; border-radius: 8px; background: #fff; font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(47,107,94,.15); }
textarea { min-height: 90px; resize: vertical; }
input[type=file] { width: 100%; font: inherit; font-size: .86rem; padding: 8px; border: 1px dashed #CDBF9F; border-radius: 8px; background: var(--gold-tint); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); background: #FFFBFA; }
.field-error { color: var(--danger); font-size: .8rem; margin-top: 4px; }
.hint { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: .9rem; cursor: pointer; }
.check input { margin-top: 5px; width: 17px; height: 17px; accent-color: var(--emerald); flex: none; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.radio-cards label { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid #D6CFBF; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--ink); }
.radio-cards input { accent-color: var(--emerald); }
.radio-cards label:has(input:checked) { border-color: var(--emerald); background: var(--emerald-tint); }
fieldset { border: 0; padding: 0; margin: 0 0 22px; }
legend { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--navy); font-size: 1.02rem; margin-bottom: 14px; width: 100%; }
legend .n { width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: var(--gold-light); display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; flex: none; }
legend::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* الجداول */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th { text-align: start; font-weight: 600; color: var(--muted); font-size: .8rem; padding: 9px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; background: #FBFAF6; }
table.t td { padding: 11px 10px; border-bottom: 1px solid #EFEBE2; vertical-align: middle; }
table.t tr:hover td { background: #FCFBF8; }
table.t td.actions { white-space: nowrap; text-align: end; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; stroke: var(--gold-light); fill: none; stroke-width: 1.4; margin-bottom: 8px; }
dl.kv { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: 8px 18px; margin: 0; font-size: .92rem; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; font-weight: 500; }
.doc-thumbs { display: flex; gap: 12px; flex-wrap: wrap; }
.doc-thumbs a { display: block; width: 170px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; color: var(--navy); font-size: .8rem; text-align: center; }
.doc-thumbs a:hover { border-color: var(--gold); text-decoration: none; }
.doc-thumbs img { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--sand); }
.doc-thumbs .pdf { height: 110px; display: flex; align-items: center; justify-content: center; background: var(--sand); font-weight: 700; color: var(--danger); }
.doc-thumbs span { display: block; padding: 6px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 10px 24px; font-size: .9rem; flex-wrap: wrap; }
.banner.trial { background: linear-gradient(90deg, var(--gold-tint), #FBF8F1); border-bottom: 1px solid var(--cream); color: #5D4C2B; }
.banner.readonly, .banner.suspended { background: var(--danger-tint); border-bottom: 1px solid #E3B9B4; color: var(--danger); }
.banner.renew { background: var(--warn-tint); border-bottom: 1px solid #E9D29C; color: var(--warn); }
.banner .btn { margin-inline-start: auto; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid #EFEBE2; }
.list-plain li:last-child { border-bottom: 0; }
.notif.unread { position: relative; padding-inline-start: 14px; }
.notif.unread::before { content: ''; position: absolute; inset-inline-start: 0; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 14px; }
.pager a, .pager span { padding: 4px 11px; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-size: .85rem; }
.pager span.cur { background: var(--navy); color: #fff; border-color: var(--navy); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .field { min-width: 150px; }
.limits li { padding: 6px 0; display: flex; gap: 8px; align-items: flex-start; }
.limits li::before { content: '—'; color: var(--gold); }
.copy-box { display: flex; gap: 8px; align-items: center; background: var(--sand); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-family: ui-monospace, monospace; font-size: .82rem; direction: ltr; word-break: break-all; }
.copy-box code { flex: 1; }
.pay-box { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #FCFBF7; white-space: pre-line; }
.pay-box h3 { display: flex; align-items: center; gap: 8px; }
.qr { width: 190px; height: 190px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.qr svg, .qr img { width: 100%; height: 100%; }

/* صفحات الدخول والتسجيل */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-art { position: relative; background: radial-gradient(120% 90% at 100% 0%, var(--navy-soft) 0%, var(--navy) 45%, var(--navy-deep) 100%); color: #E8EDF1; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-art::before { content: ''; position: absolute; inset: 0; opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cg fill='none' stroke='%23C9B083' stroke-width='1'%3E%3Crect x='24' y='24' width='48' height='48'/%3E%3Crect x='24' y='24' width='48' height='48' transform='rotate(45 48 48)'/%3E%3Ccircle cx='48' cy='48' r='11'/%3E%3Cpath d='M48 0v14M48 82v14M0 48h14M82 48h14'/%3E%3C/g%3E%3C/svg%3E"); }
.auth-art::after { content: ''; position: absolute; inset-block: 0; inset-inline-end: 0; width: 6px; background: linear-gradient(var(--gold), var(--gold-light), var(--gold)); }
.auth-art > * { position: relative; }
.auth-art .logo { display: flex; align-items: center; gap: 14px; }
.auth-art .logo img { width: 110px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.auth-art .logo b { font-family: 'Amiri', serif; font-size: 2.4rem; color: var(--gold-light); line-height: 1; display: block; }
.auth-art .logo span { color: #A9B8C5; font-size: .95rem; }
.auth-art h2 { color: #fff; font-size: 1.7rem; font-weight: 700; margin: 0 0 12px; max-width: 30ch; }
.auth-art p { color: #B9C6D1; max-width: 46ch; }
.auth-art ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.auth-art li { display: flex; gap: 10px; color: #D5DEE5; font-size: .93rem; }
.auth-art li::before { content: ''; width: 8px; height: 8px; margin-top: 9px; transform: rotate(45deg); background: var(--gold-light); flex: none; }
.auth-art .foot { font-size: .8rem; color: #8193A3; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form .box { width: 100%; max-width: 420px; }
.auth-form .box.wide { max-width: 760px; }
.auth-form h1 { font-size: 1.6rem; margin-bottom: 4px; }
.auth-form .lead { color: var(--muted); margin-bottom: 22px; }
.auth-form .stack > * + * { margin-top: 14px; }
.auth-form .alt { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--muted); }
.auth-top { position: absolute; top: 16px; inset-inline-end: 20px; z-index: 5; }
.auth.register { grid-template-columns: minmax(0, .62fr) minmax(0, 1.38fr); }
.auth.register .auth-form { align-items: flex-start; }
.code-input { font-size: 1.6rem !important; letter-spacing: .5em; text-align: center; direction: ltr; font-variant-numeric: tabular-nums; }

/* الصفحة العامة */
.landing { background: var(--sand); }
.hero { position: relative; overflow: hidden; background: radial-gradient(110% 120% at 100% 0%, var(--navy-soft) 0%, var(--navy) 42%, var(--navy-deep) 100%); color: #fff; }
.hero::before { content: ''; position: absolute; inset: 0; opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cg fill='none' stroke='%23C9B083' stroke-width='1'%3E%3Crect x='24' y='24' width='48' height='48'/%3E%3Crect x='24' y='24' width='48' height='48' transform='rotate(45 48 48)'/%3E%3Ccircle cx='48' cy='48' r='11'/%3E%3Cpath d='M48 0v14M48 82v14M0 48h14M82 48h14'/%3E%3C/g%3E%3C/svg%3E"); }
.hero::after { content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--emerald), var(--gold), var(--emerald)); }
.hero .wrap { position: relative; max-width: 1120px; margin: 0 auto; padding: 22px 24px 84px; }
.hero nav { display: flex; align-items: center; gap: 14px; margin-bottom: 64px; }
.hero nav .logo { display: flex; align-items: center; gap: 10px; color: #fff; }
.hero nav .logo img { width: 70px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.hero nav .logo b { font-family: 'Amiri', serif; font-size: 1.9rem; color: var(--gold-light); }
.hero nav .grow { flex: 1; }
.hero nav a.l { color: #D5DEE5; font-weight: 500; }
.hero h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.7rem); max-width: 22ch; margin-bottom: 16px; }
.hero h1 em { font-style: normal; color: var(--gold-light); }
.hero p.lead { color: #BFCBD5; font-size: 1.08rem; max-width: 62ch; margin-bottom: 26px; }
.hero .note { color: #9FB0BE; font-size: .88rem; margin-top: 12px; }
.features { max-width: 1120px; margin: -40px auto 0; padding: 0 24px 60px; position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; box-shadow: var(--shadow); }
.feature .ic { width: 44px; height: 44px; border-radius: 10px; background: var(--emerald-tint); color: var(--emerald); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.feature .ic svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; }
.site-foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 0 24px 40px; }

.err-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.err-page .code { font-family: 'Amiri', serif; font-size: 5rem; color: var(--gold); line-height: 1; }

/* ===== الجوال ===== */
.scrim { display: none; }
@media (max-width: 980px) {
  .shell, [dir=ltr] .shell { grid-template-columns: 1fr; background: none; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(84vw, 300px); z-index: 50; transform: translateX(100%); transition: transform .2s; }
  [dir=ltr] .side { transform: translateX(-100%); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15,26,38,.45); z-index: 40; }
  .top .burger { display: inline-flex; }
  .top { padding: 0 14px; }
  .user-menu .who { display: none; }
  .content { padding: 16px; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth, .auth.register { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 22px; }
  .auth-art ul, .auth-art .foot, .auth-art h2, .auth-art p { display: none; }
  .auth-art::after { inset-block: auto 0; inset-inline: 0; width: auto; height: 5px; }
  .features { grid-template-columns: 1fr 1fr; }
  .banner { padding: 10px 16px; }
}
@media (max-width: 640px) {
  .g2, .g3, .g4, .form-grid { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .top .plan-pill { display: none; }
  .card { padding: 16px; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; } dl.kv dd { margin-bottom: 8px; }
  .page-head { align-items: stretch; }
  .hero nav a.l { display: none; }
}
@media print { .side, .top, .banner { display: none !important; } .shell { display: block; } body { background: #fff; } }

/* ===== القسم الأول ===== */
.case-head { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; }
.case-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .88rem; }
.case-meta b { color: var(--ink); font-weight: 600; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 18px; }
.kv-grid div small { display: block; color: var(--muted); font-size: .78rem; }
.kv-grid div b { font-weight: 600; }
.stage { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #FCFBF7; }
.stage.current { border-color: var(--emerald); background: var(--emerald-tint); }
.stage h4 { margin: 0 0 4px; font-size: .98rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hr-row.past td { color: var(--muted); }
.hr-row.today td { background: var(--gold-tint); }
.date-badge { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 54px; padding: 4px 6px; border-radius: 8px; background: var(--navy); color: #fff; line-height: 1.2; }
.date-badge b { font-size: 1.15rem; } .date-badge small { color: var(--gold-light); font-size: .7rem; }
.agenda-day { margin-bottom: 18px; }
.agenda-day > h3 { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--navy); color: #fff; border-radius: 8px; font-size: .95rem; margin-bottom: 8px; }
.agenda-day > h3 small { color: var(--gold-light); }
.dl-overdue { color: var(--danger); font-weight: 600; } .dl-soon { color: var(--warn); font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 8px 14px; border-bottom: 2px solid transparent; color: var(--muted); white-space: nowrap; font-weight: 500; }
.tabs a.on, .tabs a:hover { color: var(--navy); border-bottom-color: var(--gold); text-decoration: none; }
details.box { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; background: #FCFBF7; margin-top: 12px; }
details.box > summary { cursor: pointer; font-weight: 600; color: var(--emerald); }
details.box[open] > summary { margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: var(--sand); border: 1px solid var(--line); font-size: .85rem; }
.chip form { display: inline; } .chip button { border: 0; background: none; color: var(--danger); cursor: pointer; padding: 0; font-size: 1rem; line-height: 1; }
@media (max-width: 980px) { .top-search { flex: 1; } }
@media (max-width: 640px) { .top .lang-link { display: none; } }

/* ===== نوتة الإنابة ===== */
.note-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.note-side { position: sticky; top: 76px; }
.note-scroll { overflow-x: auto; padding-bottom: 10px; }
.note-sheet { width: 794px; min-height: 1123px; margin: 0 auto; background: #fff; color: #18222D; padding: 46px 52px 40px; box-shadow: 0 2px 16px rgba(15,26,38,.12); position: relative; font-family: var(--font); font-size: 14px; line-height: 1.7; display: flex; flex-direction: column; }
.note-sheet::before { content: ''; position: absolute; inset: 14px; border: 1px solid #C9B083; pointer-events: none; }
.note-sheet::after { content: ''; position: absolute; inset: 19px; border: 1px solid rgba(201,176,131,.4); pointer-events: none; }
.ns-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 3px double #172532; }
.ns-office b { display: block; font-family: 'Amiri', serif; font-size: 24px; color: #172532; line-height: 1.3; }
.ns-office span { display: block; font-size: 12px; color: #5E6B78; }
.ns-logo { max-height: 70px; max-width: 160px; }
.ns-title { text-align: center; margin: 14px 0 12px; }
.ns-title h2 { font-family: 'Amiri', serif; font-size: 28px; color: #172532; margin: 0; letter-spacing: .5px; }
.ns-title span { font-size: 12px; color: #5E6B78; }
.ns-box { border: 1px solid #E4DED0; border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; }
.ns-box h3 { font-size: 14px; color: #1E4A41; margin: 0 0 6px; padding-inline-start: 8px; border-inline-start: 3px solid #AB936B; }
.ns-box p { margin: 0; white-space: pre-line; }
.ns-hearing { display: grid; grid-template-columns: 150px 1fr; gap: 12px; background: #FBFAF6; }
.ns-big { background: #172532; color: #fff; border-radius: 8px; padding: 10px; text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.ns-big small { color: #C9B083; font-size: 11px; } .ns-big b { font-size: 16px; line-height: 1.5; } .ns-big span { color: #E7DDC6; font-size: 15px; }
.ns-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 14px; }
.ns-grid.two { grid-template-columns: 1fr 1fr; }
.ns-grid small { display: block; font-size: 11px; color: #5E6B78; } .ns-grid b { font-weight: 600; font-size: 13.5px; }
.ns-sub { font-size: 13px; margin-top: 6px; color: #3c4a57; }
.ns-assigned { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.ns-assigned b { display: block; font-size: 16px; } .ns-assigned span { font-size: 12.5px; color: #5E6B78; }
.ns-after { font-size: 12px; color: #8A6414; margin-top: 6px !important; }
.ns-qr { width: 96px; height: 96px; flex: none; }
.ns-qr svg { width: 100%; height: 100%; }
.ns-foot { margin-top: auto; padding-top: 14px; display: flex; justify-content: space-between; align-items: flex-end; font-size: 12.5px; }
.ns-sign { margin-top: 26px; border-top: 1px dotted #5E6B78; width: 200px; padding-top: 2px; font-size: 11px; color: #5E6B78; }
.ns-brand { font-size: 10.5px; color: #AB936B; }
.ns-thanks { font-family: 'Amiri', serif; font-size: 16px; color: #1E4A41; text-align: center; margin: 4px 24px 10px; line-height: 1.8; }
.note-to { border: 0; padding: 0; margin: 0 0 6px; }
.note-to legend { font-weight: 600; color: var(--navy); margin-bottom: 6px; font-size: .9rem; }
.note-to .radio { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; font-size: .9rem; }
.note-to .radio input { accent-color: var(--emerald); }
.note-to .radio:has(input:checked) { border-color: var(--emerald); background: var(--emerald-tint); }
.note-to .radio:has(input:disabled) { opacity: .6; cursor: not-allowed; }
.note-ext { background: var(--sand); border-radius: 8px; padding: 10px; display: grid; gap: 8px; }
.note-ext .field { margin: 0; }
.rep-item { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; font-size: .9rem; }
.rep-item:first-of-type { border-top: 0; margin-top: 0; }
.rep-item p { margin: 4px 0 0; }
.rep-in { border-inline-start: 4px solid var(--gold); }
.tag.gold { background: var(--gold-tint); color: #6E5A33; border-color: var(--gold-light); }
@media (max-width: 1100px) { .note-layout { grid-template-columns: 1fr; } .note-side { position: static; } }

/* ===== صفحة تحديث الجلسة (رمز QR) ===== */
.rep-wrap { max-width: 560px; margin: 0 auto; padding: 18px 16px 30px; min-height: 100vh; display: flex; flex-direction: column; }
.rep-head { display: flex; align-items: center; gap: 12px; padding: 10px 4px 16px; }
.rep-head img { width: 70px; height: auto; border-radius: 6px; }
.rep-head b { display: block; font-size: 1.1rem; color: var(--navy); line-height: 1.4; }
.rep-head span { display: block; color: var(--gold); font-weight: 600; font-size: .9rem; }
.rep-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 18px; }
.rep-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; background: var(--navy); color: #fff; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.rep-meta small { display: block; color: var(--gold-light); font-size: .74rem; }
.rep-meta b { font-weight: 600; font-size: .92rem; }
.rep-who { color: var(--emerald-deep); font-weight: 600; }
.rep-card textarea { min-height: 110px; }
.rep-card .field { margin-bottom: 12px; }
.rep-card .btn-block { padding: 12px; font-size: 1rem; }
.rep-done { text-align: center; padding: 10px 4px; }
.rep-done h1 { font-size: 1.3rem; }
.rep-check { width: 64px; height: 64px; border-radius: 50%; background: var(--emerald-tint); color: var(--emerald); display: grid; place-items: center; margin: 0 auto 12px; }
.rep-check svg { width: 34px; height: 34px; stroke-width: 2.4; }
.rep-thanks { font-family: 'Amiri', serif; font-size: 1.15rem; color: var(--emerald-deep); }
.rep-full { text-align: center; margin: 14px 0 0; font-size: .88rem; }
.rep-foot { margin-top: auto; padding-top: 18px; text-align: center; color: var(--muted); font-size: .8rem; }
@media (max-width: 420px) { .rep-meta { grid-template-columns: 1fr; } }

/* الاشتراك */
.bill-period { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--sand); }
.bill-due { padding: 10px 14px; border-radius: 8px; background: var(--emerald-tint); border: 1px solid #B7D3CB; color: var(--emerald-deep); }
.bill-due b { font-size: 1.15rem; }

/* ===== المهام ===== */
.nav-count { margin-inline-start: auto; background: var(--gold); color: var(--navy-deep); border-radius: 99px; font-size: .72rem; font-weight: 700; padding: 0 7px; line-height: 1.6; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 4px; border-bottom: 1px solid #EFEBE2; border-inline-start: 3px solid transparent; padding-inline-start: 10px; }
.task-item:last-child { border-bottom: 0; }
.task-item.prio-urgent { border-inline-start-color: var(--danger); }
.task-item.prio-high { border-inline-start-color: var(--gold); }
.task-item.late { background: #FDF6F5; }
.task-item.closed .task-title { color: var(--muted); text-decoration: line-through; }
.task-check { flex: none; width: 22px; height: 22px; margin-top: 2px; border: 2px solid #C9C1AE; border-radius: 6px; background: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; }
button.task-check:hover { border-color: var(--emerald); background: var(--emerald-tint); }
.task-check.on { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.task-check svg { width: 14px; height: 14px; stroke-width: 3; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; color: var(--ink); }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--muted); margin-top: 3px; align-items: center; }
.task-meta svg { width: 13px; height: 13px; vertical-align: -2px; margin-inline-end: 3px; }
.task-meta a { color: var(--muted); }
.late-txt { color: var(--danger); font-weight: 600; } .today-txt { color: var(--warn); font-weight: 600; }
.tag.prio.urgent { background: var(--danger-tint); color: var(--danger); border-color: #E3B9B4; }
.tag.prio.high { background: var(--gold-tint); color: #6E5A33; border-color: var(--gold-light); }
.tag.prio.low { background: #EEF3F7; color: var(--navy); border-color: #C9D6E1; }
.task-list.compact .task-item { padding-top: 8px; padding-bottom: 8px; }
.task-actions { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; justify-content: space-between; }
.task-done-form { display: flex; gap: 10px; align-items: flex-end; flex: 1; min-width: 260px; }

/* ===== التقويم ===== */
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-bar .btns { align-items: center; }
.cal-month { margin: 0 6px; font-size: 1.15rem; min-width: 150px; text-align: center; }
.cal-scope { margin: 0; border: 0; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.cal-legend .lg::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.lg.hearing::before { background: var(--navy); } .lg.deadline::before { background: var(--danger); } .lg.task::before { background: var(--emerald); } .lg.event::before { background: #7A5BA6; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cal-wd { background: var(--navy); color: var(--gold-light); text-align: center; font-size: .8rem; font-weight: 600; padding: 7px 2px; }
.cal-day { min-height: 112px; border-top: 1px solid var(--line); border-inline-start: 1px solid var(--line); padding: 5px; background: #fff; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:nth-child(7n+1) { border-inline-start: 0; }
.cal-day.out { background: #FAF8F3; } .cal-day.out .cal-dh .num { color: #B8B0A0; }
.cal-day.today { background: var(--gold-tint); box-shadow: inset 0 0 0 2px var(--gold); }
.cal-dh { display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--navy); font-size: .88rem; }
.cal-dw { display: none; }
.cal-add { opacity: 0; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--emerald-tint); color: var(--emerald); font-weight: 700; text-decoration: none !important; }
.cal-day:hover .cal-add { opacity: 1; }
.cal-it { display: block; font-size: .74rem; line-height: 1.35; padding: 2px 5px; border-radius: 4px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none !important; }
.cal-it.hearing { background: var(--navy); } .cal-it.deadline { background: var(--danger); } .cal-it.task { background: var(--emerald); } .cal-it.event { background: #7A5BA6; }
.cal-it.task.urgent { box-shadow: inset 3px 0 0 var(--gold-light); }
.cal-it.done { opacity: .5; text-decoration: line-through !important; }
.cal-it:hover { filter: brightness(1.12); color: #fff; }
.cal-more { font-size: .72rem; color: var(--muted); padding-inline-start: 4px; }
@media (max-width: 760px) {
  .cal-grid { display: block; border: 0; }
  .cal-wd, .cal-day.out, .cal-day.empty-day:not(.today) { display: none; }
  .cal-day { min-height: 0; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; padding: 8px; }
  .cal-dh > .num { display: none; } .cal-dw { display: inline; } .cal-add { opacity: 1; }
  .cal-it { font-size: .85rem; padding: 4px 8px; white-space: normal; }
  .task-done-form { flex-direction: column; align-items: stretch; }
}

/* ===== القسم الرابع: الأتعاب والفواتير ===== */
table.t th.n, table.t td.n { text-align: end; white-space: nowrap; }
table.t tfoot th { border-top: 2px solid var(--line); padding: 9px 10px; color: var(--ink, inherit); font-size: .88rem; }
.fin-tabs { margin-bottom: 16px; }
.fin-sum { margin-inline-start: auto; color: var(--muted); font-size: .9rem; padding-bottom: 8px; }
.fin-sum b { color: var(--navy); font-size: 1.05rem; }
.fin-bars { display: flex; gap: 10px; align-items: stretch; height: 170px; padding-top: 6px; }
.fin-bars .fb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.fin-bars .fb small { color: var(--muted); font-size: .74rem; white-space: nowrap; }
.fin-bars .fb-cols { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; border-bottom: 1px solid var(--line); }
.fin-bars .fb-cols span { width: 38%; max-width: 22px; min-height: 2px; border-radius: 4px 4px 0 0; }
.fin-bars .fb-cols .in { background: var(--emerald); } .fin-bars .fb-cols .out { background: var(--danger); opacity: .8; }
.inv-items input { width: 100%; min-width: 0; }
.inv-items td { vertical-align: middle; }
.inv-totals { margin-top: 14px; margin-inline-start: auto; max-width: 340px; display: grid; gap: 6px; }
.inv-totals > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.inv-totals input { width: 110px; text-align: end; }
.inv-totals .grand { border-top: 2px solid var(--line); padding-top: 8px; font-size: 1.1rem; }
.inv-totals .grand b { color: var(--navy); font-size: 1.3rem; }
.tag.inv-paid { background: var(--ok-tint); color: var(--emerald-deep); border-color: #B7D3CB; }
.tag.inv-partial, .tag.inv-issued { background: var(--gold-tint); color: #6E5A33; border-color: var(--gold-light); }
.tag.inv-overdue { background: var(--danger-tint); color: var(--danger); border-color: #E3B9B4; }
.tag.inv-cancelled { text-decoration: line-through; }
.tag.st-payment { background: var(--ok-tint); color: var(--emerald-deep); border-color: #B7D3CB; }
.tag.st-expense { background: var(--gold-tint); color: #6E5A33; border-color: var(--gold-light); }
.fin-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.fin-mini div { background: #FBFAF6; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.fin-mini small { display: block; color: var(--muted); font-size: .78rem; } .fin-mini b { color: var(--navy); }
@media (max-width: 640px) {
  .fin-bars { height: 140px; gap: 6px; }
  .fin-sum { margin-inline-start: 0; width: 100%; }
  .fin-mini { grid-template-columns: 1fr 1fr 1fr; gap: 6px; } .fin-mini div { padding: 6px; } .fin-mini b { font-size: .85rem; }
}

/* ===== التواصلات ومحاضر الاجتماعات ===== */
.cm-list { list-style: none; margin: 0; padding: 0; }
.cm-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.cm-row:last-child { border-bottom: 0; }
.cm-ic { flex: 0 0 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--ok-tint); color: var(--emerald-deep); }
.cm-ic svg { width: 18px; height: 18px; }
.cm-ic.k-call, .cm-ic.k-whatsapp, .cm-ic.k-email { background: var(--gold-tint); color: #6E5A33; }
.cm-ic.k-video { background: #EEF1F6; color: var(--navy); }
.cm-main { flex: 1; min-width: 0; }
.cm-meta { color: var(--muted); font-size: .82rem; }
.cm-sum { color: var(--ink); font-size: .88rem; margin-top: 3px; opacity: .85; }
.cm-tags { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.cm-text { white-space: pre-line; line-height: 1.95; }
.cm-h3 { font-size: .95rem; margin: 16px 0 6px; color: var(--navy); }
.cm-acts input, .cm-acts select { width: 100%; min-width: 0; }
.cm-acts td { vertical-align: middle; } .cm-acts td.c { text-align: center; }
@media (max-width: 640px) {
  .cm-row { flex-wrap: wrap; } .cm-tags { flex-direction: row; flex-wrap: wrap; width: 100%; padding-inline-start: 46px; align-items: center; }
  .cm-acts thead { display: none; } .cm-acts tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .cm-acts td { padding: 0; border: 0; } .cm-acts td:first-child { grid-column: 1 / -1; }
}

/* ===== الأجندة القضائية ===== */
.ag-pend { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.ag-pend svg { width: 22px; height: 22px; flex: 0 0 22px; }
.ag-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ag-date { text-align: center; }
.ag-wd { font-family: 'Amiri', serif; font-size: 1.6rem; color: var(--navy); line-height: 1.2; }
.ag-g { font-size: 1.1rem; font-weight: 700; }
.ag-h { color: var(--muted); font-size: .9rem; }
.ag-count { color: var(--muted); font-size: .85rem; margin-bottom: 6px; }
table.ag-t td { vertical-align: top; font-size: .88rem; }
.ag-t .ag-s { font-size: .78rem; color: var(--muted); }
.ag-t .ag-res { min-width: 170px; }
.ag-t .ag-warn { color: var(--danger); font-weight: 600; font-size: .82rem; }
.nav-count.warn { background: var(--danger); color: #fff; }
.ag-pl { list-style: none; margin: 0; padding: 0; }
.ag-pl li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ag-pl li:last-child { border-bottom: 0; }
.ag-late { color: var(--danger); font-size: .8rem; font-weight: 600; }
.ag-inline { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ag-inline input, .ag-inline select { width: auto; min-width: 0; padding: 5px 8px; font-size: .85rem; }
.dl-start { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dl-start input { width: auto; padding: 4px 8px; font-size: .85rem; }
@media (max-width: 640px) { .ag-wd { font-size: 1.3rem; } .ag-inline { width: 100%; } }

/* توجيه تنبيهات الأجندة */
.ag-as { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-basis: 100%; }
.ag-as-tag { display: inline-flex; align-items: center; gap: 4px; background: #eef6f2; color: #1f6b4f; border: 1px solid #cfe5da; }
.ag-as-tag svg { width: 14px; height: 14px; }
.ag-as-box { width: 100%; }
.ag-as-box > summary { list-style: none; display: inline-flex; cursor: pointer; float: inline-end; }
.ag-as-box > summary::-webkit-details-marker { display: none; }
.ag-as-box[open] > summary { margin-bottom: 8px; }
.ag-as-form { clear: both; display: grid; grid-template-columns: 1fr 180px; gap: 8px 12px; align-items: end; background: var(--soft, #f7f8f6); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ag-as-form label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; }
.ag-as-form .full { grid-column: 1 / -1; }
.ag-as-form .hint { margin: 0; font-size: .78rem; }
.ag-as-form button { justify-self: start; }
@media (max-width: 640px) { .ag-as-form { grid-template-columns: 1fr; } }
@media print { .ag-as-box { display: none; } }

/* حسابات الهدايا */
.gift-tag { background: linear-gradient(90deg, #f6e7bf, #fbf3dc); color: #7a5a1e; border-color: #e3c983; }
.gift-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.gift-mode { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; }
.gift-mode:has(input:checked) { border-color: #c9a45c; background: #fffaf0; box-shadow: 0 0 0 2px rgba(201,164,92,.18); }
.gift-mode span { display: flex; flex-direction: column; gap: 3px; } .gift-mode small { color: var(--muted); font-size: .8rem; line-height: 1.6; }
.gift-prev-h { font-size: .9rem; margin: 14px 0 8px; color: var(--muted); }
.gift-preview { border: 2px solid #c9a45c; outline: 1px solid #e7d3a3; outline-offset: -7px; border-radius: 12px; padding: 22px 22px 18px; background: #fffdf7; line-height: 2; }
.gift-preview .gp-salute { font-weight: 700; color: #14233a; margin-bottom: 6px; }
.gift-preview .gp-body { white-space: pre-line; text-align: justify; color: #2b3440; }
.gift-preview .gp-sign { margin-top: 10px; color: #8a6a2b; font-weight: 700; text-align: end; }
@media (max-width: 640px) { .gift-modes { grid-template-columns: 1fr; } }

.gift-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 18px; overflow-y: auto;
  background: radial-gradient(ellipse at center, rgba(20,35,58,.78), rgba(8,14,24,.92)); animation: giftFade .5s ease both; }
.gift-card { position: relative; width: min(640px, 100%); margin: 40px 0 24px; border-radius: 22px; padding: 6px;
  background: linear-gradient(135deg, #8c6526, #f3db9a 22%, #b8893a 45%, #f7e6b4 68%, #9a7230); box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.08);
  animation: giftRise .7s cubic-bezier(.2,.8,.2,1) both .1s; }
.gift-inner { position: relative; border-radius: 17px; padding: 54px 34px 30px; text-align: center; color: #f4ecd8; overflow: hidden;
  background: radial-gradient(circle at 50% -20%, #2a4469 0, #14233a 55%, #0e1a2c 100%); }
.gift-inner::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(233,207,143,.45); border-radius: 12px; pointer-events: none; }
.gift-ribbon-v { position: absolute; top: 0; height: 44px; inset-inline-start: 50%; width: 26px; transform: translateX(50%); z-index: 2;
  background: linear-gradient(90deg, #8c6526, #f3db9a, #8c6526); border-radius: 0 0 3px 3px; pointer-events: none; }
[dir=ltr] .gift-ribbon-v { transform: translateX(-50%); }
.gift-bow { position: absolute; top: -34px; left: 50%; transform: translateX(-50%); width: 120px; z-index: 3; filter: drop-shadow(0 6px 10px rgba(0,0,0,.4)); }
.gift-badge { position: relative; z-index: 2; color: #e9cf8f; letter-spacing: 2px; font-size: .85rem; }
.gift-inner h2 { position: relative; z-index: 2; font-family: Amiri, 'Traditional Arabic', serif; font-size: 2.1rem; margin: 6px 0 18px;
  background: linear-gradient(90deg, #c99a45, #fbe7b0, #c99a45); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gift-salute { position: relative; z-index: 2; font-family: Amiri, 'Traditional Arabic', serif; font-size: 1.35rem; font-weight: 700; color: #fff; margin: 0 0 12px; }
.gift-text { position: relative; z-index: 2; text-align: justify; line-height: 2.05; font-size: 1.02rem; color: #e8e1cf; }
.gift-text p { margin: 0 0 10px; }
body:has(.gift-overlay) { overflow: hidden; }
.gift-seal { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 12px; margin: 22px 0 20px; }
.gift-seal img { width: 72px; height: auto; border-radius: 6px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.gift-seal div { display: flex; flex-direction: column; text-align: start; } .gift-seal b { color: #f3db9a; font-family: Amiri, serif; font-size: 1.2rem; } .gift-seal small { color: #cfc5ad; font-size: .82rem; }
.gift-accept { position: relative; z-index: 2; cursor: pointer; border: 0; border-radius: 99px; padding: 13px 34px; font: inherit; font-weight: 700; font-size: 1.05rem; color: #2a1d06;
  background: linear-gradient(90deg, #c99a45, #fbe7b0 50%, #c99a45); background-size: 200% 100%; box-shadow: 0 8px 22px rgba(201,154,69,.35); animation: giftShine 3.2s linear infinite; }
.gift-accept:hover, .gift-accept:focus-visible { outline: 3px solid rgba(251,231,176,.5); outline-offset: 3px; }
.gift-spark { position: absolute; z-index: 4; width: 10px; height: 10px; pointer-events: none; background: radial-gradient(circle, #fff6d6 0, #f3db9a 40%, transparent 70%); border-radius: 50%; animation: giftTwinkle 2.6s ease-in-out infinite; }
.gift-spark.s1 { top: 14%; left: 8%; } .gift-spark.s2 { top: 30%; right: 6%; animation-delay: .6s; } .gift-spark.s3 { bottom: 22%; left: 5%; animation-delay: 1.1s; }
.gift-spark.s4 { bottom: 9%; right: 12%; animation-delay: 1.7s; } .gift-spark.s5 { top: 6%; right: 30%; animation-delay: 2.1s; }
@keyframes giftFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes giftRise { from { opacity: 0; transform: translateY(26px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes giftShine { to { background-position: -200% 0; } }
@keyframes giftTwinkle { 0%, 100% { opacity: .15; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.4); } }
@media (max-width: 560px) { .gift-inner { padding: 50px 18px 24px; } .gift-inner h2 { font-size: 1.7rem; } .gift-text { font-size: .96rem; } }
@media (prefers-reduced-motion: reduce) { .gift-overlay, .gift-card, .gift-accept, .gift-spark { animation: none; } }

/* ===== المستندات والنماذج ===== */
.dc-tabs { margin-bottom: 14px; }
.dc-for { background: var(--gold-tint); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dc-for svg { width: 16px; height: 16px; }
.dc-list { list-style: none; margin: 0; padding: 0; }
.dc-list li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dc-list li:last-child { border-bottom: 0; }
.dc-ic { flex: 0 0 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--gold-tint); color: var(--gold); }
.dc-ic.t { background: #E9EEF3; color: var(--navy); }
.dc-ic svg { width: 18px; height: 18px; }
.dc-main { flex: 1; min-width: 0; }
.dc-main > a { color: var(--ink); text-decoration: none; }
.dc-main > a:hover b { color: var(--gold); }
.dc-meta { font-size: .82rem; margin-top: 2px; }
.dc-list .btns { flex-wrap: nowrap; }
@media (max-width: 640px) { .dc-list li { flex-wrap: wrap; } .dc-list .btns { width: 100%; padding-inline-start: 50px; } }
.dc-ed { margin-top: 14px; }
.dc-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 8px; background: #F7F5EF; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; }
.dc-tools .dc-fields { width: auto; min-width: 170px; padding: 5px 8px; font-size: .85rem; }
.dc-pv-t { margin-inline-start: auto; font-size: .85rem; }
.dc-split { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 0 0 10px 10px; overflow: hidden; }
.dc-ed.nopv .dc-split { grid-template-columns: 1fr; }
.dc-ed.nopv .dc-pv { display: none; }
.dc-body { border: 0; border-radius: 0; min-height: 520px; resize: vertical; font-family: 'Amiri', 'Traditional Arabic', serif; font-size: 1.05rem; line-height: 1.9; padding: 14px; }
.dc-split .dc-pv { border: 0; border-inline-start: 1px solid var(--line); border-radius: 0; max-height: 720px; overflow: auto; margin: 0; }
@media (max-width: 900px) { .dc-split { grid-template-columns: 1fr; } .dc-split .dc-pv { border-inline-start: 0; border-top: 1px solid var(--line); } }
.dc-help { margin-top: 8px; font-size: .86rem; color: var(--muted); }
.dc-help summary { cursor: pointer; }
.dc-help code { background: #F1EEE6; padding: 1px 6px; border-radius: 4px; direction: ltr; display: inline-block; }
.dc-paper { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 26px 30px; font-family: 'Amiri', 'Traditional Arabic', serif; font-size: 1.08rem; line-height: 1.95; text-align: justify; color: #111; }
.dc-paper p { margin: 0 0 .7em; }
.dc-paper .dc-h { text-align: center; font-size: 1.5rem; margin: .2em 0 .8em; color: var(--navy); }
.dc-paper .dc-sh { font-size: 1.12rem; margin: .7em 0 .3em; color: var(--navy); }
.dc-paper .dc-end { text-align: end; margin: .1em 0; }
.dc-paper .dc-hr { border: 0; border-top: 1px solid #999; margin: 1em 0; }
.dc-paper mark { background: #FFF2C6; color: inherit; border-radius: 3px; padding: 0 3px; }
.dc-embed iframe { width: 100%; height: 80vh; border: 0; border-radius: 8px; }
.dc-embed img { max-width: 100%; height: auto; display: block; margin: 0 auto; border-radius: 8px; }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tp-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: linear-gradient(180deg, #fff, #FBF9F4); }
.tp-card .btns { margin-top: auto; }
@media print { .dc-paper { border: 0; padding: 0; } }

/* ===== إحصاءات الإدارة ===== */
.adm-stats { margin-bottom: 18px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.st { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #FBF9F4; display: flex; flex-direction: column; gap: 2px; }
.st small { color: var(--muted); font-size: .8rem; }
.st b { font-size: 1.6rem; color: var(--navy); line-height: 1.2; }
.st span { font-size: .78rem; color: var(--muted); }
.st.ok b { color: #2F6B5E; } .st.bad b { color: #A23B2A; }

/* ===== البحث في بوابة ركاز ===== */
.lg-form .lg-q { display: flex; gap: 8px; margin-bottom: 10px; }
.lg-form .lg-q input { flex: 1; font-size: 1.05rem; padding: 11px 14px; }
.lg-form .lg-q .btn svg { width: 16px; height: 16px; }
.lg-list { margin: 0; padding-inline-start: 22px; }
.lg-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.lg-list li:last-child { border-bottom: 0; }
.lg-t { font-weight: 700; color: var(--navy); font-size: 1.02rem; }
.lg-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--muted); margin: 4px 0; }
.lg-snip { margin: 4px 0 0; color: #333; line-height: 1.8; font-size: .93rem; }
.lg-snip mark, .lg-pr mark, .lg-text mark { background: #FFF2C6; border-radius: 3px; padding: 0 2px; }
.lg-empty { text-align: center; color: var(--muted); padding: 34px; }
.lg-empty svg { width: 34px; height: 34px; color: var(--gold); }
.lg-h1 { font-size: 1.35rem; line-height: 1.6; }
.lg-pr li { margin-bottom: 10px; line-height: 1.9; }
.lg-text { max-height: 70vh; overflow: auto; }
.lg-save { border-inline-start: 4px solid var(--gold); }
@media (max-width: 640px) { .lg-form .lg-q { flex-direction: column; } }

/* ===== مجلة ركاز ===== */
.mg-filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.mg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.mg-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; color: var(--ink); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.mg-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(23,37,50,.10); text-decoration: none; }
.mg-card.lead { grid-column: 1 / -1; flex-direction: row; }
.mg-card.lead .mg-img { flex: 0 0 48%; aspect-ratio: auto; min-height: 260px; }
.mg-card.lead h3 { font-size: 1.45rem; }
.mg-img { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--navy), var(--navy-soft)); display: grid; place-items: center; overflow: hidden; }
.mg-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg-img span { color: var(--gold-light); font-family: 'Amiri', serif; font-size: 1.4rem; }
.mg-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.mg-body h3 { margin: 0; font-family: 'Amiri', serif; font-size: 1.15rem; line-height: 1.6; color: var(--navy); }
.mg-body p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.8; }
.mg-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.mg-article { max-width: 860px; margin: 0 auto; padding: 28px 34px; }
.mg-article h1 { font-family: 'Amiri', serif; font-size: 1.9rem; line-height: 1.6; margin: 10px 0 16px; }
.mg-hero { width: 100%; border-radius: 10px; margin-bottom: 18px; }
.mg-content { font-family: 'Amiri', 'Traditional Arabic', serif; font-size: 1.15rem; line-height: 2.05; text-align: justify; color: #1b1b1b; }
.mg-content h2, .mg-content h3, .mg-content h4 { color: var(--navy); margin: 1.2em 0 .5em; line-height: 1.6; }
.mg-content img { max-width: 100%; height: auto; border-radius: 8px; }
.mg-content blockquote { border-inline-start: 4px solid var(--gold); background: var(--gold-tint); margin: 1em 0; padding: 10px 16px; border-radius: 6px; }
.mg-content table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; }
.mg-content td, .mg-content th { border: 1px solid var(--line); padding: 6px 8px; }
.mg-content a { color: var(--emerald, #2F6B5E); }
@media (max-width: 760px) { .mg-card.lead { flex-direction: column; } .mg-card.lead .mg-img { min-height: 0; aspect-ratio: 16 / 9; } .mg-article { padding: 18px 16px; } .mg-article h1 { font-size: 1.5rem; } }

/* ===== بوابة الموكل ===== */
.pt-body { background: var(--bg, #F4F1EA); min-height: 100vh; display: flex; flex-direction: column; }
.pt-wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding-inline: 18px; box-sizing: border-box; }
.pt-top { background: var(--navy-deep); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.pt-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 12px; }
.pt-office { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.pt-office:hover { text-decoration: none; }
.pt-office img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.pt-office b { display: block; font-family: 'Amiri', serif; font-size: 1.2rem; color: var(--gold-light); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.pt-office span { font-size: .75rem; color: #C8D0D8; }
.pt-user { display: flex; align-items: center; gap: 10px; }
.pt-user .lang-link { color: #D8DEE4; font-size: .85rem; }
.pt-user .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); background: transparent; }
.pt-who { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.pt-nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 0; }
.pt-nav a { display: flex; align-items: center; gap: 6px; color: #C8D0D8; padding: 10px 14px; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 500; }
.pt-nav a svg { width: 17px; height: 17px; }
.pt-nav a.on, .pt-nav a:hover { color: #fff; border-bottom-color: var(--gold); text-decoration: none; }
.pt-nav .nav-count { margin-inline-start: 4px; }
.pt-main { flex: 1; padding-block: 22px; }
.pt-foot { text-align: center; color: var(--muted); font-size: .78rem; padding-block: 18px; }
.pt-hello h1 { font-family: 'Amiri', serif; font-size: 1.8rem; margin: 0; }
.pt-hello p { color: var(--muted); margin: 4px 0 16px; }
.pt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.pt-stats > * { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.pt-stats > a:hover { border-color: var(--gold); text-decoration: none; }
.pt-stats b { font-size: 1.6rem; color: var(--navy); }
.pt-stats span { color: var(--muted); font-size: .85rem; }
.pt-hearings { list-style: none; margin: 0; padding: 0; }
.pt-hearings li { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pt-hearings li:last-child { border-bottom: 0; }
.pt-date { flex: 0 0 64px; text-align: center; background: var(--gold-tint); border-radius: 10px; padding: 6px 4px; display: flex; flex-direction: column; }
.pt-date b { font-size: 1.4rem; color: var(--navy); line-height: 1.1; }
.pt-date span { font-size: .75rem; color: var(--navy); }
.pt-date small { font-size: .7rem; color: var(--muted); }
.pt-cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pt-case { border: 1px solid var(--line); border-radius: 12px; padding: 14px; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; gap: 8px; background: linear-gradient(180deg, #fff, #FBF9F4); }
.pt-case:hover { border-color: var(--gold); text-decoration: none; box-shadow: 0 6px 18px rgba(23,37,50,.08); }
.pt-case-h { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.pt-case-h b { color: var(--navy); line-height: 1.5; }
.pt-case-m { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .82rem; color: var(--muted); }
.pt-case-f { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; border-top: 1px dashed var(--line); padding-top: 8px; }
.pt-recent { margin: 0; padding-inline-start: 18px; line-height: 2; }
.pt-ask { margin: 14px 0 0; }
.pt-ask svg { width: 15px; height: 15px; }
.pt-judg { border-inline-start: 4px solid var(--gold); background: #FBF9F4; padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.pt-judg p { flex-basis: 100%; margin: 4px 0 0; line-height: 1.9; }
.pt-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.pt-timeline li { position: relative; padding: 0 0 16px; padding-inline-start: 22px; border-inline-start: 2px solid var(--line); margin-inline-start: 6px; }
.pt-timeline li::before { content: ''; position: absolute; inset-inline-start: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.pt-timeline li.next::before { background: var(--gold); box-shadow: 0 0 0 4px var(--gold-tint); }
.pt-tl-d { font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.pt-timeline p { margin: 4px 0 0; line-height: 1.8; }
.pt-chat { display: flex; flex-direction: column; gap: 10px; }
.pt-msg { max-width: 78%; border-radius: 14px; padding: 10px 14px; border: 1px solid var(--line); }
.pt-msg.me { align-self: flex-start; background: #EAF3EF; border-color: #CFE3DB; }
.pt-msg.them { align-self: flex-end; background: #fff; }
.pt-msg.unread { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-tint); }
.pt-msg-h { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
.pt-msg-h b { color: var(--navy); }
.pt-msg-b { line-height: 1.8; white-space: normal; word-break: break-word; }
.pt-chat.staff { max-height: 420px; overflow: auto; padding: 4px; }
.pt-send { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
.dc-share { margin: 12px 0; }
@media (max-width: 640px) { .pt-who b { display: none; } .pt-msg { max-width: 92%; } .pt-hello h1 { font-size: 1.45rem; } }

/* التاريخ الهجري المقابل */
.hijri-pair { display: flex; gap: 6px; align-items: stretch; }
.hijri-pair > input[type=date] { flex: 1 1 58%; min-width: 0; }
.hijri-pair > .hijri-in { flex: 1 1 42%; min-width: 0; background: #FBF9F4; font-variant-numeric: tabular-nums; }
.hijri-pair > .hijri-in.bad { border-color: #A23B2A; background: #FCEDEA; }
.hijri-sub { display: block; font-size: .75em; color: var(--muted); }

/* ===== المجموعة الأولى: التواصل مع الموكل، المطالب، تقرير العمل، الأقساط، المحادثة ===== */
.banner.grace { background: var(--danger-tint); border-bottom: 1px solid #E3B9B4; color: var(--danger); }
.banner.grace.g1 { background: var(--warn-tint); border-color: #E9D29C; color: var(--warn); }
.cn-send { padding: 14px 18px; }
.cn-send > summary { cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none; }
.cn-send > summary::-webkit-details-marker { display: none; }
.cn-send > summary svg { width: 17px; height: 17px; vertical-align: -3px; }
.cn-send[open] > summary { margin-bottom: 12px; }
.cn-preview { background: #FBF9F4; border-inline-start: 4px solid var(--gold); padding: 10px 14px; border-radius: 8px; line-height: 1.9; font-size: .92rem; }
.cr-list { list-style: none; margin: 0 0 10px; padding: 0; }
.cr-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.cr-list li:last-child { border-bottom: 0; }
.cr-list li.closed { opacity: .62; }
.cr-list li.closed b { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.3); }
.cr-add > summary, .cn-hist-wrap > summary { cursor: pointer; color: var(--emerald); font-weight: 600; }
.cn-hist { list-style: none; margin: 8px 0 0; padding: 0; font-size: .86rem; }
.cn-hist li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.late-txt { color: var(--danger); font-weight: 600; }
.wr-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; }
.wr-item { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.wr-item:has(input:checked) { border-color: #CFE3DB; background: #F4FAF7; }
.wr-item .tag { margin-inline-start: 8px; }
.fi-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; flex-wrap: wrap; }
.fi-row > input, .fi-row > .hijri-pair { flex: 1 1 160px; min-width: 0; }
.fi-row > button { flex: 0 0 auto; }
.chat-wrap { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.chat-peers { padding: 8px; display: flex; flex-direction: column; gap: 2px; max-height: 70vh; overflow: auto; }
.chat-peers a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
.chat-peers a:hover { background: var(--sand); text-decoration: none; }
.chat-peers a.on { background: var(--emerald-tint); color: var(--emerald-deep); font-weight: 600; }
.chat-peers a small { display: block; font-size: .74rem; color: var(--muted); font-weight: 400; }
.chat-peers .avatar { width: 30px; height: 30px; font-size: .78rem; flex: 0 0 30px; }
.chat-peers .nav-count { margin-inline-start: auto; }
.chat-main { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-log { display: flex; flex-direction: column; gap: 10px; padding: 16px; height: 58vh; min-height: 300px; overflow-y: auto; background: #FCFBF8; }
.chat-send { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: #fff; align-items: flex-end; }
.chat-send textarea { flex: 1; resize: vertical; min-height: 44px; }
.pt-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.pt-quick .muted { flex-basis: 100%; font-size: .85rem; }
.pt-contact { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 14px 16px; font-size: .9rem; color: var(--muted); }
.btn.pt-wa { background: #1F8F55; border-color: #1F8F55; color: #fff; }
.btn.pt-wa:hover { background: #17733F; color: #fff; text-decoration: none; }
.pt-req { border-inline-start: 4px solid var(--gold); }
.gift-terms { margin: 14px 0 10px; font-size: .86rem; text-align: start; justify-content: center; }
.gift-terms a { color: #8C6526; text-decoration: underline; }

/* نافذة الموافقة على الشروط */
.terms-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(15,26,38,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.terms-card { background: #fff; border-radius: 14px; max-width: 640px; width: 100%; max-height: 92vh; display: flex; flex-direction: column; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.terms-card h2 { margin-bottom: 6px; }
.terms-scroll { flex: 1; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 8px 0 14px; background: #FCFBF8; font-size: .88rem; line-height: 1.9; min-height: 120px; }
.terms-scroll h2 { font-size: 1rem; margin: 14px 0 6px; }
.terms-card .check { margin-bottom: 12px; }

/* ===== الصفحات العامة: الشروط ودليل المكاتب ===== */
body.pub { background: var(--sand); }
.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 24px; background: var(--navy-deep); }
.pub-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 1.15rem; }
.pub-logo:hover { color: #fff; text-decoration: none; }
.pub-logo img { width: 56px; height: auto; border-radius: 5px; }
.pub-nav { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; }
.pub-nav a:not(.btn) { color: var(--cream); font-size: .9rem; }
.pub-nav a.on { color: var(--gold-light); font-weight: 600; }
.pub-main { max-width: 1080px; margin: 0 auto; padding: 28px 16px 40px; min-height: 70vh; }
.pub-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 18px 24px; border-top: 1px solid var(--line); font-size: .84rem; color: var(--muted); }
.pub-doc { max-width: 820px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px 32px; }
.pub-doc-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 20px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.pub-doc-tabs a { padding: 6px 12px; border-radius: 20px; font-size: .88rem; color: var(--muted); }
.pub-doc-tabs a.on { background: var(--emerald-tint); color: var(--emerald-deep); font-weight: 600; }
.pub-doc-body { line-height: 2; }
.pub-doc-body h2 { font-size: 1.08rem; margin: 22px 0 8px; color: var(--emerald-deep); }
.pub-doc-body ul { margin: 0 0 12px; padding-inline-start: 22px; }
.pub-hero { text-align: center; margin-bottom: 24px; }
.pub-hero p { color: var(--muted); }
.pub-search { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 820px; margin: 16px auto 0; }
.pub-search input[type=search] { flex: 2 1 260px; }
.pub-search select { flex: 1 1 150px; }
.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.pub-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px 16px; color: var(--ink); transition: box-shadow .15s, border-color .15s; }
.pub-card:hover { text-decoration: none; border-color: var(--gold-light); box-shadow: var(--shadow); color: var(--ink); }
.pub-card b { color: var(--navy); font-size: 1.02rem; }
.pub-av { width: 64px; height: 64px; border-radius: 50%; background: var(--gold-tint); color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 700; overflow: hidden; flex: 0 0 auto; border: 1px solid var(--cream); }
.pub-av img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pub-av.lg { width: 96px; height: 96px; font-size: 2.4rem; }
.pub-areas { font-size: .82rem; color: var(--muted); }
.pub-join { text-align: center; margin-top: 28px; color: var(--muted); }
.pub-o-head { display: flex; gap: 18px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.pub-o-head h1 { margin: 0; }
.pub-o-head p { margin: 2px 0 0; }
.pub-o-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.pub-contact p { margin: 0 0 10px; word-break: break-word; }
.pub-contact svg { width: 16px; height: 16px; vertical-align: -3px; }
.pub-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pub-tags li { background: var(--emerald-tint); color: var(--emerald-deep); border-radius: 20px; padding: 4px 12px; font-size: .86rem; }
.pub-note { font-size: .8rem; margin-top: 18px; }
.pre { white-space: pre-line; }
@media (max-width: 760px) {
  .chat-wrap, .pub-o-grid { grid-template-columns: 1fr; }
  .chat-peers { flex-direction: row; overflow-x: auto; max-height: none; }
  .chat-peers a { flex: 0 0 auto; }
  .chat-log { height: 52vh; }
  .pub-doc { padding: 20px 16px; }
  .pub-head { padding: 10px 16px; }
}

/* ===== البائعون والطلبات ===== */
.sl-terms { background: var(--gold-tint); border: 1px solid var(--cream); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: .9rem; line-height: 1.9; }
.sl-terms ul { margin: 6px 0 0; padding-inline-start: 20px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; min-width: 0; font-size: .85rem; }
.pt-msg.internal { border-style: dashed; background: var(--gold-tint); }
/* منظومة المبيعات */
.tag.so-tier-director { background: var(--navy); color: #fff; border-color: var(--navy); }
.tag.so-tier-leader { background: var(--gold-tint); color: #6E5A33; border-color: var(--gold-light); }
.so-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.so-row select, .so-row input[type=text], .so-row input[type=email] { width: auto; min-width: 120px; flex: 1 1 140px; }
.so-act { position: relative; display: inline-block; }
.so-act summary { list-style: none; cursor: pointer; }
.so-act summary::-webkit-details-marker { display: none; }
.so-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 20; width: 300px; max-width: 86vw; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,26,38,.15); padding: 12px; text-align: start; }
.so-pop form { display: grid; gap: 6px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px dashed var(--line); }
.so-pop form:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.so-pop textarea { min-height: 54px; }
.so-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.so-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.so-card-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.so-score { font-size: .82rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: var(--sand); white-space: nowrap; }
.so-score.ok { background: var(--ok-tint); color: var(--emerald-deep); }
.so-score.pending { background: var(--gold-tint); color: #6E5A33; }
.so-score.rejected { background: var(--danger-tint); color: var(--danger); }
.so-disp { border: 1px dashed var(--gold-light); border-radius: 10px; padding: 10px 12px; margin-top: 10px; display: grid; gap: 6px; }
.so-disp legend { font-weight: 700; color: var(--navy); padding: 0 6px; }
tr.muted td { opacity: .7; }
/* تهاني المناسبات */
.oc-card .oc-head{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
.oc-thumb{width:150px;height:auto;border-radius:8px;border:1px solid var(--line)}
.oc-ico{font-size:34px;width:56px;text-align:center}
.oc-meta{flex:1;min-width:200px}.oc-meta h2{margin:0 0 4px}
.oc-on{margin-inline-start:auto}
.oc-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:12px}
.oc-gallery figure{margin:0}.oc-gallery img,.oc-empty{width:100%;aspect-ratio:1200/630;border-radius:8px;border:1px solid var(--line);object-fit:cover;display:block}
.oc-empty{display:flex;align-items:center;justify-content:center;font-size:40px;background:var(--bg-soft,#f6f3ea)}
.oc-gallery figcaption{font-size:.85rem;text-align:center;margin-top:4px}
/* واتساب */
.wa-status{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.wa-kinds{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:10px}
.wa-guide summary{cursor:pointer;list-style:none}.wa-guide ol{line-height:2;padding-inline-start:20px}

/* بوابة خدمات المحامين */
.svc-counters { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.svc-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.svc-area { border: 1px solid #D6CFBF; border-radius: 8px; padding: 8px 10px; background: #fff; }
.svc-area:has(input:checked) { border-color: var(--emerald); background: var(--emerald-tint); }
.svc-area textarea { display: none; width: 100%; margin-top: 8px; font-size: .85rem; }
.svc-area:has(input:checked) textarea { display: block; }
.svc-list .chips .tag { font-size: .9rem; padding: 5px 10px; }
.svm-steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 18px; counter-reset: s; }
.svm-steps li { flex: 1 1 120px; padding: 8px 10px; border-radius: 8px; background: #fff; border: 1px solid #E3DCCB; font-size: .85rem; color: #777; counter-increment: s; }
.svm-steps li::before { content: counter(s) '. '; }
.svm-steps li.done { background: var(--emerald-tint); border-color: var(--emerald); color: var(--emerald); }
.svm-steps li.on { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 600; }
.svm-chat { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow: auto; }
.svm-msg { background: #F7F4EC; border-radius: 10px; padding: 8px 12px; max-width: 85%; align-self: flex-start; }
.svm-msg.mine { background: var(--emerald-tint); align-self: flex-end; }
.svm-msg.system { background: transparent; border: 1px dashed #D6CFBF; align-self: center; font-size: .85rem; color: #555; }
.svm-msg.delivery { border: 2px solid var(--gold); }
.svm-msg .h { font-size: .75rem; color: #777; margin-bottom: 3px; }
.svm-contract .legal-doc h2 { text-align: center; font-size: 1.25rem; } .svm-contract .legal-doc h3 { color: var(--emerald); margin-top: 18px; } .svm-contract .legal-doc h4 { color: #8a6a24; margin-top: 12px; }
.legal-doc p { text-align: justify; line-height: 1.9; }
.svm-print { max-width: 820px; margin: 0 auto; padding: 24px; background: #fff; font-family: 'Traditional Arabic', 'Amiri', serif; font-size: 17px; }
.svm-print h2 { text-align: center; } .svm-print h3 { color: #1E6B52; border-bottom: 1px solid #C9B27C; } .svm-print h4 { color: #8a6a24; }
@media print { .no-print { display: none; } .svm-print { padding: 0; } }
.svm-tile { display:block; color: inherit; } .svm-tile:hover { border-color: var(--emerald); }

/* بوابة الخدمات — المرحلة الثالثة: التقييم */
.svt-scale{display:flex;flex-wrap:wrap;gap:6px}
.svt-scale label{cursor:pointer}
.svt-scale input{position:absolute;opacity:0;width:1px;height:1px}
.svt-scale span{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border:1px solid var(--line,#d9d3c4);border-radius:8px;font-weight:700;background:#fff}
.svt-scale input:checked + span{background:var(--gold,#b88a2c);border-color:var(--gold,#b88a2c);color:#fff}
.svt-scale input:focus-visible + span{outline:2px solid var(--navy,#1f2a44);outline-offset:2px}
.svt-score{font-size:1.4rem;font-weight:800;color:var(--gold,#b88a2c)}
.svt-review{border-top:1px solid var(--line,#e6e0d2);padding:10px 0}
.svt-review:first-of-type{border-top:0}
/* التهاني الخاصة */
.pg-auto{display:flex;gap:12px;align-items:center;padding:10px 12px;margin:6px 0 12px;border:1px solid var(--line);border-radius:10px;background:var(--bg-soft,#f6f3ea)}
.pg-ico{font-size:30px;line-height:1}
.pg-text{font-size:.86rem;color:var(--muted,#5b6875);margin-top:4px;line-height:1.7}
.oc-section{margin:22px 0 10px}.oc-section h2{margin:0 0 4px}
.oc-soon{list-style:none;margin:0;padding:0}.oc-soon li{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:8px 0;border-bottom:1px dashed var(--line)}.oc-soon li:last-child{border-bottom:0}
.oc-soon .num{min-width:110px}
/* صفحة تطبيق ركاز */
.ap{max-width:1100px;margin:0 auto}
.ap-hero{display:flex;gap:28px;align-items:center;background:linear-gradient(135deg,#0F1A26,#172532 60%,#22364A);color:#F4F1E8;border-radius:16px;padding:30px 32px;margin-bottom:22px;border:1px solid rgba(201,176,131,.4)}
.ap-emb{width:150px;border-radius:12px;border:1px solid rgba(201,176,131,.6);box-shadow:0 10px 30px rgba(0,0,0,.4);flex:none}
.ap-hero h1{font-size:1.9rem;margin:0 0 6px;color:#F1E3C2}
.ap-hero p{color:#D9D3C4;margin:0 0 14px;line-height:1.8}
.ap-cta{display:flex;align-items:center;gap:12px;flex-wrap:wrap;min-height:42px}
.ap-cta .btn{display:inline-flex;align-items:center;gap:8px;font-size:1rem;padding:10px 20px}
.ap-ok{display:inline-flex;align-items:center;gap:6px;color:#9FE3C8;font-weight:600}
.ap-hint{color:#C9B083;font-size:.92rem}
.ap-pros{list-style:none;margin:14px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.ap-pros li{border:1px solid rgba(201,176,131,.4);border-radius:999px;padding:4px 12px;font-size:.85rem;color:#E7DDC6}
.ap-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.ap-card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:20px 22px;min-width:0}
.ap-card.mine{border:2px solid var(--emerald);box-shadow:0 6px 20px rgba(47,107,94,.12)}
.ap-ic{width:44px;height:44px;border-radius:12px;background:var(--navy);color:#E9CF8E;display:grid;place-items:center;margin-bottom:8px}
.ap-card h2{margin:0 0 4px;font-size:1.2rem}
.ap-card .btn{display:inline-flex;align-items:center;gap:8px;margin:6px 0 4px}
.ap-card .btn small{color:rgba(255,255,255,.82);font-weight:400}
.ap-card ol{margin:10px 0 0;padding-inline-start:20px;line-height:1.9;font-size:.95rem}
.ap-note{font-size:.84rem;color:var(--muted);background:var(--gold-tint,#F5EFE3);border-radius:8px;padding:8px 10px;margin:10px 0 0}
.ap-foot{display:flex;gap:8px;align-items:center;justify-content:center;color:var(--muted);font-size:.9rem;margin:20px 0 10px}
@media (max-width:760px){.ap-hero{flex-direction:column;text-align:center;padding:22px 18px}.ap-emb{width:120px}.ap-cta,.ap-pros{justify-content:center}.ap-grid{grid-template-columns:minmax(0,1fr)}}
.auth-form .alt a svg { width: 16px; height: 16px; vertical-align: -3px; }
[data-install][hidden],[data-installed][hidden],[data-install-hint][hidden]{display:none!important}
.off-hint{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.off-hint span{flex:1;min-width:220px}
.off-focus{outline:3px solid var(--gold,#AB936B);outline-offset:2px}
.off-ack{border:0;border-radius:14px;padding:22px 24px;max-width:560px;width:calc(100% - 32px)}.off-ack::backdrop{background:rgba(7,13,20,.6)}.off-ack h3{margin:0 0 8px}.off-status{min-height:24px}
/* تثبيت بوابة الموكل */
.ptapp{max-width:820px;margin:0 auto}
.ptapp-hero{display:flex;gap:18px;align-items:center;background:linear-gradient(135deg,#0F1A26,#22364A);color:#F4F1E8;border-radius:14px;padding:22px;margin-bottom:16px}
.ptapp-hero img{width:84px;border-radius:18px;flex:none}
.ptapp-hero h1{margin:0 0 4px;font-size:1.5rem;color:#F1E3C2}.ptapp-hero p{margin:0 0 10px;color:#D9D3C4;line-height:1.8}
.ptapp-hero .btn{display:inline-flex;align-items:center;gap:8px}
.ptapp-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.ptapp-card{background:var(--card,#fff);border:1px solid var(--line);border-radius:12px;padding:16px 18px;min-width:0}
.ptapp-card.mine{border:2px solid var(--emerald)}
.ptapp-card h2{margin:0 0 6px;font-size:1.15rem}.ptapp-card ol{margin:0;padding-inline-start:20px;line-height:2}
.ptapp-note{text-align:center;color:var(--muted);font-size:.9rem;margin:16px 0}
.pt-appcard{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.pt-appcard img{width:44px;border-radius:10px}
.pt-appcard div{flex:1;min-width:200px}
@media (max-width:640px){.ptapp-grid{grid-template-columns:minmax(0,1fr)}.ptapp-hero{flex-direction:column;text-align:center}}
/* رأس بوابة الموكل على الجوال: اسم المكتب يُختصر بدل أن يتداخل مع أزرار الحساب */
.pt-office { flex: 1 1 auto; }
.pt-office > div { min-width: 0; overflow: hidden; }
.pt-user { flex: none; }
@media (max-width: 560px) { .pt-office b { max-width: none; font-size: 1rem; } .pt-office img { width: 38px; height: 38px; } .pt-user { gap: 6px; } .pt-user .btn-ghost { padding: 4px 8px; font-size: .8rem; } }
/* تثبيت ركاز على الموبايل من الكمبيوتر برمز QR، وتلميح آيفون */
.ap-qr{display:flex;gap:22px;align-items:center;background:var(--card);border:2px solid var(--emerald);border-radius:14px;padding:20px 22px;margin-bottom:16px}
.ap-qr-code{flex:none;width:170px;background:#fff;border-radius:10px;padding:6px;border:1px solid var(--line)}
.ap-qr-code svg{display:block;width:100%;height:auto}
.ap-qr h2{margin:0 0 4px;font-size:1.25rem}.ap-qr p{margin:0 0 10px;color:var(--muted)}
.ap-qr-steps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.ap-qr-steps div{background:var(--bg-soft,#f6f3ea);border-radius:10px;padding:10px 12px;font-size:.9rem;line-height:1.7}
.ap-qr-steps b{display:block}
.ap-pickhint{color:var(--muted);margin:0 0 10px;font-size:.95rem}
.ap-ios-tip{position:fixed;left:12px;right:12px;bottom:calc(14px + env(safe-area-inset-bottom,0px));z-index:50;background:#172532;color:#F4F1E8;border:1px solid #C9B083;border-radius:14px;padding:12px 14px;text-align:center;font-size:.95rem;line-height:1.7;box-shadow:0 8px 24px rgba(0,0,0,.35)}
.ap-ios-tip.warn{background:#7A3B24}
.ap-ios-arrow{display:block;font-size:1.4rem;animation:apb 1s infinite}
@keyframes apb{0%,100%{transform:translateY(0)}50%{transform:translateY(5px)}}
@media (max-width:760px){.ap-qr{flex-direction:column;text-align:center}.ap-qr-steps{grid-template-columns:minmax(0,1fr)}}
[data-desktop-only][hidden],[data-ios-tip][hidden],[data-ios-other][hidden]{display:none!important}
/* الدليل المصوّر: زر أخضر ثابت على يسار الصفحات العامة، وعنصر مميز في القائمة الجانبية */
.guide-fab{position:fixed;left:0;top:50%;transform:translateY(-50%);z-index:60;display:flex;flex-direction:column;align-items:center;gap:8px;background:#2F6B5E;color:#fff;
  padding:14px 9px;border-radius:0 12px 12px 0;box-shadow:0 6px 18px rgba(0,0,0,.22);text-decoration:none;font-weight:600;font-size:.9rem;border:1px solid rgba(255,255,255,.25);border-left:0}
.guide-fab span{writing-mode:vertical-rl;letter-spacing:.02em}
html[dir=ltr] .guide-fab span{transform:rotate(180deg)}
.guide-fab:hover{background:#255A4F;color:#fff;text-decoration:none;padding-left:13px}
@media (max-width:640px){.guide-fab{top:auto;bottom:18px;transform:none;flex-direction:row;padding:10px 14px 10px 12px;border-radius:0 999px 999px 0}.guide-fab span{writing-mode:horizontal-tb}html[dir=ltr] .guide-fab span{transform:none}}
@media print{.guide-fab{display:none}}
.nav .nav-guide{color:#9FE3C8!important;background:rgba(47,107,94,.28);border:1px solid rgba(111,179,162,.45);margin-top:6px}
.nav .nav-guide:hover{background:rgba(47,107,94,.45)}

/* ===== مساعد ركاز الذكي ===== */
.nav-ai svg { color: var(--gold-light); }
.ai-head h1 svg, .ai-th svg { width: 26px; height: 26px; vertical-align: -5px; color: var(--gold); }
.ai-quota { background: var(--gold-tint); border: 1px solid var(--gold-light); color: #6E5A33; border-radius: 99px; padding: 4px 14px; font-size: .85rem; font-weight: 600; }
.ai-state { border-top: 3px solid var(--gold); }
.ai-points { margin: 10px 0 16px; padding-inline-start: 20px; line-height: 1.9; }
.ai-wrap { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.ai-side { padding: 14px; position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
.ai-new { width: 100%; justify-content: center; margin-bottom: 12px; }
.ai-list { display: flex; flex-direction: column; gap: 2px; }
.ai-list a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; border: 1px solid transparent; }
.ai-list a:hover { background: var(--sand); }
.ai-list a.on { background: var(--emerald-tint); border-color: #B7D3CB; }
.ai-lt { display: block; font-size: .9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-list small svg { width: 12px; height: 12px; vertical-align: -2px; }
.ai-empty { font-size: .88rem; }
.ai-main { min-height: 60vh; display: flex; flex-direction: column; }
.ai-th { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; }
.ai-th h2 { margin: 0 0 6px; font-size: 1.1rem; }
.ai-th .tag svg { width: 13px; height: 13px; vertical-align: -2px; }
.ai-msgs { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.ai-msg { border-radius: 12px; padding: 12px 16px; max-width: 100%; scroll-margin-top: 80px; }
.ai-u { background: var(--sand); border: 1px solid var(--line); align-self: flex-start; max-width: 85%; }
.ai-a { background: #fff; border: 1px solid #CFE0DA; border-inline-start: 4px solid var(--emerald); box-shadow: var(--shadow); }
.ai-who { font-size: .8rem; font-weight: 700; color: var(--emerald-deep); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.ai-who svg { width: 16px; height: 16px; color: var(--gold); }
.ai-who .muted { font-weight: 400; margin-inline-start: auto; }
.ai-u .ai-who { color: var(--muted); }
.ai-body { line-height: 1.95; overflow-wrap: anywhere; }
.ai-body h2, .ai-body h3, .ai-body h4 { margin: 14px 0 6px; color: var(--navy); font-size: 1.05rem; }
.ai-body h2 { font-size: 1.15rem; } .ai-body > :first-child { margin-top: 0; }
.ai-body p { margin: 0 0 10px; } .ai-body ul, .ai-body ol { margin: 0 0 10px; padding-inline-start: 22px; }
.ai-body hr { border: 0; border-top: 1px dashed var(--line); margin: 12px 0; }
.ai-ref { display: inline-block; min-width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 6px; background: var(--gold-tint); border: 1px solid var(--gold-light); color: #6E5A33; font-size: .72rem; font-weight: 700; text-decoration: none; margin: 0 2px; vertical-align: 2px; }
.ai-ref:hover { background: var(--gold-light); color: #fff; text-decoration: none; }
.ai-refs { margin-top: 10px; background: var(--gold-tint); border-radius: 8px; padding: 10px 14px; font-size: .88rem; }
.ai-refs ol { margin: 6px 0 0; padding-inline-start: 22px; } .ai-refs li { margin-bottom: 4px; }
.ai-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.ai-acts svg { width: 14px; height: 14px; vertical-align: -2px; }
.ai-docf { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ai-docf select { max-width: 260px; padding: 5px 8px; font-size: .85rem; }
.ai-flag { font-size: .78rem; color: var(--muted); margin-top: 4px; } .ai-flag svg { width: 12px; height: 12px; vertical-align: -2px; }
.ai-wait .ai-body { color: var(--muted); }
.ai-dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.ai-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); opacity: .3; animation: aiDot 1.2s infinite; }
.ai-dots i:nth-child(2) { animation-delay: .2s; } .ai-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ai-hello { text-align: center; padding: 18px 8px 8px; }
.ai-hello h2 { margin: 10px 0 4px; }
.ai-orb { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto; display: flex; align-items: center; justify-content: center; color: #E9CF8E; background: radial-gradient(circle at 30% 30%, var(--emerald-soft), var(--navy) 75%); box-shadow: 0 6px 20px rgba(23,37,50,.25); }
.ai-orb svg { width: 32px; height: 32px; }
.ai-orb.sm { width: 46px; height: 46px; margin: 0; flex: none; } .ai-orb.sm svg { width: 24px; height: 24px; }
.ai-starters { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 18px 0 8px; text-align: start; }
.ai-st, .ai-tool { font: inherit; text-align: start; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: border-color .15s, box-shadow .15s, transform .15s; color: var(--ink); }
.ai-st:hover, .ai-tool:hover { border-color: var(--emerald); box-shadow: var(--shadow); transform: translateY(-1px); }
.ai-st b, .ai-tool b { color: var(--navy); font-size: .95rem; } .ai-st span, .ai-tool span { color: var(--muted); font-size: .8rem; }
.ai-tip { color: var(--muted); font-size: .85rem; margin: 10px 0 0; } .ai-tip svg { width: 14px; height: 14px; vertical-align: -2px; }
.ai-composer { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; position: sticky; bottom: 0; background: var(--card); }
.ai-composer textarea { width: 100%; resize: vertical; min-height: 80px; }
.ai-cbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.ai-cbar .grow { flex: 1; } .ai-cbar select { max-width: 280px; }
.ai-cbar .check svg, .ai-cbar .btn svg, .ai-new svg, .ai-state .btn svg, .ai-teaser .btn svg { width: 15px; height: 15px; vertical-align: -3px; }
.ai-note { font-size: .78rem; color: var(--muted); margin: 8px 0 0; }
.ai-case { border-top: 3px solid var(--gold); background: linear-gradient(180deg, #FDFBF6, #fff 60%); }
.ai-case.busy { opacity: .85; pointer-events: none; }
.ai-case-h { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.ai-case-h h2 { margin: 0; font-size: 1.1rem; } .ai-case-h p { margin: 2px 0 0; font-size: .88rem; }
.ai-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.ai-more { margin-top: 10px; } .ai-more summary { cursor: pointer; color: var(--emerald); font-size: .9rem; font-weight: 600; }
.ai-more textarea { width: 100%; margin-top: 8px; }
.ai-teaser { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--gold-tint); border: 1px solid var(--gold-light); border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; font-size: .9rem; }
.ai-teaser > svg { width: 20px; height: 20px; color: var(--gold); }
@media (max-width: 900px) { .ai-wrap { grid-template-columns: minmax(0, 1fr); } .ai-main { order: -1; min-height: 0; } .ai-side { position: static; max-height: 260px; } .ai-u { max-width: 100%; } .ai-composer { position: static; } .ai-cbar select { max-width: 100%; flex: 1 1 100%; } }
@media print { .ai-side, .ai-composer, .ai-acts { display: none !important; } }
.ai-body blockquote { margin: 10px 0; padding: 8px 12px; border-inline-start: 3px solid var(--gold-light); background: var(--gold-tint); border-radius: 6px; font-size: .88rem; color: #5B4A2A; }
@media (max-width: 600px) { .ai-starters, .ai-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ai-st, .ai-tool { padding: 10px; } .ai-st span, .ai-tool span { font-size: .75rem; } }
/* مساعد ركاز v9 */
.ai-pro { font-size: .68rem; padding: 0 7px; }
.ai-check { font-size: .82rem; margin-top: 8px; padding: 6px 10px; border-radius: 8px; }
.ai-check.ok { background: var(--ok-tint); color: var(--emerald-deep); }
.ai-check.ok svg { width: 13px; height: 13px; vertical-align: -2px; }
.ai-check.bad { background: var(--warn-tint); color: var(--warn); border: 1px solid #EBD39A; }
mark.ai-bad { background: #FBE3B5; color: inherit; border-bottom: 2px dotted var(--warn); padding: 0 2px; cursor: help; }
.ai-flag.warn { color: var(--warn); }
.ai-rate { display: inline-flex; gap: 4px; margin-inline-start: auto; }
.ai-rate .btn { padding: 2px 8px; filter: grayscale(1); opacity: .7; }
.ai-rate .btn.on, .ai-rate .btn:hover { filter: none; opacity: 1; border-color: var(--emerald); }
.ai-fb { margin-top: 10px; background: var(--sand); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
.ai-fb textarea { width: 100%; }
.ai-fb label:first-child { font-size: .85rem; font-weight: 600; }
.ai-opts { margin-top: 12px; display: flex; align-items: center; gap: 8px; font-size: .9rem; flex-wrap: wrap; }
.ai-opts select { max-width: 260px; }
.ai-doclist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 14px; }
.ai-doclist .check { font-size: .86rem; }
.ai-docs-ack { margin-top: 8px; background: var(--warn-tint); border-radius: 8px; padding: 8px 10px; }
.ai-docs-used { margin-top: 6px; font-size: .82rem; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ai-docs-used svg, .ai-docs summary svg { width: 14px; height: 14px; vertical-align: -2px; }
.ai-style { max-width: 190px; }
.ai-fbrow { border-bottom: 1px solid var(--line); padding: 12px 0; }
.ai-fbrow.done { opacity: .6; }
.ai-fbh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-fbc { margin: 6px 0; background: var(--sand); border-radius: 8px; padding: 8px 10px; }
.ai-docs-ack[hidden], .ai-fb[hidden], .ai-hello[hidden] { display: none !important; }
.ai-flag.mem { color: #7A6235; } .ai-flag.mem svg { color: var(--gold); }
.ai-kn { border-bottom: 1px solid var(--line); padding: 14px 0; }
.ai-kn.off { opacity: .55; }
.ai-kn-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.ai-kn-a { font-size: .92rem; }
.ai-kn-f { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: .8rem; margin-top: 6px; }
.ai-kn details { margin-top: 6px; } .ai-kn textarea, .ai-kn input[type=text] { width: 100%; }
.ai-kn-search { display: flex; gap: 8px; } .ai-kn-search input { flex: 1; }

/* باقات الاشتراك */
.pk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.pk-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid #D6CFBF; border-radius: 10px; cursor: pointer; position: relative; background: #fff; }
.pk-card input { position: absolute; inset-inline-end: 12px; top: 14px; accent-color: var(--emerald); }
.pk-card:has(input:checked) { border-color: var(--emerald); background: var(--emerald-tint); box-shadow: 0 0 0 1px var(--emerald) inset; }
.pk-card.off { opacity: .55; cursor: not-allowed; }
.pk-name { font-weight: 700; color: var(--navy); padding-inline-end: 24px; }
.pk-price { font-size: 1.15rem; font-weight: 700; }
.pk-price small { font-size: .78rem; font-weight: 400; color: var(--muted); }
.pk-desc { font-size: .85rem; color: var(--muted); line-height: 1.6; }
.pk-note { font-size: .78rem; color: #8a3b18; }
.pk-extras[hidden], .pk-extras [hidden], [data-pk-legacy][hidden] { display: none !important; }
.pk-quote { margin-top: 10px; }

/* هوية المكتب في القائمة، و«Powered by ركاز» في آخرها */
.brand-office { align-items: center; }
.brand-office img { width: 58px; height: 58px; object-fit: contain; background: #fff; padding: 4px; }
.brand-office b { font-family: inherit; font-size: 1.02rem; font-weight: 700; line-height: 1.35; color: var(--gold-light); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.side-foot.powered a { display: flex; align-items: center; justify-content: center; gap: 8px; color: #9FB0BE; text-decoration: none; font-size: .78rem; direction: ltr; }
.side-foot.powered img { width: 22px; height: auto; border-radius: 4px; opacity: .9; }
.side-foot.powered b { color: var(--gold-light); font-family: 'Amiri', serif; font-size: .95rem; }
