/* ═══ هوية المحامية أمواج نائف العتيبي ═══
   متغيرات نظام الاستشارات مربوطة بألوان موقع lawamwaj.com وخطه (Almarai)،
   وطبقة توافق لأصناف القالب التي يستخدمها النظام داخل تصميم الموقع. */
:root {
  --teal: #1A1A1A;
  --teal-900: #141414;
  --teal-700: #3B3935;
  --gold: #827252;
  --gold-soft: #B9A47C;
  --gold-deep: #6B5D42;
  --ivory: #F7F4EE;
  --paper: #FCFBF8;
  --line: #E6DFD2;
  --ink: #1A1A1A;
  --muted: #6E685E;
  --radius: 14px;
  --shadow: 0 10px 30px -12px rgba(20, 20, 20, .22);
  --head: "Almarai", "Segoe UI", Tahoma, sans-serif;
  --body: "Almarai", "Segoe UI", Tahoma, sans-serif;
  --max: 1200px;
}
.app-page, .admin, .room { font-family: var(--body); }
.app-page h1, .app-page h2, .app-page h3, .admin h1, .admin h2, .admin h3 { font-family: var(--head); }
.container { width: min(var(--max), 100% - 40px); margin-inline: auto; }
@media (max-width: 640px) { .container { width: calc(100% - 32px); } }
.btn-primary { background: var(--ink); color: #fff !important; border-color: var(--ink); }
.btn-primary:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: #fff !important; }
.btn-ghost { border-color: rgba(255, 255, 255, .55); color: #fff !important; background: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.btn svg { width: 18px; height: 18px; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 24px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .g2, .g3 { grid-template-columns: 1fr; } }
.app-page .card, .admin .card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; transition: .25s; position: relative; box-shadow: none; }
.app-page a.card:hover, .app-page .card.hover:hover, .admin a.card:hover, .admin .card.hover:hover { border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-3px); }
.app-page .card h3, .admin .card h3 { margin-bottom: .4em; }
.app-page .card p, .admin .card p { color: var(--muted); margin: 0; font-size: .97rem; }
.app-page .page-hero p { color: #d4cdbf; max-width: 720px; font-size: 1.08rem; margin: 0; }
.app-page .page-hero .container { position: relative; z-index: 1; }
/* النماذج */
.app-page .form, .admin .form { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.app-page .field, .admin .field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { font-family: var(--head); font-size: .92rem; color: var(--ink); font-weight: 700; }
.app-page .field input, .app-page .field select, .app-page .field textarea,
.admin .field input, .admin .field select, .admin .field textarea {
  font: inherit; font-size: .98rem; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.field textarea { min-height: 130px; resize: vertical; }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.choice label { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; text-align: center; font-family: var(--head); font-size: .92rem; color: var(--ink); transition: .2s; }
.choice input { position: absolute; opacity: 0; }
.choice label:has(input:checked) { border-color: var(--gold); background: var(--gold-50, #F4EFE6); }
.choice label:has(input:focus-visible) { outline: 2px solid var(--gold); }
.note { background: #f7f3ea; border: 1px dashed var(--gold); border-radius: 10px; padding: 12px 16px; font-size: .9rem; color: var(--gold-deep); margin-bottom: 18px; }
.form-msg { display: none; margin-top: 16px; padding: 14px 16px; border-radius: 10px; background: #F4EFE6; color: var(--ink); }
.form-msg.show { display: block; }
@media (max-width: 640px) { .form .row, .choice { grid-template-columns: 1fr; } .app-page .form, .admin .form { padding: 22px; } }

/* ═══ تنسيقات نظام الاستشارات ═══ */
.app-section { padding-block: 48px 80px; }
.container.narrow { max-width: 760px; }
.small { font-size: .88rem; }
.center { text-align: center; }
.wide { width: 100%; }
.btn.sm { padding: 7px 14px; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.h3 { font-size: 1.2rem; }
.pre { white-space: pre-wrap; }
.hp { position: absolute; left: -9999px; }
.linkish { background: none; border: 0; padding: 0; color: var(--teal); text-decoration: underline; cursor: pointer; font: inherit; font-size: .9rem; }
.back { color: var(--teal); font-family: var(--head); font-size: .92rem; }
.inline { display: inline; }
.nowrap { white-space: nowrap; }

.test-banner { background: #fff4d6; color: #6b5310; text-align: center; font-size: .88rem; padding: 8px 16px; border-bottom: 1px solid #ecd9a0; }
.app-notice { border-radius: 12px; padding: 14px 18px; background: #F4EFE6; color: var(--teal); border: 1px solid #E6DFD2; }
.app-notice.error { background: #fbeeee; color: #8a2b2b; border-color: #efcfcf; }
.app-notice.success { background: #eef6ef; color: #245a36; border-color: #cfe5d3; }
.app-notice svg { width: 18px; height: 18px; vertical-align: -3px; }

/* الحجز */
.book-step { display: flex; align-items: center; gap: 12px; margin: 28px 0 14px; }
.book-step:first-of-type { margin-top: 0; }
.book-step h2 { margin: 0; font-size: 1.25rem; }
.book-step .num { width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: var(--gold); display: grid; place-items: center; font-family: var(--head); }
.kind-fixed { display: flex; gap: 14px; align-items: center; background: var(--ivory); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.kind-fixed svg { width: 30px; height: 30px; color: var(--teal); flex: 0 0 30px; }
.kind-fixed b { display: block; font-family: var(--head); color: var(--teal); font-weight: 500; }
.kind-fixed span { color: var(--muted); font-size: .9rem; }
.choice.dur { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.choice.dur label { display: grid; gap: 2px; }
.choice.dur label span { color: var(--muted); font-size: .88rem; font-family: var(--body); }
.days { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.days button, .times button {
  font: inherit; border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 12px; cursor: pointer; transition: .15s;
}
.days button { flex: 0 0 auto; min-width: 92px; padding: 10px 12px; text-align: center; scroll-snap-align: start; line-height: 1.5; }
.days button b { display: block; font-family: var(--head); color: var(--teal); font-weight: 500; font-size: .95rem; }
.days button small { color: var(--muted); font-size: .8rem; }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin: 14px 0 6px; }
.times button { padding: 10px 6px; }
.days button:hover, .times button:hover { border-color: var(--gold); }
.days button[aria-pressed="true"], .times button[aria-pressed="true"] { border-color: var(--teal); background: var(--teal); color: #fff; }
.days button[aria-pressed="true"] b, .days button[aria-pressed="true"] small { color: #fff; }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; margin: 6px 0 18px; }
.agree input { margin-top: 6px; }
.agree a { color: var(--teal); text-decoration: underline; }
.summary { background: var(--ivory); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; font-size: .95rem; }

/* الحقائق والحالات */
.facts { display: grid; gap: 0; margin: 0 0 12px; }
.facts > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.facts dt { color: var(--muted); font-size: .92rem; }
.facts dd { margin: 0; font-weight: 500; }
.badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .82rem; font-family: var(--head); background: #eceae2; color: var(--ink); white-space: nowrap; }
.st-upcoming, .st-confirmed { background: #e6eef6; color: #214d77; }
.st-open { background: #e3f3e8; color: #1f6a3a; }
.st-in_progress { background: var(--teal); color: #fff; }
.st-completed { background: #edf0ef; color: #3c4b4a; }
.st-pending_payment { background: #fff4d6; color: #6b5310; }
.st-expired, .st-cancelled, .st-no_show { background: #fbeeee; color: #8a2b2b; }
.st-rescheduled { background: #f1efe5; color: var(--gold-deep); }
.pay { font-size: .82rem; white-space: nowrap; }
.pay.ok { color: #1f6a3a; } .pay.wait { color: #8a6a10; } .pay.no, .pay.refund { color: #8a2b2b; }
.pay.refund { font-weight: 600; }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.hold, .opens { margin: 12px 0 0; color: var(--gold-deep); }
.sim-pay { display: grid; gap: 12px; }
.sim-pay p { background: #fff4d6; padding: 12px 14px; border-radius: 10px; margin: 0; font-size: .93rem; }
.sim-pay svg { width: 18px; height: 18px; vertical-align: -3px; }
.otp-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-family: var(--head); }
.ready .btn { margin-top: 14px; }
.docs { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.docs li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.docs a { display: inline-flex; gap: 8px; align-items: center; color: var(--teal); min-width: 0; }
.docs a span { overflow-wrap: anywhere; }
.docs svg { width: 18px; height: 18px; flex: 0 0 18px; }
.docs small { color: var(--muted); }
.inline-upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.portal-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.cons-card .cons-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.cons-card .ref { color: var(--muted); font-size: .85rem; }
.cons-card .btn { margin-top: 14px; }
.cons-card svg { width: 16px; height: 16px; }

/* الفاتورة */
body.invoice { background: #f7f4ee; font-family: "Almarai", "Segoe UI", Tahoma, sans-serif; margin: 0; padding: 24px 16px; color: #1A1A1A; }
.inv { max-width: 760px; margin: 0 auto; background: #fff; padding: 36px; border-radius: 14px; }
.inv header { display: flex; justify-content: space-between; gap: 20px; align-items: center; border-bottom: 2px solid var(--gold); padding-bottom: 18px; flex-wrap: wrap; }
.inv h1 { margin: 0 0 6px; font-size: 1.5rem; color: var(--teal); }
.inv header p { margin: 0; }
.inv .parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 22px 0; }
.inv .parties h2 { font-size: 1rem; color: var(--gold-deep); margin: 0 0 6px; }
.inv .parties p { margin: 0; }
.inv table { width: 100%; border-collapse: collapse; }
.inv th, .inv td { padding: 12px; border-bottom: 1px solid var(--line); text-align: right; }
.inv td:last-child, .inv th:last-child { text-align: left; white-space: nowrap; }
.inv tfoot th { background: var(--ivory); font-size: 1.05rem; }
.inv .paid { color: #1f6a3a; margin: 18px 0; }
@media print { body.invoice { background: #fff; padding: 0; } .inv { padding: 0; } .no-print { display: none; } }

/* لوحة الإدارة */
body.admin { background: #f3f2ee; }
.admin-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.admin-side { background: var(--teal-900); color: #cfd8d6; padding: 22px 16px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; }
.admin-brand { display: flex; gap: 10px; align-items: center; color: #fff; font-family: var(--head); line-height: 1.4; }
.admin-brand small { display: block; color: var(--gold); font-size: .78rem; }
.admin-side nav { display: grid; gap: 4px; }
.admin-side nav a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; font-size: .95rem; }
.admin-side nav a:hover, .admin-side nav a[aria-current="page"] { background: rgba(255, 255, 255, .08); color: #fff; }
.admin-side nav svg { width: 20px; height: 20px; color: var(--gold); }
.admin-out { margin-top: auto; display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; }
.admin-out .linkish { color: var(--gold-soft); }
.admin-main { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.admin-title { font-size: 1.6rem; margin-bottom: 20px; }
.form.login { max-width: 420px; margin: 40px auto; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { padding: 8px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .92rem; }
.tabs a span { color: var(--muted); font-size: .8rem; margin-inline-start: 4px; }
.tabs a[aria-current="page"] { background: var(--teal); color: #fff; border-color: var(--teal); }
.tabs a[aria-current="page"] span { color: var(--gold-soft); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: 12px 14px; text-align: right; border-bottom: 1px solid #efece3; vertical-align: middle; }
.tbl thead th { background: var(--ivory); font-family: var(--head); font-weight: 500; color: var(--teal); white-space: nowrap; }
.tbl a { color: var(--teal); }
.tbl svg { width: 16px; height: 16px; vertical-align: -3px; }
.tbl small { color: var(--muted); }
.sms-body { max-width: 460px; font-size: .88rem; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.panel-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.panel-card h2 { font-size: 1.15rem; }
.panel-card h3 { font-size: 1rem; margin-top: 16px; }
.panel-card.danger { border-color: #efcfcf; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.stack { display: grid; gap: 12px; margin-top: 12px; }
.stack .field { margin: 0; }
.check { display: flex; gap: 8px; align-items: center; font-size: .92rem; }
.events summary { cursor: pointer; color: var(--teal); font-family: var(--head); margin: 8px 0; }
.events ol { padding-inline-start: 18px; margin: 0; font-size: .88rem; display: grid; gap: 6px; }
.events time { color: var(--muted); }
.plain { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.settings { display: grid; gap: 20px; max-width: 900px; }
.sched input[type="time"] { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; direction: ltr; }
.sched th { width: 110px; }
.inline-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-field label { min-width: 170px; }
.inline-field input, .inline-field select { width: 120px; }

/* غرفة الاجتماع */
body.room { margin: 0; height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; background: #0f2224; color: #e7ecea; font-family: var(--body); overflow: hidden; }
.room-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px; background: var(--teal-900); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.room-brand { display: flex; gap: 10px; align-items: center; min-width: 0; }
.room-brand b { display: block; font-family: var(--head); font-weight: 500; color: #fff; }
.room-brand span { font-size: .8rem; color: var(--gold-soft); }
.room-meta { display: flex; gap: 10px; align-items: center; font-size: .85rem; color: #b9c4c2; }
.room-meta .dot { width: 9px; height: 9px; border-radius: 50%; background: #c9a13b; }
.room-meta .dot.ok { background: #3fae68; }
.room-meta .dot.bad { background: #d25555; }
.timer { font-family: var(--head); direction: ltr; background: rgba(255, 255, 255, .08); padding: 2px 10px; border-radius: 999px; }
.stage { position: relative; padding: 14px; display: grid; min-height: 0; }
.tile { position: relative; border-radius: 16px; overflow: hidden; background: #172f32; }
.tile video { width: 100%; height: 100%; object-fit: contain; background: #0b1a1c; }
.tile.remote { width: 100%; height: 100%; }
.tile.local { position: absolute; inset-inline-start: 26px; bottom: 26px; width: min(240px, 32vw); aspect-ratio: 4/3; border: 2px solid rgba(171, 166, 133, .5); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); z-index: 2; }
.tile.local video { object-fit: cover; transform: scaleX(-1); }
.tile.local.screen video { transform: none; object-fit: contain; }
.tile .label { position: absolute; bottom: 10px; inset-inline-end: 10px; background: rgba(0, 0, 0, .55); padding: 3px 10px; border-radius: 999px; font-size: .8rem; }
.cam-off { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); }
.cam-off svg { width: 36px; height: 36px; }
.waiting { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; color: #b9c4c2; }
.waiting svg { width: 64px; height: 64px; color: var(--gold); opacity: .8; }
.waiting p { margin: 12px 0 0; }
.panel { position: absolute; top: 14px; bottom: 14px; inset-inline-end: 14px; width: min(340px, calc(100% - 28px)); background: #fbfaf6; color: var(--ink); border-radius: 16px; padding: 18px; z-index: 3; overflow: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .4); }
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.panel-head h2 { margin: 0; font-size: 1.1rem; }
.icon-btn { background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--muted); line-height: 1; }
.room-error { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 24px; background: rgba(15, 34, 36, .92); z-index: 4; }
.room-error p { max-width: 460px; }
.controls { display: flex; justify-content: center; gap: 10px; padding: 12px; background: var(--teal-900); flex-wrap: wrap; }
.ctl { display: grid; justify-items: center; gap: 4px; min-width: 76px; padding: 8px 10px; border-radius: 14px; border: 0; background: rgba(255, 255, 255, .07); color: #e7ecea; font: inherit; font-size: .78rem; cursor: pointer; }
.ctl svg { width: 22px; height: 22px; }
.ctl:hover { background: rgba(255, 255, 255, .14); }
.ctl[aria-pressed="false"]#btn-cam, .ctl[aria-pressed="false"]#btn-mic { background: #5a2b2b; }
.ctl[aria-pressed="true"]#btn-share, .ctl[aria-pressed="true"]#btn-docs { background: var(--gold); color: var(--teal-900); }
.ctl.end { background: #a33b3b; }
.ctl.end:hover { background: #bb4646; }
.ctl.end.strong { background: var(--gold); color: var(--teal-900); }
.ctl:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; }
  .admin-side nav { display: flex; flex-wrap: wrap; }
  .admin-side nav a span { font-size: .85rem; }
  .admin-out { margin: 0 0 0 auto; }
  .admin-grid, .pay-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .inv { padding: 20px; }
  .inv .parties { grid-template-columns: 1fr; }
  .ctl { min-width: 0; flex: 1 1 60px; padding: 8px 4px; }
  .ctl span { font-size: .7rem; }
  .room-meta #conn-text { display: none; }
  .tile.local { width: 38vw; inset-inline-start: 20px; bottom: 20px; }
}

.app-hero .container { padding-block: 40px 34px; }
.app-hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }

/* ——— الإصدار الثاني: لوحة العميل ولوحة المحامي ——— */
.cs-new { background: #fff4d6; color: #6b5310; }
.cs-info_requested { background: #fdebd8; color: #8a4b12; }
.cs-awaiting_payment, .is-awaiting_payment, .ms-awaiting_payment { background: #fff4d6; color: #6b5310; }
.cs-confirmed, .ms-upcoming { background: #e6eef6; color: #214d77; }
.cs-in_progress, .ms-started { background: var(--teal); color: #fff; }
.cs-held { background: #efe9f7; color: #563a80; }
.cs-closed, .ms-ended, .is-paid { background: #e3f3e8; color: #1f6a3a; }
.cs-converted { background: var(--teal); color: var(--gold-soft); }
.cs-rejected, .cs-cancelled, .cs-expired, .ms-cancelled, .ms-expired, .ms-no_show, .is-cancelled, .is-refund { background: #fbeeee; color: #8a2b2b; }
.ms-ready { background: #3fae68; color: #fff; }
.ms-overdue, .ms-follow { background: #f1efe5; color: var(--gold-deep); }
.kind-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; padding: 2px 10px; border-radius: 999px; background: #F4EFE6; color: var(--teal); white-space: nowrap; }
.kind-tag svg { width: 14px; height: 14px; }

.portal-top { background: var(--teal); color: #fff; padding: 30px 0 0; }
button.btn-ghost { background: transparent; }
.portal-top h1 { color: #fff; margin: 0; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.portal-top .eyebrow { color: var(--gold); margin: 0; }
.pt-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 20px; }
.pt-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pt-actions svg { width: 18px; height: 18px; }
.portal-nav { display: flex; gap: 4px; overflow-x: auto; }
.portal-nav a { display: inline-flex; gap: 8px; align-items: center; padding: 12px 18px; color: #cdd7d5; border-radius: 12px 12px 0 0; white-space: nowrap; font-family: var(--head); font-size: .95rem; }
.portal-nav a svg { width: 18px; height: 18px; }
.portal-nav a[aria-current="page"] { background: var(--paper); color: var(--teal); }
.portal-nav a:hover:not([aria-current]) { color: #fff; background: rgba(255, 255, 255, .06); }
.portal-body { padding-top: 32px; }
.block { margin-bottom: 30px; }
.block-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.portal-grid .form { padding: 22px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 26px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: grid; gap: 4px; transition: .2s; }
.kpi span { color: var(--muted); font-size: .88rem; }
.kpi b { font-family: var(--head); font-weight: 500; color: var(--teal); font-size: 1.5rem; line-height: 1.3; }
.kpi b small { display: block; font-size: .78rem; color: var(--muted); font-family: var(--body); }
a.kpi:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.kpi.hot { border-color: var(--gold); background: #fffbef; }

.todo { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.todo li { display: flex; align-items: center; gap: 12px; background: #fffbef; border: 1px solid #ecdfae; border-radius: 12px; padding: 12px 16px; }
.todo li span { flex: 1; }
.todo svg { width: 20px; height: 20px; color: var(--gold-deep); flex: 0 0 20px; }

.meet-card { display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 12px; }
.meet-card.ms-ready, .meet-card.ms-started { border-inline-start-color: #3fae68; }
.meet-card.ms-upcoming { border-inline-start-color: #3b6ea5; }
.meet-card.ms-awaiting_payment { border-inline-start-color: var(--gold); }
.mc-when { text-align: center; border-inline-end: 1px solid var(--line); padding-inline-end: 12px; }
.mc-when b { display: block; font-family: var(--head); color: var(--teal); font-size: 1.15rem; font-weight: 500; }
.mc-when span { color: var(--muted); font-size: .85rem; }
.mc-body h3 { margin: 6px 0 2px; font-size: 1.05rem; }
.mc-body p { margin: 0; }
.mc-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mc-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.mc-actions svg, .btn.sm svg { width: 16px; height: 16px; }

.cons-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.cons-head h2 { margin: 4px 0; font-size: 1.4rem; }
.cons-head .ref { color: var(--muted); font-size: .9rem; }
.stepper { list-style: none; padding: 0; margin: 0 0 26px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.stepper li { text-align: center; font-size: .85rem; color: var(--muted); position: relative; padding-top: 42px; }
.stepper li span { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #eceae2; color: var(--muted); font-family: var(--head); z-index: 1; }
.stepper li::before { content: ""; position: absolute; top: 16px; left: 50%; width: 100%; height: 2px; background: #e4e0d2; }
.stepper li:first-child::before { display: none; }
.stepper li.done { color: var(--teal); }
.stepper li.done span { background: var(--teal); color: var(--gold); }
.stepper li.done::before, .stepper li.current::before { background: var(--teal); }
.stepper li.current { color: var(--teal); font-weight: 600; }
.stepper li.current span { background: var(--gold); color: var(--teal-900); box-shadow: 0 0 0 4px #f1efe5; }

.thread { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.thread li { border-radius: 12px; padding: 10px 14px; background: #f3f2ee; max-width: 92%; }
.thread li.lawyer { background: #F4EFE6; justify-self: start; }
.thread li.client { background: #fffbef; justify-self: end; }
.thread b { font-family: var(--head); font-weight: 500; color: var(--teal); }
.thread time { color: var(--muted); font-size: .8rem; margin-inline-start: 8px; }
.thread p { margin: 4px 0 0; }
.inv-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.inv-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.inv-list small { display: block; color: var(--muted); font-size: .82rem; }
.inv-list .amt { text-align: left; font-family: var(--head); display: grid; gap: 4px; justify-items: end; white-space: nowrap; }
.timeline { list-style: none; margin: 0; display: grid; gap: 8px; font-size: .88rem; border-inline-start: 2px solid var(--line); padding: 0; padding-inline-start: 14px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -20px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.timeline time { display: block; color: var(--muted); font-size: .78rem; }
.timeline.big { font-size: .95rem; }
.empty { text-align: center; padding: 50px 20px; background: #fff; border: 1px dashed var(--line); border-radius: 16px; }
.empty svg { width: 46px; height: 46px; color: var(--gold); }

.verified { display: flex; gap: 8px; align-items: center; background: #eef6ef; color: #245a36; padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; }
.verified svg { width: 20px; height: 20px; }
.otp-box { background: var(--ivory); border: 1px solid var(--line); border-radius: 12px; padding: 16px 16px 4px; margin-bottom: 18px; }
.with-btn { display: flex; gap: 8px; }
.with-btn input { flex: 1; min-width: 0; }
.with-btn .btn { padding: 10px 14px; font-size: .85rem; }
.otp-input.sm { font-size: 1.2rem; letter-spacing: .3em; }
.choice.two { grid-template-columns: 1fr 1fr; }
.choice.methods label { display: grid; justify-items: center; gap: 6px; }
.choice.methods svg { width: 24px; height: 24px; }
.choice.methods b { font-weight: 500; }
.facts .total dd, .facts .total dt { font-weight: 700; color: var(--teal); }
.facts.compact > div { padding: 5px 0; grid-template-columns: 120px 1fr; font-size: .88rem; }

.admin-kpis { grid-template-columns: repeat(4, 1fr); }
.meet-admin { border: 1px solid var(--line); border-inline-start: 4px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: #fcfbf8; }
.meet-admin.ms-ready, .meet-admin.ms-started { border-inline-start-color: #3fae68; }
.meet-admin.ms-upcoming { border-inline-start-color: #3b6ea5; }
.meet-admin.ms-awaiting_payment { border-inline-start-color: var(--gold); }
.ma-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.meet-admin p { margin: 6px 0; }
details.more { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
details.more summary { cursor: pointer; color: var(--teal); font-family: var(--head); font-size: .95rem; display: flex; gap: 6px; align-items: center; }
details.more summary svg { width: 18px; height: 18px; }
.panel-card.highlight { border-color: var(--gold); box-shadow: 0 0 0 3px #f6f2e2; }
.wide-card { grid-column: 1 / -1; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; justify-content: space-between; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.list a { display: grid; color: var(--ink); }
.list a span { color: var(--muted); font-size: .88rem; }
.list small { color: var(--muted); }
.search { display: flex; gap: 8px; margin-bottom: 16px; max-width: 620px; }
.search input { flex: 1; font: inherit; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.note { border-inline-start: 3px solid var(--gold); background: #fcfbf8; padding: 8px 12px; margin-top: 10px; border-radius: 6px; }
.note time { color: var(--muted); font-size: .8rem; }
.note p { margin: 4px 0 0; }
.next-action { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.next-action legend { font-family: var(--head); color: var(--teal); padding: 0 6px; }
.next-action label { display: flex; gap: 6px; align-items: center; }
.clip { color: var(--muted); }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: #fcfbf6; }
.tbl tfoot th { background: var(--ivory); }

@media (max-width: 1100px) { .admin-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .portal-grid { grid-template-columns: 1fr; }
  .meet-card { grid-template-columns: 76px 1fr; }
  .mc-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .stepper li { font-size: .72rem; }
}
@media (max-width: 560px) {
  .admin-kpis { grid-template-columns: 1fr 1fr; }
  .with-btn { flex-direction: column; }
  .pt-actions .btn { padding: 9px 14px; font-size: .85rem; }
}

/* ——— الإصدار الثالث: القضايا، العقود، الإشعارات ——— */
.ks-open { background: #e6eef6; color: #214d77; }
.ks-awaiting_client { background: #fdebd8; color: #8a4b12; }
.ks-closed { background: #edf0ef; color: #3c4b4a; }
.ct-sent { background: #fff4d6; color: #6b5310; }
.ct-viewed { background: #e6eef6; color: #214d77; }
.ct-signed { background: #e3f3e8; color: #1f6a3a; }
.ct-declined, .ct-cancelled { background: #fbeeee; color: #8a2b2b; }
.portal-nav a .count { background: var(--gold); color: var(--teal-900); border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; font-size: .75rem; display: inline-grid; place-items: center; }
.hearings { display: grid; gap: 10px; }
.hearings li { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-inline-start: 3px solid var(--gold); border-radius: 10px; background: #fff; }
.hearings li.past { opacity: .6; }
.hearings b { font-family: var(--head); font-weight: 500; color: var(--teal); }
.hearings small { color: var(--muted); }
.contract-view iframe { width: 100%; height: min(75vh, 900px); border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.sign-box { margin-top: 22px; border-color: var(--gold); box-shadow: 0 0 0 3px #f6f2e2; }
.sign-box h2 svg { width: 22px; height: 22px; vertical-align: -4px; }
.notif-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.notif-list a { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.notif-list li.unread a { border-inline-start: 4px solid var(--gold); background: #fffbef; }
.notif-list b { font-family: var(--head); font-weight: 500; color: var(--teal); }
.notif-list span { color: var(--ink); font-size: .92rem; }
.notif-list time { color: var(--muted); font-size: .8rem; }
.inv table.cert th { width: 34%; background: var(--ivory); font-weight: 600; }
.inv table.cert td, .inv table.cert th { text-align: right; vertical-align: top; }

/* ——— التقويم ——— */
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-nav h2 { margin: 0 12px 0 0; font-size: 1.2rem; }
.cal-toolbar .tabs { margin: 0; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .82rem; color: var(--muted); margin-bottom: 12px; }
.cal-legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-inline-end: 6px; vertical-align: -2px; background: var(--c, #ccc); }
.cal-legend .ev-video { --c: #2f6fae; } .cal-legend .ev-phone { --c: #2f8f5b; } .cal-legend .ev-office { --c: #8a6a10; }
.cal-legend .ev-await { --c: #e2c77a; } .cal-legend .ev-hearing { --c: #7a3fa0; } .cal-legend .ev-block { --c: #9aa4a3; }

.ev { --c: #2f6fae; display: block; border-inline-start: 4px solid var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--ink); border-radius: 8px; font-size: .78rem; line-height: 1.35; overflow: hidden; }
.ev b { font-family: var(--head); font-weight: 500; color: var(--c); }
.ev small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evk-video { --c: #2f6fae; } .evk-phone { --c: #2f8f5b; } .evk-office { --c: #8a6a10; }
.ev-hearing { --c: #7a3fa0; }
.ev-block { --c: #9aa4a3; background: repeating-linear-gradient(135deg, #f1f2f1, #f1f2f1 6px, #e6e8e7 6px, #e6e8e7 12px); }
.evs-awaiting_payment { background: #fff8e6; border-inline-start-style: dashed; }
.evs-cancelled, .evs-no_show { opacity: .5; text-decoration: line-through; }
.evs-ended { opacity: .75; }
.evs-started { box-shadow: 0 0 0 2px #3fae68 inset; }

.cal-week { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.cal-headrow, .cal-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(110px, 1fr)); min-width: 860px; }
.cal-headrow { position: sticky; top: 0; background: var(--ivory); border-bottom: 1px solid var(--line); z-index: 2; }
.dh { display: grid; text-align: center; padding: 8px 4px; color: var(--ink); border-inline-start: 1px solid var(--line); }
.dh b { font-family: var(--head); font-weight: 500; color: var(--teal); font-size: .9rem; }
.dh span { font-size: .78rem; color: var(--muted); }
.dh.today { background: var(--teal); } .dh.today b, .dh.today span { color: #fff; }
.cal-grid .times { position: relative; margin: 0; display: block; gap: 0; }
.times .hr { position: absolute; inset-inline: 0; font-size: .72rem; line-height: 1.2; color: var(--muted); text-align: center; border-top: 1px solid #f0eee6; padding-top: 2px; direction: ltr; }
.cal-grid .col { position: relative; border-inline-start: 1px solid var(--line); background-image: linear-gradient(#f0eee6 1px, transparent 1px); background-size: 100% 52px; }
.cal-grid .col.today { background-color: #fcfbf5; }
.cal-grid .col.closed { background-color: #f6f3f3; }
.cal-grid .work { position: absolute; inset-inline: 0; background: rgba(171, 166, 133, .09); }
.cal-grid .ev { position: absolute; inset-inline: 3px; padding: 3px 6px; z-index: 1; }
.cal-grid a.ev:hover { z-index: 3; box-shadow: var(--shadow); }
.cal-grid .now { position: absolute; inset-inline: 0; height: 2px; background: #d25555; z-index: 2; }
.cal-grid .now::before { content: ""; position: absolute; inset-inline-start: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #d25555; }

.cal-month { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cal-month .mh, .cal-month .mg { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-month .mh b { text-align: center; padding: 8px; background: var(--ivory); font-family: var(--head); font-weight: 500; color: var(--teal); font-size: .88rem; }
.cal-month .mc { min-height: 108px; border-top: 1px solid var(--line); border-inline-start: 1px solid var(--line); padding: 4px; display: grid; align-content: start; gap: 3px; }
.cal-month .mc.out { background: #faf9f5; } .cal-month .mc.out .dn { color: #b9bdb9; }
.cal-month .mc.today { background: #fcfbf5; box-shadow: inset 0 0 0 2px var(--gold); }
.cal-month .mc.closed { background: #f6f3f3; }
.cal-month .dn { font-family: var(--head); color: var(--teal); font-size: .9rem; }
.cal-month .chip { padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .72rem; }
.cal-month .more-n { font-size: .75rem; color: var(--muted); }

.agenda { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.agenda li.ev { display: grid; grid-template-columns: 90px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; font-size: .92rem; }
.ag-time { display: grid; text-align: center; } .ag-time span { color: var(--muted); font-size: .8rem; }
.ag-body { display: grid; } .ag-body b { color: var(--ink); } .ag-body span { color: var(--muted); } .ag-body small { color: var(--muted); }
.ag-side { display: flex; gap: 8px; align-items: center; }
.copy-row { display: flex; gap: 8px; margin: 10px 0; }
.copy-row input { flex: 1; font: inherit; font-size: .82rem; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--ivory); }
@media (max-width: 700px) { .agenda li.ev { grid-template-columns: 70px 1fr; } .ag-side { grid-column: 1 / -1; } .cal-month .mc { min-height: 70px; } .cal-month .chip { display: none; } }

.panel-card h2 svg { width: 22px; height: 22px; vertical-align: -4px; color: var(--gold-deep); }
