/* مجمع عيادات زاد الخيرية — الهوية البصرية للوحة الإدارة
   كحلي (هوية موحّدة) على خلفية فاتحة */
:root {
  --brand: #223468;
  --brand-600: #35509a;
  --brand-700: #1b2a54;
  --brand-50: #eef1f9;
  --brand-100: #dde3f4;
  --side-bg: #10182f;
  --side-2: #1b2a54;
  --gold: #35509a;
  --gold-50: #eef1f9;

  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --border: #e8ecf1;
  --border-strong: #d3dae4;
  --text: #16232b;
  --text-2: #465562;
  --text-3: #5f6b78;

  --ok: #0b7a53;     --ok-50: #e5f4eb;
  --warn: #8f5e12;   --warn-50: #fcf1dd;
  --danger: #b23a27; --danger-50: #fbe9e5;
  --info: #35509a;   --info-50: #e6eff9;
  --violet: #35509a; --violet-50: #eef1f9;
  --gray: #5d6470;   --gray-50: #eef1f3;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 47, .05), 0 6px 20px rgba(16, 24, 47, .05);
  --shadow-lg: 0 20px 60px rgba(16, 24, 47, .22);
  --font: 'Tajawal', system-ui, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
.z-num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.z-muted { color: var(--text-2); }
.z-faint { color: var(--text-3); font-size: 13px; }
.z-ic { flex: none; }

/* ---------- layout ---------- */
.z-app { display: flex; min-height: 100vh; }
.z-side {
  width: 272px; flex: none; background: var(--surface); color: var(--text);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  border-inline-end: 1px solid var(--border);
}
.z-brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 14px; }
.z-logo {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: #fff url("assets/logo.jpg") center / 128% no-repeat;
  font-size: 0 !important; color: transparent; box-shadow: 0 4px 12px rgba(34,52,104,.18), inset 0 0 0 1px rgba(0,0,0,.06);
}
.z-brand b { display: block; font-size: 15px; line-height: 1.3; }
.z-brand span { font-size: 12.5px; color: var(--text-3); }
.z-nav { flex: 1; overflow-y: auto; padding: 0 12px 12px; }
.z-nav-title { font-size: 12.5px; color: var(--text-3); padding: 8px 22px 6px; font-weight: 700; }
.z-nav-item {
  width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: none; position: relative;
  color: var(--text-2); padding: 10px 12px; border-radius: 11px; cursor: pointer; text-align: start; font-size: 15px; margin-bottom: 2px;
}
.z-nav-item:hover { background: var(--gray-50); color: var(--text); }
.z-nav-item.on { background: var(--brand-50); color: var(--brand-700); font-weight: 800; }
.z-nav-item.on::after { content: ''; position: absolute; inset-inline-end: -12px; top: 50%; transform: translateY(-50%); width: 4px; height: 24px; border-radius: 4px 0 0 4px; background: var(--brand-700); }
.z-nav-count { margin-inline-start: auto; background: var(--brand-100); color: var(--brand-700); border-radius: 99px; font-size: 12px; font-weight: 800; padding: 0 8px; line-height: 20px; }
.z-nav-count.hot { background: var(--danger); color: #fff; }
.z-side-foot { padding: 14px 16px; border-top: 1px solid var(--border); }
.z-side-foot .z-user b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-side-foot .z-user span { font-size: 12px; color: var(--text-3); }
.z-side-link { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-size: 14px; cursor: pointer; text-decoration: none; }
.z-side-link:hover, .z-side-link.on { background: var(--gray-50); color: var(--text); }
.z-scrim { display: none; }

.z-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.z-top {
  position: sticky; top: 0; z-index: 30; height: 66px; display: flex; align-items: center; gap: 14px;
  padding: 0 28px; background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.z-top h1 { font-size: 19px; margin: 0; font-weight: 800; white-space: nowrap; }
.z-top-search { position: relative; flex: 1; max-width: 420px; margin-inline-start: 12px; }
.z-top-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.z-menu-btn { display: none !important; }
.z-content { padding: 26px 28px 60px; width: 100%; max-width: 1480px; }

/* ---------- page header ---------- */
.z-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.z-page-head h2 { margin: 0; font-size: 24px; font-weight: 800; }
.z-page-head p { margin: 4px 0 0; color: var(--text-2); }
.z-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- buttons ---------- */
.z-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent;
  border-radius: 10px; cursor: pointer; font-weight: 700; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s;
}
.z-btn-md { height: 40px; padding: 0 16px; font-size: 14.5px; }
.z-btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.z-btn-icon { height: 36px; width: 36px; padding: 0; }
.z-btn-primary { background: var(--brand); color: #fff; }
.z-btn-primary:hover:not(:disabled) { background: var(--brand-700); }
.z-btn-gold { background: var(--gold); color: #fff; }
.z-btn-gold:hover:not(:disabled) { background: var(--brand); }
.z-btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.z-btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-700); }
.z-btn-ghost { background: transparent; color: var(--text-2); }
.z-btn-ghost:hover:not(:disabled) { background: var(--gray-50); color: var(--text); }
.z-btn-danger { background: var(--danger); color: #fff; }
.z-btn-danger:hover:not(:disabled) { background: #a13220; }
.z-btn-soft { background: var(--brand-50); color: var(--brand-700); }
.z-btn-soft:hover:not(:disabled) { background: var(--brand-100); }
.z-btn:disabled { opacity: .5; cursor: not-allowed; }
.z-btn:focus-visible, .z-input:focus-visible, .z-nav-item:focus-visible { outline: 3px solid rgba(34,52,104,.3); outline-offset: 1px; }
.z-block { width: 100%; }
.z-spin { width: 15px; height: 15px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: zspin .7s linear infinite; }
@keyframes zspin { to { transform: rotate(360deg); } }

/* ---------- cards ---------- */
.z-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.z-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 0; }
.z-card-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.z-card-head p { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
.z-card-body { padding: 16px 18px 18px; }
.z-card-flush .z-card-body { padding: 12px 0 0; }

.z-grid { display: grid; gap: 16px; }
.z-kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
/* أربع بطاقات: صف واحد أو 2×2 — لا تنكسر 3+1 */
.z-kpis:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .z-kpis:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.z-split { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); align-items: start; }
.z-stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.z-kpi { padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.z-kpi-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.z-kpi-label { color: var(--text-2); font-size: 13.5px; }
.z-kpi-value { font-size: 26px; font-weight: 800; line-height: 1.2; margin-top: 2px; }
.z-kpi-foot { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

.tone-brand { background: var(--brand-50); color: var(--brand-700); }
.tone-ok { background: var(--ok-50); color: var(--ok); }
.tone-warn { background: var(--warn-50); color: var(--warn); }
.tone-danger { background: var(--danger-50); color: var(--danger); }
.tone-info { background: var(--info-50); color: var(--info); }
.tone-violet { background: var(--violet-50); color: var(--violet); }
.tone-gold { background: var(--gold-50); color: #1b2a54; }
.tone-gray { background: var(--gray-50); color: var(--gray); }

/* ---------- badges ---------- */
.z-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.z-badge .z-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.z-chip {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 99px; padding: 5px 12px; font-size: 13px; cursor: pointer; font-weight: 500;
}
.z-chip b { font-weight: 800; }
.z-chip.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.z-chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- forms ---------- */
.z-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.z-field > label { font-size: 13.5px; font-weight: 700; color: var(--text); }
.z-field > label i { color: var(--danger); font-style: normal; margin-inline-start: 2px; }
.z-field-hint { font-size: 12.5px; color: var(--text-3); }
.z-field-err { font-size: 12.5px; color: var(--danger); display: flex; gap: 5px; align-items: center; }
.z-input {
  height: 40px; width: 100%; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
  padding: 0 12px; font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
textarea.z-input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
select.z-input { padding-inline-end: 8px; }
.z-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(34,52,104,.14); }
.z-input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(191,63,43,.1); }
.z-input:disabled { background: var(--gray-50); color: var(--text-3); }
.z-form { display: grid; gap: 14px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.z-form .z-span { grid-column: 1 / -1; }
.z-form-section { grid-column: 1 / -1; font-size: 13px; font-weight: 800; color: var(--brand-700); padding-top: 6px; border-top: 1px dashed var(--border); margin-top: 4px; }
.z-search { position: relative; }
.z-search .z-ic { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.z-search .z-input { padding-inline-start: 36px; }

.z-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.z-toolbar .z-search { flex: 1 1 240px; max-width: 360px; }
.z-toolbar select.z-input { width: auto; min-width: 150px; flex: 0 1 auto; }

/* ---------- table ---------- */
.z-table-wrap { overflow-x: auto; }
.z-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.z-table th { text-align: start; font-size: 12.5px; color: var(--text-2); font-weight: 700; background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.z-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.z-table tr:last-child td { border-bottom: 0; }
.z-table tbody tr:hover td { background: #fafbfd; }
.z-table tr.is-dim td { background: var(--surface-2); color: var(--text-2); }   /* صف ملغي/معطّل: خلفية مميزة بلا شفافية */
.z-table .z-end { text-align: end; }
.z-th-sort { border: 0; background: none; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: inherit; font-size: inherit; }
.z-th-sort .z-ic { opacity: .3; }
.z-th-sort.on { color: var(--brand-700); }
.z-th-sort.on .z-ic { opacity: 1; }
.z-cell-main { font-weight: 700; }
.z-cell-sub { font-size: 12.5px; color: var(--text-3); }
.z-link { border: 0; background: none; padding: 0; cursor: pointer; color: var(--text); font-weight: 700; text-align: start; }
.z-link:hover { color: var(--brand); text-decoration: underline; }
.z-row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.z-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }

/* ---------- dialog ---------- */
.z-overlay { position: fixed; inset: 0; background: rgba(16, 24, 47, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; animation: zfade .15s; }
.z-dialog { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; animation: zpop .18s; }
.z-dialog.lg { max-width: 780px; }
.z-dialog.xl { max-width: 960px; }
.z-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.z-dialog-head h3 { margin: 0; font-size: 18px; font-weight: 800; }
.z-dialog-head p { margin: 3px 0 0; font-size: 13.5px; color: var(--text-2); }
.z-dialog-body { padding: 18px 22px; }
.z-dialog-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; flex-wrap: wrap; }
@keyframes zfade { from { opacity: 0; } }
@keyframes zpop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- menu / popover ---------- */
.z-pop-wrap { position: relative; }
.z-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 210px; padding: 6px; z-index: 50; }
.z-pop.wide { width: 360px; }
.z-pop-item { width: 100%; display: flex; align-items: center; gap: 9px; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; text-align: start; }
.z-pop-item:hover:not(:disabled) { background: var(--gray-50); }
.z-pop-item.danger { color: var(--danger); }
.z-pop-item:disabled { opacity: .45; cursor: not-allowed; }
.z-pop-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.z-pop-title { font-size: 12px; color: var(--text-3); padding: 6px 10px 4px; font-weight: 700; }

/* ---------- tabs ---------- */
.z-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; padding: 0 12px; }
.z-tab { border: 0; background: none; padding: 12px 12px 11px; cursor: pointer; font-weight: 700; color: var(--text-2); border-bottom: 2.5px solid transparent; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; font-size: 14px; }
.z-tab:hover { color: var(--text); }
.z-tab.on { color: var(--brand-700); border-bottom-color: var(--brand); }
.z-tab .z-tab-count { background: var(--gray-50); color: var(--text-2); border-radius: 99px; font-size: 12px; padding: 0 7px; }
.z-tab.on .z-tab-count { background: var(--brand-50); color: var(--brand-700); }

/* ---------- misc states ---------- */
.z-empty { text-align: center; padding: 44px 20px; color: var(--text-2); }
.z-empty .z-empty-ic { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--gray-50); color: var(--text-3); }
.z-empty h4 { margin: 0 0 4px; color: var(--text); font-size: 16px; }
.z-empty p { margin: 0 auto 14px; max-width: 380px; font-size: 14px; }
.z-locked { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 12px; background: repeating-linear-gradient(-45deg, var(--surface-2), var(--surface-2) 8px, #f1f3f8 8px, #f1f3f8 16px); border: 1px dashed var(--border-strong); color: var(--text-2); font-size: 13.5px; }
.z-locked b { color: var(--text); display: block; font-size: 14px; }
.z-locked-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; flex: none; color: var(--text-3); border: 1px solid var(--border); }
.z-mask { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 12.5px; }
.z-banner { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 11px; font-size: 13.5px; }
.z-skel { background: linear-gradient(90deg, #eef1f5 25%, #f4f6fa 50%, #eef1f5 75%); background-size: 200% 100%; animation: zskel 1.1s infinite; border-radius: 8px; }
@keyframes zskel { to { background-position: -200% 0; } }

.z-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.z-avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.z-avatar.lg { width: 60px; height: 60px; font-size: 21px; }
.z-person { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* ---------- toasts ---------- */
.z-toasts { position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.z-toast { background: #10182f; color: #fff; border-radius: 12px; padding: 12px 14px; min-width: 280px; max-width: 380px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; animation: zpop .2s; font-size: 14px; }
.z-toast b { display: block; }
.z-toast span { color: #c5cfe8; font-size: 13px; }
.z-toast .z-toast-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }

/* ---------- dashboard ---------- */
.z-hello { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: linear-gradient(120deg, var(--brand-700), var(--brand) 60%, var(--brand-600)); color: #fff; border-radius: 18px; padding: 22px 24px; margin-bottom: 18px; position: relative; overflow: hidden; }
.z-hello::after { content: ''; position: absolute; inset-inline-end: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(34,52,104,.28), transparent 70%); }
.z-hello h2 { margin: 0; font-size: 22px; font-weight: 800; }
.z-hello p { margin: 4px 0 0; color: #d6ddf0; }
.z-hello .z-actions { position: relative; z-index: 1; }
.z-hello .z-btn-secondary { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.z-hello .z-btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.4); }

.z-seg { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--gray-50); }
.z-seg > span { height: 100%; }
.z-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 13px; color: var(--text-2); }
.z-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-inline-end: 6px; }

.z-doc-row { display: flex; gap: 14px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border); }
.z-doc-row:first-child { border-top: 0; }
.z-doc-meta { width: 210px; flex: none; min-width: 0; }
.z-timeline { flex: 1; position: relative; height: 30px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.z-timeline .z-blk { position: absolute; top: 4px; bottom: 4px; border-radius: 5px; min-width: 4px; }
.z-timeline .z-brk { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(-45deg, transparent, transparent 4px, rgba(0,0,0,.07) 4px, rgba(0,0,0,.07) 8px); }
.z-timeline .z-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); }
.z-tl-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); margin-top: 3px; }

.z-alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-top: 1px solid var(--border); cursor: pointer; border-inline: 0; border-bottom: 0; background: none; width: 100%; text-align: start; }
.z-alert:first-child { border-top: 0; }
.z-alert:hover { background: var(--surface-2); }
.z-alert b { display: block; font-size: 14px; }
.z-alert.is-unread { background: var(--brand-50); }   /* غير المقروء بخلفية خفيفة، والمقروء بخط عادي — بلا شفافية تُضعف التباين */
.z-alert.is-unread:hover { background: var(--brand-100); }
.z-alert.is-read b { font-weight: 600; color: var(--text-2); }
.z-alert span { font-size: 12.5px; color: var(--text-3); }
.z-alert-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }

.z-bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; padding-top: 8px; }
.z-bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.z-bars .z-bar { width: 100%; max-width: 34px; background: var(--brand-100); border-radius: 6px 6px 3px 3px; min-height: 3px; }
.z-bars .z-bar.today { background: var(--gold); }
.z-bars small { font-size: 11px; color: var(--text-3); }
.z-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.z-mini > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; }
.z-mini small { color: var(--text-2); font-size: 12.5px; display: block; }
.z-mini b { font-size: 18px; }

