/* ===== Krown — global UI (Cairo font, RTL, AdminLTE 4 tweaks) ===== */
:root {
  /* brand «نبيتي» (Ahmed 2026-10-08, docs/BRAND.md): wine + wine-2 + gold accent + ivory page + white paper + ink.
     The old --dx-navy/--dx-blue/--av-green names are kept as aliases so every view keeps working. */
  --k-wine: #2A1745; --k-wine-2: #5B3FD6; --k-wine-deep: #1B0E2E; --k-wine-700: #3A2466; --k-wine-900: #21123A;
  --k-gold: #9B82FF; --k-gold-2: #E2C27A; --k-gold-ink: #4A32B8; --k-gold-soft: #EFEAFD;
  --k-ivory: #F6F4FB; --k-paper: #FFFFFF; --k-ink: #1C1A22; --k-muted: #5C5560; --k-line: #E2DCF0; --k-tint: #E9E3FF; --k-tint-soft: #F3F0FC;
  --dx-ink: var(--k-wine-deep); --dx-navy: var(--k-wine); --dx-navy-2: var(--k-wine-700); --dx-blue: var(--k-wine-2); --dx-blue-dark: var(--k-wine-700); --dx-blue-deep: var(--k-wine-2); --dx-cyan: var(--k-gold); --dx-silver: #EFE6D8; --dx-blue-soft: var(--k-tint-soft);
  --av-green: var(--k-wine); --av-green-dark: var(--k-wine-2); --av-green-light: var(--k-tint-soft); --av-gold: var(--k-gold); --dx-teal: var(--k-wine); --dx-sky: var(--k-gold);
  --bs-font-sans-serif: 'Cairo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-color: var(--k-ink); --bs-body-color-rgb: 28,26,34; --bs-secondary-color: rgba(28,26,34,.72); --bs-emphasis-color: var(--k-ink);
  --bs-tertiary-bg: var(--k-ivory); --bs-tertiary-bg-rgb: 251,246,238; --bs-border-color: #E4DCD0;
  --bs-success: var(--av-green); --bs-success-rgb: 74,20,38; --bs-primary: #2A1745; --bs-primary-rgb: 74,20,38;
  --bs-link-color: #5B3FD6; --bs-link-color-rgb: 122,46,69; --bs-link-hover-color: #2A1745; --bs-link-hover-color-rgb: 74,20,38;
  --bs-focus-ring-color: rgba(155,130,255,.45);
}
html, body { font-family: 'Cairo', system-ui, sans-serif; }
body { font-size: .95rem; background-color: var(--k-ivory); color: var(--k-ink); }
.app-wrapper, .app-main { background-color: var(--k-ivory); }
h1,h2,h3,h4,h5,h6 { font-family: 'Cairo', sans-serif; }
.btn-success, .bg-success, .text-bg-success { background-color: var(--av-green) !important; border-color: var(--av-green) !important; }
.btn-success:hover { background-color: var(--av-green-dark) !important; border-color: var(--av-green-dark) !important; }
.btn-outline-success { color: var(--av-green); border-color: var(--av-green); }
.btn-outline-success:hover { background: var(--av-green); border-color: var(--av-green); color:#fff; }
.text-success { color: var(--av-green) !important; }
a { color: var(--k-wine-2); } a:hover { color: var(--k-wine); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--k-gold); box-shadow: 0 0 0 .2rem rgba(155,130,255,.3); }
.btn:focus-visible, a:focus-visible, .nav-link:focus-visible, .page-link:focus { outline: 2px solid var(--k-gold); outline-offset: 2px; box-shadow: none; }
.form-check-input:checked { background-color: var(--k-wine); border-color: var(--k-wine); }
.page-item.active .page-link { background: var(--av-green); border-color: var(--av-green); }
.nav-pills .nav-link.active { background: var(--av-green); }

