/* هيكل النظام: القائمة الجانبية بلون المركز، الشريط العلوي، التقويم، ملف المراجع، الطباعة */
.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100dvh; }
.side { --side-ink: var(--brand-ink); --side-2: color-mix(in srgb, var(--brand-ink) 84%, var(--brand)); --side-mute: color-mix(in srgb, var(--brand-ink) 66%, var(--brand)); position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--brand); color: var(--side-ink); z-index: 40; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; min-width: 0; }
.side-brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; flex: none; background: #fff; padding: 3px; }
.side-brand div { min-width: 0; display: flex; flex-direction: column; }
.side-brand b { font-size: 15px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; text-wrap: balance; }
.side-brand span { font-size: 12px; color: var(--side-mute); }
.brand-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: var(--brand); color: var(--brand-ink); margin: 0 auto 10px; }
.brand-mark.sm { width: 40px; height: 40px; border-radius: 10px; margin: 0; flex: none; }
.side .brand-mark.sm { background: color-mix(in srgb, var(--brand-ink) 16%, transparent); }
.brand-mark svg { width: 55%; height: 55%; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 10px 12px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: none; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 12px; font-weight: 700; color: var(--side-mute); padding: 0 12px 4px; }
.side-nav a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px; border-radius: 8px; color: var(--side-2); font-weight: 700; font-size: 14px; text-decoration: none; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.side-nav a svg { width: 19px; height: 19px; flex: none; opacity: .8; }
.side-nav a:hover { background: color-mix(in srgb, var(--brand-ink) 8%, transparent); color: var(--side-ink); text-decoration: none; }
.side-nav a.on { background: color-mix(in srgb, var(--brand-ink) 15%, transparent); color: var(--side-ink); }
.side-nav a.on svg { opacity: 1; }
.side :focus-visible { outline-color: var(--brand-ink); }
.side-nav .count { margin-inline-start: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand-ink); color: var(--brand); font: 800 12px/20px var(--font); text-align: center; font-style: normal; font-variant-numeric: tabular-nums; }
.side-foot { margin: 0 10px 12px; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, #000 16%, transparent); display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--side-mute); }
.sync { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink-2); }
.sync svg { width: 16px; height: 16px; }
.sync.ok { color: var(--ok); } .sync.off { color: var(--warn); }
.side .sync { color: var(--side-ink); }
.side .sync::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--side-mute); flex: none; }
.side .sync.ok::before { background: #4ade80; } .side .sync.off::before { background: #fbbf24; }
.side .sync svg { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; min-height: 60px; padding: 8px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.top h1 { margin: 0; font-size: 18px; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-search { position: relative; flex: 1 1 auto; max-width: 420px; }
.top-search > .ic { position: absolute; inset-inline-start: 12px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); pointer-events: none; z-index: 1; }
.top-search input { min-height: 40px; padding-inline: 38px 34px; background: var(--surface-2); border-color: var(--line); }
.top-search input:focus { background: var(--surface); }
.top-search kbd { position: absolute; inset-inline-end: 10px; top: 50%; translate: 0 -50%; min-width: 20px; height: 20px; border: 1px solid var(--line-2); border-radius: 5px; font: 700 11px/18px var(--font); color: var(--muted); text-align: center; pointer-events: none; background: var(--surface); }
.top-search:focus-within kbd { display: none; }
.top-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.me-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--ink); font-family: var(--font); text-align: start; cursor: pointer; transition: background var(--t-fast) var(--ease); }
.me-btn:hover { background: var(--surface-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font: 800 14px/1 var(--font); flex: none; }
.me-name { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.me-name b { font-size: 13.5px; white-space: nowrap; }
.me-name small { font-size: 12px; color: var(--muted); }
.menu-btn, .search-btn, .search-close { display: none; }
#view { padding: 22px 24px 48px; outline: none; max-width: 1480px; width: 100%; }
#view.enter { animation: view-in 280ms var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
.bottom { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(15, 27, 45, .42); z-index: 35; animation: fade-in var(--t) var(--ease); }

@media (max-width: 1180px) and (min-width: 961px) {
  .shell { grid-template-columns: 216px minmax(0, 1fr); }
  .me-name { display: none; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(290px, 86vw); transform: translateX(100%); transition: transform var(--t) var(--ease); box-shadow: var(--sh-2); }
  [dir=ltr] .side { transform: translateX(-100%); }
  .side.open { transform: none !important; }
  .menu-btn, .search-btn { display: inline-flex; }
  .top { padding: 6px 10px; min-height: 56px; gap: 6px; }
  .top h1 { font-size: 17px; flex: 1; }
  .top-search { display: none; }
  .top.searching h1, .top.searching .top-actions, .top.searching .menu-btn { display: none; }
  .top.searching .top-search { display: block; max-width: none; }
  .top.searching .search-close { display: inline-flex; }
  .top-search kbd, .me-name, .top .lang-btn span, #clockBtn span { display: none; }
  .me-btn { padding: 0 4px; }
  #view { padding: 14px 12px 96px; }
  .bottom { display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .bottom a, .bottom button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; border: 0; background: none; color: var(--muted); font: 700 11px/1.2 var(--font); text-decoration: none; border-radius: 10px; cursor: pointer; padding: 2px; text-align: center; -webkit-tap-highlight-color: transparent; }
  .bottom svg { width: 22px; height: 22px; padding: 3px 16px; box-sizing: content-box; border-radius: 99px; transition: background var(--t-fast) var(--ease); }
  .bottom a.on { color: var(--brand); }
  .bottom a.on svg { background: var(--brand-soft); }
}

/* رأس الصفحة داخل الشاشة */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { margin: 0; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

/* ── اليوم: لوحة حيّة ── */
.dept-bar { width: 10px; height: 10px; border-radius: 50%; align-self: center; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 700; white-space: nowrap; }
.chip .dot { width: 8px; height: 8px; }
.today-head h2 { font-size: 22px; }
.today-head .hours { color: var(--ink-2); font-weight: 700; }
/* العدّادات والخط الزمني شريط واحد على شاشة الاستقبال، فيبقى الجدول في أول الشاشة */
.today-band { display: grid; gap: 12px; }
.today-band > .tl-card { margin: 0; }
.today-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; }
.today-kpis[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.today-kpis .kpi { display: flex; flex-direction: column; }
.today-kpis .kpi .s { margin-top: auto; padding-top: 2px; }
.kpi-cash { container-type: inline-size; }
.today-kpis .kpi.kpi-cash .v { font-size: clamp(18px, 15.5cqi, 24px); white-space: nowrap; }
/* بطاقة «للمتابعة» رابط لا فلتر: سطح أبيض مثل أخواتها، والرقم بلون المركز حين ينتظر شيء، وسهم يدلّ على الانتقال */
.kpi-inbox .k .ic { width: 16px; height: 16px; margin-inline-start: auto; color: var(--muted); transition: translate var(--t-fast) var(--ease), color var(--t-fast); }
[dir=ltr] .kpi-inbox .k .ic { scale: -1 1; }
.kpi-inbox:hover .k .ic { color: var(--brand); translate: -2px 0; }
[dir=ltr] .kpi-inbox:hover .k .ic { translate: 2px 0; }
.kpi-inbox.on .v { color: var(--brand); }
@media (min-width: 1280px) {
  .today-band { grid-template-columns: minmax(400px, 1fr) minmax(0, 1.5fr); align-items: stretch; }
  .today-band:has(> .tl-card[hidden]) { grid-template-columns: 1fr; }
  .today-band:has(> .tl-card[hidden]) .today-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .today-kpis[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-kpis { gap: 10px; }
  .today-kpis .kpi { padding: 10px 14px; }
  .today-kpis .kpi .v { font-size: 24px; margin-top: 2px; }
  .today-band .tl-card { padding: 12px 14px; display: flex; flex-direction: column; }
  .today-band .tl-scroll { flex: 1; display: flex; }
  .today-band .tl { flex: 1; }
  .today-band .tl-row:not(.tl-axis) { flex: 1; }
  .today-band .tl-card > .card-head { margin-bottom: 4px; }
  .today-band .tl { --name-w: 118px; min-width: 0; }
  .today-band .tl-row { min-height: 36px; }
  .today-band .tl-axis { min-height: 20px; }
  .today-band .tl-track { height: 24px; }
  .today-band .tl-axis .tl-track { height: 18px; }
  .today-band .tl-seg { line-height: 16px; }
  .today-band .tl-name b { font-size: 12.5px; }
  .today-band .tl-name small { font-size: 11.5px; }
}
@media (max-width: 560px) {
  .today-head .btn-row { width: 100%; display: grid; grid-template-columns: 1fr 1fr auto; }
  .today-head .hall-link .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .today-kpis, .today-kpis[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .today-kpis .kpi { padding: 12px 14px; }
  .today-kpis .kpi .v { font-size: 23px; }
  .today-kpis > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
button.kpi { display: block; width: 100%; text-align: start; font: inherit; color: inherit; cursor: pointer; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
button.kpi:hover { border-color: var(--brand-line); }
button.kpi:active { transform: scale(.985); }
button.kpi[aria-pressed=true] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--sh-1); }
.today-kpis .v, .today-kpis .s { display: block; }
.warn-t { color: var(--warn); font-weight: 800; }
.alert.strip { align-items: center; padding: 8px 10px; padding-inline-start: 14px; margin-top: 12px; }
.tl-card, .day-card { margin-top: 14px; }

/* الخط الزمني للأخصائيين */
.tl-legend .sw { width: 14px; height: 10px; border-radius: 3px; display: inline-block; --c: var(--ink-2); }
.tl-scroll { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; }
.tl { --name-w: 168px; position: relative; min-width: 720px; display: flex; flex-direction: column; padding-top: 4px; }
.tl-row { display: grid; grid-template-columns: var(--name-w) minmax(0, 1fr); align-items: center; min-height: 46px; border-top: 1px solid var(--line); }
.tl-axis { min-height: 26px; border-top: 0; }
.tl-name { display: flex; flex-direction: column; min-width: 0; padding-inline-end: 12px; line-height: 1.3; }
/* عمود الأسماء ثابت أثناء التمرير الأفقي على الجوال، والخط «الآن» يمرّ تحته */
.tl-name, .tl-axis > span:first-child { position: sticky; inset-inline-start: 0; z-index: 4; align-self: stretch; justify-content: center; background: var(--surface); }
/* شريط بلون السطح يسدّ أي فراغ بكسل عند حافة التمرير فلا تطلّ الشرائح من خلف الأسماء */
.tl-name::before, .tl-axis > span:first-child::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: -3px; width: 3px; background: var(--surface); }
.tl-name b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-name small { font-size: 12px; color: var(--muted); }
.tl-name small.busy { color: var(--here); font-weight: 700; }
.tl-track { position: relative; height: 30px; border-radius: 6px; background-color: var(--surface-2); background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: calc(100% / var(--hours, 13)) 100%; }
.tl-axis .tl-track { background: none; height: 22px; }
.tl-tick { position: absolute; top: 2px; translate: 50% 0; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
[dir=ltr] .tl-tick { translate: -50% 0; }
.tl-tick:first-child { translate: 0 0; }
.tl-closed { position: absolute; inset-block: 0; background: repeating-linear-gradient(135deg, transparent 0 5px, color-mix(in srgb, var(--ink) 7%, transparent) 5px 10px); pointer-events: none; }
.tl-seg, .tl-legend .sw { border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 15%, var(--surface)); }
.tl-seg { position: absolute; inset-block: 3px; min-width: 6px; padding: 0; border-radius: 5px; color: var(--ink); font: 700 11.5px/22px var(--font); text-align: start; overflow: hidden; cursor: pointer; container-type: inline-size; transition: box-shadow var(--t-fast) var(--ease), translate var(--t-fast) var(--ease); }
.tl-seg span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-seg .full { padding: 0 4px; }
.tl-seg .ini { display: none; text-align: center; }
/* الشريحة الضيقة تعرض الحرف الأول بدل اسم مقصوص؛ الاسم الكامل في التلميح وقارئ الشاشة */
@container (max-width: 44px) { .tl-seg .full { display: none; } .tl-seg .ini { display: block; } }
@container (max-width: 13px) { .tl-seg .ini { display: none; } }
.tl-seg:hover { box-shadow: var(--sh-1), 0 0 0 1px var(--c); z-index: 2; translate: 0 -1px; }
.tl-seg.s-arrived, .tl-legend .s-arrived { background: color-mix(in srgb, var(--c) 38%, var(--surface)); border-color: var(--c); }
.tl-seg.s-done, .tl-legend .s-done { background: color-mix(in srgb, var(--c) 78%, #000); border-color: transparent; color: #fff; }
.tl-seg.s-no_show, .tl-legend .s-no_show { background: repeating-linear-gradient(135deg, var(--surface) 0 4px, var(--line-2) 4px 6px); border-color: var(--line-2); color: var(--muted); text-decoration: line-through; }
.tl-now { position: absolute; top: 0; bottom: 0; inset-inline-start: calc(var(--name-w) + (100% - var(--name-w)) * var(--p, 0)); width: 2px; translate: 50% 0; background: var(--brand); border-radius: 2px; z-index: 3; pointer-events: none; transition: inset-inline-start .6s var(--ease); }
[dir=ltr] .tl-now { translate: -50% 0; }
.tl-now-pill { position: absolute; top: 0; left: 50%; translate: -50% 0; padding: 0 7px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font: 800 11px/20px var(--font); white-space: nowrap; }
/* الخط الزمني على الجوال: اسم الأخصائي فوق شريطه، والشريط بعرض الشاشة بلا تمرير جانبي */
@media (max-width: 560px) {
  .tl { --name-w: 0px; min-width: 0; }
  .tl-row { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-bottom: 8px; }
  .tl-axis { padding-bottom: 0; }
  .tl-axis > span:first-child { display: none; }
  .tl-name { position: static; flex-direction: row; align-items: baseline; gap: 8px; padding: 8px 0 5px; background: none; }
  .tl-name::before { content: none; }
  .tl-name b { font-size: 13.5px; }
  .tl-name small { font-size: 12px; }
  .tl-track { height: 28px; }
}

/* جدول مواعيد اليوم */
.day-card { padding: 0; overflow: hidden; }
.day-card > .card-head { padding: 14px 16px 12px; margin: 0; flex-wrap: wrap; gap: 10px; }
.count-pill { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 12.5px; font-weight: 800; vertical-align: 2px; margin-inline-start: 4px; }
.count-pill:empty { display: none; }
.day-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg .n { color: var(--muted); font-weight: 700; }
.seg .on .n { color: inherit; }
.seg .dot { width: 8px; height: 8px; }
.table-scroll { overflow-x: auto; }
.day-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.day-table th { padding: 9px 12px; background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); font-weight: 800; text-align: start; white-space: nowrap; border-top: 1px solid var(--line); }
.day-table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; text-align: start; }
.day-table tbody tr { transition: background var(--t-fast) var(--ease); }
.day-table tbody tr:not(.now-row, .break-row):hover { background: var(--surface-2); }
.c-time { width: 64px; white-space: nowrap; }
.c-time b { display: block; font-size: 15px; line-height: 1.25; }
.c-time small { color: var(--muted); font-size: 12px; }
.c-who { min-width: 180px; }
.c-who .who { font-weight: 800; color: var(--ink); }
.c-who .sub, .c-svc .sub, .c-st .sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.m-meta { display: none; }
.c-svc { color: var(--ink-2); white-space: nowrap; }
.svc { display: inline-flex; align-items: center; gap: 7px; }
.svc .dot, .m-meta .dot { width: 8px; height: 8px; }
.m-meta .dot { display: inline-block; margin-inline-end: 6px; vertical-align: 1px; }
.c-st { white-space: nowrap; }
.c-st .late { display: block; color: var(--warn); font-weight: 800; font-size: 12px; margin-top: 3px; }
.c-act { width: 1%; }
.c-act .acts { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: nowrap; }
@media (max-width: 1240px) and (min-width: 761px) {
  .day-table .c-svc, .day-table .c-spec, .day-table .c-dept { display: none; }
  .m-meta { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
}
.day-table tr.is-off td:not(.c-act) { opacity: .62; }
.day-table tr.st-done .c-time b { color: var(--muted); }
.now-row td { padding: 4px 12px; border-top: 0; }
.now-row + tr td { border-top: 0; }
.now-line { display: flex; align-items: center; gap: 8px; }
.now-line::after { content: ''; flex: 1; height: 2px; border-radius: 2px; background: var(--brand); }
.now-pill { padding: 0 9px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font: 800 12px/22px var(--font); white-space: nowrap; }
.break-row td { padding: 8px 12px; text-align: center; color: var(--ink-2); font-size: 13px; background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); }
.break-row .ic { width: 15px; height: 15px; vertical-align: -3px; margin-inline-end: 6px; color: var(--muted); }
.meter { display: inline-flex; gap: 2px; vertical-align: middle; }
.meter i { width: 7px; height: 14px; border-radius: 2px; background: var(--line-2); }
.meter i.on { background: var(--c, var(--brand)); }
@media (max-width: 760px) {
  .day-table thead { display: none; }
  .day-table, .day-table tbody { display: block; }
  .day-table tr { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; grid-template-areas: "time who st" "act act act"; gap: 6px 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
  .day-table td { padding: 0; border: 0; }
  .c-time { grid-area: time; } .c-who { grid-area: who; min-width: 0; } .c-st { grid-area: st; text-align: end; } .c-act { grid-area: act; }
  .day-table .c-svc, .day-table .c-spec, .day-table .c-dept { display: none; }
  .m-meta { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
  .c-act .acts { justify-content: flex-start; padding-inline-start: 60px; }
  .day-table tr.now-row, .day-table tr.break-row { display: block; padding: 6px 14px; }
  .day-table tr.now-row td, .day-table tr.break-row td { display: block; padding: 0; }
  .day-table tr.break-row { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); }
  .day-table tr.break-row td { background: none; }
  .tl { --name-w: 120px; }
}
@media (max-width: 420px) { .c-act .acts { padding-inline-start: 0; } }

/* ── التقويم: أعمدة الأخصائيين أو الأجهزة ── */
/* شريط التحكم: التاريخ في زر واحد يفتح منتقي التاريخ، وكل الأدوات في سطر واحد على شاشة الاستقبال */
.cal-nav { display: inline-flex; align-items: center; gap: 6px; }
.cal-pick { position: relative; display: inline-flex; }
.cal-pick input[type=date] { position: absolute; inset: 0; opacity: 0; pointer-events: none; width: 100%; min-height: 0; padding: 0; border: 0; }
.cal-title { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--r); background: none; color: var(--ink); font: 800 16px/1.2 var(--font); cursor: pointer; white-space: nowrap; transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.cal-title:hover { background: var(--surface); border-color: var(--line); }
.cal-title svg { width: 17px; height: 17px; color: var(--muted); }
.cal-nav #today.on { color: var(--brand); border-color: var(--brand-line); background: var(--brand-soft); }
.cal-bar { margin-bottom: 12px; gap: 6px; }
.cal-bar .cal-nav { gap: 4px; }
.cal-bar .cal-title { padding: 0 8px; font-size: 15.5px; }
.cal-bar .seg button { padding: 0 10px; }
.cal-bar select { max-width: 170px; }
.cal-legend { margin-top: 10px; }
.cal-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); max-height: calc(100dvh - 210px); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
/* التقويم يملأ ارتفاع الشاشة بتمرير واحد داخله، بدل تمرير الصفحة والتقويم معًا */
@media (min-width: 761px) {
  .cal-page { display: flex; flex-direction: column; height: calc(100dvh - 131px); min-height: 460px; }
  .cal-page .cal-wrap { flex: 1; min-height: 0; max-height: none; }
}
@media (min-width: 761px) and (max-width: 960px) { .cal-page { height: calc(100dvh - 166px - env(safe-area-inset-bottom)); } }
.cal-head.is-today { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.cal-col .slot-hit:hover::after { content: '+ ' attr(data-t); position: absolute; inset-inline-start: 6px; top: 50%; translate: 0 -50%; font: 700 11px/1 var(--font); color: var(--brand); font-variant-numeric: tabular-nums; }
.cal-col.is-week .appt { padding-inline: 6px; }
.cal { display: grid; position: relative; min-width: max-content; }
.cal-head { position: sticky; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 8px; font-weight: 800; font-size: 13px; text-align: center; min-height: 48px; display: flex; flex-direction: column; justify-content: center; }
.cal-head small { font-weight: 600; color: var(--muted); font-size: 11.5px; }
.cal-corner { position: sticky; inset-inline-start: 0; top: 0; z-index: 8; background: var(--surface); border-bottom: 1px solid var(--line); border-inline-end: 1px solid var(--line); }
.cal-times { position: sticky; inset-inline-start: 0; z-index: 5; background: var(--surface); border-inline-end: 1px solid var(--line); }
.cal-times div { height: var(--slot); font-size: 11.5px; color: var(--muted); padding-inline: 8px; text-align: end; transform: translateY(-8px); font-variant-numeric: tabular-nums; }
.cal-times div:first-child { transform: none; }
.cal-col { position: relative; border-inline-end: 1px solid var(--line); min-width: 170px; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--slot) - 1px), var(--line) calc(var(--slot) - 1px), var(--line) var(--slot)); }
/* أسبوع كامل يتسع لشاشة الاستقبال (1366) بلا تمرير جانبي: عمود اليوم يكفيه 116px */
.cal-col.is-week { min-width: 116px; }
.cal-col .closed { position: absolute; inset-inline: 0; background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--line) 6px 12px); opacity: .85; pointer-events: none; }
.cal-col .slot-hit { position: absolute; inset-inline: 0; height: var(--slot); cursor: pointer; }
.cal-col .slot-hit:hover { background: var(--brand-soft); }
.cal-col .now { position: absolute; inset-inline: 0; height: 2px; margin-top: -1px; background: var(--brand); z-index: 3; pointer-events: none; }
.cal-times { position: sticky; }
.cal-now-pill { position: absolute; inset-inline: 4px; translate: 0 -50%; z-index: 4; padding: 0 4px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font: 800 11px/18px var(--font); text-align: center; }
.appt { position: absolute; inset-inline: 4px; z-index: 2; border-radius: 8px; padding: 4px 8px; font-size: 12px; line-height: 1.35; overflow: hidden; cursor: pointer; background: color-mix(in srgb, var(--c) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 38%, transparent); color: var(--ink); text-align: start; font-family: var(--font); transition: box-shadow var(--t-fast) var(--ease), translate var(--t-fast) var(--ease); }
.appt:hover { box-shadow: var(--sh-1), 0 0 0 1px var(--c); z-index: 4; translate: 0 -1px; }
.appt b::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c); margin-inline-end: 6px; vertical-align: 1px; }
.appt b { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt span { display: block; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt b span { display: inline; color: inherit; }
.appt.s-cancelled, .appt.s-no_show { opacity: .55; text-decoration: line-through; }
.appt.s-done { background: color-mix(in srgb, var(--c) 5%, var(--surface)); border-color: var(--line-2); }
.appt.s-done b { color: var(--ink-2); }
.appt.s-arrived { outline: 2px solid var(--here); outline-offset: -2px; }
.appt .st-dot { position: absolute; top: 6px; inset-inline-end: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--st); }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--st); display: inline-block; }