/* ---------- appointments ---------- */
.z-time { font-weight: 800; font-size: 15px; }
.z-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.z-slot { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 9px; height: 38px; cursor: pointer; font-weight: 700; font-size: 14px; }
.z-slot:hover { border-color: var(--brand); color: var(--brand-700); }
.z-slot.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.z-summary { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 16px; font-size: 13.5px; }
.z-summary small { display: block; color: var(--text-2); font-size: 12px; }
.z-summary b { font-size: 14px; }
.z-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 20px; }
.z-kv small { display: block; color: var(--text-3); font-size: 12.5px; margin-bottom: 2px; }
.z-kv b { font-weight: 700; font-size: 14.5px; }
.z-picker-list { border: 1px solid var(--border); border-radius: 10px; max-height: 210px; overflow-y: auto; margin-top: 6px; }
.z-picker-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: none; padding: 9px 12px; cursor: pointer; text-align: start; border-bottom: 1px solid var(--border); }
.z-picker-item:last-child { border-bottom: 0; }
.z-picker-item:hover, .z-picker-item.on { background: var(--brand-50); }
.z-seg-toggle { display: inline-flex; background: var(--gray-50); border-radius: 10px; padding: 3px; gap: 3px; }
.z-seg-toggle button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--text-2); }
.z-seg-toggle button.on { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow); }