/* sidebar — wine with ivory text, gold active edge */
.app-sidebar { background: radial-gradient(420px 260px at 100% 0%, rgba(155,130,255,.10) 0%, transparent 70%), linear-gradient(180deg, #21123A 0%, #2A1745 55%, #2a1745 100%) !important; }
.app-sidebar .sidebar-brand { border-bottom: 1px solid rgba(155,130,255,.22); height: auto; min-height: 3.5rem; padding: .35rem 0; }
.app-sidebar .sidebar-brand .brand-link { display:flex; align-items:center; justify-content:center; gap:.4rem; padding: .25rem .75rem; }
.app-sidebar .brand-image { width: 34px; height: 34px; }
.app-sidebar .brand-logo { height: 34px; width: auto; max-width: 190px; object-fit: contain; float: none !important; margin: 0 !important; box-shadow: none !important; }
.app-sidebar .brand-mark { display: none; height: 32px; width: 32px; float: none !important; margin: 0 !important; box-shadow: none !important; }
.sidebar-mini.sidebar-collapse .app-sidebar:not(:hover) .brand-logo { display: none; }
.sidebar-mini.sidebar-collapse .app-sidebar:not(:hover) .brand-mark { display: block; }
.app-sidebar .nav-header { color: #D9BE86; font-size: .72rem; letter-spacing: .5px; margin-top: .4rem; }
.app-sidebar .sidebar-menu > .nav-item > .nav-link.active, .app-sidebar .nav-treeview > .nav-item > .nav-link.active { background: rgba(246,244,251,.12) !important; color: #FFFFFF !important; box-shadow: inset -3px 0 0 var(--k-gold); }
.app-sidebar .nav-link { color: #F3EADC; }
.app-sidebar .nav-link:hover { background: rgba(246,244,251,.07); color: #fff; }
.app-sidebar .nav-link .nav-icon { color: #E2C27A; }
.app-sidebar .nav-link.active .nav-icon { color: var(--k-gold-2); }
.app-sidebar .nav-arrow { transition: transform .2s; }
.app-sidebar .nav-badge, .app-sidebar .badge { box-shadow: 0 0 0 1px rgba(0,0,0,.1); }

/* header */
.app-header { background: var(--k-paper); border-bottom: 1px solid var(--k-line); box-shadow: inset 0 2px 0 var(--k-gold); }
.app-header .navbar-nav > .nav-item > .nav-link.fw-semibold { color: var(--dx-navy); }
.avatar-circle { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:50%; background: var(--av-green); color:#fff; font-weight:700; }
.avatar-circle.avatar-lg { width:64px; height:64px; font-size:1.6rem; margin-bottom:.5rem; background:#fff; color: var(--av-green); }
.navbar-badge { position:absolute; top:6px; right:4px; font-size:.6rem; padding:2px 4px; }
.notif-list { max-height: 320px; overflow-y:auto; }
.notif-list .dropdown-item { white-space: normal; }
.user-menu .user-header { padding: 1rem; text-align:center; }
.user-menu .user-header p { margin: 0; font-weight: 600; } .user-menu .user-header small { display:block; font-weight:400; opacity:.85; }
.user-menu .user-footer { padding: .75rem; background: #f8f9fa; }
.dropdown-menu-lg { min-width: 300px; }

/* cards & tables */
.card { border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04); border-radius: .75rem; }
.card-header { background: #fff; border-bottom: 1px solid #F2F0ED; font-weight: 700; }
.card-outline.card-success { border-top: 3px solid var(--av-green); }
.table > :not(caption) > * > * { padding: .6rem .75rem; vertical-align: middle; }
.table thead th { white-space: nowrap; background: #F1EDFB; font-weight: 700; color:#2A1745; border-bottom: 2px solid #DED6FF; }
.table-hover tbody tr:hover { background: #F8F6FE; }
.table a.row-link { color: inherit; font-weight: 600; } .table a.row-link:hover { color: var(--av-green); }
.small-box { border-radius: .75rem; }
.small-box .inner h3 { font-weight: 800; }
/* KPI cards (2026-10-08 «نبيتي»): white paper card, accent top edge + tinted icon chip per family */
.kpi-card { --kc: #2A1745; --kt: #E9E3FF; border-radius: .85rem; color: var(--k-ink); background: var(--k-paper); padding: 1rem 1.25rem; padding-inline-end: 4.6rem; position:relative; overflow:hidden; min-height: 110px;
  border: 1px solid var(--k-line); box-shadow: 0 1px 2px rgba(27,14,46,.05), 0 6px 18px -12px rgba(27,14,46,.25); }
.kpi-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--kc); }
.kpi-card .kpi-value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; color: var(--kc); }
.kpi-card .kpi-label { opacity: 1; color: var(--k-ink); font-weight: 700; }
.kpi-card .opacity-75 { color: var(--k-muted); opacity: 1 !important; }
.kpi-card .kpi-icon { position:absolute; inset-inline-end: 1rem; top: 1rem; width: 2.75rem; height: 2.75rem; border-radius: .8rem; display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; opacity: 1; color: var(--kc); background: var(--kt); }
.kpi-card a { color: inherit; text-decoration: none; }
.bg-kpi-green  { --kc: #2A1745; --kt: #E9E3FF; }   /* wine — money in */
.bg-kpi-blue   { --kc: #5B3FD6; --kt: #EBE5FB; }   /* wine-2 — appointments */
.bg-kpi-teal   { --kc: #4A32B8; --kt: #EFEAFD; }   /* gold ink — totals */
.bg-kpi-purple { --kc: #5B3A78; --kt: #EFE7F5; }   /* plum — new patients */
.bg-kpi-orange { --kc: #9A4A12; --kt: #FBEBDD; }   /* copper — expenses / warning */
.bg-kpi-red    { --kc: #A3262E; --kt: #FBE6E7; }   /* danger */

/* forms */
label.required::after, .required > label::after { content: ' *'; color: #dc3545; }
.form-label { font-weight: 600; margin-bottom: .25rem; }
.form-text { font-size: .8rem; }
.num, .phone, input[type=number], input[type=tel], .ltr { direction: ltr; text-align: left; font-variant-numeric: tabular-nums; }
.money { font-variant-numeric: tabular-nums; direction: ltr; display:inline-block; }
.was-validated .form-control:invalid, .form-control.is-invalid { background-image: none; }
.filter-bar .form-control, .filter-bar .form-select { width: auto; flex: 1 1 150px; max-width: 100%; }
.filter-bar input[name=q] { flex: 2 1 240px; }
.filter-bar input[type=date] { flex: 0 1 160px; }
.filter-bar .btn { flex: 0 0 auto; }
@media (max-width: 575.98px) { .filter-bar .form-control, .filter-bar .form-select { flex-basis: 100%; } }
.toolbar { display:flex; gap:.5rem; flex-wrap:wrap; align-items:center; }

/* badges for statuses */
.badge { font-weight: 600; padding: .4em .65em; }
.badge-status { border-radius: 999px; }

/* timeline */
.av-timeline { position: relative; padding-right: 1.5rem; }
.av-timeline::before { content:''; position:absolute; right: .45rem; top:0; bottom:0; width:2px; background:#E3DCF5; }
.av-timeline .tl-item { position: relative; margin-bottom: 1rem; }
.av-timeline .tl-item::before { content:''; position:absolute; right: -1.35rem; top:.35rem; width: .8rem; height:.8rem; border-radius:50%; background: var(--av-green); border: 2px solid #fff; box-shadow: 0 0 0 2px #E3DCF5; }

/* auth */
.auth-page { min-height: 100vh; background: radial-gradient(900px 520px at 85% -10%, rgba(91,63,214,.45) 0%, transparent 60%), radial-gradient(700px 420px at 0% 110%, rgba(155,130,255,.18) 0%, transparent 60%), linear-gradient(165deg, #120A20 0%, #1B0E2E 40%, #2A1745 100%); display:flex; align-items:center; justify-content:center; padding: 1.5rem 1rem; }
.auth-wrap { width: 100%; max-width: 440px; }
/* sign-in opened from DentX: the «back to DentX» bar is a flex child of body — stack it full width above the card (it sat beside the card and pushed the page wider than the phone, owner 2026-11-11) */
.auth-page { flex-direction: column; }
.auth-page > .kr-dentx-back { align-self: stretch; margin: -1.5rem -1rem 1rem; }
.auth-brand { text-decoration:none; color:#fff; display:inline-block; }
.auth-brand-name { font-size: 1.8rem; font-weight: 800; letter-spacing: .5px; margin-top:.25rem; }
.auth-brand-sub { opacity: .85; font-size: .95rem; }
.auth-logo { display:block; width: 240px; max-width: 70vw; height: auto; margin: 0 auto .5rem; }
.auth-tagline { color: #C9BBFF; font-family: 'Manrope', 'Segoe UI', sans-serif; font-weight: 500; font-size: .8rem; letter-spacing: .01em; margin-top: .35rem; white-space: nowrap; }
.auth-slogan { color: #9B82FF; font-size: .82rem; letter-spacing: .4px; direction: ltr; opacity: .9; }
.auth-card { border-radius: 1rem; }
.auth-card .form-control { font-size: 1.05rem; padding: .7rem .9rem; }
.auth-card .btn-lg { padding: .7rem; font-weight: 700; }
.otp-input { letter-spacing: .6rem; font-size: 1.6rem !important; text-align: center !important; font-weight: 700; }

/* misc */
.cursor-pointer { cursor: pointer; }
.text-truncate-2 { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient: vertical; overflow:hidden; }
.sticky-actions { position: sticky; bottom: 0; background: #fff; padding: .75rem 0; border-top: 1px solid #eee; z-index: 5; }
@media (max-width: 575.98px) { .app-content-header h3 { font-size: 1.2rem; } .breadcrumb { font-size: .8rem; } .table-responsive { font-size: .88rem; } }
@media print { .app-sidebar, .app-header, .app-footer, .app-content-header, .d-print-none, .toolbar, .filter-bar, .pagination { display:none !important; } .app-main { margin: 0 !important; } .card { box-shadow:none; border:1px solid #ddd; } }
.min-w-0 { min-width: 0 !important; }
.app-content .badge { max-width: 100%; white-space: normal; text-align: start; }
.app-main { overflow-x: clip; }
/* the off-canvas sidebar sits past the right edge in RTL; without this Android Chrome lets the page pan sideways */
html, body { overflow-x: clip; }

/* brand: primary buttons wine (hover wine-2), badges wine-2 */
.btn-primary { --bs-btn-bg: #2A1745; --bs-btn-border-color: #2A1745; --bs-btn-hover-bg: #5B3FD6; --bs-btn-hover-border-color: #5B3FD6; --bs-btn-active-bg: #21123A; --bs-btn-active-border-color: #21123A; --bs-btn-disabled-bg: #2A1745; --bs-btn-disabled-border-color: #2A1745; --bs-btn-focus-shadow-rgb: 200,155,60; }
.btn-outline-primary { --bs-btn-color: #2A1745; --bs-btn-border-color: #5B3FD6; --bs-btn-hover-bg: #2A1745; --bs-btn-hover-border-color: #2A1745; --bs-btn-active-bg: #21123A; --bs-btn-active-border-color: #21123A; --bs-btn-focus-shadow-rgb: 200,155,60; }
.text-bg-primary, .bg-primary { background-color: #5B3FD6 !important; }
.text-primary { color: #2A1745 !important; }
.user-menu .user-header.text-bg-success { background: linear-gradient(135deg, #1B0E2E, #2A1745 55%, #3A2466) !important; color: #fff !important; }
.app-footer .dx-foot-brand { color: var(--dx-navy); }
.app-footer { background: var(--k-paper); border-top: 1px solid var(--k-line); }
.app-footer .dx-foot-slogan { color: #6A6470; font-family: 'Manrope', 'Segoe UI', sans-serif; font-weight: 500; direction: ltr; unicode-bidi: isolate; }

/* ---- brand: no green anywhere — Bootstrap/AdminLTE "success" family mapped to Krown wine (2026-10-08 «نبيتي») ---- */
:root, [data-bs-theme=light] {
  --bs-success: #2A1745; --bs-success-rgb: 74,20,38;
  --bs-success-text-emphasis: #21123A; --bs-success-bg-subtle: #E9E3FF; --bs-success-border-subtle: #D6CCFF;
  --bs-form-valid-color: #2A1745; --bs-form-valid-border-color: #2A1745;
}
.btn-success { --bs-btn-bg:#2A1745; --bs-btn-border-color:#2A1745; --bs-btn-hover-bg:#5B3FD6; --bs-btn-hover-border-color:#5B3FD6; --bs-btn-active-bg:#21123A; --bs-btn-active-border-color:#21123A; --bs-btn-disabled-bg:#2A1745; --bs-btn-disabled-border-color:#2A1745; --bs-btn-focus-shadow-rgb:200,155,60; }
.btn-outline-success { --bs-btn-color:#2A1745; --bs-btn-border-color:#2A1745; --bs-btn-hover-bg:#2A1745; --bs-btn-hover-border-color:#2A1745; --bs-btn-active-bg:#5B3FD6; --bs-btn-active-border-color:#5B3FD6; --bs-btn-focus-shadow-rgb:200,155,60; }
.alert-success { --bs-alert-color:#21123A; --bs-alert-bg:#E9E3FF; --bs-alert-border-color:#D6CCFF; --bs-alert-link-color:#1B0E2E; }
.table-success { --bs-table-bg:#E9E3FF; --bs-table-border-color:#D6CCFF; --bs-table-color:#2A1745; }
.list-group-item-success { --bs-list-group-color:#21123A; --bs-list-group-bg:#E9E3FF; --bs-list-group-border-color:#D6CCFF; }
.border-success { border-color: #2A1745 !important; }
.bg-success-subtle { background-color: #E9E3FF !important; }
.text-success-emphasis { color: #21123A !important; }
.progress-bar.bg-success, .progress-bar-success { background-color: #9B82FF !important; }
.form-control.is-valid, .was-validated .form-control:valid, .form-select.is-valid, .was-validated .form-select:valid { border-color: #2A1745; }
.form-check-input.is-valid:checked, .was-validated .form-check-input:valid:checked { background-color: #2A1745; border-color:#2A1745; }
.valid-feedback { color: #2A1745; }
.toast.text-bg-success { background-color: #2A1745 !important; }

/* ---- header brand logo (2026-09-29): visible whenever the sidebar (and its logo) is not — phones/tablets, or desktop with the sidebar collapsed ---- */
.app-header .dx-hdr-brand { display: none; }
.app-header .dx-hdr-logo { height: 26px; width: auto; max-width: 140px; object-fit: contain; display: block; }
@media (max-width: 991.98px) { .app-header .dx-hdr-brand { display: flex; align-items: center; } }
@media (min-width: 992px) { .sidebar-collapse .app-header .dx-hdr-brand { display: flex; align-items: center; } }
@media (max-width: 380px) { .app-header .dx-hdr-logo { height: 22px; } }
@media print { .app-header .dx-hdr-brand { display: none !important; } }

/* ---- first-run onboarding (public/js/onboarding.js · views/partials/onboarding.ejs) — installed app only, 2026-09-29 ---- */
html.dx-onb-open, html.dx-onb-open body { overflow: hidden !important; }
html.dx-onb-open body { background: #1B0E2E; }
#dxOnb { position: fixed; inset: 0; z-index: 2147482000; display: flex; flex-direction: column; direction: rtl; color: #fff; font-family: Cairo, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(620px 420px at 88% -6%, rgba(91,63,214,.40) 0%, transparent 62%), radial-gradient(520px 380px at 4% 106%, rgba(155,130,255,.20) 0%, transparent 60%), linear-gradient(165deg, #120A20 0%, #1B0E2E 42%, #2A1745 100%);
  padding: max(14px, var(--dx-sat, env(safe-area-inset-top, 0px))) 0 max(18px, var(--dx-sab, env(safe-area-inset-bottom, 0px))); transition: opacity .35s ease; }
#dxOnb.dx-out { opacity: 0; pointer-events: none; }
#dxOnb * { box-sizing: border-box; }
#dxOnb .o-top { display: flex; align-items: center; justify-content: space-between; padding: 0 18px; min-height: 44px; }
#dxOnb .o-logo { height: 42px; width: auto; filter: drop-shadow(0 6px 18px rgba(91,63,214,.3)); }
#dxOnb .o-skip[hidden] { display: inline-block !important; visibility: hidden; }
#dxOnb .o-skip { background: rgba(255,255,255,.07); border: 1px solid rgba(231,227,239,.22); color: #E6D7C9; font: 700 .88rem Cairo, system-ui, sans-serif; border-radius: 999px; padding: 6px 16px; cursor: pointer; }
#dxOnb .o-track { flex: 1 1 auto; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
#dxOnb .o-track::-webkit-scrollbar { display: none; }
#dxOnb .o-slide { flex: 0 0 100%; width: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px 28px; }
#dxOnb .o-art { width: min(330px, 84vw); height: auto; aspect-ratio: 320 / 260; display: block; margin: 0 auto 18px; animation: dxOnbFloat 5s ease-in-out infinite; }
#dxOnb .o-kick { display: inline-block; color: #9B82FF; font-size: .8rem; font-weight: 700; letter-spacing: .02em; background: rgba(155,130,255,.1); border: 1px solid rgba(155,130,255,.25); border-radius: 999px; padding: 2px 12px; margin-bottom: 10px; }
#dxOnb h2 { font-size: 1.6rem; font-weight: 800; line-height: 1.45; margin: 0 0 10px; color: #fff; max-width: 360px; text-wrap: balance; }
#dxOnb .o-sub { color: #E6D7C9; font-size: 1rem; line-height: 1.9; margin: 0; max-width: 340px; text-wrap: balance; }
#dxOnb .o-foot { padding: 6px 22px 0; width: 100%; max-width: 460px; margin: 0 auto; }
#dxOnb .o-dots { display: flex; justify-content: center; gap: 8px; margin: 4px 0 18px; }
#dxOnb .o-dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,.22); border: 0; padding: 0; transition: width .25s, background .25s; cursor: pointer; }
#dxOnb .o-dot.on { width: 26px; background: linear-gradient(90deg, #5B3FD6, #9B82FF); box-shadow: 0 0 12px rgba(155,130,255,.55); }
#dxOnb .o-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; border: 0; border-radius: 16px; padding: 15px 18px; font: 800 1.12rem Cairo, system-ui, sans-serif; color: #fff; cursor: pointer;
  background: linear-gradient(90deg, #3A2466, #5B3FD6 55%, #9B82FF); box-shadow: 0 12px 30px rgba(91,63,214,.38); }
#dxOnb .o-btn:active { transform: translateY(1px); }
#dxOnb .o-btn[disabled] { opacity: .75; cursor: progress; }
#dxOnb .o-note { color: #B9A79A; font-size: .8rem; text-align: center; margin: 10px 0 0; min-height: 1.3em; }
#dxOnb .o-res { list-style: none; margin: 0 0 12px; padding: 0; background: rgba(255,255,255,.06); border: 1px solid rgba(155,130,255,.16); border-radius: 16px; overflow: hidden; }
#dxOnb .o-res li { display: flex; align-items: center; gap: 10px; padding: 11px 14px; font-weight: 700; font-size: .98rem; border-bottom: 1px solid rgba(255,255,255,.07); }
#dxOnb .o-res li:last-child { border-bottom: 0; }
#dxOnb .o-res .ok { color: #9B82FF; } #dxOnb .o-res .no { color: #ffb4bd; }
#dxOnb .o-res i { font-size: 1.15rem; }
#dxOnb .o-spin { width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: dxOnbSpin .8s linear infinite; }
@keyframes dxOnbSpin { to { transform: rotate(360deg); } }
@keyframes dxOnbFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@media (prefers-reduced-motion: reduce) { #dxOnb .o-art { animation: none; } }
@media (max-height: 640px) { #dxOnb .o-art { width: min(250px, 70vw); margin-bottom: 10px; } #dxOnb h2 { font-size: 1.35rem; } #dxOnb .o-sub { font-size: .92rem; line-height: 1.75; } }
@media (min-width: 768px) { #dxOnb .o-art { width: 360px; } }

/* ---- mobile filters (public/js/mobile-filters.js) — phones only; desktop ≥768px untouched, 2026-09-29 ---- */
@media (max-width: 767.98px) {
  /* compact page title block */
  .app-content-header { padding: .55rem .25rem .35rem !important; }
  .app-content-header h3 { font-size: 1.12rem !important; line-height: 1.5; }
  .app-content-header .breadcrumb { display: none !important; }
  /* status tabs / pill rows: one line, swipe sideways */
  .mf-hscroll { flex-wrap: nowrap !important; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain; max-width: 100%; }
  .mf-hscroll::-webkit-scrollbar { display: none; }
  .mf-hscroll > *, .mf-hscroll .nav-link, .mf-hscroll > .btn { flex: 0 0 auto !important; white-space: nowrap; }
  .btn-group.mf-hscroll { display: flex; }
  /* sticky toolbar */
  .mf-bar-wrap { position: sticky; top: 0; z-index: 1025; margin: -.25rem calc(var(--bs-gutter-x, 1.5rem) * -.5) .6rem; padding: .45rem calc(var(--bs-gutter-x, 1.5rem) * .5); background: var(--bs-tertiary-bg, #f8f9fa); border-bottom: 1px solid transparent; }
  .mf-bar-wrap.mf-stuck { border-bottom-color: #E8E4EF; box-shadow: 0 6px 14px -10px rgba(42,23,69,.35); }
  .mf-bar { display: flex; gap: .45rem; align-items: center; }
  .mf-search { position: relative; flex: 1 1 auto; min-width: 0; margin: 0; }
  .mf-search .bi-search { position: absolute; inset-inline-start: .75rem; top: 50%; transform: translateY(-50%); color: #6A6470; pointer-events: none; font-size: .95rem; }
  .mf-search input { height: 42px; border-radius: 999px; padding-inline-start: 2.2rem; background: #fff; font-size: .95rem; }
  .mf-filter-btn { height: 42px; flex: 0 0 auto; border-radius: 999px; padding: 0 .95rem; background: #fff; border: 1px solid #DAD6DB; color: var(--dx-navy, #2A1745); font-weight: 700; display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
  .mf-filter-btn.has { border-color: #5B3FD6; color: #3A2466; background: #EFEAFD; }
  .mf-filter-btn.wide { flex: 1 1 auto; justify-content: center; }
  .mf-filter-btn:active { transform: translateY(1px); }
  .mf-badge { background: #5B3FD6; color: #fff; font-size: .72rem; min-width: 1.35rem; padding: .25em .45em; }
  .mf-act { height: 42px; min-width: 42px; flex: 0 0 auto; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: 0 .8rem; font-weight: 700; white-space: nowrap; }
  .mf-act i { font-size: 1.1rem; }
  .mf-moved { display: none !important; }
  .mf-chips { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; padding-top: .45rem; -webkit-overflow-scrolling: touch; }
  .mf-chips::-webkit-scrollbar { display: none; }
  .mf-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .25rem; max-width: 78vw; background: #EFEAFD; color: #21123A; border: 1px solid #D6CCFF; border-radius: 999px; padding: .12rem .3rem .12rem .6rem; font-size: .8rem; font-weight: 600; line-height: 1.6; text-decoration: none; }
  .mf-chip-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mf-chip .mf-x { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; color: #21123A; text-decoration: none; font-size: 1rem; }
  .mf-chip .mf-x:active { background: rgba(33,18,58,.12); }
  .mf-chip-clear { background: transparent; border-color: transparent; color: #b3373a; padding: .12rem .5rem; }
  /* the header the form left behind */
  .mf-empty { display: none !important; }
  .mf-rest .toolbar, .mf-rest > .d-flex { gap: .35rem !important; }
  .mf-rest .toolbar .btn, .toolbar.mf-tb .btn { padding: .25rem .6rem; font-size: .85rem; }
  .mf-hide { display: none !important; }
  /* bottom sheet */
  .mf-sheet.offcanvas-bottom { height: auto; max-height: 85vh; border-radius: 1.1rem 1.1rem 0 0; border-top: 0; box-shadow: 0 -10px 30px rgba(27,14,46,.25); }
  .mf-sheet .mf-grab { width: 42px; height: 5px; border-radius: 999px; background: #E3D9CB; margin: .5rem auto 0; flex: 0 0 auto; }
  .mf-sheet .offcanvas-header { padding: .5rem 1rem .4rem; border-bottom: 1px solid #F3F1F8; }
  .mf-sheet .offcanvas-title { font-weight: 800; font-size: 1.05rem; color: var(--dx-navy, #2A1745); }
  .mf-sheet .offcanvas-body { padding: .85rem 1rem 1rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .mf-sheet .mf-foot { display: flex; gap: .5rem; padding: .7rem 1rem max(.7rem, var(--dx-sab, env(safe-area-inset-bottom, 0px))); border-top: 1px solid #F3F1F8; background: #fff; flex: 0 0 auto; }
  .mf-sheet .mf-foot .btn { flex: 1 1 0; height: 46px; border-radius: .8rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }
  .mf-sheet .mf-foot .mf-apply { flex-grow: 1.6; }
  /* the original form inside the sheet: one control per line */
  .mf-sheet form.mf-in-sheet { display: flex !important; flex-direction: column; flex-wrap: nowrap !important; gap: .6rem !important; margin: 0; }
  .mf-sheet form.mf-in-sheet.row { flex-direction: row; flex-wrap: wrap !important; gap: 0 !important; row-gap: .6rem !important; }
  .mf-sheet form.mf-in-sheet .input-group { flex-wrap: nowrap; }
  .mf-sheet form.mf-in-sheet .input-group > .form-control { flex: 1 1 0 !important; width: auto !important; }
  .mf-sheet form.mf-in-sheet > .form-control, .mf-sheet form.mf-in-sheet > .form-select, .mf-sheet form.mf-in-sheet > .input-group, .mf-sheet form.mf-in-sheet > div:not(.form-check):not([class*=col]) { width: 100% !important; max-width: none !important; min-width: 0 !important; flex: 0 0 auto !important; }
  .mf-sheet form.mf-in-sheet .form-control, .mf-sheet form.mf-in-sheet .form-select { max-width: none !important; min-height: 44px; font-size: 1rem; }
  .mf-sheet form.mf-in-sheet .input-group > .form-control { min-width: 0 !important; }
  .mf-sheet form.mf-in-sheet > .form-check { align-self: flex-start !important; padding-block: .25rem; }
  .mf-sheet form.mf-in-sheet [data-near-me] { min-height: 44px; }
  .mf-sheet form.mf-in-sheet [data-near-me] .d-none { display: inline !important; }
  .mf-sheet form.mf-in-sheet > .btn { width: 100%; }
  .mf-sheet form.mf-in-sheet > label, .mf-sheet form.mf-in-sheet > span { margin-bottom: -.35rem; }
}
@media print { .mf-bar-wrap, .mf-sheet { display: none !important; } }
@media (max-width: 767.98px) {
  /* KPI tiles: half the height on phones so the list shows sooner */
  .kpi-card { min-height: 0; padding: .7rem .8rem .6rem; }
  .kpi-card .kpi-value { font-size: 1.3rem; }
  .kpi-card .kpi-label { font-size: .82rem; line-height: 1.5; }
  .kpi-card .kpi-icon { display: none; }
  .mf-sheet .mf-lbl { color: #6A6470; margin-bottom: -.4rem !important; }
}

/* ===== bottom nav — phone/tablet app bar (views/partials/bottom_nav.ejs · public/js/bottom-nav.js) ===== */
.dx-bnav { display: none; }
@media (max-width: 991.98px) {
  :root { --dx-bn-h: 64px; --dx-bn-safe: var(--dx-sab, env(safe-area-inset-bottom, 0px)); --dx-bn-total: calc(var(--dx-bn-h) + var(--dx-bn-safe)); }
  .dx-bnav { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1034; direction: rtl;
    padding-bottom: var(--dx-bn-safe);
    background: linear-gradient(180deg, rgba(58,36,102,.86) 0%, rgba(27,14,46,.94) 100%);
    -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
    box-shadow: 0 -10px 30px -12px rgba(27,14,46,.55);
    transform: translateY(0); transition: transform .32s cubic-bezier(.22,.8,.24,1), opacity .2s ease; will-change: transform; }
  .dx-bnav::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 1px; pointer-events: none;
    background: linear-gradient(90deg, rgba(155,130,255,0) 0%, rgba(155,130,255,.55) 22%, rgba(214,204,255,.9) 50%, rgba(155,130,255,.55) 78%, rgba(155,130,255,0) 100%); }
  .dx-bnav-in { display: flex; align-items: stretch; height: var(--dx-bn-h); max-width: 640px; margin: 0 auto; padding: 0 4px; }
  .dx-bn-item { flex: 1 1 0; min-width: 44px; min-height: 44px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border: 0; background: none; padding: 6px 2px 5px; margin: 0; color: rgba(231,227,239,.62); text-decoration: none; font-family: inherit;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: color .2s ease; }
  .dx-bn-item:hover, .dx-bn-item:focus { color: rgba(244,242,249,.9); text-decoration: none; }
  .dx-bn-item:focus-visible { outline: 2px solid rgba(155,130,255,.7); outline-offset: -4px; border-radius: 14px; }
  .dx-bn-ic { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 30px; border-radius: 999px; transition: transform .18s ease, background-color .25s ease; }
  .dx-bn-ic .bi { font-size: 1.32rem; line-height: 1; }
  .dx-bn-lbl { font-size: 11.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; letter-spacing: 0; }
  /* active: electric blue + tinted pill behind the icon + glowing dash on top */
  .dx-bn-item.is-active { color: #9B82FF; }
  .dx-bn-item.is-active .dx-bn-lbl { font-weight: 800; color: #E2C27A; }
  .dx-bn-item.is-active .dx-bn-ic { background: rgba(91,63,214,.16); }
  .dx-bn-item.is-active .dx-bn-ic .bi { filter: drop-shadow(0 0 6px rgba(91,63,214,.55)); }
  .dx-bn-item.is-active::before { content: ''; position: absolute; top: 0; left: 50%; width: 22px; height: 3px; margin-left: -11px; border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, #5B3FD6, #9B82FF); box-shadow: 0 0 10px 1px rgba(155,130,255,.75); }
  .dx-bn-item.is-press .dx-bn-ic { transform: scale(.86); }
  .dx-bn-badge { position: absolute; top: -3px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ff3b5c; color: #fff;
    font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #21123A; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
  /* center «+» */
  .dx-bn-fab { justify-content: flex-end; padding-bottom: 5px; }
  .dx-bn-fab-c { position: absolute; top: -20px; left: 50%; width: 56px; height: 56px; margin-left: -28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #fff; background: linear-gradient(140deg, #5B3FD6 0%, #9B82FF 100%);
    box-shadow: 0 0 0 5px #21123A, 0 0 0 6px rgba(155,130,255,.35), 0 10px 22px rgba(91,63,214,.5), inset 0 1px 0 rgba(255,255,255,.35);
    transition: transform .2s cubic-bezier(.3,1.4,.5,1), box-shadow .25s ease; }
  .dx-bn-fab-c .bi { font-size: 1.6rem; -webkit-text-stroke: .6px #fff; }
  .dx-bn-fab .dx-bn-lbl { color: rgba(231,227,239,.78); }
  .dx-bn-fab.is-press .dx-bn-fab-c { transform: scale(.9); }
  .dx-bn-fab[aria-expanded="true"] .dx-bn-fab-c { transform: rotate(45deg); }

  /* hidden states (classes on <html> set by bottom-nav.js) */
  html.dx-bn-down .dx-bnav, html.dx-bn-kb .dx-bnav, html.dx-bn-ov .dx-bnav, body.sidebar-open .dx-bnav { transform: translateY(calc(100% + 28px)); }
  html.dx-bn-kb .dx-bnav { transition: none; }

  /* room for the bar: footer grows underneath it (its own background shows through the glass) */
  .app-footer { padding-bottom: calc(var(--dx-bn-total) + 1rem) !important; }
  /* things pinned to the bottom ride above the bar, and drop back when it slides away */
  #avToasts { bottom: var(--dx-bn-total) !important; transition: bottom .32s cubic-bezier(.22,.8,.24,1); }
  .dx-pwa-banner { bottom: calc(var(--dx-bn-total) + 12px) !important; transition: bottom .32s cubic-bezier(.22,.8,.24,1); }
  .sticky-actions { bottom: var(--dx-bn-total); transition: bottom .32s cubic-bezier(.22,.8,.24,1); }
  html.dx-bn-down #avToasts, html.dx-bn-kb #avToasts, html.dx-bn-ov #avToasts { bottom: 0 !important; }
  html.dx-bn-down .dx-pwa-banner, html.dx-bn-kb .dx-pwa-banner { bottom: 16px !important; }
  html.dx-bn-down .sticky-actions, html.dx-bn-kb .sticky-actions, html.dx-bn-ov .sticky-actions { bottom: 0; }

  /* bottom sheets («+» and «المزيد») */
  .dx-bsheet.offcanvas-bottom { height: auto; max-height: 86vh; border: 0; border-radius: 24px 24px 0 0; background: #fff; direction: rtl;
    box-shadow: 0 -18px 40px rgba(27,14,46,.3); padding-bottom: var(--dx-sab, env(safe-area-inset-bottom, 0px)); }
  .dx-bsheet-grab { width: 40px; height: 5px; border-radius: 999px; background: #E3D9CB; margin: 8px auto 0; flex: 0 0 auto; }
  .dx-bsheet-head { display: flex; align-items: center; gap: .6rem; padding: .55rem 1.1rem .5rem; }
  .dx-bsheet-t { margin: 0; font-weight: 800; font-size: 1.1rem; color: var(--dx-navy); }
  .dx-bsheet-x { margin-inline-start: auto; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #F7F3ED; color: #605663; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; }
  .dx-bsheet-x:active { background: #E9E5F1; }
  .dx-bsheet-body { padding: .35rem 1rem 1.2rem; }
  .dx-act-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
  .dx-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; min-height: 104px; padding: .85rem .35rem .7rem; border-radius: 18px;
    background: #F9F8FE; border: 1px solid #EFECF5; color: var(--dx-navy); text-decoration: none; text-align: center;
    transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease; -webkit-tap-highlight-color: transparent; }
  .dx-act:hover { color: var(--dx-navy); background: #F5F2FD; }
  .dx-act:active { transform: scale(.95); background: #F9ECF0; }
  .dx-act-ic { width: 50px; height: 50px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.45rem;
    box-shadow: 0 8px 16px -8px var(--tc, rgba(91,63,214,.7)), inset 0 1px 0 rgba(255,255,255,.3); background: var(--tg); }
  .dx-act-l { font-size: .84rem; font-weight: 700; line-height: 1.3; }
  .dx-act.t-rose   { --tg: linear-gradient(140deg, #A3262E, #D9575A); --tc: rgba(163,38,46,.8); }
  .dx-act.t-indigo { --tg: linear-gradient(140deg, #C73C68, #D77795); --tc: rgba(199,60,104,.8); }
  .dx-act.t-violet { --tg: linear-gradient(140deg, #5B3A78, #8A5FA8); --tc: rgba(91,58,120,.8); }
  .dx-act.t-amber  { --tg: linear-gradient(140deg, #f59e0b, #ffc233); --tc: rgba(245,158,11,.8); }
  .dx-act.t-teal   { --tg: linear-gradient(140deg, #4A32B8, #9B82FF); --tc: rgba(155,130,255,.8); }
  .dx-act.t-blue   { --tg: linear-gradient(140deg, #3A2466, #5B3FD6); --tc: rgba(91,63,214,.8); }
  .dx-act.t-cyan   { --tg: linear-gradient(140deg, #5B3FD6, #9B82FF); --tc: rgba(155,130,255,.8); }
  .dx-act.t-green  { --tg: linear-gradient(140deg, #21123A, #9B82FF); --tc: rgba(155,130,255,.8); }
  /* «المزيد» sheet */
  .dx-more-me { display: flex; align-items: center; gap: .65rem; min-width: 0; color: var(--dx-navy); text-decoration: none; }
  .dx-more-av { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.15rem; color: #fff;
    background: linear-gradient(140deg, #2A1745, #5B3FD6); box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(155,130,255,.55); }
  .dx-more-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
  .dx-more-who b { font-weight: 800; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dx-more-who small { color: #6A6470; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dx-bsheet-more .dx-bsheet-head { border-bottom: 1px solid #F3F1F8; padding-bottom: .7rem; }
  .dx-more-h { font-size: .76rem; font-weight: 800; color: #9D93A1; margin: .95rem .2rem .45rem; }
  .dx-more-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem .3rem; }
  .dx-more-i { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .45rem .1rem; border-radius: 14px; color: #2E2832; text-decoration: none; text-align: center; -webkit-tap-highlight-color: transparent; }
  .dx-more-i:hover { color: #2E2832; }
  .dx-more-i:active { background: #F6F4FA; }
  .dx-more-ic { position: relative; width: 48px; height: 48px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: #3A2466; background: #F5F2FD; }
  .dx-more-ic .dx-bn-badge { top: -5px; right: -5px; box-shadow: 0 0 0 2px #fff; }
  .dx-more-l { font-size: .74rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .dx-more-i.is-active .dx-more-ic { color: #fff; background: linear-gradient(140deg, #5B3FD6, #9B82FF); box-shadow: 0 6px 14px -6px rgba(91,63,214,.8); }
  .dx-more-i.is-active .dx-more-l { color: #3A2466; font-weight: 800; }
  .dx-more-foot { margin-top: 1.1rem; border-top: 1px solid #F3F1F8; padding-top: .5rem; }
  .dx-more-row { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 48px; padding: 0 .4rem; border: 0; background: none; color: var(--dx-navy); font-weight: 700; font-family: inherit; font-size: .95rem; text-decoration: none; border-radius: 12px; }
  .dx-more-row:hover { color: var(--dx-navy); }
  .dx-more-row:active { background: #F6F4FA; }
  .dx-more-row > .bi:first-child { font-size: 1.15rem; color: #3A2466; }
  .dx-more-row.is-danger, .dx-more-row.is-danger > .bi:first-child { color: #c62f45; }
  .dx-more-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; font-size: .78rem; color: #9C92A0; padding: .6rem 0 .2rem; }
  .dx-more-legal a { color: #726676; text-decoration: none; }
}
@media (max-width: 359.98px) { .dx-bn-lbl { font-size: 10.5px; } .dx-bn-ic { width: 44px; } .dx-more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 991.98px) and (prefers-reduced-motion: reduce) {
  .dx-bnav, .dx-bn-ic, .dx-bn-fab-c, .dx-act, #avToasts, .dx-pwa-banner, .sticky-actions { transition: none !important; }
  .dx-bn-item.is-press .dx-bn-ic, .dx-bn-fab.is-press .dx-bn-fab-c, .dx-act:active { transform: none; }
}
@media print { .dx-bnav, .dx-bsheet { display: none !important; } }
@media (max-width: 991.98px) {
  .dx-act-grid.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
  .dx-act-grid.is-4 .dx-act { min-height: 96px; padding: .75rem .2rem .6rem; border-radius: 16px; gap: .45rem; }
  .dx-act-grid.is-4 .dx-act-ic { width: 46px; height: 46px; border-radius: 15px; font-size: 1.3rem; }
  .dx-act-grid.is-4 .dx-act-l { font-size: .78rem; }
}
@media (max-width: 359.98px) { .dx-act-grid.is-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- bottom app bar: calmer look (owner: «خف البهرجة») — flat white bar, simple wine active state, flat «+», single-tone tiles ---- */
@media (max-width: 991.98px) {
  .dx-bnav { background: rgba(255,255,255,.97); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: 0 -1px 0 #E9E5F1, 0 -6px 16px -12px rgba(42,23,69,.18); }
  .dx-bnav::before { display: none; }
  .dx-bn-item { color: #6A6470; }
  .dx-bn-item:hover, .dx-bn-item:focus { color: #4F4751; }
  .dx-bn-item.is-active { color: #5B3FD6; }
  .dx-bn-item.is-active .dx-bn-lbl { color: #5B3FD6; font-weight: 700; }
  .dx-bn-item.is-active .dx-bn-ic { background: transparent; }
  .dx-bn-item.is-active .dx-bn-ic .bi { filter: none; }
  .dx-bn-item.is-active::before { display: none; }
  .dx-bn-badge { box-shadow: 0 0 0 2px #fff; background: #e5484d; }
  .dx-bn-fab-c { top: -12px; width: 48px; height: 48px; margin-left: -24px; background: #5B3FD6;
    box-shadow: 0 0 0 4px #fff, 0 4px 10px rgba(91,63,214,.28); }
  .dx-bn-fab-c .bi { font-size: 1.4rem; -webkit-text-stroke: 0; }
  .dx-bn-fab .dx-bn-lbl { color: #6A6470; }
  .dx-act { background: #fff; border: 1px solid #F1EBE0; }
  .dx-act-ic { background: #EFEAFD !important; color: #5B3FD6; box-shadow: none; border-radius: 14px; }
  .dx-bsheet.offcanvas-bottom { box-shadow: 0 -8px 24px rgba(27,14,46,.15); }
}

/* ===== network map — /map (views/map/index.ejs · public/js/network-map.js) and the «عرض على الخريطة» chip (views/partials/map_link.ejs) ===== */
.dx-map-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .32rem .8rem; border-radius: 999px; font-size: .82rem; font-weight: 700; text-decoration: none; white-space: nowrap;
  color: #5B3FD6; background: linear-gradient(135deg, #EFEAFD, #EFEAFD); border: 1px solid #F3DBE3; box-shadow: 0 1px 2px rgba(42,23,69,.06); transition: transform .15s ease, box-shadow .2s ease; }
.dx-map-chip:hover { color: #2A1745; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(91,63,214,.2); }
.dx-map-chip .bi { font-size: .95rem; color: #5B3FD6; }
.dx-map-chip-row { display: flex; justify-content: flex-end; margin: 0 0 .6rem; }

html.nm-page, html.nm-page body { overflow: hidden; overscroll-behavior: none; }
.nm-root { --nm-cases: #5B3FD6; --nm-emg: #e5364b; --nm-jobs: #AC3258; --nm-courses: #8b5cf6; --nm-listings: #f59e0b; --nm-places: #2A1745;
  position: relative; display: flex; height: calc(100vh - 3.5rem); background: #F5F1EB; overflow: hidden; direction: rtl; }
.nm-root .t-cases { --c: var(--nm-cases); } .nm-root .t-emg { --c: var(--nm-emg); } .nm-root .t-jobs { --c: var(--nm-jobs); }
.nm-root .t-courses { --c: var(--nm-courses); } .nm-root .t-listings { --c: var(--nm-listings); } .nm-root .t-places { --c: var(--nm-places); }
.nm-stage { position: relative; flex: 1 1 auto; min-width: 0; }
.nm-map { position: absolute; inset: 0; background: #F3EDE4; }
.nm-map .leaflet-container, .nm-map.leaflet-container { font-family: 'Cairo', sans-serif; background: #F3EDE4; }
.nm-tiles { filter: saturate(.55) contrast(.96) brightness(1.04); }
.nm-fail { display: flex; height: 100%; align-items: center; justify-content: center; gap: .5rem; color: #6A6470; }
.nm-lf { background: none; border: 0; }

/* side panel (desktop) */
.nm-side { flex: 0 0 348px; display: flex; flex-direction: column; background: #fff; border-inline-end: 1px solid #E8E4EF; z-index: 2; min-height: 0; }
.nm-side-h { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .9rem 1rem .75rem; border-bottom: 1px solid #F3F1F8;
  background: linear-gradient(180deg, #FBFAFF, #fff); }
.nm-side-t { font-weight: 800; color: #2A1745; font-size: 1.05rem; } .nm-side-t .bi { color: #5B3FD6; }
.nm-side-sub { font-size: .8rem; color: #6A6470; }
.nm-btn-ghost { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 700; padding: .35rem .7rem; border-radius: 999px; border: 1px solid #E4DCFF; color: #5B3FD6; text-decoration: none; white-space: nowrap; }
.nm-btn-ghost:hover { background: #EFEAFD; color: #2A1745; }
.nm-list { flex: 1 1 auto; overflow-y: auto; padding: .4rem; scrollbar-width: thin; }
.nm-li { display: flex; align-items: center; gap: .65rem; width: 100%; text-align: start; border: 0; background: none; padding: .55rem .6rem; border-radius: 12px; cursor: pointer; transition: background .15s ease; font-family: inherit; }
.nm-li:hover, .nm-li.is-hot { background: #F8F6FE; }
.nm-li.is-sel { background: #EFEAFD; box-shadow: inset 3px 0 0 #5B3FD6; }
.nm-li-ic { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--c); box-shadow: 0 3px 8px -3px var(--c); }
.nm-li-b { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.nm-li-t { font-weight: 700; color: #2A1745; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm-li-s { font-size: .75rem; color: #6A6470; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm-li-km { flex: 0 0 auto; font-size: .74rem; font-weight: 700; color: #5B3FD6; background: #F4F1FD; border-radius: 999px; padding: .1rem .5rem; direction: rtl; }
.nm-li-km:empty { display: none; }
.nm-li-more { text-align: center; font-size: .78rem; color: #6A6470; padding: .6rem; }
.nm-li-empty { display: flex; flex-direction: column; align-items: center; gap: .25rem; text-align: center; padding: 2.5rem 1rem; color: #6A6470; font-size: .85rem; }
.nm-li-empty .bi { font-size: 2rem; color: #C9C3CB; } .nm-li-empty b { color: #2A1745; }

/* top overlay */
.nm-top { position: absolute; top: 12px; inset-inline: 12px; z-index: 900; pointer-events: none; display: flex; flex-direction: column; gap: 8px; }
.nm-top > * { pointer-events: auto; }
.nm-row1 { display: flex; gap: 8px; align-items: center; max-width: 560px; }
.nm-search { position: relative; flex: 1 1 auto; }
.nm-search > .bi { position: absolute; top: 50%; inset-inline-start: 14px; transform: translateY(-50%); color: #6A6470; pointer-events: none; }
.nm-search input { width: 100%; height: 44px; border: 0; border-radius: 14px; padding: 0 42px 0 14px; font-family: inherit; font-size: .92rem; color: #2A1745; background: #fff;
  box-shadow: 0 6px 20px -6px rgba(42,23,69,.28), 0 0 0 1px rgba(42,23,69,.06); outline: none; }
.nm-search input:focus { box-shadow: 0 6px 20px -6px rgba(42,23,69,.28), 0 0 0 2px #5B3FD6; }
.nm-sugg { position: absolute; top: calc(100% + 6px); inset-inline: 0; margin: 0; padding: 6px; list-style: none; background: #fff; border-radius: 14px; box-shadow: 0 14px 34px -10px rgba(42,23,69,.35); max-height: 320px; overflow-y: auto; }
.nm-sugg li { display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; border-radius: 10px; cursor: pointer; font-size: .86rem; color: #2A1745; }
.nm-sugg li:hover, .nm-sugg li.is-act { background: #F4F1FD; }
.nm-sugg li .bi { color: var(--c, #827586); } .nm-sugg li small { margin-inline-start: auto; color: #6A6470; font-size: .72rem; white-space: nowrap; }
.nm-sugg li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm-sugg li.is-empty { color: #6A6470; cursor: default; }
.nm-fab-sm { flex: 0 0 auto; height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: 0 .9rem; border: 0; border-radius: 14px;
  background: linear-gradient(140deg, #5B3FD6, #9B82FF); color: #fff; font-weight: 700; font-family: inherit; font-size: .88rem; box-shadow: 0 8px 20px -8px rgba(91,63,214,.8); }
.nm-fab-sm .bi { font-size: 1.1rem; }
.nm-fab-sm.is-busy .bi { animation: nm-spin 1s linear infinite; }
@keyframes nm-spin { to { transform: rotate(360deg); } }
.nm-chips { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin: 0 -2px; -webkit-overflow-scrolling: touch; }
.nm-chips::-webkit-scrollbar { display: none; }
.nm-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem; height: 34px; padding: 0 .75rem; border-radius: 999px; border: 1px solid rgba(42,23,69,.08);
  background: rgba(255,255,255,.96); color: #48414B; font-family: inherit; font-size: .8rem; font-weight: 700; white-space: nowrap; cursor: pointer;
  box-shadow: 0 3px 10px -4px rgba(42,23,69,.25); transition: background .15s ease, color .15s ease, border-color .15s ease; }
.nm-chip .bi { font-size: .9rem; }
.nm-chip .nm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #5B3FD6); opacity: .45; }
.nm-chip.is-on { color: var(--c, #5B3FD6); border-color: var(--c, #5B3FD6); background: #fff; box-shadow: 0 3px 12px -4px var(--c, #5B3FD6), inset 0 0 0 1px var(--c, #5B3FD6); }
.nm-chip.is-on .nm-dot { opacity: 1; box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 0 0 4px var(--c); }
.nm-chip.is-muted { opacity: .45; }
.nm-chip.t-emg.is-on { background: #e5364b; color: #fff; border-color: #e5364b; box-shadow: 0 4px 14px -4px rgba(229,54,75,.8); }
.nm-chip.t-emg:not(.is-on) .bi { color: #e5364b; }
.nm-chip.nm-r.is-on { background: #5B3FD6; color: #fff; border-color: #5B3FD6; box-shadow: 0 4px 14px -4px rgba(91,63,214,.8); }
.nm-chip-sel { padding-inline-end: .35rem; cursor: default; }
.nm-chip-sel select { border: 0; background: transparent; font-family: inherit; font-size: .8rem; font-weight: 700; color: inherit; outline: none; max-width: 150px; cursor: pointer; padding: 0 .1rem; }
.nm-chip-sel.is-on { --c: #5B3FD6; }
.nm-sep { flex: 0 0 1px; width: 1px; height: 22px; background: rgba(42,23,69,.15); margin: 0 2px; }
.nm-rlabel { flex: 0 0 auto; font-size: .76rem; font-weight: 700; color: #48414B; background: rgba(255,255,255,.8); border-radius: 999px; padding: .2rem .55rem; }

.nm-loading { position: absolute; top: 112px; left: 50%; transform: translateX(-50%); z-index: 850; background: #2A1745; color: #fff; font-size: .78rem; font-weight: 700;
  border-radius: 999px; padding: .3rem .8rem; display: inline-flex; gap: .4rem; align-items: center; box-shadow: 0 6px 18px -6px rgba(42,23,69,.6); }
.nm-empty { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 820; background: rgba(255,255,255,.95); color: #48414B; font-weight: 700; font-size: .85rem;
  padding: .7rem 1rem; border-radius: 14px; box-shadow: 0 10px 30px -10px rgba(42,23,69,.35); text-align: center; max-width: 80%; pointer-events: none; }
.nm-empty .bi { color: #5B3FD6; }
.nm-toast { position: absolute; top: 112px; left: 50%; transform: translateX(-50%); z-index: 950; background: #2A1745; color: #fff; font-size: .82rem; border-radius: 12px; padding: .5rem .9rem; transition: opacity .35s ease; max-width: 90%; text-align: center; }
.nm-toast.is-out { opacity: 0; }

/* legend */
.nm-legend { position: absolute; bottom: 24px; inset-inline-start: 12px; z-index: 800; background: rgba(255,255,255,.96); border-radius: 14px; box-shadow: 0 8px 24px -10px rgba(42,23,69,.35); font-size: .76rem; color: #48414B; min-width: 0; }
.nm-legend summary { cursor: pointer; list-style: none; padding: .45rem .75rem; font-weight: 700; color: #2A1745; white-space: nowrap; }
.nm-legend summary::-webkit-details-marker { display: none; }
.nm-legend summary .bi { color: #5B3FD6; }
.nm-legend ul { list-style: none; margin: 0; padding: 0 .75rem .6rem; display: grid; gap: .3rem; }
.nm-legend li { display: flex; align-items: center; gap: .45rem; white-space: nowrap; }
.nm-lg { width: 14px; height: 14px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); flex: 0 0 auto; }
.nm-lg-area { border-radius: 50%; transform: none; background: rgba(91,63,214,.18); border: 1px solid rgba(91,63,214,.45); width: 16px; height: 16px; box-shadow: none; }
.nm-lg-cl { border-radius: 50%; transform: none; background: #5B3FD6; color: #fff; width: 18px; height: 18px; font-size: .62rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.nm-listfab { display: none; }

/* markers */
.nm-pin { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); width: 36px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .18s cubic-bezier(.3,1.4,.5,1); -webkit-tap-highlight-color: transparent; }
.nm-pin-b { position: absolute; top: 1px; left: 1px; width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c); border: 2.5px solid #fff;
  box-shadow: -2px 3px 8px rgba(42,23,69,.35); display: flex; align-items: center; justify-content: center; }
.nm-pin-b .bi { transform: rotate(45deg); color: #fff; font-size: 15px; line-height: 1; }
.nm-pin.t-places .nm-pin-b { background: linear-gradient(135deg, #3A2466, #2A1745); }
.nm-pin.t-places .nm-pin-b .bi { color: #E6CB8A; }
.nm-pin:hover, .nm-pin.is-hot { transform: translate(-50%, -100%) scale(1.14); z-index: 5; }
.nm-pin.is-sel { transform: translate(-50%, -100%) scale(1.26); }
.nm-pin.is-sel .nm-pin-b, .nm-pin.is-hot .nm-pin-b { box-shadow: 0 0 0 4px rgba(255,255,255,.7), 0 0 0 7px var(--c), -2px 6px 14px rgba(42,23,69,.4); }
.nm-own { position: absolute; top: -2px; right: -2px; width: 13px; height: 13px; border-radius: 50%; background: #9B82FF; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.nm-halo { position: absolute; top: 1px; left: 1px; width: 34px; height: 34px; border-radius: 50%; background: rgba(229,54,75,.45); animation: nm-halo 1.8s ease-out infinite; pointer-events: none; }
@keyframes nm-halo { 0% { transform: scale(.9); opacity: .75; } 100% { transform: scale(2.6); opacity: 0; } }
.nm-cl { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); padding: 4px; border: 0; border-radius: 50%; background: var(--ring, #5B3FD6); cursor: pointer;
  box-shadow: 0 0 0 5px rgba(91,63,214,.16), 0 6px 16px -4px rgba(42,23,69,.45); transition: transform .18s cubic-bezier(.3,1.4,.5,1); -webkit-tap-highlight-color: transparent; }
.nm-cl-in { display: flex; align-items: center; justify-content: center; border-radius: 50%; background: linear-gradient(140deg, #5B3FD6, #3A2466); color: #fff; font-weight: 800;
  border: 2px solid #fff; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.nm-cl.s1 .nm-cl-in { width: 32px; height: 32px; font-size: 13px; }
.nm-cl.s2 .nm-cl-in { width: 40px; height: 40px; font-size: 14px; }
.nm-cl.s3 .nm-cl-in { width: 48px; height: 48px; font-size: 15px; }
.nm-cl:hover, .nm-cl.is-hot { transform: translate(-50%, -50%) scale(1.12); box-shadow: 0 0 0 7px rgba(91,63,214,.28), 0 8px 18px -4px rgba(42,23,69,.5); }
.nm-cl-emg { position: absolute; top: 0; right: 0; width: 12px; height: 12px; border-radius: 50%; background: #e5364b; border: 2px solid #fff; animation: nm-blink 1.4s ease-in-out infinite; }
@keyframes nm-blink { 50% { box-shadow: 0 0 0 5px rgba(229,54,75,.25); } }
.nm-me { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); width: 20px; height: 20px; pointer-events: auto; }
.nm-me-dot { position: absolute; inset: 0; border-radius: 50%; background: #5B3FD6; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(42,23,69,.45); }
.nm-me-pulse { position: absolute; inset: -14px; border-radius: 50%; background: rgba(91,63,214,.22); animation: nm-halo 2.2s ease-out infinite; }

/* card */
.nm-card { position: absolute; z-index: 950; left: 60px; bottom: 20px; width: 380px; max-width: calc(100% - 80px); background: #fff; border-radius: 20px; padding: 1rem 1rem .9rem;
  box-shadow: 0 24px 60px -18px rgba(42,23,69,.5), 0 0 0 1px rgba(42,23,69,.05); opacity: 0; transform: translateY(12px); transition: opacity .2s ease, transform .22s cubic-bezier(.22,.8,.24,1); }
.nm-card.is-open { opacity: 1; transform: none; }
.nm-grab { display: none; }
.nm-card-x { position: absolute; top: 10px; left: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: #F7F3ED; color: #48414B; display: flex; align-items: center; justify-content: center; }
.nm-card-x:hover { background: #E9E5F1; }
.nm-card-head { display: flex; gap: .75rem; align-items: flex-start; padding-inline-end: 34px; }
.nm-card-ic, .nm-card-logo { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 14px; }
.nm-card-ic { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.3rem; background: var(--c); box-shadow: 0 8px 18px -8px var(--c); }
.nm-card-ic.t-places { background: linear-gradient(135deg, #3A2466, #2A1745); color: #E6CB8A; }
.nm-card-logo { object-fit: cover; border: 1px solid #E8E4EF; background: #fff; }
.nm-card-hb { min-width: 0; flex: 1 1 auto; }
.nm-card-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .25rem; }
.nm-tag { display: inline-flex; align-items: center; gap: .2rem; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: .1rem .55rem; color: var(--c, #48414B); background: color-mix(in srgb, var(--c, #827586) 12%, #fff); }
.nm-tag.t-emg { background: #e5364b; color: #fff; animation: nm-blink 1.6s ease-in-out infinite; }
.nm-tag-km { --c: #5B3FD6; } .nm-tag-me { --c: #4A32B8; } .nm-tag-ok { --c: #2A1745; }
.nm-card-t { font-size: 1.05rem; font-weight: 800; color: #2A1745; margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.nm-card-s { font-size: .82rem; color: #6A6470; margin-top: .1rem; }
.nm-card-place { font-size: .8rem; color: #48414B; margin-top: .6rem; }
.nm-card-place > .bi { color: #5B3FD6; }
.nm-approx { display: inline-flex; align-items: center; gap: .25rem; margin-top: .25rem; font-size: .72rem; color: #5B3FD6; background: #F4F1FD; border-radius: 8px; padding: .12rem .5rem; }
.nm-card-rate { font-size: .8rem; color: #48414B; margin-top: .35rem; font-weight: 700; } .nm-card-rate .bi { color: #f59e0b; } .nm-card-rate span { color: #6A6470; font-weight: 400; }
.nm-facts { list-style: none; margin: .6rem 0 0; padding: .55rem .65rem; background: #FAF8F4; border-radius: 12px; display: grid; gap: .3rem; }
.nm-facts li { display: flex; gap: .5rem; align-items: baseline; font-size: .82rem; color: #2A1745; }
.nm-facts .bi { color: #6A6470; flex: 0 0 auto; }
.nm-card-acts { display: flex; gap: .5rem; margin-top: .8rem; }
.nm-act { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; border-radius: 13px; font-weight: 800; font-size: .92rem; text-decoration: none; color: #fff;
  background: linear-gradient(140deg, #5B3FD6, #3A2466); box-shadow: 0 10px 20px -10px rgba(91,63,214,.9); }
.nm-act:hover { color: #fff; filter: brightness(1.06); }
.nm-act.t-emg { background: linear-gradient(140deg, #ff4d61, #d42a3f); box-shadow: 0 10px 20px -10px rgba(229,54,75,.9); }
.nm-act-2 { flex: 0 0 auto; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-width: 64px; min-height: 44px; border-radius: 13px; border: 1px solid #F3DCE3;
  color: #5B3FD6; text-decoration: none; font-size: .68rem; font-weight: 700; background: #fff; }
.nm-act-2 .bi { font-size: 1.05rem; } .nm-act-2:hover { background: #F4F1FD; color: #2A1745; }

.nm-root .leaflet-control-zoom { border: 0 !important; box-shadow: 0 6px 18px -6px rgba(42,23,69,.35) !important; border-radius: 12px !important; overflow: hidden; margin-bottom: 24px !important; }
.nm-root .leaflet-control-zoom a { width: 38px !important; height: 38px !important; line-height: 38px !important; color: #2A1745 !important; }
.nm-root .leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.7) !important; }

@media (max-width: 991.98px) {
  .nm-side { display: none; }
  .nm-top { top: 8px; inset-inline: 8px; gap: 6px; }
  .nm-row1 { max-width: none; }
  .nm-search input { height: 42px; border-radius: 13px; }
  .nm-fab-sm { height: 42px; width: 42px; padding: 0; border-radius: 13px; }
  .nm-chip { height: 32px; font-size: .76rem; padding: 0 .65rem; }
  .nm-root .leaflet-control-zoom { display: none; }
  .nm-loading, .nm-toast { top: 100px; }
  .nm-legend { bottom: 16px; inset-inline-start: 8px; }
  .nm-legend[open] { max-height: 60%; overflow-y: auto; }
  .nm-listfab { display: inline-flex; position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 800; align-items: center; gap: .4rem; height: 40px; padding: 0 1rem;
    border-radius: 999px; background: #2A1745; color: #fff; font-weight: 700; font-size: .84rem; text-decoration: none; box-shadow: 0 10px 24px -8px rgba(42,23,69,.7); white-space: nowrap; }
  .nm-listfab:hover { color: #fff; }
  .nm-root.has-card .nm-listfab, .nm-root.has-card .nm-legend { opacity: 0; pointer-events: none; }
  .nm-card { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; border-radius: 22px; padding: .6rem .9rem .9rem; transform: translateY(110%); opacity: 1;
    transition: transform .28s cubic-bezier(.22,.8,.24,1); max-height: 72%; overflow-y: auto; }
  .nm-card.is-open { transform: none; }
  .nm-grab { display: block; width: 40px; height: 5px; border-radius: 999px; background: #E3D9CB; margin: 0 auto .5rem; }
  .nm-card-x { top: 14px; }
}
@media (min-width: 992px) {
  .nm-chips { flex-wrap: wrap; overflow: visible; }
  .nm-loading, .nm-toast { top: auto; bottom: 24px; }
}
.nm-grp-h { font-weight: 800; color: #2A1745; padding: .15rem .25rem .5rem; padding-inline-end: 40px; } .nm-grp-h .bi { color: #5B3FD6; }
.nm-grp { max-height: 300px; overflow-y: auto; margin: 0 -.4rem; }
@media (max-width: 991.98px) {
  .nm-listfab { bottom: 30px; } .nm-legend { bottom: 30px; }
  .nm-chips { -webkit-mask-image: linear-gradient(to left, transparent 0, #000 28px); mask-image: linear-gradient(to left, transparent 0, #000 28px); padding-left: 24px; }
}
.nm-root.has-card .nm-legend { opacity: 0; pointer-events: none; }

/* ---- home: no page title/breadcrumb, full-bleed slider (owner request) ---- */
body.dx-home .app-content-header { display: none; }
body.dx-home .app-content { padding-top: 0; }
body.dx-home .dx-slider { margin-top: 0; border-radius: 0 !important; box-shadow: none; }
@media (max-width: 991.98px) { body.dx-home .dx-slider { margin-inline: calc(50% - 50vw); width: 100vw; } }
@media (min-width: 992px) { body.dx-home .app-content > .container-fluid { --dx-cp: calc(var(--bs-gutter-x, 1.5rem) * .5); } body.dx-home .dx-slider { margin-inline: calc(-1 * var(--dx-cp) - .5rem); } }

/* ---- chips / segmented buttons (public/js/chips.js + views/partials/chips.ejs) ---- */
.dx-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.dx-chip { min-height: 42px; padding: .35rem .95rem; border-radius: 999px; border: 1.5px solid #E3D7C4; background: #fff; color: #2A1745;
  font: inherit; font-weight: 600; font-size: .9rem; line-height: 1.3; display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; user-select: none; }
.dx-chip:hover { border-color: #5B3FD6; background: #F7F5FE; }
.dx-chip:focus-visible { outline: 0; box-shadow: 0 0 0 .22rem rgba(91,63,214,.35); }
.dx-chip.active { background: #5B3FD6; border-color: #5B3FD6; color: #fff; box-shadow: 0 3px 10px -4px rgba(91,63,214,.7); }
.dx-chip.active::before { content: '\F26E'; font-family: 'bootstrap-icons'; font-size: .95em; margin-inline-end: .05rem; }
.dx-chip .bi { font-size: 1em; }
.dx-chip:disabled { opacity: .5; cursor: not-allowed; }
.dx-chips[data-tone=danger] .dx-chip.active { background: #d63340; border-color: #d63340; box-shadow: 0 3px 10px -4px rgba(214,51,64,.7); }
.dx-chips[data-tone=warn] .dx-chip.active { background: #e58a00; border-color: #e58a00; box-shadow: 0 3px 10px -4px rgba(229,138,0,.7); }
.dx-chips[data-tone=navy] .dx-chip.active { background: #2A1745; border-color: #2A1745; }
.dx-chips.is-invalid .dx-chip { border-color: #dc3545; }
/* segmented variant: equal-width buttons in one row */
.dx-seg { gap: 0; flex-wrap: nowrap; border-radius: 12px; }
.dx-seg .dx-chip { flex: 1 1 0; justify-content: center; border-radius: 0; margin-inline-start: -1.5px; padding-inline: .5rem; }
.dx-seg .dx-chip:first-of-type { border-start-start-radius: 12px; border-end-start-radius: 12px; margin-inline-start: 0; }
.dx-seg .dx-chip:last-of-type { border-start-end-radius: 12px; border-end-end-radius: 12px; }
.dx-seg .dx-chip.active { position: relative; z-index: 1; }
.dx-seg .dx-chip.active::before { content: none; }
.dx-chips.dx-sm .dx-chip { min-height: 40px; padding: .25rem .75rem; font-size: .85rem; }
@media (max-width: 575.98px) { .dx-chip { min-height: 44px; } }

/* ---- medical record (patients) ---- */
.dx-medalerts { border: 0; border-radius: .9rem; background: #fff5f5; border-inline-start: 5px solid #d63340; padding: .75rem 1rem; }
.dx-medalerts.lv-warning { background: #fff8ec; border-inline-start-color: #e58a00; }
.dx-medalerts.lv-info { background: #FCF5F7; border-inline-start-color: #5B3FD6; }
.dx-medalerts .ma-head { font-weight: 800; color: #2A1745; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.dx-medalerts .ma-head small { font-weight: 600; color: #726675; }
.dx-medalerts .ma-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.ma-item { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .3rem .75rem; font-weight: 700; font-size: .85rem; line-height: 1.35; }
.ma-item.lv-danger { background: #d63340; color: #fff; }
.ma-item.lv-warning { background: #ffe7c2; color: #7a4300; }
.ma-item.lv-info { background: #F8EAEF; color: #21123A; }
.ma-item[title] { cursor: help; }
.dx-medsec { border: 1px solid #EFECF5; border-radius: .9rem; padding: 1rem; background: #fff; }
.dx-medsec + .dx-medsec { margin-top: 1rem; }
.dx-medsec > h6 { font-weight: 800; color: #2A1745; display: flex; align-items: center; gap: .4rem; margin-bottom: .85rem; }
.dx-medsec > h6 .bi { color: #5B3FD6; }
.dx-sub { font-size: .82rem; font-weight: 700; color: #726675; margin: .75rem 0 .4rem; }
.dx-since { display: inline-flex; align-items: center; gap: .3rem; background: #F7F5FE; border: 1px solid #F4DFE6; border-radius: 999px; padding: .15rem .25rem .15rem .6rem; font-size: .82rem; }
.dx-since input { width: 5.2rem; height: 32px; border-radius: 999px; font-size: .85rem; }
.dx-rows .dx-row { border: 1px dashed #E3D7C4; border-radius: .75rem; padding: .6rem; position: relative; background: #FDFCFF; }
.dx-rows .dx-row + .dx-row { margin-top: .5rem; }
.dx-typeahead { position: relative; }
.dx-typeahead .ta-menu { position: absolute; inset-inline: 0; top: 100%; z-index: 1060; background: #fff; border: 1px solid #E9DECC; border-radius: .6rem; box-shadow: 0 10px 28px -12px rgba(42,23,69,.35); max-height: 260px; overflow-y: auto; margin-top: 2px; }
.dx-typeahead .ta-item { display: block; width: 100%; text-align: start; border: 0; background: none; padding: .5rem .75rem; min-height: 44px; font: inherit; }
.dx-typeahead .ta-item:hover, .dx-typeahead .ta-item.on { background: #F4F1FD; }
.dx-typeahead .ta-item small { color: #6A6470; }
.dx-mh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; }
.dx-kv { display: flex; justify-content: space-between; gap: .75rem; padding: .35rem 0; border-bottom: 1px dashed #F3F1F8; }
.dx-kv:last-child { border-bottom: 0; }
.dx-kv > span:first-child { color: #6A6470; }
.dx-kv > span:last-child { font-weight: 600; text-align: end; }
.dx-tag { display: inline-flex; align-items: center; gap: .25rem; background: #F1EDFB; color: #2A1745; border-radius: 999px; padding: .15rem .6rem; font-size: .82rem; font-weight: 600; margin: 0 0 .3rem .2rem; }
.dx-tag.red { background: #fde8ea; color: #a1202c; }
.dx-tag.amber { background: #fff1d6; color: #7a4300; }
.dx-vital { border: 1px solid #EFECF5; border-radius: .8rem; padding: .55rem .7rem; background: #fff; height: 100%; }
.dx-vital .v-l { font-size: .75rem; color: #6A6470; font-weight: 600; }
.dx-vital .v-v { font-size: 1.25rem; font-weight: 800; color: #2A1745; direction: ltr; text-align: start; font-variant-numeric: tabular-nums; }
.dx-vital .v-v small { font-size: .7rem; color: #6A6470; font-weight: 600; }
.dx-vital.flag { border-color: #f1b0b6; background: #fff6f7; } .dx-vital.flag .v-v { color: #c0262f; }
.dx-vital.flag-warn { border-color: #f5d49a; background: #fffaf0; } .dx-vital.flag-warn .v-v { color: #9a5800; }
input.v-flag { border-color: #e58a00 !important; background: #fffaf0; }
input.v-bad { border-color: #d63340 !important; background: #fff6f7; }
.dx-chart-box { position: relative; height: 220px; }
.pt-tabs { gap: .25rem; scrollbar-width: none; } .pt-tabs::-webkit-scrollbar { display: none; }
.pt-tabs .nav-link { white-space: nowrap; font-weight: 700; color: #504752; border-radius: .6rem .6rem 0 0; }
.pt-tabs .nav-link.active { color: #3A2466; }
.pt-tabs .nav-link .badge { font-size: .68rem; }
.dx-files-kinds .dx-chip { min-height: 36px; }
.dx-ba { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.dx-ba figure { margin: 0; position: relative; border-radius: .7rem; overflow: hidden; background: #F7F3EE; aspect-ratio: 4/3; }
.dx-ba img { width: 100%; height: 100%; object-fit: cover; }
.dx-ba figcaption { position: absolute; top: .4rem; inset-inline-start: .4rem; background: rgba(42,23,69,.78); color: #fff; font-weight: 700; font-size: .75rem; border-radius: 999px; padding: .1rem .55rem; }
.dx-step-card { border: 2px dashed #EFC7D4; background: #FCF7F9; border-radius: .9rem; }
.dx-medalerts .ma-hints summary { color: #2A1745; cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: .3rem; min-height: 32px; }
.dx-medalerts .ma-hints summary::-webkit-details-marker { display: none; }
.dx-medalerts .ma-hints summary::before { content: '\F282'; font-family: 'bootstrap-icons'; font-size: .8em; transition: transform .15s; }
.dx-medalerts .ma-hints[open] summary::before { transform: rotate(180deg); }
@media (max-width: 575.98px) { .ma-item { font-size: .8rem; padding: .25rem .6rem; } .dx-medalerts { padding: .6rem .75rem; } }
.ltr-chips .dx-chip { direction: ltr; unicode-bidi: isolate; min-width: 3.2rem; justify-content: center; }
@media (min-width: 992px) { .pt-tabs { flex-wrap: wrap !important; overflow: visible !important; } }

/* (legacy) «CLINIC» tag — no longer rendered */
.app-sidebar .dx-clinic-tag { font-family: 'Avenir Next', 'Segoe UI', sans-serif; font-weight: 700; font-size: .7rem; letter-spacing: .28em; color: #9B82FF; border: 1px solid rgba(155,130,255,.45); border-radius: 6px; padding: .1rem .35rem .1rem .1rem; line-height: 1.2; }
.sidebar-mini.sidebar-collapse .app-sidebar:not(:hover) .dx-clinic-tag { display: none; }

/* ---- AA fixes (2026-10-08 rebrand pass) ---- */
.text-danger { color: #B02A37 !important; }
.btn-outline-secondary { --bs-btn-color: #5C5560; --bs-btn-border-color: #B9B0B6; --bs-btn-hover-bg: #5C5560; --bs-btn-hover-border-color: #5C5560; --bs-btn-hover-color: #fff; }

/* ---- «الدعم الفني» (Kauthar, /support): unread dot on the menu items + full-height chat frame ---- */
.dx-sup-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #B02A37; box-shadow: 0 0 0 2px rgba(155,130,255,.45); vertical-align: middle; margin-inline-start: .45rem; flex: 0 0 auto; }
.dx-bn-dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: #B02A37; box-shadow: 0 0 0 2px #fff; }
.dx-um-support { font-weight: 600; }
.dx-support { display: flex; flex-direction: column; gap: .5rem; }
.dx-support-frame-wrap { position: relative; border-radius: 1rem; overflow: hidden; background: #fff; border: 1px solid #E2DCF0; box-shadow: 0 4px 18px rgba(42,23,69,.06); }
.dx-support-frame { display: block; width: 100%; height: 70vh; min-height: 420px; border: 0; background: #fff; }
.dx-support-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; color: #6A6470; background: #fff; transition: opacity .25s; }
.dx-support-loading .spinner-border { color: #5B3FD6; }
.dx-support-loading.is-done { opacity: 0; pointer-events: none; }
.dx-support-fallback { display: none; align-items: center; gap: .6rem; flex-wrap: wrap; background: #F6F4FB; border: 1px solid #9B82FF; color: #4A32B8; border-radius: .8rem; padding: .55rem .75rem; font-size: .9rem; }
.dx-support-fallback.show { display: flex; }
.dx-support-fallback .btn-wa { background: #25D366; border-color: #25D366; color: #fff; font-weight: 700; }
.dx-support-note { font-size: .8rem; color: #6A6470; }
@media (max-width: 991.98px) {
  body.dx-support-page .app-content { padding-inline: .4rem; }
  body.dx-support-page .app-footer { display: none; }
  .dx-support-frame-wrap { border-radius: .8rem; }
}