/* اقتراح الأوقات المتاحة */
.slots { display: flex; flex-wrap: wrap; gap: 6px; }
.slots button { min-height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); font: 700 13px var(--font); cursor: pointer; font-variant-numeric: tabular-nums; }
.slots button:hover, .slots button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* ── قائمة المراجعين ── */
.pt-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pt-ini { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 800 14px/1 var(--font); color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--surface)); }
.pt-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.pt-txt > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-txt > small, .pt-spec { font-size: 12.5px; color: var(--muted); }
.pt-spec { display: block; margin-top: 2px; padding-inline-start: 14px; }
.pt-when { font-weight: 700; color: var(--ink); }
.pt-badges { text-align: end; white-space: nowrap; }
.pt-badges .badge + .badge { margin-inline-start: 4px; }
.pt-meta { margin-top: 3px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.pt-next { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 2px 9px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 12.5px; font-weight: 700; width: fit-content; }
.pt-next svg { width: 14px; height: 14px; }
@media (max-width: 640px) {
  .pt-table td[data-m=title] { font-size: 15px; }
  .pt-table .pt-cell { align-items: flex-start; }
  .pt-table .pt-ini { width: 40px; height: 40px; font-size: 16px; }
  .pt-txt > b { white-space: normal; }
}

.inv-sub { margin-top: 2px; font-size: 12.5px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62vw; }
.inv-total { font-weight: 800; }
td[data-m=end] > .m-only { margin-top: 4px; }
@media (max-width: 640px) {
  .pt-head { gap: 12px; }
  .pt-head .pt-avatar { width: 52px; height: 52px; font-size: 20px; border-radius: 14px; }
  .pt-head .grow { min-width: 0; flex-basis: calc(100% - 64px); }
  .pt-head h2 { font-size: 20px; }
  .pt-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
  .pt-actions .btn { min-height: 46px; padding: 0 8px; justify-content: center; font-size: 13.5px; }
  .pt-actions .btn.ghost { background: var(--surface-2); border-color: var(--line); }
}
@media (hover: none) { .tabs { scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; } }
/* شريط التاريخ خارج التقويم (الصالة) يملأ عرض الجوال: السهمان على الطرفين والتاريخ بينهما */
@media (max-width: 760px) {
  .cal-bar .cal-nav { width: 100%; }
  .cal-bar .cal-pick { flex: 1; min-width: 0; justify-content: center; }
}
/* الصالة على الجوال: المراجع وتمارينه بعرض البطاقة، وأزرار الحالة صف كامل تحته */
@media (max-width: 640px) {
  .hs-head { gap: 6px 10px; padding: 10px 12px; }
  .hs-head .grow { flex: 1 1 0; min-width: 0; }
  .hs-head .btn.sm { margin-inline-start: auto; }
  .hall-session .list .row { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .hall-session .list .row > .grow { flex-basis: 100%; }
  .hall-session .list .row > .acts { flex-basis: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
  .hall-session .list .row > .acts:empty { display: none; }
  .hall-session .list .row > .acts .btn { min-height: 42px; justify-content: center; }
}
/* الفترات والمؤشرات على الجوال: الفترات صف واحد يُسحب جانبيًا، والمؤشرات عمودان والأخير الفردي بعرض كامل */
@media (max-width: 640px) {
  .rep-bar .seg { order: -1; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .rep-bar .seg::-webkit-scrollbar { display: none; }
  .rep-bar .seg button { flex: none; }
  .rep-bar input[type=date] { flex: 1 1 0; min-width: 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpis > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* زر الحفظ في الإعدادات يبقى ظاهرًا فوق الشريط السفلي أثناء التمرير في النموذج الطويل */
@media (max-width: 960px) {
  .save-bar { position: sticky; z-index: 6; bottom: calc(64px + env(safe-area-inset-bottom)); margin-inline: -4px; padding: 12px 4px; background: linear-gradient(to bottom, transparent, var(--bg) 35%); }
}
@media (max-width: 640px) { .save-bar .btn { flex: 1; min-height: 48px; justify-content: center; } }
/* الوارد على الجوال: كل طلب أو رسالة كتلة، وأزرارها بعرضها تحتها */
@media (max-width: 640px) {
  .inbox-list > .row { flex-wrap: wrap; gap: 12px; padding: 14px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
  .inbox-list > .row:last-child { border-bottom: 1px solid var(--line); }
  .inbox-list > .row > .grow { flex-basis: 100%; line-height: 1.6; }
  .inbox-list > .row > .btn-row { flex-basis: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
  .inbox-list > .row > .btn-row .btn { min-height: 44px; justify-content: center; }
  .tabs a { padding-inline: 10px; }
}
/* على الجوال عنوان الشاشة في الشريط العلوي؛ رأس الصفحة لا يكرره ويختفي إن لم يبق فيه شيء */
@media (max-width: 640px) {
  .page-head:not(.today-head) h2 { display: none; }
  .page-head:not(.today-head):not(:has(p:not(.m-hide))):not(:has(.btn:not(.fab))) { margin: 0; }
  .card .table-wrap { border: 0; border-radius: 0; margin-inline: -14px; background: none; }
  .card > .table-wrap:first-child { margin-top: -14px; }
  .card > .table-wrap:last-child { margin-bottom: -14px; }
  .page-head { margin-bottom: 12px; }
}

/* ── الجوال: زر الإضافة عائم فوق الشريط السفلي، والأدوات مضغوطة ── */
@media (max-width: 760px) {
  .btn.fab { position: fixed; z-index: 25; inset-inline-end: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); min-height: 52px; padding: 0 20px 0 18px; border-radius: 99px; box-shadow: var(--sh-2); font-size: 15px; }
  #view:has(.btn.fab) { padding-bottom: 150px; }
  .toolbar { gap: 8px; }
  .toolbar input[type=search] { flex: 1 1 100%; max-width: none; }
  .toolbar > select, .toolbar > .field { flex: 1 1 0; min-width: 0; }
  .toolbar > .field:has(select) { flex-basis: 100%; }
  .toolbar > .grow:last-child, .toolbar > .grow:has(+ .fab:last-child) { display: none; }
  .pt-toolbar #count { flex-basis: 100%; }
  .pt-toolbar #count:empty { display: none; }
}

/* ── المواعيد على الجوال: شريط الأيام وقائمة اليوم ── */
.ag-head { position: sticky; top: 56px; z-index: 12; margin: -14px -12px 10px; padding: 10px 12px 8px; background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.ag-head .cal-nav { width: 100%; gap: 4px; }
.ag-head .cal-pick { flex: 1; min-width: 0; justify-content: center; }
.ag-head .cal-title { font-size: 16px; padding: 0 6px; max-width: 100%; overflow: hidden; }
.ag-head .cal-title span { overflow: hidden; text-overflow: ellipsis; }
.ag-head .btn.icon { min-width: 40px; }
.ds { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.ds-day { display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 56px; padding: 6px 0 5px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font-family: var(--font); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.ds-day small { font-size: 12px; font-weight: 700; color: var(--muted); }
.ds-day b { font-size: 17px; font-weight: 800; line-height: 1.2; }
.ds-day .ds-dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.ds-day .ds-dot.on { background: var(--brand); }
.ds-day.is-today b { color: var(--brand); }
.ds-day.off { color: var(--muted); }
.ds-day.off b { font-weight: 700; }
.ds-day.on { background: var(--brand); color: var(--brand-ink); box-shadow: var(--sh-1); }
.ds-day.on small, .ds-day.on b { color: inherit; }
.ds-day.on .ds-dot.on { background: var(--brand-ink); }
.ds-day:active { background: var(--brand-soft); }
.ag-specs { display: flex; gap: 6px; margin: 8px -12px 0; padding: 0 12px 2px; overflow-x: auto; scrollbar-width: none; }
.ag-specs::-webkit-scrollbar { display: none; }
.chip-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink-2); font: 700 13.5px/1 var(--font); cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.chip-btn span { font-size: 12px; color: var(--muted); }
.chip-btn.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.chip-btn.on span { color: var(--brand); }
.ag-list { display: flex; flex-direction: column; gap: 8px; }
.ag-item { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-family: var(--font); text-align: start; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.ag-item:active { background: var(--surface-2); }
.ag-time { display: flex; flex-direction: column; line-height: 1.25; }
.ag-time b { font-size: 15px; font-weight: 800; }
.ag-time small { font-size: 12px; color: var(--muted); }
.ag-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.35; }
.ag-body b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-body b .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; margin-inline-end: 7px; vertical-align: 2px; }
.ag-body small { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-item > svg { width: 18px; height: 18px; color: var(--muted); }
.ag-item.s-done { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.ag-item.s-done .ag-body b, .ag-item.s-done .ag-time b { color: var(--ink-2); }
.ag-item.s-cancelled, .ag-item.s-no_show { opacity: .62; }
.ag-item.s-cancelled .ag-body b { text-decoration: line-through; }
.ag-item.s-arrived { border-color: var(--here); box-shadow: inset 0 0 0 1px var(--here); }
.ag-hall { background: color-mix(in srgb, var(--c) 7%, var(--surface)); border-style: dashed; border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.ag-free { min-height: 56px; background: transparent; border-style: dashed; border-color: var(--line-2); color: var(--ink-2); }
.ag-free .ag-body b { font-weight: 700; color: var(--ink-2); }
.ag-book { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 12px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 800; }
.ag-book svg { width: 15px; height: 15px; }
.ag-now { display: flex; align-items: center; gap: 8px; margin: 2px 0; color: var(--brand); }
.ag-now::after { content: ''; flex: 1; height: 2px; border-radius: 2px; background: var(--brand); }
.ag-now span { padding: 2px 10px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: 12px; font-weight: 800; }
.ag-note { margin: 0 0 4px; padding: 8px 12px; border-radius: var(--r); background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 700; }

/* ── ملف المراجع ── */
.pt-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.pt-avatar { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff; background: var(--c, var(--brand)); flex: none; }
.pt-head .grow { flex: 1; min-width: 220px; }
.pt-head h2 { margin: 0; }
.pt-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); font-size: 13.5px; margin-top: 4px; }
.pt-facts span { display: inline-flex; gap: 4px; align-items: center; }
.pt-facts b { color: var(--muted); font-weight: 700; }
.pt-alerts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.visit { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--surface); }
.visit-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.soap { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; font-size: 14px; }
.soap div b { display: block; font-size: 12px; color: var(--muted); }
.soap div p { margin: 0; white-space: pre-line; }
.pain-scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.pain-scale label { position: relative; }
.pain-scale input { position: absolute; opacity: 0; }
.pain-scale span { display: grid; place-items: center; height: 40px; border-radius: 8px; border: 1px solid var(--line-2); font-weight: 800; cursor: pointer; background: var(--surface); }
.pain-scale input:checked + span { background: var(--pc); color: #fff; border-color: var(--pc); }
.pain-scale input:focus-visible + span { outline: 3px solid var(--brand-line); }
.rom-row, .ex-row, .item-row, .pay-row { display: grid; gap: 8px; align-items: end; }
.rom-row { grid-template-columns: 1.3fr 1.2fr .8fr .8fr auto; }
.ex-row { grid-template-columns: 2fr repeat(4, .7fr) 1.4fr auto; }
.item-row { grid-template-columns: 2.2fr .6fr 1fr 1fr 1fr auto; }
.pay-row { grid-template-columns: 1.2fr 1fr 1.6fr auto; }
.rows { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 760px) {
  .rom-row, .ex-row, .item-row, .pay-row { grid-template-columns: 1fr 1fr; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
  .rom-row > :first-child, .ex-row > :first-child, .item-row > :first-child { grid-column: 1 / -1; }
}
.totals { margin-inline-start: auto; width: min(360px, 100%); display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; gap: 10px; }
.totals .grand { font-size: 17px; font-weight: 800; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
.thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); flex: none; }
.attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.attach { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: flex; gap: 10px; align-items: center; background: var(--surface); min-width: 0; }
.consent-body { white-space: pre-line; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: 14px; max-height: 260px; overflow: auto; }

/* ── صالة التأهيل ── */
.toolbar-title { font-size: 16px; margin: 0; }
.hall-windows { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 2px 0 14px; }
.hall-windows .chip b { font-weight: 700; margin-inline-start: 2px; color: var(--ink); }
.hall-sessions { display: grid; gap: 12px; }
.hall-session { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; box-shadow: var(--sh-1); }
.hs-head::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--brand)); flex: none; }
.hs-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.hs-head .time { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 52px; line-height: 1.15; }
.hs-head .time small { display: block; color: var(--muted); font-weight: 600; }
.hs-meter { display: flex; gap: 3px; }
.hs-meter i { width: 10px; height: 18px; border-radius: 3px; background: var(--line); }
.hs-meter i.on { background: var(--c, var(--brand)); }
.hs-count { font-variant-numeric: tabular-nums; }
.hall-session .list .row { padding-inline: 14px; }
.hall-session .row.is-off { opacity: .55; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); font-weight: 700; cursor: pointer; text-align: start; }
.linkish:hover { color: var(--brand); text-decoration: underline; }
.ex-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ex-chip { font-size: 12.5px; padding: 3px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--ink); border: 1px solid var(--brand-line); }
.ex-chip b { color: var(--brand); font-weight: 700; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 8px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; background: var(--surface); }
.choice:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.choice small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.cal .appt.hall-block { background: color-mix(in srgb, var(--c) 10%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--c) 60%, transparent); }

/* ── لوحة المالك ── */
.band { padding: 0; overflow: hidden; }
.band > .card-head { padding: 14px 16px 12px; margin: 0; }
.band-cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.cell { background: var(--surface); padding: 14px 16px; min-width: 0; }
.cell .k { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 700; }
.cell .k .dot { width: 8px; height: 8px; }
.cell .v { display: block; font-size: 26px; font-weight: 800; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.cell.lead .v { font-size: 30px; }
.cell .s { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel-wrap { padding: 12px 16px 14px; }
.funnel { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.funnel i { display: block; height: 100%; width: 0; background: var(--st); transition: width .7s var(--ease); }
.funnel i:not(.z) ~ i:not(.z) { border-inline-start: 2px solid var(--surface); }
.funnel-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 9px; font-size: 12.5px; color: var(--ink-2); }
.funnel-legend span { display: inline-flex; align-items: center; gap: 6px; }
.funnel-legend .dot { width: 8px; height: 8px; }
.ledger { margin-top: 14px; }
.ledger-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 0 32px; }
.ledger dl { margin: 0; }
.row-l { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.row-l:first-child { border-top: 0; }
.row-l dt { color: var(--ink-2); font-weight: 700; font-size: 14px; }
.row-l dd { margin: 0; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.row-l.net dt { color: var(--ink); }
.row-l.net dd { font-size: 22px; }
.row-l dd.good { color: var(--ok); } .row-l dd.bad { color: var(--bad); }
.ratio-row { flex-direction: column; align-items: stretch; gap: 4px; border-top: 0; padding-top: 0; }
.ratio-row small { color: var(--muted); font-size: 12px; }
.ratio { height: 6px; border-radius: 99px; background: var(--ok-soft); overflow: hidden; }
.ratio i { display: block; height: 100%; background: color-mix(in srgb, var(--bad) 70%, var(--surface)); border-radius: 99px; }
.grid.two.dash-grid { margin-top: 14px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .grid.two.dash-grid { grid-template-columns: minmax(0, 1fr); } }
/* لوحة المالك الحيّة: خط الأخصائيين بنفس «الآن»، ومن في المركز الآن */
.page-head .now-pill { display: inline-block; margin-inline-start: 6px; vertical-align: 1px; }
.dash-live > .card { margin: 0; }
.dash-live .tl { --name-w: 132px; min-width: 560px; }
/* على الجوال يلتزم بقاعدة الخط الزمني العامة: الاسم فوق الشريط وبلا تمرير جانبي */
@media (max-width: 560px) { .dash-live .tl { --name-w: 0px; min-width: 0; } }
.here-list { list-style: none; margin: 0; padding: 0; }
.here-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.here-list li:first-child { border-top: 0; padding-top: 2px; }
.here-list .dot { width: 8px; height: 8px; }
.here-list b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.here-list small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.here-list .when { color: var(--ink-2); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.here-hall { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); font-size: 13px; }
.here-hall .grow { flex: 1; min-width: 0; }
.here-hall small { display: block; color: var(--muted); font-size: 12px; }
.here-next { margin: 10px 0 0; font-size: 13px; color: var(--ink-2); }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 90px; }
.bar-cell > b { min-width: 22px; }
.bar-cell > i { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: block; }
.bar-cell > i > b { display: block; height: 100%; border-radius: 99px; transition: width .7s var(--ease); }
.alerts-list .row { align-items: center; }
@media (max-width: 760px) {
  .ledger-grid { grid-template-columns: minmax(0, 1fr); }
  .ledger-grid dl + dl { border-top: 1px solid var(--line); }
  .band-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell.lead { grid-column: 1 / -1; }
  .cell .v { font-size: 22px; } .cell.lead .v { font-size: 26px; }
}
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px 24px; }
.checklist a, .checklist div { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.checklist .done { color: var(--ok); }
.checklist .todo { color: var(--warn); }
.hours-grid { display: grid; grid-template-columns: 110px repeat(2, minmax(0, 1fr)) repeat(2, minmax(0, 1fr)); gap: 6px 8px; align-items: center; }
.hours-grid .h { font-size: 12px; color: var(--muted); font-weight: 700; }
.hours-grid input { min-height: 38px; padding: 4px 8px; }
@media (max-width: 560px) { .hours-grid { grid-template-columns: 80px repeat(4, minmax(0, 1fr)); font-size: 12px; } }
.logo-prev { width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.code-box { font-family: ui-monospace, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; word-break: break-all; direction: ltr; text-align: left; }

/* ── الطباعة ── */
#print { font-family: var(--font); color: #000; }
.doc { max-width: 190mm; margin: 0 auto; font-size: 12.5px; line-height: 1.55; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid var(--brand); padding-bottom: 10px; margin-bottom: 14px; }
.doc-head img { width: 70px; height: 70px; object-fit: contain; }
.doc-head h1 { font-size: 18px; margin: 0; }
.doc-head .sub { color: #444; font-size: 12px; }
.doc h2 { font-size: 15px; margin: 14px 0 6px; color: var(--brand); }
.doc table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.doc th, .doc td { border: 1px solid #c9d1db; padding: 6px 8px; text-align: start; vertical-align: top; }
.doc th { background: #f1f4f8; font-weight: 800; }
.doc .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.doc .sig { margin-top: 30px; display: flex; justify-content: space-between; gap: 30px; }
.doc .sig div { flex: 1; border-top: 1px solid #000; padding-top: 4px; text-align: center; }
.doc .foot { margin-top: 18px; padding-top: 8px; border-top: 1px solid #c9d1db; font-size: 11px; color: #444; }
.doc .chart text { fill: #444; }
.receipt80 { width: 72mm; margin: 0 auto; font-size: 12px; }
.receipt80 table { width: 100%; border-collapse: collapse; }
.receipt80 td { padding: 2px 0; }
.receipt80 hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }

/* عناوين أقسام لوحة المالك */
.sec-title { font-size: 13.5px; color: var(--muted); font-weight: 800; margin: 18px 0 8px; letter-spacing: 0; }
.sec-title:first-of-type { margin-top: 4px; }

/* ── الأدوار والصلاحيات ── */
.lv-normal { --lvc: var(--ok); } .lv-caution { --lvc: var(--warn); } .lv-sensitive { --lvc: var(--bad); }
.lv { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 1px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 800; line-height: 20px; white-space: nowrap; color: var(--lvc); background: color-mix(in srgb, var(--lvc) 11%, var(--surface)); }
.lv::before, .lv-dot { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--lvc); flex: none; display: inline-block; }
.lv-dot { width: 7px; height: 7px; }
.lv-strip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.lv-n { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.lv-n::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--lvc); }
.lv-n b { color: var(--ink); font-weight: 800; }

.pm-title { margin: 20px 0 8px; font-size: 15px; }
.pm-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }
.pm-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.pm { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px; align-items: start; }
.pm-group { margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.pm-group > legend { float: left; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 13.5px; }
.pm-group > legend + * { clear: both; }
.pm-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; min-height: 50px; padding: 9px 14px; border-top: 1px solid var(--line); cursor: pointer; transition: background var(--t-fast) var(--ease); }
.pm-group > legend + .pm-row { border-top: 0; }
.pm-row:hover { background: var(--surface-2); }
.pm-row > input { grid-row: 1 / span 2; width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.pm-row > .pm-txt { grid-column: 2; grid-row: 1; }
.pm-row > .lv { grid-column: 3; grid-row: 1 / span 2; }
.pm-row > .pm-mark { grid-column: 2; grid-row: 2; font-size: 11.5px; font-weight: 800; }
.pm-mark:empty { display: none; }
.pm-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pm-txt b { font-size: 14px; font-weight: 700; line-height: 1.5; }
.pm-txt small { font-size: 12px; line-height: 1.5; color: var(--muted); }
.pm-row.is-add { background: var(--info-soft); } .pm-row.is-add .pm-mark { color: var(--info); }
.pm-row.is-remove { background: color-mix(in srgb, var(--bad-soft) 55%, var(--surface)); } .pm-row.is-remove .pm-mark { color: var(--bad); }
.pm-sum { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.modal-foot .grow { flex: 1; }
.btn.ghost.danger { color: var(--bad); } .btn.ghost.danger:hover { background: var(--bad-soft); color: var(--bad); }

.st-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.st-who > span:last-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.st-who small { font-size: 12px; }
.st-ini { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 800 14px/1 var(--font); color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--surface)); }
.st-ini.sm { width: 26px; height: 26px; font-size: 12px; }
.role-chip { display: inline-flex; align-items: center; padding: 1px 10px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface-2); color: var(--ink); font-size: 12.5px; font-weight: 800; line-height: 22px; white-space: nowrap; }
.role-chip.is-owner { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.staff-t .btn-row { justify-content: flex-end; }

.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 14px; }
.role-card { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 1px 2px rgba(15, 27, 45, .04); }
.role-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.role-card h3 { margin: 0 0 5px; font-size: 16px; }
.role-card header > svg { width: 22px; height: 22px; color: var(--brand); flex: none; }
.role-card .chip.sm { font-size: 12px; } .role-card .chip.muted { color: var(--muted); }
.role-count { font-size: 24px; font-weight: 800; line-height: 1; color: var(--ink); white-space: nowrap; }
.role-count small { font-size: 13px; font-weight: 700; color: var(--muted); }
.role-meta { display: flex; align-items: center; gap: 10px; min-height: 26px; color: var(--ink-2); }
.role-perms { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.role-perms li { display: flex; align-items: center; gap: 8px; line-height: 1.45; }
.role-perms.inline { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.role-card footer { margin-top: auto; padding-top: 2px; }
.role-card.is-owner { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); border-color: var(--brand-line); }
.role-new { align-items: center; justify-content: center; min-height: 210px; border-style: dashed; border-color: var(--line-2); background: transparent; box-shadow: none; color: var(--ink); font: inherit; text-align: center; cursor: pointer; gap: 6px; transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.role-new > svg { width: 26px; height: 26px; color: var(--brand); }
.role-new:hover { background: var(--brand-soft); border-color: var(--brand-line); }
.faces { display: inline-flex; align-items: center; padding-inline-end: 6px; }
.faces .st-ini { margin-inline-end: -6px; box-shadow: 0 0 0 2px var(--surface); }
.faces > .small { margin-inline-start: 12px; }

.kind-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px; margin: 16px 0 4px; padding: 0; border: 0; }
.kind-pick > legend { padding: 0; margin-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.kind-opt { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer; transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.kind-opt input { margin: 3px 0 0; accent-color: var(--brand); }
.kind-opt span { display: flex; flex-direction: column; gap: 2px; }
.kind-opt small { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.kind-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.up-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.role-help { margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.role-help:empty { display: none; }
.role-help p { margin: 8px 0 0; }
@media (max-width: 640px) {
  .modal-foot .pm-sum { flex-basis: 100%; }
  .modal-foot .grow { display: none; }
  .pm-row { padding: 10px 12px; }
}

/* ── التقارير والتصدير ── */
.rep-export { display: flex; align-items: center; gap: 10px; }
.xp-pair { display: inline-flex; gap: 6px; flex: none; }
.xp svg { width: 17px; height: 17px; }
.xp-x svg { color: #1d6f42; } .xp-p svg { color: #b42318; }
.btn.soft.xp { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn.soft.xp:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--brand) 30%, var(--line-2)); }
.rep-hero { margin-bottom: 14px; }
.rep-hero-in { display: grid; grid-template-columns: minmax(260px, 330px) minmax(0, 1fr); }
.rep-money { margin: 0; padding: 14px 20px; display: flex; flex-direction: column; justify-content: center; border-inline-end: 1px solid var(--line); }
.rep-money .row-l dd { font-size: 19px; }
.rep-money .row-l.net { padding-top: 12px; }
.rep-money .row-l.net dd { font-size: 28px; }
.rep-trend { min-width: 0; padding: 14px 18px 8px; }
.rep-trend .card-head { margin-bottom: 2px; }
.rep-chart { display: block; width: 100%; height: auto; max-height: 210px; }
.rep-chart .g { stroke: var(--line); stroke-width: 1; }
.rep-chart .ax { font: 600 10.5px var(--font); fill: var(--muted); }
.rep-chart .b { fill: color-mix(in srgb, var(--brand) 42%, var(--surface)); transition: fill var(--t-fast) var(--ease); }
.rep-chart .b:hover, .rep-chart .pk { fill: var(--brand); }
.cell.bad .v { color: var(--bad); }
.rep-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.rep-grid .rep-wide { grid-column: 1 / -1; }
.rep-grid th.end, .rep-grid td.end { text-align: end; }
.dotc { display: inline-block; width: 9px; height: 9px; margin-inline-end: 8px; border-radius: 50%; background: var(--c); vertical-align: 1px; }
.rep-files { margin-top: 14px; }
.rep-files .card-head p { margin: 2px 0 0; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 8px; }
.file-row { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 8px 6px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.file-row .grow { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; }
.file-row .f-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); color: var(--muted); flex: none; }
.file-row .f-ic svg { width: 17px; height: 17px; }
@media (max-width: 1000px) {
  .rep-hero-in { grid-template-columns: minmax(0, 1fr); }
  .rep-money { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .rep-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .rep-export { width: 100%; }
  .rep-export .xp-pair, .rep-export .xp { flex: 1; }
  .rep-money { padding: 12px 16px; }
  .rep-trend { padding: 12px 12px 6px; }
}

/* ── الأوقات المتاحة في نموذج الموعد ── */
.slot-panel { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.sp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; }
.sp-head b { font-size: 14px; }
.sp-win { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.chip-win { padding: 2px 10px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); font-weight: 800; font-variant-numeric: tabular-nums; }
.sp-group { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px; align-items: start; }
.sp-group + .sp-group { margin-top: 8px; }
.sp-label { padding-top: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.slots button small { margin-inline-start: 4px; font-size: 10.5px; font-weight: 700; opacity: .7; }
.sp-none { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
@media (max-width: 640px) {
  .sp-group { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .sp-label { padding-top: 0; }
  .slots button { min-height: 40px; min-width: 62px; }
}

/* ── نموذج المراجع: الأساسيات أولًا، الجنسيات بنقرة، والباقي مطويّ ── */
.pt-form .pf-seg label { min-height: 40px; padding: 0 14px; font-size: 13.5px; }
.pt-form .pf-seg { align-self: flex-start; max-width: 100%; }
.pt-form .nat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.pt-form .nat-other-wrap { flex: 1 1 200px; max-width: 280px; display: flex; align-items: center; gap: 8px; }
.pt-form .nat-other-wrap .nat-other { flex: 1; min-width: 0; min-height: 40px; }
.pt-form .nat-oflag:empty { display: none; }
.nat-v { display: inline-flex; align-items: center; gap: 6px; }
.pt-form .dup-hint:not(:empty) { color: var(--warn); font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.pt-form .dup-hint a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.pt-form #ageHint:empty { display: none; }
.pt-form .pf-add { margin-top: 12px; }
.pt-form #guardian.needed { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.pf-more { border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 14px; background: var(--surface); }
.pf-more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; font-weight: 800; font-size: 14px; border-radius: var(--r); }
.pf-more > summary::-webkit-details-marker { display: none; }
.pf-more > summary > span { flex: none; }
.pf-more > summary small { flex: 1 1 auto; min-width: 0; color: var(--muted); font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-more > summary::after { content: ''; flex: none; width: 8px; height: 8px; margin-inline-start: auto; border: solid var(--muted); border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); transition: transform .2s ease; }
.pf-more[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.pf-more[open] > summary small { visibility: hidden; }
.pf-more > summary:hover { background: var(--surface-2); }
.pf-more > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pf-more-body { padding: 0 14px 14px; }
.pf-more-body > .pf-first { padding: 4px 0 14px; }
.pf-more-body > fieldset { border-width: 1px 0 0; border-radius: 0; padding: 10px 0 14px; margin: 0; }
.pf-more-body > fieldset > legend { padding: 0; padding-inline-end: 8px; }
@media (prefers-reduced-motion: reduce) { .pf-more > summary::after { transition: none; } }
.pt-form .pf-name { grid-column: span 2; }
@media (max-width: 420px) { .pt-form .pf-name { grid-column: auto; } }
@media (max-width: 640px) {
  .pt-form .pf-seg { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .pt-form .pf-seg.pf-gender { grid-template-columns: 1fr 1fr; }
  .pt-form .pf-seg label { justify-content: center; min-height: 44px; padding: 0 6px; }
  .pt-form .nat-other-wrap { flex-basis: 100%; max-width: none; }
}

/* ── تقويم الكمبيوتر: استراحة مطويّة، صفوف تتكيّف مع الشاشة، ويوم مغلق برسالة ── */
.cal-times .cal-fold-t { transform: none; display: flex; align-items: center; justify-content: flex-end; font-size: 10.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-block: 1px dashed var(--line-2); }
.cal-col .fold { position: absolute; inset-inline: 0; z-index: 1; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border-block: 1px dashed var(--line-2); color: var(--muted); font: 600 11px/1 var(--font); font-variant-numeric: tabular-nums; pointer-events: none; }
.cal.dense .appt { padding-block: 2px; line-height: 1.25; }
.cal .appt.tight { display: flex; align-items: center; gap: 6px; padding-block: 0; }
.cal .appt.tight > b { flex: 0 1 auto; min-width: 0; }
.cal .appt.tight > span { flex: 1 1 0; min-width: 0; font-size: 11px; }
.cal .appt.tight > span ~ span { display: none; }
.cal .appt.tight > .st-dot { top: 50%; translate: 0 -50%; }
.cal-closed { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 32px 16px; }
.cal-closed > svg { width: 34px; height: 34px; color: var(--muted); }
.cal-closed > b { font-size: 16px; }
.cal-closed > span { color: var(--muted); max-width: 40ch; }
.cal-closed .btn { margin-top: 6px; }
.cal-col { background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--slot) - 1px), color-mix(in srgb, var(--line) 50%, transparent) calc(var(--slot) - 1px), color-mix(in srgb, var(--line) 50%, transparent) var(--slot)); }
.cal-col .hr { position: absolute; inset-inline: 0; height: 0; margin-top: -1px; border-top: 1px solid var(--line-2); pointer-events: none; }
.cal-times .cal-fold-t + div { transform: none; }