/* ---------- patient profile ---------- */
.z-profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 20px; }
.z-profile-head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.z-profile-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.z-note { border: 1px solid var(--border); border-radius: 11px; padding: 11px 14px; background: var(--surface-2); }
.z-note + .z-note { margin-top: 10px; }
.z-note-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.z-timeline-list { position: relative; padding-inline-start: 22px; }
.z-timeline-list::before { content: ''; position: absolute; inset-inline-start: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.z-tl-item { position: relative; padding-bottom: 16px; }
.z-tl-item::before { content: ''; position: absolute; inset-inline-start: -20px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); }

/* ---------- invoices ---------- */
.z-lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.z-lines th { text-align: start; font-size: 12.5px; color: var(--text-2); padding: 8px 6px; border-bottom: 1px solid var(--border); }
.z-lines td { padding: 8px 6px; border-bottom: 1px solid var(--border); }
.z-totals { margin-inline-start: auto; width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.z-totals > div { display: flex; justify-content: space-between; }
.z-totals .grand { font-size: 17px; font-weight: 800; border-top: 1px solid var(--border); padding-top: 8px; }

#z-print { display: none; }
.z-receipt { font-family: var(--font); color: #111; max-width: 520px; margin: 0 auto; padding: 24px; }
.z-receipt h1 { font-size: 20px; margin: 0; }
.z-receipt table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
.z-receipt td, .z-receipt th { border-bottom: 1px solid #ddd; padding: 6px 4px; text-align: start; }

@media print {
  .z-app, .z-overlay, .z-toasts { display: none !important; }
  #z-print { display: block; }
  body { background: #fff; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .z-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .z-side { position: fixed; top: 0; bottom: 0; right: 0; z-index: 80; transform: translateX(105%); transition: transform .22s; box-shadow: var(--shadow-lg); }
  .z-side.open { transform: none; }
  .z-scrim.open { display: block; position: fixed; inset: 0; background: rgba(16,24,47,.4); z-index: 70; }
  .z-menu-btn { display: inline-flex !important; }
  .z-top { padding: 0 16px; }
  .z-content { padding: 18px 16px 50px; }
}
@media (max-width: 720px) {
  .z-top h1 { display: none; }
  .z-top-search { margin: 0; }
  .z-role-label { display: none; }
  .z-form { grid-template-columns: minmax(0, 1fr); }
  .z-doc-row { flex-direction: column; align-items: stretch; }
  .z-doc-meta { width: auto; }
  .z-page-head h2 { font-size: 20px; }
  .z-kpi-value { font-size: 22px; }
  .z-hide-sm { display: none; }
  .z-pop.wide { width: min(340px, calc(100vw - 32px)); }
}

/* ================= إضافات الأقسام الجديدة ================= */
.z-dot-count { position: absolute; top: -5px; inset-inline-end: -5px; background: var(--danger); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }
.z-split + .z-card, .z-split + .z-split, .z-card + .z-split { margin-top: 18px; }
.z-cal-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

/* calendar: week */
.z-week { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 8px; padding: 14px; overflow-x: auto; }
.z-week-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 6px; min-height: 200px; display: flex; flex-direction: column; gap: 6px; }
.z-week-col.is-today { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-50); }
.z-week-col.is-off { background: repeating-linear-gradient(-45deg, var(--surface-2), var(--surface-2) 8px, #f1f3f8 8px, #f1f3f8 16px); }
.z-week-head { border: 0; background: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; text-align: start; padding: 4px 6px 6px; border-bottom: 1px solid var(--border); }
.z-week-head b { font-size: 14px; }
.z-week-head span { grid-column: 1; font-size: 12px; color: var(--text-3); }
.z-week-head small { grid-row: 1 / span 2; grid-column: 2; align-self: center; background: var(--brand-100); color: var(--brand-700); border-radius: 99px; padding: 0 8px; font-weight: 800; }
.z-week-item { border: 1px solid var(--border); border-inline-start: 4px solid; background: var(--surface); border-radius: 8px; padding: 6px 8px; text-align: start; cursor: pointer; display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.z-week-item:hover { box-shadow: var(--shadow); }
.z-week-item small { color: var(--text-3); font-size: 11.5px; }

/* calendar: month */
.z-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 14px; }
.z-month-wd { text-align: center; font-size: 12.5px; font-weight: 800; color: var(--text-2); padding: 4px 0; }
.z-month-cell { min-height: 84px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; text-align: start; cursor: pointer; font-size: 12.5px; }
.z-month-cell:hover { border-color: var(--brand); }
.z-month-cell.is-empty { background: transparent; border: 0; cursor: default; }
.z-month-cell.is-today { border-color: var(--brand); background: var(--brand-50); }
.z-month-cell.is-off { background: var(--surface-2); }
.z-month-n { font-weight: 800; font-size: 14px; }
.z-month-dots { display: flex; gap: 3px; flex-wrap: wrap; }
.z-month-dots i { width: 8px; height: 8px; border-radius: 50%; }

/* switch / pills / steps / choices */
.z-switch { width: 42px; height: 24px; border-radius: 99px; border: 0; background: var(--border-strong); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.z-switch i { position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: inset-inline-start .15s; }
.z-switch.on { background: var(--brand); }
.z-switch.on i { inset-inline-start: 21px; }
.z-switch:disabled { opacity: .5; cursor: not-allowed; }
.z-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.z-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 99px; padding: 5px 12px; cursor: pointer; font-size: 13.5px; background: var(--surface); }
.z-pill input { display: none; }
.z-pill.on { background: var(--brand-50); border-color: var(--brand); color: var(--brand-700); font-weight: 700; }
.z-steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.z-steps li { flex: 1 1 150px; }
.z-steps button { width: 100%; display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 10px 12px; font-weight: 700; color: var(--text-3); cursor: pointer; }
.z-steps button span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-50); font-size: 13px; flex: none; }
.z-steps li.on button { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); }
.z-steps li.on button span { background: var(--brand); color: #fff; }
.z-steps li.done button { color: var(--text); }
.z-steps li.done button span { background: var(--ok-50); color: var(--ok); }
.z-steps button:disabled { cursor: default; }
.z-steps.small li { flex-basis: 110px; }
.z-steps.small button { padding: 7px 9px; font-size: 13px; }
.z-choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.z-choice { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: start; }
.z-choice:hover { border-color: var(--brand); }
.z-choice.on { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 2px var(--brand-100); }
.z-choice b { display: block; }
.z-choice small { display: block; color: var(--text-3); font-size: 12.5px; }
.z-choice-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--gold-50); color: #1b2a54; display: grid; place-items: center; flex: none; }
.z-days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.z-day { flex: none; min-width: 96px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.z-day small { color: var(--text-3); font-size: 12px; }
.z-day span { font-size: 11.5px; color: var(--ok); }
.z-day.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.z-day.on small, .z-day.on span { color: var(--brand-100); }

/* services */
.z-svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; padding: 16px 18px 18px; }
.z-svc { border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.z-svc.is-off { background: var(--surface-2); border-style: dashed; box-shadow: none; }
.z-svc.is-off .z-svc-cat { filter: grayscale(1); }
.z-svc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.z-svc-cat { font-size: 12px; font-weight: 800; border-radius: 99px; padding: 2px 10px; }
.z-svc h3 { margin: 0; font-size: 16.5px; }
.z-svc p { margin: 0; color: var(--text-2); font-size: 13.5px; flex: 1; }
.z-svc-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.z-svc-meta span { display: inline-flex; gap: 5px; align-items: center; }
.z-svc-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed var(--border); padding-top: 10px; }
.z-svc-foot > b { font-size: 18px; color: var(--brand-700); }

/* work hours */
.z-wh { display: flex; flex-direction: column; gap: 8px; }
.z-wh-day { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.z-wh-day.is-off { background: var(--surface-2); }
.z-wh-name { display: flex; align-items: center; gap: 10px; width: 130px; flex: none; }
.z-wh-times { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; }
.z-wh-times label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.z-wh-times .z-input { width: 118px; height: 36px; }
.z-wh-table th.is-off { color: var(--danger); }
.z-slot-chip { display: inline-flex; flex-direction: column; align-items: center; background: var(--brand-50); color: var(--brand-700); border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 700; line-height: 1.35; }
.z-slot-chip.warn { background: var(--warn-50); color: var(--warn); }

/* requests / tickets / tips / preview */
.z-req-list { display: flex; flex-direction: column; gap: 12px; }
.z-req { border: 1px solid var(--border); border-inline-start: 4px solid var(--border-strong); border-radius: 12px; padding: 14px; }
.z-req.is-pending { border-inline-start-color: var(--warn); }
.z-req.is-approved { border-inline-start-color: var(--ok); }
.z-req.is-rejected { border-inline-start-color: var(--danger); }
.z-req-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.z-tips { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 14px; color: var(--text-2); }
.z-tips li { display: flex; gap: 10px; align-items: flex-start; }
.z-tips .z-ic { color: var(--brand); margin-top: 3px; }
.z-ticket { border-top: 1px solid var(--border); }
.z-ticket:first-child { border-top: 0; }
.z-ticket-head { width: 100%; border: 0; background: none; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 12px 18px; text-align: start; cursor: pointer; }
.z-ticket-head:hover { background: var(--surface-2); }
.z-ticket-body { padding: 0 18px 14px; }
.z-preview { margin-top: 14px; }
.z-preview-card { display: flex; gap: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.z-preview-card p { margin: 4px 0 0; white-space: pre-line; font-size: 13.5px; color: var(--text-2); }

/* bars */
.z-hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.z-hbars li > div:first-child { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 4px; gap: 8px; }
.z-hbars li i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-inline-end: 6px; }
.z-hbars li.is-zero { color: var(--text-3); }
.z-hbar-track { height: 9px; background: var(--gray-50); border-radius: 99px; overflow: hidden; }
.z-hbar-track span { display: block; height: 100%; border-radius: 99px; }

/* notifications */
.z-ncats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 18px; }
.z-ncat { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: start; }
.z-ncat b { display: block; font-size: 14px; }
.z-ncat small { color: var(--text-3); font-size: 12px; }
.z-ncat.on { border-color: var(--brand); background: var(--brand-50); }
.z-notif { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-top: 1px solid var(--border); cursor: pointer; }
.z-notif:first-child { border-top: 0; }
.z-notif:hover { background: var(--surface-2); }
.z-notif.is-unread { background: #fafbfd; }
.z-notif-title { font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.z-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); display: inline-block; }
.z-src { border: 1px solid; border-radius: 99px; padding: 0 8px; margin-inline-start: 8px; font-size: 11.5px; font-weight: 700; }

/* roles */
.z-perm td, .z-perm th { text-align: center; }
.z-perm td:first-child, .z-perm th:first-child { text-align: start; }
.z-perm input { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }
.z-perm tr.is-fin td { background: var(--gold-50); }
details.z-card > summary { list-style: none; }
details.z-card > summary::-webkit-details-marker { display: none; }

/* print (reports) */
.z-print-head { display: none; }
@media print {
  body.z-print-page .z-app { display: block !important; }
  body.z-print-page .z-side, body.z-print-page .z-top, body.z-print-page .no-print, body.z-print-page .z-page-head .z-actions, body.z-print-page .z-toasts { display: none !important; }
  body.z-print-page .z-print-head { display: block; margin-bottom: 12px; }
  body.z-print-page .z-content { padding: 0; max-width: none; }
  body.z-print-page .z-card { box-shadow: none; break-inside: avoid; }
  body.z-print-page .z-split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .z-week { grid-template-columns: repeat(7, 150px); }
  .z-month-cell { min-height: 58px; padding: 4px; }
  .z-month-cell b { font-size: 11px; }
  .z-wh-name { width: 100%; }
}
.z-seg-toggle { flex-wrap: wrap; max-width: 100%; }
@media (max-width: 720px) {
  .z-cal-bar b { min-width: 0 !important; font-size: 13.5px; }
  .z-cal-bar .z-actions { flex-wrap: nowrap; }
}

/* ===== الرئيسية: ترتيب الصفوف ===== */
.z-dash-top { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; margin-top: 18px; }
.z-dash-top > .z-card { height: 100%; }
.z-dash-row { margin-top: 18px; }
.z-dash-status { padding: 4px 20px 14px; border-bottom: 1px solid var(--border); }
.z-dash-status .z-legend { margin-top: 10px; }
.z-fin { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: end; }
.z-fin .z-bars { margin-top: 8px; }
@media (max-width: 1024px) { .z-dash-top, .z-fin { grid-template-columns: minmax(0, 1fr); } }

/* ===== مواعيد العمل: فترات متعددة + 24 ساعة ===== */
.z-wh-day { align-items: flex-start; }
.z-wh-name { padding-top: 6px; }
.z-wh-body { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.z-wh-24 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.z-wh-pn { font-size: 12.5px; color: var(--text-3); min-width: 48px; }
.z-slot-chip span + span { margin-top: 2px; }
.z-dweek { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.z-dweek-day { border: 1px solid var(--border); border-radius: 11px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.z-dweek-day b { font-size: 13.5px; }
.z-dweek-day.on { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.z-dweek-day.off { background: var(--surface-2); color: var(--text-3); }
.z-dweek-day small { color: var(--warn); font-size: 11.5px; }

/* قسم اختياري قابل للطي داخل النماذج */
.z-more { margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.z-more summary { cursor: pointer; font-weight: 700; color: var(--brand-700); font-size: 14px; }

/* =====================================================================
   إعادة التصميم (2026-10-07): تجميع القائمة، التنقل السفلي، الجداول كبطاقات،
   شبكة الأوقات، صفحة الحجز، الرئيسية، النماذج
   ===================================================================== */
.z-nav-group + .z-nav-group { margin-top: 6px; }
.z-nav-group .z-nav-title { padding: 12px 12px 4px; font-size: 11.5px; letter-spacing: .02em; }
.z-nav-item { padding: 9px 12px; font-size: 14.5px; }

/* التنقل السفلي (موبايل) */
.z-bnav { display: none; }
@media (max-width: 720px) {
  .z-bnav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
    background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(16, 24, 47, .06);
  }
  .z-bn-item { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 700; color: var(--text-3); padding: 4px 0; min-height: 48px; cursor: pointer; }
  .z-bn-item.on { color: var(--brand-700); }
  .z-bn-ic { position: relative; display: grid; place-items: center; width: 44px; height: 28px; border-radius: 14px; }
  .z-bn-item.on .z-bn-ic { background: var(--brand-50); }
  .z-bn-ic i { position: absolute; top: -4px; inset-inline-end: 0; background: var(--brand); color: #fff; font-style: normal; font-size: 10.5px; font-weight: 800; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
  .z-bn-fab { justify-self: center; width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--gold); color: #fff; display: grid; place-items: center; margin-top: -22px; box-shadow: 0 6px 16px rgba(34, 52, 104, .4); cursor: pointer; }
  .z-content { padding-bottom: 96px; }
  .z-toasts { bottom: 84px; inset-inline: 12px; }
  .z-toast { min-width: 0; max-width: none; }
}

/* الجداول ← بطاقات على الموبايل */
@media (max-width: 720px) {
  table[data-cards] { display: block; }
  table[data-cards] thead { display: none; }
  table[data-cards] tbody { display: block; }
  table[data-cards] tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  table[data-cards] tr:last-child { border-bottom: 0; }
  table[data-cards] td { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; justify-items: end; padding: 4px 0; border: 0; text-align: end; width: 100%; }
  table[data-cards] td::before { content: attr(data-label); grid-column: 1; grid-row: 1 / span 3; align-self: start; justify-self: start; color: var(--text-3); font-size: 12.5px; font-weight: 700; text-align: start; }
  table[data-cards] td > * { grid-column: 2; }
  table[data-cards] td:first-child { display: flex; justify-content: flex-start; text-align: start; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px dashed var(--border); font-size: 15px; }
  table[data-cards] td:first-child::before, table[data-cards] td[data-label=""]::before, table[data-cards] td:has(.z-row-actions)::before { display: none; }
  table[data-cards] td:empty { display: none; }
  table[data-cards] td:has(.z-row-actions) { display: flex; justify-content: flex-end; padding-top: 8px; }
  table[data-cards] .z-row-actions { flex-wrap: wrap; }
  table[data-cards] tbody tr:hover td { background: none; }
  .z-toolbar { padding: 12px 14px; }
  .z-toolbar .z-search { max-width: none; flex-basis: 100%; }
  .z-toolbar select.z-input { flex: 1 1 140px; min-width: 0; }
  .z-card-head { flex-wrap: wrap; }
  .z-page-head .z-actions { width: 100%; }
  .z-page-head .z-actions .z-btn { flex: 1 1 auto; }
  .z-pager { flex-wrap: wrap; }
  .z-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .z-kpi { padding: 12px; gap: 10px; }
  .z-kpi-ic { width: 36px; height: 36px; }
  .z-kpi-foot { display: none; }
  .z-split { gap: 14px; }
  .z-tabs { padding: 0 6px; }
  .z-btn-md, .z-input, .z-btn-icon { min-height: 44px; }
  .z-btn-sm { min-height: 36px; }
  .z-top { height: 60px; gap: 8px; }
}

/* النوافذ على الموبايل: ورقة سفلية بدل نافذة عائمة تخرج عن الشاشة */
@media (max-width: 720px) {
  .z-overlay { padding: 0; align-items: flex-end; }
  .z-dialog, .z-dialog.lg, .z-dialog.xl { max-width: none; border-radius: 18px 18px 0 0; max-height: 94vh; display: flex; flex-direction: column; animation: zsheet .22s; }
  .z-dialog-body { overflow-y: auto; flex: 1; padding: 16px 16px; }
  .z-dialog-head { padding: 16px 16px 0; }
  .z-dialog-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-radius: 0; }
  .z-dialog-foot .z-btn { flex: 1; }
}
@keyframes zsheet { from { transform: translateY(40px); opacity: 0; } }

/* الإشعارات المؤقتة: شريط ملوّن حسب النوع */
.z-toast { border-inline-start: 4px solid var(--ok); }
.z-toast:has(.tone-danger) { border-inline-start-color: #e0705c; }
.z-toast:has(.tone-warn) { border-inline-start-color: #35509a; }
.z-toast:has(.tone-info) { border-inline-start-color: #8fa6e0; }

/* ---------- الرئيسية ---------- */
.z-dh { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.z-dh h2 { margin: 0; font-size: 22px; font-weight: 800; }
.z-dh p { margin: 2px 0 0; color: var(--text-2); font-size: 13.5px; }
.z-qa { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 10px; margin-bottom: 18px; }
.z-qa-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 11px 13px; cursor: pointer; text-align: start; font-weight: 700; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.z-qa-item:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.z-qa-item.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.z-qa-item .z-qa-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand-700); }
.z-qa-item.primary .z-qa-ic { background: rgba(255,255,255,.18); color: #fff; }
@media (min-width: 721px) and (max-width: 1180px) { .z-qa-item { flex-direction: column; justify-content: center; text-align: center; gap: 6px; padding: 12px 8px; } }   /* عرض متوسط: الأيقونة فوق النص حتى يبقى سطرًا واحدًا */
.z-sched-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--border); }
.z-sched-row:first-child { border-top: 0; }
.z-sched-row.is-now { background: var(--brand-50); }
.z-sched-row.is-done { background: var(--surface-2); }
.z-sched-time { width: 74px; flex: none; font-weight: 800; font-size: 14.5px; }
.z-sched-time small { display: block; font-weight: 500; font-size: 11.5px; color: var(--text-3); }
.z-sched-main { flex: 1; min-width: 0; }
.z-sched-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-sched-main span { font-size: 12.5px; color: var(--text-3); }
.z-sched-bar { width: 4px; align-self: stretch; border-radius: 4px; flex: none; }
@media (max-width: 720px) { .z-sched-row { padding: 10px 14px; gap: 10px; flex-wrap: wrap; } .z-sched-time { width: 62px; } .z-sched-act { margin-inline-start: auto; } }

/* ---------- صفحة الحجز (شاشة واحدة) ---------- */
.z-bk { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.z-bk-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.z-bk-side { position: sticky; top: 82px; }
.z-bk-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.z-bk-step.is-locked { background: var(--surface-2); box-shadow: none; border-style: dashed; }   /* خطوة لم تُفتح بعد: تمييز بالخلفية لا بالشفافية حتى يبقى النص مقروءًا */
.z-bk-step.is-locked .z-bk-head h3 { color: var(--text-2); }
.z-bk-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; width: 100%; border: 0; background: none; text-align: start; }
button.z-bk-head { cursor: pointer; }
.z-bk-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-50); color: var(--text-2); font-weight: 800; font-size: 13.5px; flex: none; }
.z-bk-step.is-active .z-bk-n { background: var(--brand); color: #fff; }
.z-bk-step.is-done .z-bk-n { background: var(--ok-50); color: var(--ok); }
.z-bk-head > span:nth-child(2) { min-width: 0; flex: 1; }
.z-bk-head h3 { margin: 0; font-size: 15.5px; font-weight: 800; }
.z-bk-head small { display: block; color: var(--text-3); font-size: 12.5px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-bk-head .z-bk-edit { color: var(--brand-700); font-size: 13px; font-weight: 700; flex: none; }
.z-bk-body { padding: 2px 18px 18px; }
.z-bk-pick { display: flex; align-items: center; gap: 10px; border: 1px solid var(--brand-100); background: var(--brand-50); border-radius: 12px; padding: 10px 12px; }
.z-bk-pick > span:first-child { flex: 1; min-width: 0; }
.z-bk-res { border: 1px solid var(--border); border-radius: 12px; margin-top: 8px; overflow: hidden; max-height: 280px; overflow-y: auto; }
.z-bk-res button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); padding: 10px 12px; cursor: pointer; text-align: start; min-height: 48px; }
.z-bk-res button:last-child { border-bottom: 0; }
.z-bk-res button:hover { background: var(--brand-50); }
.z-bk-sum dl { margin: 0; display: grid; gap: 12px; }
.z-bk-sum dt { font-size: 12px; color: var(--text-3); }
.z-bk-sum dd { margin: 1px 0 0; font-weight: 700; }
.z-bk-sum .z-bk-empty { color: var(--text-3); font-weight: 500; }
.z-bk-bar { display: none; }
@media (max-width: 1024px) {
  .z-bk { grid-template-columns: minmax(0, 1fr); }
  .z-bk-side { position: static; order: 2; }
}
@media (max-width: 720px) {
  .z-bk-side { display: none; }
  .z-bk-bar { display: flex; align-items: center; gap: 10px; position: fixed; inset-inline: 0; bottom: 64px; z-index: 55; background: var(--surface); border-top: 1px solid var(--border); padding: 10px 14px; box-shadow: 0 -6px 18px rgba(16,24,47,.08); }
  .z-bk-bar > div { flex: 1; min-width: 0; font-size: 13px; }
  .z-bk-bar b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .z-bk-body { padding: 2px 14px 16px; }
  .z-bk-head { padding: 12px 14px; }
  .z-content:has(.z-bk-bar) { padding-bottom: 150px; }
}

/* شبكة الأوقات: متاح / محجوز / غير متاح / ماضٍ / المحدد */
.z-sg { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.z-sg-cell { height: 42px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 700; font-size: 14px; cursor: pointer; display: grid; place-items: center; line-height: 1.1; }
.z-sg-cell:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); }
.z-sg-cell.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(34,52,104,.3); }
.z-sg-cell:disabled { cursor: not-allowed; background: var(--surface-2); border-style: dashed; color: var(--text-3); font-weight: 500; }
.z-sg-cell.booked:disabled { background: var(--danger-50); border: 1px solid #f0cfc7; color: var(--danger); text-decoration: line-through; }
.z-sg-cell.past:disabled { opacity: .5; text-decoration: line-through; }
.z-sg-cell.patient:disabled { background: var(--warn-50); border: 1px dashed #d3dae4; color: var(--warn); }
.z-sg-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px; color: var(--text-2); align-items: center; }
.z-sg-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-inline-end: 5px; vertical-align: -2px; border: 1px solid var(--border-strong); background: var(--surface); }
.z-sg-legend i.booked { background: var(--danger-50); border-color: #f0cfc7; }
.z-sg-legend i.past { background: var(--surface-2); border-style: dashed; }
.z-sg-legend i.on { background: var(--brand); border-color: var(--brand); }
.z-sg-legend i.patient { background: var(--warn-50); border-color: #d3dae4; }
.z-day { min-height: 64px; }

/* ---------- النماذج: أقسام واضحة ---------- */
.z-fsec { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.z-fsec:first-child { margin-top: 0; }
.z-fsec h4 { margin: 0; font-size: 13px; font-weight: 800; color: var(--brand-700); white-space: nowrap; }
.z-fsec::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.z-more { grid-column: 1 / -1; margin-top: 4px; }
.z-more[open] > summary { margin-bottom: 14px; }
.z-more > .z-form { margin-top: 12px; }

@media (max-width: 720px) {
  .z-qa { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
  .z-qa-item.primary:nth-last-child(odd) { grid-column: 1 / -1; }   /* عدد فردي: الحجز بعرض كامل والباقي أزواج */
  .z-qa-item { padding: 8px 10px; font-size: 13.5px; gap: 8px; }
  .z-qa-item .z-qa-ic { width: 30px; height: 30px; }
  .z-dh h2 { font-size: 19px; }
  .z-dh { margin-bottom: 12px; }
}

/* خلية جدول رقمية: لا تتحول إلى inline-block فتكسر تخطيط الجدول */
@media (min-width: 721px) { .z-table td.z-num, .z-table th.z-num, .z-lines td.z-num { display: table-cell; direction: rtl; unicode-bidi: normal; } }

/* سطر ثانوي رقمي (هاتف/رقم ملف) يبدأ في سطر مستقل تحت الاسم */
.z-cell-sub.z-num { display: block; width: fit-content; }

/* ملف المريض */
.z-ph { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; padding: 18px 20px; }
.z-ph-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border); }
.z-ph-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; grid-column: 1 / -1; }
.z-ph-fact { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 9px 12px; }
.z-ph-fact small { display: block; color: var(--text-3); font-size: 12px; }
.z-ph-fact b { font-size: 14.5px; }
@media (max-width: 720px) { .z-ph { padding: 14px; gap: 12px; } .z-ph-actions .z-btn { flex: 1 1 calc(50% - 8px); } }

/* الحجز: اختيار الخدمة بشكل مضغوط */
.z-bk-filter { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 8px; margin-bottom: 10px; }
.z-bk-filter > :only-child { grid-column: 1 / -1; }
.z-bk-list { border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 300px; overflow-y: auto; }
.z-bk-item { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.z-bk-item:last-child { border-bottom: 0; }
.z-bk-item:hover { background: var(--surface-2); }
.z-bk-item.on { background: var(--brand-50); box-shadow: inset -3px 0 0 var(--brand); }
.z-bk-item b { font-size: 14px; color: var(--text); }
.z-bk-item small { display: block; font-size: 12px; color: var(--text-3); }
.z-bk-item:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.z-bk-picked { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--brand-100); background: var(--brand-50); border-radius: var(--radius-sm); }
.z-bk-picked small { display: block; font-size: 12px; color: var(--text-2); }
@media (max-width: 720px) { .z-bk-filter { grid-template-columns: 1fr; } }

/* موبايل: صفوف الفلاتر (chips) تُمرَّر أفقيًا بدل أن تلتف في عدة أسطر */
@media (max-width: 720px) {
  .z-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 4px; margin-inline: -2px; padding-inline: 2px; }
  .z-chips::-webkit-scrollbar { display: none; }
  .z-chips > * { flex: none; }
}

/* =====================================================================
   المواعيد + حجز موعد — نفس تصميم وترتيب «التميز» (schedule.jsx / today.jsx / booking.jsx)
   ===================================================================== */
/* الفلاتر + التنقل بالتاريخ + نوع العرض */
.z-fbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.z-fbar > .z-field > label { font-weight: 700; color: var(--text); }
.z-cal-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.z-date-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.z-date-nav strong { font-size: 16px; min-width: min(170px, 40vw); text-align: center; }
.z-icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.z-icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.z-date-in { width: auto; min-width: 150px; height: 36px; }
.z-view-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.z-cal-body { padding: 18px 20px; }

/* جدول الخانات: الوقت عمودي والأطباء أعمدة */
.z-tg-wrap { min-width: 0; }
.z-tg-summary { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; color: var(--text-2); font-size: 14px; }
.z-tg-summary span { display: inline-flex; align-items: center; gap: 5px; }
.z-tg-scroll { overflow-x: auto; overflow-y: visible; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.z-tg { display: grid; min-width: min-content; }
.z-tg-corner, .z-tg-head { position: sticky; top: 0; z-index: 4; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.z-tg-corner { inset-inline-start: 0; z-index: 6; }
.z-tg-head { padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; border-inline-start: 1px solid var(--border); min-width: 0; }
.z-tg-head strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-tg-head > span { font-size: 13px; color: var(--text-3); }
.z-tg-head.is-today { background: var(--brand-50); }
.z-tg-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--warn); font-weight: 700; }
.z-tg-axis { position: sticky; inset-inline-start: 0; z-index: 3; background: var(--surface-2); }
.z-tg-axis-t { display: flex; align-items: flex-start; justify-content: center; padding-top: 5px; font-size: 12px; color: var(--text-3); border-bottom: 1px dashed var(--border); }
.z-tg-col { position: relative; border-inline-start: 1px solid var(--border); min-width: 0; }
.z-tg-cell { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; border: 0; border-bottom: 1px dashed var(--border); font: inherit; font-size: 12.5px; padding: 0; background: transparent; }
.z-tg-cell.is-free { color: var(--ok); cursor: pointer; font-weight: 700; }
.z-tg-cell.is-free:hover { background: var(--ok-50); }
.z-tg-cell.is-free.is-static { cursor: default; }
.z-tg-cell.is-free.is-static:hover { background: transparent; }
.z-tg-cell.is-past { background: repeating-linear-gradient(135deg, #f7f8fb, #f7f8fb 6px, #eff1f5 6px, #eff1f5 12px); }
.z-tg-cell.is-off { color: var(--warn); font-size: 11.5px; background: repeating-linear-gradient(135deg, #fff8ea, #fff8ea 6px, #fdf2dd 6px, #fdf2dd 12px); }
.z-tg-now { position: absolute; inset-inline: 0; height: 0; border-top: 2px solid var(--danger); z-index: 2; pointer-events: none; }
.z-tg-now::before { content: ""; position: absolute; inset-inline-end: -1px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.z-tg-appt { position: absolute; inset-inline-start: 3px; width: calc(100% - 6px); z-index: 1; display: flex; flex-direction: column; gap: 1px; text-align: start; overflow: hidden; padding: 4px 8px; border-radius: 9px; border: 1px solid; border-inline-start-width: 4px; font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgba(16, 24, 47, .08); line-height: 1.3; }
.z-tg-appt:hover { filter: brightness(.97); z-index: 3; }
.z-tg-appt-top { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; }
.z-tg-appt-name { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-tg-appt-svc, .z-tg-appt-time { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-tg-appt.is-booked { background: var(--brand-50); border-color: #c9d2ea; border-inline-start-color: var(--brand); color: var(--brand-700); }
.z-tg-appt.is-arrived { background: #fff4d6; border-color: #f2dc9b; border-inline-start-color: #d99a00; color: #6b4b00; }
.z-tg-appt.is-noshow { background: var(--danger-50); border-color: #f3c2bd; border-inline-start-color: var(--danger); color: #8a2c22; }
.z-tg-appt.is-current { box-shadow: 0 0 0 2px var(--danger), 0 2px 6px rgba(178, 58, 39, .3); }
.z-tg-appt.is-dim { opacity: .3; }
.z-tg-appt.is-hit { box-shadow: 0 0 0 2px #f59e0b, 0 2px 8px rgba(245, 158, 11, .35); }
.z-tg-badge { margin-inline-start: auto; font-size: 10.5px; padding: 0 6px; border-radius: 999px; background: #fff; border: 1px solid currentColor; }
.z-tg-badge.is-now { background: var(--danger); color: #fff; border-color: var(--danger); }
.z-tg-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.z-tg-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; border: 1px solid #c5ccd6; }
.z-tg-sw.is-free { background: #fff; border-color: var(--ok); }
.z-tg-sw.is-booked { background: #c9d2ea; }
.z-tg-sw.is-arrived { background: #f2dc9b; }
.z-tg-sw.is-noshow { background: #f3c2bd; }
.z-tg-sw.is-off { background: #fdf2dd; }
.z-tg-docs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; scrollbar-width: none; }
.z-tg-doc { flex: none; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13.5px; cursor: pointer; }
.z-tg-doc.on { background: var(--brand); color: #fff; border-color: transparent; font-weight: 700; }
.z-ap-results { border: 1px solid #f2dc9b; background: #fffaf0; border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.z-ap-results button { display: flex; width: 100%; gap: 10px; align-items: center; justify-content: space-between; border: 0; background: transparent; font: inherit; padding: 6px 4px; cursor: pointer; border-radius: 8px; text-align: start; flex-wrap: wrap; }
.z-ap-results button:hover { background: #fff1d1; }

/* كل مواعيد اليوم */
.z-tl-title { font-weight: 800; font-size: 16px; margin-bottom: 10px; }
.z-cal-body .z-timeline { display: flex; flex-direction: column; gap: 10px; height: auto; overflow: visible; background: none; border: 0; border-radius: 0; }
.z-tl-row { display: flex; gap: 12px; align-items: stretch; }
.z-tl-time { width: 64px; flex: none; padding-top: 14px; font-size: 14px; color: var(--text-2); font-weight: 700; text-align: center; }
.z-tl-card { flex: 1; min-width: 0; border-radius: var(--radius); padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-inline-start: 4px solid var(--brand); display: flex; align-items: center; gap: 10px; }
.z-tl-card.st-attended { border-inline-start-color: #d99a00; }
.z-tl-card.st-no_show { border-inline-start-color: var(--gray); }
.z-tl-card.st-cancelled { border-inline-start-color: var(--danger); }
.z-tl-card.st-cancelled .z-tl-info strong { text-decoration: line-through; }
.z-tl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.z-tl-info strong { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-tl-info span { font-size: 13.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-tl-count { display: inline-flex; align-items: center; gap: 4px; flex: none; white-space: nowrap; font-size: 13px; color: var(--text-3); }

/* نافذة تفاصيل الموعد: صفوف الإجراءات */
.z-ad-foot { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.z-ad-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }

/* معالج الحجز */
.z-wz .z-field { margin-bottom: 14px; }
.z-wz-steps { display: flex; align-items: center; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.z-wz-dot { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 14.5px; }
.z-wz-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-50); color: var(--text-2); font-size: 13.5px; font-weight: 800; flex: none; }
.z-wz-dot.active { color: var(--text); font-weight: 700; }
.z-wz-dot.active .z-wz-n { background: var(--brand); color: #fff; }
.z-wz-dot.done .z-wz-n { background: var(--ok); color: #fff; }
.z-wz-sep { width: 18px; height: 2px; background: var(--border); border-radius: 2px; }
.z-wz-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: thin; }
.z-wz-tab { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.z-wz-tab .z-num { font-size: 12.5px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); }
.z-wz-tab:hover { border-color: var(--brand); }
.z-wz-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.z-wz-tab.active .z-num { background: rgba(255, 255, 255, .2); }
.z-wz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.z-wz-choice { width: 100%; text-align: start; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); display: flex; gap: 12px; align-items: center; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s; }
.z-wz-choice:hover { border-color: var(--brand-100); }
.z-wz-choice.selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.z-wz-choice strong { display: block; font-size: 15.5px; color: var(--text); }
.z-wz-choice span span { font-size: 13.5px; color: var(--text-3); }
.z-wz-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); flex: none; }
.z-wz-price { margin-inline-start: auto; font-weight: 800; color: var(--brand-700); flex: none; }
.z-wz-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 8px; }
.z-wz-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font: inherit; cursor: pointer; }
.z-wz-day strong { font-size: 14.5px; }
.z-wz-day span { font-size: 12.5px; color: var(--text-3); }
.z-wz-day small { font-size: 12px; color: var(--ok); font-weight: 700; }
.z-wz-day:hover { border-color: var(--brand-100); }
.z-wz-day.selected { border-color: var(--brand); background: var(--brand); color: #fff; }
.z-wz-day.selected span, .z-wz-day.selected small { color: #fff; }
.z-wz-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.z-wz-slot { height: 46px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.z-wz-slot:hover { border-color: var(--brand-100); }
.z-wz-slot.selected { border-color: var(--brand); background: var(--brand); color: #fff; }
.z-wz-slot.is-taken { background: var(--surface-2); color: var(--text-3); border-style: dashed; cursor: not-allowed; text-decoration: line-through; }
.z-wz-daybox { margin-top: 4px; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.z-wz-daybox-h { font-weight: 800; margin-bottom: 8px; }
.z-wz-kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 14px; flex-wrap: wrap; }
.z-wz-review { display: flex; flex-direction: column; margin: 0; }
.z-wz-review > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.z-wz-review > div:last-child { border-bottom: 0; }
.z-wz-review dt { color: var(--text-3); }
.z-wz-review dd { margin: 0; font-weight: 700; text-align: end; }
.z-wz-success { text-align: center; }
.z-wz-success .mark { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 4px auto 12px; background: var(--ok-50); color: var(--ok); }
.z-wz-success h2 { margin: 0 0 14px; font-size: 20px; }
.z-wz-success .z-wz-review { text-align: start; max-width: 520px; margin: 0 auto; }
.z-wz-foot { display: flex; gap: 10px; align-items: center; padding-top: 16px; margin-top: 8px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.z-btn.is-soft-disabled { opacity: .55; }

@media (max-width: 720px) {
  .z-fbar { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 10px; }
  .z-cal-head { padding: 12px 14px; }
  .z-cal-body { padding: 14px; }
  .z-date-nav strong { min-width: 0; flex: 1; }
  .z-tg-scroll { max-height: none; }
  .z-tg-head strong { font-size: 13.5px; }
  .z-tl-row { gap: 8px; }
  .z-tl-time { width: 50px; font-size: 13px; }
  .z-tl-card { flex-wrap: wrap; }
  .z-tl-info { flex-basis: 100%; }
  .z-wz-grid { grid-template-columns: minmax(0, 1fr); }
  .z-wz-label { display: none; }
  .z-wz-dot.active .z-wz-label { display: inline; }
}
.z-tg-appt.is-tiny { justify-content: center; padding-block: 2px; }
.z-tg-appt-line { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12.5px; }
.z-tg-appt-line strong { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-tg-appt-line .z-num { flex: none; font-size: 11.5px; }
.z-tg-appt.is-small { justify-content: center; gap: 2px; }
.z-tg-appt-sub { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- صفحة الدفع عند تأكيد الحضور (Checkout) ---------- */
.z-co-amount { background: var(--brand); color: #fff; border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.z-co-amount small { opacity: .9; font-size: 13px; }
.z-co-amount b { font-size: 32px; font-weight: 800; }
.z-co-amount span { font-size: 13px; color: #dfe6f7; }
.z-co-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.z-co-m { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); font: inherit; color: var(--text); cursor: pointer; text-align: start; }
.z-co-m:hover { border-color: var(--brand); }
.z-co-m.on { border-color: var(--brand); background: var(--brand-soft, #e8ecf7); box-shadow: 0 0 0 2px var(--brand) inset; }
.z-co-ic { font-size: 20px; }
.z-co-m b { font-size: 14px; }
@media (max-width: 720px) { .z-co-methods { grid-template-columns: 1fr 1fr; } }

/* شرح كل مربع في شاشة الصلاحيات */
.z-perm .z-perm-cell { vertical-align: top; }
.z-perm .z-perm-what { font-size: 11.5px; color: var(--text-2); line-height: 1.4; margin-top: 4px; max-width: 150px; margin-inline: auto; }

/* ---------- الرئيسية (بنفس ترتيب «التميز») ---------- */
.z-home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.z-home-head h2 { margin: 0; font-size: 22px; }
.z-home-head p { margin: 4px 0 0; color: var(--text-2); font-size: 13.5px; }
.z-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.z-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; font: inherit; color: var(--text); text-align: start; box-shadow: 0 1px 2px rgba(16, 24, 47, .04); }
.z-tile:disabled { cursor: default; color: var(--text); }
.z-tile.is-link { cursor: pointer; transition: border-color .15s, transform .15s; }
.z-tile.is-link:hover { border-color: var(--brand); transform: translateY(-1px); }
.z-tile-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 6px; background: var(--surface-2); color: var(--brand); }
.z-tile-ic.tone-ok { background: #e6f4ee; color: var(--ok); }
.z-tile-ic.tone-warn { background: #fbf1e1; color: var(--warn); }
.z-tile-ic.tone-danger { background: #fbe9e6; color: var(--danger); }
.z-tile-ic.tone-gray { background: var(--surface-2); color: var(--gray); }
.z-tile b { font-size: 22px; font-weight: 800; line-height: 1.2; }
.z-tile small { color: var(--text-2); font-size: 13px; }
.z-tile em { font-style: normal; color: var(--text-3); font-size: 12px; }
.z-home-banner { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; margin-bottom: 14px; border: 1px solid #f0d9ae; background: #fdf6e7; color: var(--warn); border-radius: 12px; font: inherit; cursor: pointer; text-align: start; }
.z-home-banner-go { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--text); white-space: nowrap; }
.z-home-date, .z-home-doc { width: auto; height: 32px; padding: 0 8px; font-size: 13px; }
.z-home-doc { max-width: 170px; }
.z-home-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.z-home-filters > button[type=button]:not([class*=z-btn]) { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; }
.z-home-filters > button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.z-home-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.z-latest-act { margin-top: 14px; }
.z-latest-act > * { width: 100%; justify-content: center; }
@media (max-width: 720px) {
  .z-tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .z-tile { padding: 12px; }
  .z-tile b { font-size: 18px; }
  .z-home-head > button { width: 100%; justify-content: center; }
}
