/* ===== DentX — global UI (English LTR first + Arabic RTL; Inter for Latin, Cairo for Arabic; AdminLTE 4 tweaks) =====
   Direction rules (i18n 2026-10-12): use logical properties (margin-inline-start, inset-inline-end, text-align:start).
   Icons that point somewhere are written for LTR and get .dx-flip (mirrored in RTL). Icon badges stay top-right in both. */
:root {
  /* brand (2026-09-29): deep navy + electric blue + cyan + silver. --av-green* kept as aliases so every view keeps working */
  --dx-ink: #050d1f; --dx-navy: #0a1a3a; --dx-navy-2: #10264f; --dx-blue: #1e88ff; --dx-blue-dark: #0b63d6; --dx-blue-deep: #0a4fb0; --dx-cyan: #19c3ff; --dx-silver: #d9dee6; --dx-blue-soft: #eaf3ff;
  --av-green: #0b6fe0; --av-green-dark: #0a4fb0; --av-green-light: #eaf3ff; --av-gold: #f59e0b; --dx-teal: #0b6fe0; --dx-sky: #19c3ff;
  --dx-font: 'Inter', 'Cairo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-font-sans-serif: var(--dx-font);
  --bs-success: var(--av-green); --bs-success-rgb: 11,111,224; --bs-primary: #1e88ff; --bs-primary-rgb: 30,136,255;
  --bs-link-color: #0b6fe0; --bs-link-color-rgb: 11,111,224; --bs-link-hover-color: #0a4fb0; --bs-link-hover-color-rgb: 10,79,176;

  /* ===== DESIGN TOKENS (2026-10-07, «الواجهة كالحة وتقسيماتها مش واضحة») — applied system-wide by the
     "DESIGN SYSTEM" block at the end of this file. One accent (logo blue) + semantic colours. No green. ===== */
  /* surfaces */
  --dx-bg: #f2f5fa;            /* page — soft blue-tinted, never flat grey */
  --dx-surface: #ffffff;       /* cards, tables, forms */
  --dx-surface-2: #f7f9fc;     /* quiet panels: table head, nested blocks, footers */
  --dx-surface-3: #eef2f8;     /* hover / pressed */
  --dx-border: #e2e8f1;        /* hairlines */
  --dx-border-strong: #cfd8e5; /* inputs, outline buttons */
  /* text (all ≥ 4.5:1 on white and on --dx-bg) */
  --dx-text: #0f1b33;          /* headings, values */
  --dx-text-2: #364259;        /* body */
  --dx-text-3: #5a667c;        /* secondary / labels / helper */
  /* the one accent */
  --dx-accent: #0b6fe0; --dx-accent-hover: #0a58bf; --dx-accent-ink: #0a4fa8; --dx-accent-soft: #eaf2fe; --dx-accent-ring: rgba(11,111,224,.22);
  /* semantic (soft background + dark ink) — success uses the logo cyan family, never green */
  --dx-ok: #04709b;   --dx-ok-soft: #e1f4fc;
  --dx-warn: #8a4a00; --dx-warn-soft: #fff3df; --dx-warn-line: #f0b44c;
  --dx-bad: #b3202f;  --dx-bad-soft: #fdecee;  --dx-bad-line: #e8868f;
  --dx-info: #3b4f8f; --dx-info-soft: #edf0fb;
  --dx-mute: #4a5566; --dx-mute-soft: #eef1f5;
  /* shape */
  --dx-r-sm: 8px; --dx-r: 12px; --dx-r-lg: 16px; --dx-r-pill: 999px;
  --dx-sh-1: 0 1px 2px rgba(15,27,51,.05);
  --dx-sh-2: 0 1px 2px rgba(15,27,51,.04), 0 6px 16px -6px rgba(15,27,51,.10);
  --dx-sh-3: 0 16px 40px -12px rgba(15,27,51,.22);
  /* spacing scale (4px base) */
  --dx-s1: .25rem; --dx-s2: .5rem; --dx-s3: .75rem; --dx-s4: 1rem; --dx-s5: 1.5rem; --dx-s6: 2rem;
  /* type scale (Cairo) */
  --dx-fs-xs: .75rem; --dx-fs-sm: .84rem; --dx-fs-base: .95rem; --dx-fs-md: 1.05rem; --dx-fs-lg: 1.3rem; --dx-fs-xl: 1.6rem;
}
html[lang=ar] { --dx-font: 'Cairo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
html, body { font-family: var(--dx-font); }
body { font-size: .95rem; }
h1,h2,h3,h4,h5,h6 { font-family: var(--dx-font); }
html[lang=en] body { letter-spacing: -.003em; }
[dir=rtl] .dx-flip { transform: scaleX(-1); display: inline-block; }
.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(--av-green); } a:hover { color: var(--av-green-dark); }
.form-control:focus, .form-select:focus { border-color: var(--av-green); box-shadow: 0 0 0 .2rem rgba(30,136,255,.2); }
.page-item.active .page-link { background: var(--av-green); border-color: var(--av-green); }
.nav-pills .nav-link.active { background: var(--av-green); }

/* sidebar */
.app-sidebar { background: radial-gradient(420px 260px at 100% 0%, rgba(30,136,255,.16) 0%, transparent 70%), linear-gradient(180deg, #050d1f 0%, #0a1a3a 100%) !important; }
.app-sidebar .sidebar-brand { border-bottom: 1px solid rgba(25,195,255,.14); 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: 50px; width: auto; max-width: 190px; object-fit: contain; float: none !important; margin: 0 !important; box-shadow: none !important; }
.sidebar-mini.sidebar-collapse .app-sidebar:not(:hover) .brand-logo { height: 26px; }
.app-sidebar .nav-header { color: #7fb4e8; 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: linear-gradient(90deg, #0b63d6, #1e88ff) !important; color: #fff !important; box-shadow: 0 4px 14px rgba(30,136,255,.28); }
.app-sidebar .nav-link { color: #d9dee6; }
.app-sidebar .nav-link:hover { background: rgba(30,136,255,.12); color: #fff; }
.app-sidebar .nav-link .nav-icon { color: #8fc6ff; }
.app-sidebar .nav-link.active .nav-icon { color: #fff; }
.app-sidebar .nav-arrow { transition: transform .2s; }

/* header */
.app-header { border-bottom: 1px solid #e3e8f0; box-shadow: inset 0 2px 0 var(--dx-blue); }
.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; left:auto; 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 #eef1f3; 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: #eef4fc; font-weight: 700; color:#0a1a3a; border-bottom: 2px solid #d3e2f5; }
.table-hover tbody tr:hover { background: #f4f8fe; }
.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-card { border-radius: .75rem; color:#fff; padding: 1rem 1.25rem; position:relative; overflow:hidden; min-height: 110px; }
.kpi-card .kpi-value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.kpi-card .kpi-label { opacity: .9; }
.kpi-card .kpi-icon { position:absolute; inset-inline-end: 1rem; bottom: .5rem; font-size: 3.2rem; opacity: .25; }
.kpi-card a { color:#fff; text-decoration: none; }
.bg-kpi-green { background: linear-gradient(135deg, #0a1a3a, #0b63d6); }
.bg-kpi-blue { background: linear-gradient(135deg, #0b63d6, #1e88ff); }
.bg-kpi-orange { background: linear-gradient(135deg, #c96a10, #e58a2e); }
.bg-kpi-red { background: linear-gradient(135deg, #b3373a, #d9575a); }
.bg-kpi-purple { background: linear-gradient(135deg, #5b3fa8, #7c5fd3); }
.bg-kpi-teal { background: linear-gradient(135deg, #0a6fa8, #19a8e0); }

/* 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-inline-start: 1.5rem; }
.av-timeline::before { content:''; position:absolute; inset-inline-start: .45rem; top:0; bottom:0; width:2px; background:#dce6f3; }
.av-timeline .tl-item { position: relative; margin-bottom: 1rem; }
.av-timeline .tl-item::before { content:''; position:absolute; inset-inline-start: -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 #dce6f3; }

/* auth */
.auth-page { min-height: 100vh; background: radial-gradient(900px 520px at 85% -10%, rgba(30,136,255,.45) 0%, transparent 60%), radial-gradient(700px 420px at 0% 110%, rgba(25,195,255,.18) 0%, transparent 60%), linear-gradient(165deg, #02060f 0%, #050d1f 40%, #0a1a3a 100%); display:flex; align-items:center; justify-content:center; padding: 1.5rem 1rem; }
.auth-wrap { width: 100%; max-width: 440px; }
.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: 300px; max-width: 82vw; height: auto; margin: 0 auto -.25rem; }
.auth-tagline { color: #d9dee6; font-weight: 700; font-size: 1rem; margin-top: .15rem; }
.auth-slogan { color: #19c3ff; 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; }

/* brand: primary buttons/badges in electric blue */
.btn-primary { --bs-btn-bg: #1e88ff; --bs-btn-border-color: #1e88ff; --bs-btn-hover-bg: #0b63d6; --bs-btn-hover-border-color: #0b63d6; --bs-btn-active-bg: #0a4fb0; --bs-btn-active-border-color: #0a4fb0; }
.btn-outline-primary { --bs-btn-color: #0b6fe0; --bs-btn-border-color: #1e88ff; --bs-btn-hover-bg: #1e88ff; --bs-btn-hover-border-color: #1e88ff; --bs-btn-active-bg: #0b63d6; }
.text-bg-primary, .bg-primary { background-color: #1e88ff !important; }
.text-primary { color: #0b6fe0 !important; }
.user-menu .user-header.text-bg-success { background: linear-gradient(135deg, #050d1f, #0a1a3a 55%, #0b63d6) !important; color: #fff !important; }
.app-footer .dx-foot-brand { color: var(--dx-navy); }
.app-footer .dx-foot-slogan { color: #6b7a90; direction: ltr; unicode-bidi: isolate; }

/* ---- brand: no green anywhere — Bootstrap/AdminLTE "success" family mapped to the logo blues (2026-09-29, Ahmed) ---- */
:root, [data-bs-theme=light] {
  --bs-success: #0b6fe0; --bs-success-rgb: 11,111,224;
  --bs-success-text-emphasis: #0a3f8a; --bs-success-bg-subtle: #e3f0ff; --bs-success-border-subtle: #b6d4fe;
  --bs-form-valid-color: #0b6fe0; --bs-form-valid-border-color: #0b6fe0;
}
.btn-success { --bs-btn-bg:#0b6fe0; --bs-btn-border-color:#0b6fe0; --bs-btn-hover-bg:#0a4fb0; --bs-btn-hover-border-color:#0a4fb0; --bs-btn-active-bg:#0a3f8a; --bs-btn-active-border-color:#0a3f8a; --bs-btn-disabled-bg:#0b6fe0; --bs-btn-disabled-border-color:#0b6fe0; --bs-btn-focus-shadow-rgb:11,111,224; }
.btn-outline-success { --bs-btn-color:#0b6fe0; --bs-btn-border-color:#0b6fe0; --bs-btn-hover-bg:#0b6fe0; --bs-btn-hover-border-color:#0b6fe0; --bs-btn-active-bg:#0a4fb0; --bs-btn-active-border-color:#0a4fb0; --bs-btn-focus-shadow-rgb:11,111,224; }
.alert-success { --bs-alert-color:#0a3f8a; --bs-alert-bg:#e3f0ff; --bs-alert-border-color:#b6d4fe; --bs-alert-link-color:#082f66; }
.table-success { --bs-table-bg:#e3f0ff; --bs-table-border-color:#b6d4fe; --bs-table-color:#0a1a3a; }
.list-group-item-success { --bs-list-group-color:#0a3f8a; --bs-list-group-bg:#e3f0ff; --bs-list-group-border-color:#b6d4fe; }
.border-success { border-color: #0b6fe0 !important; }
.bg-success-subtle { background-color: #e3f0ff !important; }
.text-success-emphasis { color: #0a3f8a !important; }
.progress-bar.bg-success, .progress-bar-success { background-color: #19c3ff !important; }
.form-control.is-valid, .was-validated .form-control:valid, .form-select.is-valid, .was-validated .form-select:valid { border-color: #0b6fe0; }
.form-check-input.is-valid:checked, .was-validated .form-check-input:valid:checked { background-color: #0b6fe0; border-color:#0b6fe0; }
.valid-feedback { color: #0b6fe0; }
.toast.text-bg-success { background-color: #0b6fe0 !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: 34px; width: auto; max-width: 110px; 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: 28px; } }
@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: #050d1f; }
#dxOnb { position: fixed; inset: 0; z-index: 2147482000; display: flex; flex-direction: column; color: #fff; font-family: var(--dx-font);
  background: radial-gradient(620px 420px at 88% -6%, rgba(30,136,255,.40) 0%, transparent 62%), radial-gradient(520px 380px at 4% 106%, rgba(25,195,255,.20) 0%, transparent 60%), linear-gradient(165deg, #02060f 0%, #050d1f 42%, #0a1a3a 100%);
  padding: max(14px, env(safe-area-inset-top)) 0 max(18px, env(safe-area-inset-bottom)); 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(30,136,255,.3)); }
#dxOnb .o-skip[hidden] { display: inline-block !important; visibility: hidden; }
#dxOnb .o-skip { background: rgba(255,255,255,.07); border: 1px solid rgba(217,222,230,.22); color: #c4d3e8; font-weight: 700; font-size: .88rem; font-family: var(--dx-font); 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: #19c3ff; font-size: .8rem; font-weight: 700; letter-spacing: .02em; background: rgba(25,195,255,.1); border: 1px solid rgba(25,195,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: #c4d3e8; 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, #1e88ff, #19c3ff); box-shadow: 0 0 12px rgba(25,195,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-weight: 800; font-size: 1.12rem; font-family: var(--dx-font); color: #fff; cursor: pointer;
  background: linear-gradient(90deg, #0b63d6, #1e88ff 55%, #19c3ff); box-shadow: 0 12px 30px rgba(30,136,255,.38); }
#dxOnb .o-btn:active { transform: translateY(1px); }
#dxOnb .o-btn[disabled] { opacity: .75; cursor: progress; }
#dxOnb .o-note { color: #7f93b0; 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(25,195,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: #19c3ff; } #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: #e3e8f0; box-shadow: 0 6px 14px -10px rgba(10,26,58,.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: #7b8a9f; 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 #cfd8e6; color: var(--dx-navy, #0a1a3a); font-weight: 700; display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
  .mf-filter-btn.has { border-color: #1e88ff; color: #0b63d6; background: #eaf3ff; }
  .mf-filter-btn.wide { flex: 1 1 auto; justify-content: center; }
  .mf-filter-btn:active { transform: translateY(1px); }
  .mf-badge { background: #1e88ff; 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: #eaf3ff; color: #0a3f8a; border: 1px solid #b6d4fe; 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: #0a3f8a; text-decoration: none; font-size: 1rem; }
  .mf-chip .mf-x:active { background: rgba(10,63,138,.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(5,13,31,.25); }
  .mf-sheet .mf-grab { width: 42px; height: 5px; border-radius: 999px; background: #d3dbe7; margin: .5rem auto 0; flex: 0 0 auto; }
  .mf-sheet .offcanvas-header { padding: .5rem 1rem .4rem; border-bottom: 1px solid #eef1f5; }
  .mf-sheet .offcanvas-title { font-weight: 800; font-size: 1.05rem; color: var(--dx-navy, #0a1a3a); }
  .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, env(safe-area-inset-bottom)); border-top: 1px solid #eef1f5; 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: .6rem .8rem; }
  .kpi-card .kpi-value { font-size: 1.3rem; }
  .kpi-card .kpi-label { font-size: .82rem; line-height: 1.5; }
  .kpi-card .kpi-icon { font-size: 2rem; inset-inline-end: .6rem; bottom: .35rem; }
  .mf-sheet .mf-lbl { color: #6b7a90; 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: 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;
    padding-bottom: var(--dx-bn-safe);
    background: linear-gradient(180deg, rgba(16,38,79,.86) 0%, rgba(5,13,31,.94) 100%);
    -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
    box-shadow: 0 -10px 30px -12px rgba(5,13,31,.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(25,195,255,0) 0%, rgba(25,195,255,.55) 22%, rgba(120,220,255,.9) 50%, rgba(25,195,255,.55) 78%, rgba(25,195,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(217,222,230,.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(236,242,250,.9); text-decoration: none; }
  .dx-bn-item:focus-visible { outline: 2px solid rgba(25,195,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: #4aa6ff; }
  .dx-bn-item.is-active .dx-bn-lbl { font-weight: 800; color: #6fb8ff; }
  .dx-bn-item.is-active .dx-bn-ic { background: rgba(30,136,255,.16); }
  .dx-bn-item.is-active .dx-bn-ic .bi { filter: drop-shadow(0 0 6px rgba(30,136,255,.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, #1e88ff, #19c3ff); box-shadow: 0 0 10px 1px rgba(25,195,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 #0c1f43; 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, #1e88ff 0%, #19c3ff 100%);
    box-shadow: 0 0 0 5px #0d2147, 0 0 0 6px rgba(25,195,255,.35), 0 10px 22px rgba(30,136,255,.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(217,222,230,.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;
    box-shadow: 0 -18px 40px rgba(5,13,31,.3); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .dx-bsheet-grab { width: 40px; height: 5px; border-radius: 999px; background: #d3dbe7; 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: #f1f4f9; color: #4a5a72; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; }
  .dx-bsheet-x:active { background: #e3e9f2; }
  .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: #f5f8fd; border: 1px solid #e6edf7; 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: #eef4fd; }
  .dx-act:active { transform: scale(.95); background: #e8f0fc; }
  .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(30,136,255,.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, #ff5a7a, #ff8a5c); --tc: rgba(255,90,122,.8); }
  .dx-act.t-indigo { --tg: linear-gradient(140deg, #4f5bff, #7a8bff); --tc: rgba(79,91,255,.8); }
  .dx-act.t-violet { --tg: linear-gradient(140deg, #8b3dff, #c05cff); --tc: rgba(139,61,255,.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, #0fb5a6, #33d6c1); --tc: rgba(15,181,166,.8); }
  .dx-act.t-blue   { --tg: linear-gradient(140deg, #0b63d6, #1e88ff); --tc: rgba(30,136,255,.8); }
  .dx-act.t-cyan   { --tg: linear-gradient(140deg, #1e88ff, #19c3ff); --tc: rgba(25,195,255,.8); }
  .dx-act.t-green  { --tg: linear-gradient(140deg, #0a3f8a, #19c3ff); --tc: rgba(25,195,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, #0a1a3a, #1e88ff); box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(25,195,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: #6b7a90; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dx-bsheet-more .dx-bsheet-head { border-bottom: 1px solid #eef1f5; padding-bottom: .7rem; }
  .dx-more-h { font-size: .76rem; font-weight: 800; color: #8a97ab; 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: #243451; text-decoration: none; text-align: center; -webkit-tap-highlight-color: transparent; }
  .dx-more-i:hover { color: #243451; }
  .dx-more-i:active { background: #f1f5fb; }
  .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: #0b63d6; background: #edf4ff; }
  .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, #1e88ff, #19c3ff); box-shadow: 0 6px 14px -6px rgba(30,136,255,.8); }
  .dx-more-i.is-active .dx-more-l { color: #0b63d6; font-weight: 800; }
  .dx-more-foot { margin-top: 1.1rem; border-top: 1px solid #eef1f5; 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: #f1f5fb; }
  .dx-more-row > .bi:first-child { font-size: 1.15rem; color: #0b63d6; }
  .dx-more-row.is-danger, .dx-more-row.is-danger > .bi:first-child { color: #c62f45; }
}
@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 blue 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 #e3e9f2, 0 -6px 16px -12px rgba(10,26,58,.18); }
  .dx-bnav::before { display: none; }
  .dx-bn-item { color: #7a869a; }
  .dx-bn-item:hover, .dx-bn-item:focus { color: #3d4a60; }
  .dx-bn-item.is-active { color: #1e88ff; }
  .dx-bn-item.is-active .dx-bn-lbl { color: #1e88ff; 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: #1e88ff;
    box-shadow: 0 0 0 4px #fff, 0 4px 10px rgba(30,136,255,.28); }
  .dx-bn-fab-c .bi { font-size: 1.4rem; -webkit-text-stroke: 0; }
  .dx-bn-fab .dx-bn-lbl { color: #7a869a; }
  .dx-act { background: #fff; border: 1px solid #e6ecf4; }
  .dx-act-ic { background: #eaf3ff !important; color: #1e88ff; box-shadow: none; border-radius: 14px; }
  .dx-bsheet.offcanvas-bottom { box-shadow: 0 -8px 24px rgba(5,13,31,.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: #0a4fb0; background: linear-gradient(135deg, #eaf3ff, #dff4ff); border: 1px solid #cfe3fb; box-shadow: 0 1px 2px rgba(10,26,58,.06); transition: transform .15s ease, box-shadow .2s ease; }
.dx-map-chip:hover { color: #0a1a3a; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30,136,255,.2); }
.dx-map-chip .bi { font-size: .95rem; color: #1e88ff; }
.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: #1e88ff; --nm-emg: #e5364b; --nm-jobs: #4f46e5; --nm-courses: #8b5cf6; --nm-listings: #f59e0b; --nm-places: #0a1a3a;
  position: relative; display: flex; height: calc(100vh - 3.5rem); background: #eef2f7; overflow: hidden; }
.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: #e9eef5; }
.nm-map .leaflet-container, .nm-map.leaflet-container { font-family: var(--dx-font); background: #e9eef5; }
.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: #6b7a90; }
.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 #e3e8f0; 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 #eef1f5;
  background: linear-gradient(180deg, #f7faff, #fff); }
.nm-side-t { font-weight: 800; color: #0a1a3a; font-size: 1.05rem; } .nm-side-t .bi { color: #1e88ff; }
.nm-side-sub { font-size: .8rem; color: #6b7a90; }
.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 #cfe0f5; color: #0a4fb0; text-decoration: none; white-space: nowrap; }
.nm-btn-ghost:hover { background: #eaf3ff; color: #0a1a3a; }
.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: #f1f6fd; }
.nm-li.is-sel { background: #eaf3ff; box-shadow: inset 3px 0 0 #1e88ff; }
.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: #0a1a3a; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm-li-s { font-size: .75rem; color: #6b7a90; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm-li-km { flex: 0 0 auto; font-size: .74rem; font-weight: 700; color: #0a4fb0; background: #eef5ff; border-radius: 999px; padding: .1rem .5rem; unicode-bidi: isolate; }
.nm-li-km:empty { display: none; }
.nm-li-more { text-align: center; font-size: .78rem; color: #6b7a90; padding: .6rem; }
.nm-li-empty { display: flex; flex-direction: column; align-items: center; gap: .25rem; text-align: center; padding: 2.5rem 1rem; color: #6b7a90; font-size: .85rem; }
.nm-li-empty .bi { font-size: 2rem; color: #b8c6da; } .nm-li-empty b { color: #0a1a3a; }

/* 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: #6b7a90; 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: #0a1a3a; background: #fff;
  box-shadow: 0 6px 20px -6px rgba(10,26,58,.28), 0 0 0 1px rgba(10,26,58,.06); outline: none; }
.nm-search input:focus { box-shadow: 0 6px 20px -6px rgba(10,26,58,.28), 0 0 0 2px #1e88ff; }
.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(10,26,58,.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: #0a1a3a; }
.nm-sugg li:hover, .nm-sugg li.is-act { background: #eef5ff; }
.nm-sugg li .bi { color: var(--c, #6b7a90); } .nm-sugg li small { margin-inline-start: auto; color: #6b7a90; font-size: .72rem; white-space: nowrap; }
.nm-sugg li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm-sugg li.is-empty { color: #6b7a90; 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, #1e88ff, #19c3ff); color: #fff; font-weight: 700; font-family: inherit; font-size: .88rem; box-shadow: 0 8px 20px -8px rgba(30,136,255,.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(10,26,58,.08);
  background: rgba(255,255,255,.96); color: #34445e; font-family: inherit; font-size: .8rem; font-weight: 700; white-space: nowrap; cursor: pointer;
  box-shadow: 0 3px 10px -4px rgba(10,26,58,.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, #1e88ff); opacity: .45; }
.nm-chip.is-on { color: var(--c, #0a4fb0); border-color: var(--c, #1e88ff); background: #fff; box-shadow: 0 3px 12px -4px var(--c, #1e88ff), inset 0 0 0 1px var(--c, #1e88ff); }
.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: #1e88ff; color: #fff; border-color: #1e88ff; box-shadow: 0 4px 14px -4px rgba(30,136,255,.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: #0a4fb0; }
.nm-sep { flex: 0 0 1px; width: 1px; height: 22px; background: rgba(10,26,58,.15); margin: 0 2px; }
.nm-rlabel { flex: 0 0 auto; font-size: .76rem; font-weight: 700; color: #34445e; 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: #0a1a3a; 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(10,26,58,.6); }
.nm-empty { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 820; background: rgba(255,255,255,.95); color: #34445e; font-weight: 700; font-size: .85rem;
  padding: .7rem 1rem; border-radius: 14px; box-shadow: 0 10px 30px -10px rgba(10,26,58,.35); text-align: center; max-width: 80%; pointer-events: none; }
.nm-empty .bi { color: #1e88ff; }
.nm-toast { position: absolute; top: 112px; left: 50%; transform: translateX(-50%); z-index: 950; background: #0a1a3a; 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(10,26,58,.35); font-size: .76rem; color: #34445e; min-width: 0; }
.nm-legend summary { cursor: pointer; list-style: none; padding: .45rem .75rem; font-weight: 700; color: #0a1a3a; white-space: nowrap; }
.nm-legend summary::-webkit-details-marker { display: none; }
.nm-legend summary .bi { color: #1e88ff; }
.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(30,136,255,.18); border: 1px solid rgba(30,136,255,.45); width: 16px; height: 16px; box-shadow: none; }
.nm-lg-cl { border-radius: 50%; transform: none; background: #1e88ff; 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(10,26,58,.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, #10264f, #0a1a3a); }
.nm-pin.t-places .nm-pin-b .bi { color: #8fd3ff; }
.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(10,26,58,.4); }
.nm-own { position: absolute; top: -2px; right: -2px; width: 13px; height: 13px; border-radius: 50%; background: #19c3ff; 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, #1e88ff); cursor: pointer;
  box-shadow: 0 0 0 5px rgba(30,136,255,.16), 0 6px 16px -4px rgba(10,26,58,.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, #1e88ff, #0b63d6); 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(30,136,255,.28), 0 8px 18px -4px rgba(10,26,58,.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: #1e88ff; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(10,26,58,.45); }
.nm-me-pulse { position: absolute; inset: -14px; border-radius: 50%; background: rgba(30,136,255,.22); animation: nm-halo 2.2s ease-out infinite; }

/* card */
.nm-card { position: absolute; z-index: 950; inset-inline-end: 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(10,26,58,.5), 0 0 0 1px rgba(10,26,58,.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; inset-inline-end: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: #f1f4f9; color: #34445e; display: flex; align-items: center; justify-content: center; }
.nm-card-x:hover { background: #e3e9f2; }
.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, #10264f, #0a1a3a); color: #8fd3ff; }
.nm-card-logo { object-fit: cover; border: 1px solid #e3e8f0; 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, #34445e); background: color-mix(in srgb, var(--c, #6b7a90) 12%, #fff); }
.nm-tag.t-emg { background: #e5364b; color: #fff; animation: nm-blink 1.6s ease-in-out infinite; }
.nm-tag-km { --c: #0a4fb0; } .nm-tag-me { --c: #0b87b8; } .nm-tag-ok { --c: #0b6fe0; }
.nm-card-t { font-size: 1.05rem; font-weight: 800; color: #0a1a3a; margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.nm-card-s { font-size: .82rem; color: #6b7a90; margin-top: .1rem; }
.nm-card-place { font-size: .8rem; color: #34445e; margin-top: .6rem; }
.nm-card-place > .bi { color: #1e88ff; }
.nm-approx { display: inline-flex; align-items: center; gap: .25rem; margin-top: .25rem; font-size: .72rem; color: #0a4fb0; background: #eef5ff; border-radius: 8px; padding: .12rem .5rem; }
.nm-card-rate { font-size: .8rem; color: #34445e; margin-top: .35rem; font-weight: 700; } .nm-card-rate .bi { color: #f59e0b; } .nm-card-rate span { color: #6b7a90; font-weight: 400; }
.nm-facts { list-style: none; margin: .6rem 0 0; padding: .55rem .65rem; background: #f6f8fc; border-radius: 12px; display: grid; gap: .3rem; }
.nm-facts li { display: flex; gap: .5rem; align-items: baseline; font-size: .82rem; color: #0a1a3a; }
.nm-facts .bi { color: #6b7a90; 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, #1e88ff, #0b63d6); box-shadow: 0 10px 20px -10px rgba(30,136,255,.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 #d6e3f5;
  color: #0a4fb0; text-decoration: none; font-size: .68rem; font-weight: 700; background: #fff; }
.nm-act-2 .bi { font-size: 1.05rem; } .nm-act-2:hover { background: #eef5ff; color: #0a1a3a; }

.nm-root .leaflet-control-zoom { border: 0 !important; box-shadow: 0 6px 18px -6px rgba(10,26,58,.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: #0a1a3a !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: #0a1a3a; color: #fff; font-weight: 700; font-size: .84rem; text-decoration: none; box-shadow: 0 10px 24px -8px rgba(10,26,58,.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: #d3dbe7; 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: #0a1a3a; padding: .15rem .25rem .5rem; padding-inline-end: 40px; } .nm-grp-h .bi { color: #1e88ff; }
.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; }
  [dir=ltr] .nm-chips { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px); mask-image: linear-gradient(to right, transparent 0, #000 28px); padding-left: 0; padding-right: 24px; }
}
.nm-root.has-card .nm-legend { opacity: 0; pointer-events: none; }

/* ---- brand wordmark «DentX» in headings (public/js/app.js dxWordmark) ---- */
.dx-word { font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; font-weight: 800; letter-spacing: .3px; unicode-bidi: isolate; white-space: nowrap; }
.dx-word b { font-weight: 900; color: #1e88ff; }
#dxGate .dx-word b, .auth-page .dx-word b, .lp-hero .dx-word b, .dx-onb .dx-word b, .app-sidebar .dx-word b { color: #19c3ff; }

/* ---- 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 #cfd9e8; background: #fff; color: #0a1a3a;
  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: #1e88ff; background: #f3f8ff; }
.dx-chip:focus-visible { outline: 0; box-shadow: 0 0 0 .22rem rgba(30,136,255,.35); }
.dx-chip.active { background: #1e88ff; border-color: #1e88ff; color: #fff; box-shadow: 0 3px 10px -4px rgba(30,136,255,.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: #0a1a3a; border-color: #0a1a3a; }
.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: #f1f7ff; border-inline-start-color: #1e88ff; }
.dx-medalerts .ma-head { font-weight: 800; color: #0a1a3a; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.dx-medalerts .ma-head small { font-weight: 600; color: #5b6b82; }
.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: #e3efff; color: #0a3d80; }
.ma-item[title] { cursor: help; }
.dx-medsec { border: 1px solid #e6edf7; border-radius: .9rem; padding: 1rem; background: #fff; }
.dx-medsec + .dx-medsec { margin-top: 1rem; }
.dx-medsec > h6 { font-weight: 800; color: #0a1a3a; display: flex; align-items: center; gap: .4rem; margin-bottom: .85rem; }
.dx-medsec > h6 .bi { color: #1e88ff; }
.dx-sub { font-size: .82rem; font-weight: 700; color: #5b6b82; margin: .75rem 0 .4rem; }
.dx-since { display: inline-flex; align-items: center; gap: .3rem; background: #f3f8ff; border: 1px solid #d6e6fb; 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 #cfd9e8; border-radius: .75rem; padding: .6rem; position: relative; background: #fbfdff; }
.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 #d6e0ee; border-radius: .6rem; box-shadow: 0 10px 28px -12px rgba(10,26,58,.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: #eef5ff; }
.dx-typeahead .ta-item small { color: #6b7a90; }
.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 #eef1f5; }
.dx-kv:last-child { border-bottom: 0; }
.dx-kv > span:first-child { color: #6b7a90; }
.dx-kv > span:last-child { font-weight: 600; text-align: end; }
.dx-tag { display: inline-flex; align-items: center; gap: .25rem; background: #eef4fc; color: #0a1a3a; 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 #e6edf7; border-radius: .8rem; padding: .55rem .7rem; background: #fff; height: 100%; }
.dx-vital .v-l { font-size: .75rem; color: #6b7a90; font-weight: 600; }
.dx-vital .v-v { font-size: 1.25rem; font-weight: 800; color: #0a1a3a; direction: ltr; text-align: start; font-variant-numeric: tabular-nums; }
.dx-vital .v-v small { font-size: .7rem; color: #6b7a90; 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: #3b4b63; border-radius: .6rem .6rem 0 0; }
.pt-tabs .nav-link.active { color: #0b63d6; }
.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: #f1f4f8; 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(10,26,58,.78); color: #fff; font-weight: 700; font-size: .75rem; border-radius: 999px; padding: .1rem .55rem; }
.dx-step-card { border: 2px dashed #b9d4f7; background: #f5f9ff; border-radius: .9rem; }
.dx-medalerts .ma-hints summary { color: #0a1a3a; 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; } }

/* validation feedback placed after an .input-group / .form-check (not a direct sibling of the input) — Bootstrap's
   `:invalid ~ .invalid-feedback` can't reach it, so the user saw only a red border without the Arabic message */
.was-validated .input-group:has(:invalid) ~ .invalid-feedback,
.was-validated .form-check:has(:invalid) ~ .invalid-feedback,
.was-validated .form-check:has(:invalid) .invalid-feedback { display: block; }

/* =====================================================================================================
   DESIGN SYSTEM v2 (2026-10-07) — owner: «الواجهة كالحة مش مريحة للعين وتقسيماتها مش واضحة».
   Calm, airy, one accent. Tokens live at the top of this file (--dx-*). Everything below only restyles
   AdminLTE/Bootstrap classes the views already use — no markup contract changes.
   ===================================================================================================== */

/* ---- 1. canvas & type ---- */
body, .app-main, .bg-body-tertiary.app-wrapper { color: var(--dx-text-2); }
body.bg-body-tertiary, body .app-wrapper { background-color: var(--dx-bg) !important; }
.app-main { background: var(--dx-bg); }
h1,h2,h3,h4,h5,h6,.h5,.h6 { color: var(--dx-text); }
.text-muted, .text-body-secondary { color: var(--dx-text-3) !important; }
.app-content a:not(.btn):not(.alert-link):not(.nav-link):not(.page-link):not(.dropdown-item) { text-decoration: none; }
.app-content .table a:not(.btn):hover, .app-content .card-body p a:hover { text-decoration: underline; text-underline-offset: 3px; }
hr { border-color: var(--dx-border); opacity: 1; }

/* ---- 2. top bar ---- */
.app-header { background: var(--dx-surface) !important; border-bottom: 1px solid var(--dx-border); box-shadow: none; }
.app-header .nav-link { color: var(--dx-text-2); }
.app-header .nav-link:hover { color: var(--dx-accent); }
.app-header .navbar-nav > .nav-item > .nav-link.fw-semibold { color: var(--dx-text); font-weight: 700 !important; }
.dropdown-menu { border: 1px solid var(--dx-border); border-radius: var(--dx-r); box-shadow: var(--dx-sh-3); }
.dropdown-item { border-radius: var(--dx-r-sm); }
.dropdown-menu .dropdown-item:active { background: var(--dx-accent-soft); color: var(--dx-accent-ink); }

/* ---- 3. sidebar: clear groups, quiet active state ---- */
.app-sidebar { background: linear-gradient(180deg, #071226 0%, #0a1a3a 100%) !important; }
.app-sidebar .sidebar-menu { padding: 0 .5rem .75rem; }
.app-sidebar .sidebar-menu .nav-item { margin: 1px 0; }
.app-sidebar .nav-header { display: flex; align-items: center; gap: .4rem; color: #9db1cf; font-size: .74rem; font-weight: 700; letter-spacing: 0;
  padding: 1.05rem .75rem .35rem !important; margin: .35rem 0 0; border-top: 1px solid rgba(157,177,207,.12); }
.app-sidebar .sidebar-menu > .nav-header:first-child { border-top: 0; margin-top: 0; padding-top: .5rem !important; }
.app-sidebar .nav-header .dx-grp-t { flex: 1 1 auto; }
.app-sidebar .nav-header.dx-grp-toggle { cursor: pointer; user-select: none; }
.app-sidebar .nav-header.dx-grp-toggle:hover { color: #d5e1f2; }
.app-sidebar .nav-header .dx-grp-ch { font-size: .7rem; transition: transform .2s; opacity: .8; }
.app-sidebar .nav-header.is-closed .dx-grp-ch { transform: rotate(90deg); }
.app-sidebar .nav-header .dx-grp-n { font-size: .68rem; font-weight: 700; background: rgba(157,177,207,.14); color: #b9c8dd; border-radius: 999px; padding: 0 .45rem; display: none; }
.app-sidebar .nav-header.is-closed .dx-grp-n { display: inline-block; }
.app-sidebar li.dx-grp-hidden { display: none !important; }
.app-sidebar .nav-link { color: #c9d4e5; border-radius: 10px; padding-block: .5rem; }
.app-sidebar .nav-link p { font-weight: 500; }
.app-sidebar .nav-link .nav-icon { color: #7fa6d6; }
.app-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-sidebar .sidebar-menu > .nav-item > .nav-link.active, .app-sidebar .nav-treeview > .nav-item > .nav-link.active {
  background: rgba(30,136,255,.18) !important; color: #fff !important; box-shadow: inset -3px 0 0 #3d9bff; }
.app-sidebar .sidebar-menu > .nav-item > .nav-link.active p { font-weight: 700; }
.app-sidebar .nav-link.active .nav-icon { color: #6fb6ff; }
/* a parent whose child page is open: no fill — only the child gets the highlight */
.app-sidebar .sidebar-menu > .nav-item.menu-open > .nav-link.active { background: transparent !important; box-shadow: none; }
.app-sidebar .nav-treeview { padding-inline-start: .35rem; margin: 2px 0 4px; border-inline-start: 0; }
.app-sidebar .nav-treeview .nav-link { padding-block: .38rem; font-size: .88rem; color: #aebdd3; }
.app-sidebar .nav-treeview .nav-link .nav-icon { color: #58779f; }
.app-sidebar .nav-treeview .nav-link.active { box-shadow: inset -3px 0 0 #3d9bff; }
[dir=ltr] .app-sidebar .nav-link.active { box-shadow: inset 3px 0 0 #3d9bff; }

/* ---- 4. page header: breadcrumb (small) → icon + title → one-line description → primary action ---- */
.app-content-header.dx-ph { padding: 1.25rem .5rem .9rem; }
.dx-ph-in { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.dx-ph-ic { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--dx-surface); border: 1px solid var(--dx-border); color: var(--dx-accent); font-size: 1.3rem; box-shadow: var(--dx-sh-1); }
.dx-ph-txt { flex: 1 1 auto; min-width: 0; }
.dx-ph .breadcrumb { float: none !important; font-size: var(--dx-fs-xs); margin: 0 0 .1rem !important; padding: 0; background: none; }
.dx-ph .breadcrumb a { color: var(--dx-text-3); }
.dx-ph .breadcrumb a:hover { color: var(--dx-accent); }
.dx-ph .breadcrumb-item.active { color: var(--dx-text-3); }
.dx-ph .breadcrumb-item + .breadcrumb-item::before { color: #a3afc1; }
.dx-ph h3 { font-size: var(--dx-fs-lg); font-weight: 800 !important; color: var(--dx-text); line-height: 1.4; margin: 0; }
.dx-ph-desc { margin: .1rem 0 0; font-size: var(--dx-fs-sm); color: var(--dx-text-3); line-height: 1.6; }
.dx-ph-act { flex: 0 0 auto; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.dx-ph-act:empty { display: none; }
.dx-ph-act .btn { min-height: 40px; padding-inline: 1rem; }
.dx-trial { display: block; background: var(--dx-surface) !important; color: var(--dx-text-2) !important;
  border: 1px solid var(--dx-border) !important; border-inline-start: 3px solid var(--dx-warn-line) !important; border-radius: var(--dx-r) !important; padding: .55rem .9rem !important; }
.dx-trial > .bi { color: var(--dx-warn); }
.dx-trial.is-over { border-inline-start-color: var(--dx-bad-line) !important; }
.dx-trial.is-over > .bi { color: var(--dx-bad); }
.dx-trial .alert-link { color: var(--dx-accent); }
@media (max-width: 767.98px) {
  .app-content-header.dx-ph { padding: .7rem .25rem .45rem !important; }
  .dx-ph-ic { display: none; }
  .dx-ph h3 { font-size: 1.12rem !important; }
  .dx-ph-desc { font-size: .8rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .dx-ph-act { display: none; }
}

/* ---- 5. cards: one quiet surface; role decides weight ---- */
.card { background: var(--dx-surface); border: 1px solid var(--dx-border); border-radius: var(--dx-r-lg); box-shadow: var(--dx-sh-1); }
.card.card-outline { border-top: 1px solid var(--dx-border) !important; }
.card > .card-header { background: transparent; border-bottom: 1px solid var(--dx-border); padding: .85rem 1.15rem; font-weight: 700; color: var(--dx-text); }
.card > .card-header:first-child { border-radius: var(--dx-r-lg) var(--dx-r-lg) 0 0; }
.card .card-title { font-size: 1rem; font-weight: 700; color: var(--dx-text); margin: 0; }
.card .card-title > .bi:first-child, .card-header > .bi:first-child, .card-header h3 > .bi:first-child, .card-header h5 > .bi:first-child, .card-header h6 > .bi:first-child { color: var(--dx-accent); }
.card > .card-footer { background: var(--dx-surface-2); border-top: 1px solid var(--dx-border); border-radius: 0 0 var(--dx-r-lg) var(--dx-r-lg); }
.card > .card-body { padding: 1.15rem; }
/* card inside card → a flat panel, not another floating box */
.card .card { box-shadow: none; border-radius: var(--dx-r); background: var(--dx-surface); }
.card .card > .card-header { padding: .65rem .9rem; }
.dx-medsec { border-color: var(--dx-border); border-radius: var(--dx-r); }

/* ---- 6. KPI tiles: white tile + tinted icon chip (was: rainbow gradients) ---- */
.kpi-card { background: var(--dx-surface) !important; color: var(--dx-text-2) !important; border: 1px solid var(--dx-border); box-shadow: var(--dx-sh-1);
  border-radius: var(--dx-r-lg); min-height: 98px; padding: 1rem 1.1rem; padding-inline-end: 4.4rem; transition: border-color .15s, box-shadow .15s; }
.kpi-card:has(a:not(.btn)):hover { border-color: #b9cdea; box-shadow: var(--dx-sh-2); }
.kpi-card .kpi-value { color: var(--dx-text); font-size: 1.6rem; font-weight: 800; }
.kpi-card .kpi-label { color: var(--dx-text-2); opacity: 1; font-weight: 600; font-size: var(--dx-fs-sm); }
.kpi-card a, .kpi-card a:hover { color: inherit !important; text-decoration: none; }
.kpi-card .small, .kpi-card small { color: var(--dx-text-3) !important; opacity: 1 !important; }
.kpi-card .kpi-icon { position: absolute; inset-inline-end: 1rem; inset-inline-start: auto; top: 1rem; bottom: auto; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; opacity: 1; color: var(--dx-accent); background: var(--dx-accent-soft); }
.kpi-card.bg-kpi-orange .kpi-icon, .kpi-card.bg-kpi-gold .kpi-icon { color: var(--dx-warn); background: var(--dx-warn-soft); }
.kpi-card.bg-kpi-red .kpi-icon { color: var(--dx-bad); background: var(--dx-bad-soft); }
.kpi-card.bg-kpi-purple .kpi-icon, .kpi-card.bg-kpi-navy-soft .kpi-icon { color: var(--dx-info); background: var(--dx-info-soft); }
.kpi-card.bg-kpi-navy .kpi-icon, .kpi-card.bg-kpi-green .kpi-icon { color: #fff; background: #0a1a3a; }
.kpi-card.bg-kpi-teal .kpi-icon { color: var(--dx-ok); background: var(--dx-ok-soft); }
.kpi-card.bg-kpi-red .kpi-value { color: var(--dx-bad); }
@media (max-width: 767.98px) {
  .kpi-card { padding: .7rem .8rem; padding-inline-end: 3.3rem; min-height: 0; }
  .kpi-card .kpi-value { font-size: 1.25rem; }
  .kpi-card .kpi-icon { width: 34px; height: 34px; font-size: 1.05rem; inset-inline-end: .65rem; top: .7rem; border-radius: 10px; }
}

/* ---- 7. tables: light head, roomy rows, no zebra, ghost row actions ---- */
.table { --bs-table-bg: transparent; --bs-table-striped-bg: transparent; --bs-table-border-color: #edf1f6; color: var(--dx-text-2); }
.table > :not(caption) > * > * { padding: .7rem .75rem; border-bottom-color: #edf1f6; }
.table thead th { background: var(--dx-surface-2) !important; color: var(--dx-text-3) !important; font-weight: 700; font-size: .8rem; border-bottom: 1px solid var(--dx-border) !important; border-top: 0; }
.table.table-sm > :not(caption) > * > * { padding: .45rem .6rem; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f5f8fd; --bs-table-accent-bg: #f5f8fd; }
.table-hover tbody tr:hover { background: transparent; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table td strong, .table td .fw-bold, .table a.row-link, .table td > a:not(.btn) { color: var(--dx-text); font-weight: 600; }
.table td > a:not(.btn):hover { color: var(--dx-accent); }
.card-body.p-0 > .table-responsive > .table, .card > .table-responsive > .table { margin-bottom: 0; }
/* sticky column titles (desktop, tables that fit their card — app.js adds .dx-fit) */
@media (min-width: 992px) {
  .table-responsive.dx-fit { overflow: visible; }
  .table-responsive.dx-fit > .table > thead th { position: sticky; top: var(--dx-sticky-top, 57px); z-index: 2; }
}
/* row action buttons: icon-only ghosts instead of 4 framed boxes per row */
.table td .btn-sm[class*="btn-outline-"], .table td .btn-group-sm > .btn[class*="btn-outline-"] { --bs-btn-border-color: transparent; --bs-btn-bg: transparent; border-color: transparent; min-width: 32px; }
.table td .btn-sm.btn-outline-secondary, .table td .btn-sm.btn-outline-dark, .table td .btn-sm.btn-outline-info { color: var(--dx-text-3); }
.table td .btn-sm[class*="btn-outline-"]:hover { background: var(--dx-surface-3); color: var(--dx-accent-ink); border-color: transparent; }
.table td .btn-sm.btn-outline-danger { color: #c0394a; }
.table td .btn-sm.btn-outline-danger:hover { background: var(--dx-bad-soft); color: var(--dx-bad); }

/* ---- 8. status pills: one shape, soft tint + dark ink, same meaning everywhere ---- */
.app-content .badge, .dx-bsheet .badge { font-weight: 700; border-radius: var(--dx-r-pill); padding: .32em .7em; font-size: .76em; letter-spacing: 0; }
.app-content .badge.text-bg-primary, .app-content .badge.bg-primary { background-color: var(--dx-accent-soft) !important; color: var(--dx-accent-ink) !important; }
.app-content .badge.text-bg-success, .app-content .badge.bg-success { background-color: var(--dx-ok-soft) !important; color: var(--dx-ok) !important; }
.app-content .badge.text-bg-warning, .app-content .badge.bg-warning { background-color: var(--dx-warn-soft) !important; color: var(--dx-warn) !important; }
.app-content .badge.text-bg-danger, .app-content .badge.bg-danger { background-color: var(--dx-bad-soft) !important; color: var(--dx-bad) !important; }
.app-content .badge.text-bg-info, .app-content .badge.bg-info { background-color: var(--dx-info-soft) !important; color: var(--dx-info) !important; }
.app-content .badge.text-bg-secondary, .app-content .badge.bg-secondary, .app-content .badge.text-bg-light, .app-content .badge.bg-light { background-color: var(--dx-mute-soft) !important; color: var(--dx-mute) !important; border: 0; }
.app-content .badge.text-bg-dark, .app-content .badge.bg-dark { background-color: #0a1a3a !important; color: #fff !important; }
/* a solid button keeps a readable counter */
.app-content .btn-primary .badge, .app-content .btn-success .badge, .app-content .btn-danger .badge, .app-content .nav-pills .active .badge { background-color: rgba(255,255,255,.22) !important; color: #fff !important; }
/* calm: nothing pulses */
.app-content .badge, .sp-emerg { animation: none !important; }

/* ---- 9. buttons ---- */
.btn { border-radius: 10px; font-weight: 600; }
.btn-sm { border-radius: 8px; }
.btn-lg { border-radius: 12px; }
.btn-outline-secondary, .btn-light, .btn-default { --bs-btn-color: var(--dx-text-2); --bs-btn-bg: var(--dx-surface); --bs-btn-border-color: var(--dx-border-strong);
  --bs-btn-hover-color: var(--dx-text); --bs-btn-hover-bg: var(--dx-surface-3); --bs-btn-hover-border-color: #bccadc; --bs-btn-active-bg: #e5ebf4; --bs-btn-active-color: var(--dx-text); --bs-btn-active-border-color: #bccadc; }
.btn-light.border { border-color: var(--dx-border-strong) !important; }
.btn:focus-visible { box-shadow: 0 0 0 .2rem var(--dx-accent-ring); }

/* ---- 10. forms: grouped, readable, consistent ---- */
.form-control, .form-select { border-color: var(--dx-border-strong); border-radius: 10px; color: var(--dx-text); background-color: var(--dx-surface); }
.form-control:not(textarea):not([type=file]):not(.form-control-sm):not(.form-control-lg), .form-select:not(.form-select-sm):not([multiple]):not([size]) { min-height: 42px; }
.form-control::placeholder { color: #6b778b; }
.form-control:focus, .form-select:focus { border-color: var(--dx-accent); box-shadow: 0 0 0 .2rem var(--dx-accent-ring); }
.form-label { color: var(--dx-text); font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.form-text { color: var(--dx-text-3); font-size: .8rem; }
.input-group-text { background: var(--dx-surface-2); border-color: var(--dx-border-strong); color: var(--dx-text-3); }
.input-group > .form-control:not(:last-child), .input-group > .form-select:not(:last-child) { border-radius: 0 10px 10px 0; }
.input-group > :last-child:not(.dropdown-menu):not(.invalid-feedback) { border-radius: 10px 0 0 10px; }
.input-group > .invalid-feedback:last-child { border-radius: 0; }
.form-check-input { border-color: #b3c0d3; }
.form-check-input:checked { background-color: var(--dx-accent); border-color: var(--dx-accent); }
.sticky-actions { background: var(--dx-surface); border-top: 1px solid var(--dx-border); }
/* titled section inside a long form: <div class="col-12"><div class="dx-fsec"> <span class="dx-fsec-n">1</span> <div><h6>…</h6><p>…</p></div></div></div> */
.dx-fsec { display: flex; align-items: flex-start; gap: .7rem; padding-top: 1.1rem; margin-top: .35rem; border-top: 1px solid var(--dx-border); }
.dx-fsec.is-first { border-top: 0; padding-top: 0; margin-top: 0; }
.dx-fsec-n { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--dx-accent-soft); color: var(--dx-accent-ink); font-weight: 800; font-size: .85rem; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.dx-fsec h6 { margin: 0; font-size: 1rem; font-weight: 800; color: var(--dx-text); line-height: 1.75; }
.dx-fsec p { margin: 0; font-size: var(--dx-fs-sm); color: var(--dx-text-3); line-height: 1.6; }

/* ---- 11. alerts, tabs, pills, lists, pagination, modals ---- */
.alert { border-radius: var(--dx-r); border-width: 1px; }
.alert-warning { --bs-alert-bg: var(--dx-warn-soft); --bs-alert-color: #6b3a00; --bs-alert-border-color: #f6d9a6; }
.alert-danger { --bs-alert-bg: var(--dx-bad-soft); --bs-alert-color: #8c1724; --bs-alert-border-color: #f5c2c7; }
.alert-info { --bs-alert-bg: var(--dx-accent-soft); --bs-alert-color: #0a3f8a; --bs-alert-border-color: #c9defb; }
.alert-secondary, .alert-light { --bs-alert-bg: var(--dx-surface-2); --bs-alert-color: var(--dx-text-2); --bs-alert-border-color: var(--dx-border); }
.app-content .nav-tabs { border-bottom: 1px solid var(--dx-border); gap: .15rem; }
.app-content .nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--dx-text-3); font-weight: 600; padding: .6rem .9rem; margin-bottom: -1px; background: transparent; }
.app-content .nav-tabs .nav-link:hover { color: var(--dx-text); border-bottom-color: var(--dx-border-strong); }
.app-content .nav-tabs .nav-link.active { color: var(--dx-accent-ink); border-bottom-color: var(--dx-accent); background: transparent; font-weight: 700; }
.app-content .card-header-tabs { margin-bottom: -.86rem; }
.app-content .nav-pills .nav-link { color: var(--dx-text-2); border-radius: var(--dx-r-pill); font-weight: 600; }
.app-content .nav-pills .nav-link:not(.active):hover { background: var(--dx-surface-3); color: var(--dx-text); }
.app-content .nav-pills .nav-link.active { background: var(--dx-accent); color: #fff; }
.list-group { --bs-list-group-border-color: var(--dx-border); --bs-list-group-color: var(--dx-text-2); --bs-list-group-action-hover-bg: var(--dx-surface-2); }
.list-group-item-action:hover { color: var(--dx-text); }
.pagination { --bs-pagination-color: var(--dx-text-2); --bs-pagination-border-color: var(--dx-border); --bs-pagination-hover-bg: var(--dx-surface-3); --bs-pagination-hover-color: var(--dx-text); gap: .25rem; }
.pagination .page-link { border-radius: 8px !important; min-width: 36px; text-align: center; }
.page-item.active .page-link { background: var(--dx-accent); border-color: var(--dx-accent); }
.modal-content { border: 0; border-radius: var(--dx-r-lg); box-shadow: var(--dx-sh-3); }
.modal-header { border-bottom-color: var(--dx-border); }
.modal-footer { border-top-color: var(--dx-border); background: var(--dx-surface-2); border-radius: 0 0 var(--dx-r-lg) var(--dx-r-lg); }
.offcanvas { border-color: var(--dx-border) !important; }

/* ---- 12. empty states (views/partials/empty.ejs) ---- */
.dx-empty-st { text-align: center; padding: 2.6rem 1rem; }
.dx-empty-st .dx-empty-ic { width: 64px; height: 64px; margin: 0 auto .85rem; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  background: var(--dx-accent-soft); color: var(--dx-accent); font-size: 1.7rem; }
.dx-empty-st .dx-empty-t { color: var(--dx-text-2); font-weight: 600; font-size: .98rem; margin-bottom: 1rem; max-width: 420px; margin-inline: auto; line-height: 1.7; }

/* ---- 13. footer, filters, misc ---- */
.app-footer { background: transparent; border-top: 1px solid var(--dx-border); color: var(--dx-text-3); font-size: .84rem; }
.app-footer .dx-foot-slogan { color: var(--dx-text-3); }
@media (max-width: 767.98px) { .mf-bar-wrap { background: var(--dx-bg); } }
body.dx-home .app-main { background: var(--dx-bg) !important; }
.filter-bar .btn-outline-secondary { min-width: 42px; }
.avatar-circle { background: var(--dx-accent); }
.user-menu .user-footer { background: var(--dx-surface-2); }
.progress { background: var(--dx-surface-3); border-radius: var(--dx-r-pill); }
@media print { body, .app-main, body .app-wrapper { background: #fff !important; } .card { box-shadow: none !important; } .dx-ph-ic, .dx-ph-act, .dx-ph-desc { display: none !important; } }
.app-content .table .badge { white-space: nowrap; }
@media (max-width: 767.98px) {
  .mf-act, .mf-filter-btn { border-radius: 999px !important; }
}
@media (max-width: 575.98px) {
  /* phones: KPI tiles stay half-height — icon chip hidden, number + label only */
  .kpi-card { padding-inline-end: .8rem; }
  .kpi-card .kpi-icon { display: none; }
}
/* desktop: .app-main was an (unbounded) scroll container, which trapped position:sticky — clip instead (the window scrolls) */
@media (min-width: 992px) { .app-main { overflow: clip !important; } }

/* ---- legal links (privacy / terms / account deletion) ---- */
.auth-legal a { color: rgba(255,255,255,.6); text-decoration: none; }
.auth-legal a:hover { color: #fff; }
.auth-legal { color: rgba(255,255,255,.4); }
.dx-more-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; font-size: .78rem; color: #8a96a8; padding: .6rem 0 .2rem; }
.dx-more-legal a { color: #5a6b85; text-decoration: none; }
.dx-side-legal { font-size: .75rem; padding: .75rem 1rem 1rem; color: rgba(255,255,255,.35); }
.dx-side-legal a { color: rgba(255,255,255,.55); text-decoration: none; }
.sidebar-collapse .dx-side-legal { display: none; }

/* ---- patients list: stacked cards on phones (≤576px), table on wider screens ---- */
.pt-cards { display: none; }
@media (max-width: 575.98px) {
  .pt-table-wrap { display: none; }
  .pt-cards { display: block; }
  .pt-card { display: block; padding: .8rem 1rem; border-bottom: 1px solid var(--bs-border-color-translucent); color: inherit; }
  .pt-card:last-child { border-bottom: 0; }
  .pt-card-top { display: flex; align-items: flex-start; gap: .6rem; }
  .pt-card-av { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #e8f1ff; color: #0b63d6; font-weight: 800; }
  .pt-card-main { flex: 1 1 auto; min-width: 0; }
  .pt-card-name { font-weight: 700; font-size: 1rem; line-height: 1.35; color: var(--dx-navy, #0a1a3a); text-decoration: none; word-break: break-word; }
  .pt-card-meta { display: flex; flex-wrap: wrap; gap: .15rem .7rem; font-size: .8rem; color: var(--bs-secondary-color); margin-top: .15rem; }
  .pt-card-bal { flex: 0 0 auto; text-align: end; font-size: .85rem; white-space: nowrap; }
  .pt-card-bal small { display: block; font-size: .7rem; color: var(--bs-secondary-color); }
  .pt-card-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; padding-inline-start: 48px; }
  .pt-card-actions .btn { min-height: 36px; }
}
.ji-when { background: var(--bs-warning-bg-subtle); border-radius: .5rem; padding: .4rem .6rem; font-size: .9rem; }

/* =====================================================================================================
   SECTIONS & MEDIA CARDS (2026-10-07) — owner: «عناوين الاقسام مش ظاهرة… كله داخل في بعضه… الكروت نصية بس».
   .dx-sec      section header (views/partials/section_head.ejs): hue icon tile + title + count + description + «عرض الكل»,
                and its own bottom rule IS the divider (hue bar at the start → hairline fading out).
   .dx-block    section rhythm; .dx-block.is-band = alternate light band (full-bleed on phones).
   .dx-mcard    media card: visual on top (≥768px) / 84px square at the side (phones). Visual = photo or a tinted
                icon tile (views/partials/media_tile.ejs). Emergency = corner ribbon, never a red frame.
   Hues are a curated brand-compatible set (no green): blue · sky · indigo · violet · amber · rose (emergency) · slate.
   ===================================================================================================== */
.dx-hue-blue   { --h: #0b5fc7; --h-soft: #e7f0fd; --h-band: #f1f6fe; --h-line: rgba(11,95,199,.30); }
.dx-hue-sky    { --h: #04709b; --h-soft: #dff3fb; --h-band: #eff9fd; --h-line: rgba(4,112,155,.30); }
.dx-hue-indigo { --h: #3a44b0; --h-soft: #eaecfb; --h-band: #f3f4fd; --h-line: rgba(58,68,176,.30); }
.dx-hue-violet { --h: #6a3fb5; --h-soft: #f0eafb; --h-band: #f7f3fd; --h-line: rgba(106,63,181,.28); }
.dx-hue-amber  { --h: #8a4a00; --h-soft: #fdefd9; --h-band: #fef8ee; --h-line: rgba(196,120,20,.38); }
.dx-hue-rose   { --h: #b3202f; --h-soft: #fce8ea; --h-band: #fef4f5; --h-line: rgba(179,32,47,.30); }
.dx-hue-slate  { --h: #3c4a60; --h-soft: #e9edf3; --h-band: #f4f6f9; --h-line: rgba(60,74,96,.25); }

/* ---- section header ---- */
.dx-sec { position: relative; display: flex; align-items: center; gap: .85rem; padding-bottom: .85rem; margin-bottom: 1.1rem; min-width: 0; }
.dx-sec::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px; background: linear-gradient(to left, var(--h-line, var(--dx-border)), transparent 92%); }
.dx-sec::before { content: ""; position: absolute; inset-inline-start: 0; bottom: -1px; width: 44px; height: 3px; border-radius: 3px; background: var(--h, var(--dx-accent)); }
[dir=ltr] .dx-sec::after { background: linear-gradient(to right, var(--h-line, var(--dx-border)), transparent 92%); }
.dx-sec-ic { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: var(--h-soft, var(--dx-accent-soft)); color: var(--h, var(--dx-accent)); font-size: 1.3rem; }
.dx-sec-txt { flex: 1 1 auto; min-width: 0; }
.dx-sec-t { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: 1.2rem; font-weight: 800; color: var(--dx-text); line-height: 1.45; }
.dx-sec-t > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-sec-n { flex: 0 0 auto; font-size: .76rem; font-weight: 800; line-height: 1; padding: .3rem .55rem; border-radius: 999px; background: var(--h-soft, var(--dx-accent-soft)); color: var(--h, var(--dx-accent-ink)); font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.dx-sec-d { margin: .05rem 0 0; font-size: var(--dx-fs-sm); color: var(--dx-text-3); line-height: 1.55; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-sec-all { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem; font-size: .84rem; font-weight: 700; white-space: nowrap; text-decoration: none !important;
  color: var(--h, var(--dx-accent-ink)) !important; border: 1px solid var(--h-line, var(--dx-border-strong)); background: var(--dx-surface); border-radius: 999px; padding: .32rem .8rem; transition: background .15s, border-color .15s; }
.dx-sec-all:hover { background: var(--h-soft); border-color: var(--h); }
.dx-sec-all .bi { font-size: .8em; }
.dx-sec-all .dx-sec-all-s { display: none; }
@media (max-width: 767.98px) {
  .dx-sec { gap: .65rem; padding-bottom: .7rem; margin-bottom: .85rem; }
  .dx-sec-ic { flex-basis: 38px; width: 38px; height: 38px; border-radius: 11px; font-size: 1.1rem; }
  .dx-sec-t { font-size: 1.08rem; }
  .dx-sec-d { font-size: .78rem; }
  .dx-sec-all { padding: .28rem .65rem; font-size: .8rem; }
  .dx-sec-all .dx-sec-all-t { display: none; }
  .dx-sec-all .dx-sec-all-s { display: inline; }
}

/* ---- section rhythm & alternate bands ---- */
.dx-block { margin-bottom: 1.25rem; padding: 1.25rem 1.25rem 1.4rem; border-radius: 20px; }
.dx-block.is-band { background: var(--h-band, var(--dx-surface-2)); box-shadow: inset 0 0 0 1px rgba(15,27,51,.03); }
.dx-block > :last-child { margin-bottom: 0; }
@media (max-width: 767.98px) {
  .dx-block { margin-bottom: .75rem; padding: 1rem 0 1.15rem; }
  .dx-block.is-band { border-radius: 0; margin-inline: calc(var(--dx-bleed, .75rem) * -1); padding: 1.1rem var(--dx-bleed, .75rem) 1.25rem; box-shadow: none; }
}
/* compact one-line empty state inside a section */
.dx-sec-empty { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border: 1px dashed var(--h-line, var(--dx-border-strong)); border-radius: 12px;
  background: rgba(255,255,255,.7); color: var(--dx-text-3); font-size: .86rem; grid-column: 1 / -1; width: 100%; }
.dx-sec-empty > .bi { color: var(--h, var(--dx-accent)); font-size: 1.05rem; flex: 0 0 auto; }
.dx-sec-empty a { margin-inline-start: auto; font-weight: 700; white-space: nowrap; color: var(--h, var(--dx-accent)) !important; }

/* ---- media visual (photo or tinted icon tile) ---- */
.dx-mm { position: relative; display: block; overflow: hidden; background: var(--h-soft, var(--dx-surface-3)); color: var(--h, var(--dx-accent)); aspect-ratio: 16 / 9; border-radius: 12px; }
.dx-mm > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.dx-mm > .dx-mm-ic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.3rem; }
.dx-mm.is-tile { background: radial-gradient(120% 90% at 85% 0%, rgba(255,255,255,.75) 0%, transparent 55%), var(--h-soft); }
.dx-mm.is-tile > .dx-mm-ic { opacity: .9; }
.dx-mm.is-round { border-radius: 50%; }
.dx-mm-chip { position: absolute; bottom: .45rem; inset-inline-start: .45rem; background: rgba(10,26,58,.82); color: #fff; font-size: .78rem; font-weight: 700;
  border-radius: 999px; padding: .15rem .6rem; line-height: 1.5; max-width: calc(100% - .9rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-mm-tag { position: absolute; top: .45rem; inset-inline-start: .45rem; background: rgba(255,255,255,.94); color: var(--h, var(--dx-text)); font-size: .72rem; font-weight: 700;
  border-radius: 999px; padding: .1rem .5rem; line-height: 1.6; }
.dx-mm-ribbon { position: absolute; top: 0; inset-inline-start: 0; background: #c4222f; color: #fff; font-size: .72rem; font-weight: 800; padding: .2rem .65rem .2rem .55rem;
  border-end-end-radius: 10px; display: inline-flex; align-items: center; gap: .25rem; box-shadow: 0 2px 6px rgba(179,32,47,.25); z-index: 1; }
/* calendar chip (courses): day number + month */
.dx-cal { position: absolute; top: .45rem; inset-inline-end: .45rem; width: 46px; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(15,27,51,.14); text-align: center; overflow: hidden; line-height: 1.1; z-index: 1; }
.dx-cal b { display: block; font-size: 1.15rem; font-weight: 800; color: var(--dx-text); padding: .2rem 0 .05rem; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.dx-cal small { display: block; font-size: .64rem; font-weight: 700; color: #fff; background: var(--h, var(--dx-accent)); padding: .12rem 0; }

/* ---- media card ---- */
.dx-mcard { position: relative; display: flex; flex-direction: column; background: var(--dx-surface); border: 1px solid var(--dx-border); border-radius: 16px; overflow: hidden; min-width: 0;
  box-shadow: var(--dx-sh-1); transition: border-color .15s, box-shadow .15s, transform .15s; height: 100%; }
.dx-mcard:hover { border-color: #c7d5ea; box-shadow: var(--dx-sh-2); }
.dx-mcard > .dx-mm { border-radius: 0; flex: 0 0 auto; }
.dx-mbody { display: flex; flex-direction: column; gap: .3rem; padding: .85rem 1rem 1rem; flex: 1 1 auto; min-width: 0; }
.dx-mtag { display: flex; align-items: center; gap: .35rem; font-size: .76rem; color: var(--dx-text-3); min-width: 0; flex-wrap: wrap; }
.dx-mtag .dx-pill { display: inline-flex; align-items: center; gap: .25rem; background: var(--h-soft, var(--dx-surface-3)); color: var(--h, var(--dx-text-2)); font-weight: 700; border-radius: 999px; padding: .05rem .55rem; white-space: nowrap; }
.dx-mtag .dx-pill.is-mute { background: var(--dx-mute-soft); color: var(--dx-mute); }
.dx-mtitle { font-weight: 700; font-size: 1rem; line-height: 1.5; color: var(--dx-text) !important; text-decoration: none !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.dx-mtitle:hover { color: var(--dx-accent-ink) !important; }
.dx-mmeta { display: flex; align-items: center; gap: .3rem .75rem; flex-wrap: wrap; font-size: .8rem; color: var(--dx-text-3); min-width: 0; }
.dx-mmeta > span { display: inline-flex; align-items: center; gap: .3rem; min-width: 0; max-width: 100%; }
.dx-mmeta > span.tr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.dx-mmeta .bi { color: #8592a8; }
.dx-mfoot { display: flex; align-items: center; gap: .5rem; margin-top: auto; padding-top: .55rem; min-width: 0; flex-wrap: wrap; }
.dx-mprice { font-weight: 800; font-size: 1.02rem; color: var(--dx-text); white-space: nowrap; }
.dx-mprice small { font-weight: 600; font-size: .74rem; color: var(--dx-text-3); }
@media (min-width: 768px) { .dx-mprice.is-on-media { display: none; } }
.dx-mprice del { font-weight: 500; font-size: .78rem; color: #8592a8; margin-inline-start: .25rem; }
.dx-km-chip { margin-inline-start: auto; display: inline-flex; align-items: center; gap: .25rem; font-size: .74rem; font-weight: 700; color: var(--dx-text-2); background: var(--dx-surface-3); border-radius: 999px; padding: .1rem .5rem; white-space: nowrap; }
.dx-km-chip .bi { color: var(--dx-text-3); }
.dx-mposter { display: flex; align-items: center; gap: .45rem; font-size: .8rem; color: var(--dx-text-2); min-width: 0; }
.dx-mposter .dx-av { position: relative; flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--dx-accent-soft); color: var(--dx-accent-ink); font-weight: 800; font-size: .72rem; }
.dx-mposter .dx-av img { width: 100%; height: 100%; object-fit: cover; }
.dx-mposter .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-vf { color: #1e6fe0; font-size: .85em; }
.dx-mact { padding: 0 1rem 1rem; position: relative; z-index: 2; }
.dx-mact .btn { width: 100%; }
.dx-mcard .stretched-link::after { z-index: 1; }
.dx-mcard a:not(.stretched-link), .dx-mcard .btn { position: relative; z-index: 2; }

/* grids */
.dx-mgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.dx-mgrid.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1199.98px) { .dx-mgrid.is-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 991.98px) { .dx-mgrid, .dx-mgrid.is-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dx-mgrid.is-feed > :nth-child(n+4) { display: none; }

/* phones: the visual moves to the side (84px square), cards stack as a list */
@media (max-width: 767.98px) {
  .dx-mgrid, .dx-mgrid.is-4 { grid-template-columns: minmax(0, 1fr); gap: .65rem; }
  .dx-mcard { display: grid; grid-template-columns: 84px minmax(0, 1fr); grid-template-areas: "mm body" "act act"; column-gap: .8rem; padding: .7rem; border-radius: 14px; }
  .dx-mcard > .dx-mm { grid-area: mm; width: 84px; height: 84px; aspect-ratio: auto; border-radius: 12px; align-self: start; }
  .dx-mcard > .dx-mm > .dx-mm-ic { font-size: 1.75rem; }
  .dx-mcard > .dx-mm .dx-mm-chip, .dx-mcard > .dx-mm .dx-mm-tag { display: none; }
  .dx-mcard > .dx-mm .dx-mm-ribbon { font-size: .62rem; padding: .1rem .4rem; border-end-end-radius: 8px; }
  .dx-mcard > .dx-mm .dx-cal { width: 38px; top: .3rem; inset-inline-end: .3rem; }
  .dx-mcard > .dx-mm .dx-cal b { font-size: .95rem; }
  .dx-mcard > .dx-mm .dx-cal small { font-size: .58rem; }
  .dx-mbody { grid-area: body; padding: 0; gap: .2rem; }
  .dx-mtitle { font-size: .95rem; }
  .dx-mfoot { padding-top: .35rem; }
  .dx-mact { grid-area: act; padding: .65rem 0 0; }
  .dx-mact .btn { min-height: 40px; }
}

/* activity panel (home «نشاطي») */
.dx-actp { background: var(--dx-surface); border: 1px solid var(--dx-border); border-radius: 16px; overflow: hidden; box-shadow: var(--dx-sh-1); }
.dx-actp-h { padding: 1rem 1.1rem 0; }
.dx-actp-h .dx-sec { margin-bottom: .4rem; }
.dx-actp-g { font-size: .74rem; font-weight: 800; color: var(--dx-text-3); padding: .7rem 1.1rem .25rem; letter-spacing: 0; }
.dx-actp ul { list-style: none; margin: 0; padding: 0 .45rem .35rem; }
.dx-actp li { position: relative; display: flex; align-items: center; gap: .65rem; padding: .45rem .6rem; border-radius: 10px; font-size: .88rem; color: var(--dx-text-2); }
.dx-actp li:hover { background: var(--dx-surface-2); }
.dx-actp li a { color: inherit; text-decoration: none; }
.dx-actp .dx-ai { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--h-soft); color: var(--h); font-size: .95rem; }
.dx-actp .dx-cnt { margin-inline-start: auto; min-width: 1.7rem; text-align: center; font-size: .78rem; font-weight: 800; border-radius: 1rem; padding: .12rem .5rem; background: var(--dx-surface-3); color: var(--dx-text-2); }
.dx-actp .dx-cnt.act { background: var(--h-soft); color: var(--h); }
.dx-actp-sec { border-top: 1px solid var(--dx-border); padding: .75rem 1.1rem; font-size: .82rem; color: var(--dx-text-3); }
.dx-actp-quiet { padding: .2rem 1.1rem 1rem; font-size: .86rem; color: var(--dx-text-3); }
@media print { .dx-sec::before, .dx-sec::after, .dx-sec-all { display: none !important; } .dx-block.is-band { background: none !important; } }
/* people card (directory): kind-tinted cover with the member's round logo/avatar */
.dx-pcard > .dx-pcover { aspect-ratio: auto; height: 104px; }
.dx-pcover > .dx-mm-ic { justify-content: flex-end; align-items: flex-start; padding: .6rem .8rem; font-size: 1.3rem; opacity: .55; }
.dx-pav { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%; overflow: hidden; background: #fff; border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(15,27,51,.14); display: flex; align-items: center; justify-content: center; font-size: 1.7rem; font-weight: 800; color: var(--h); }
.dx-pav img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 767.98px) {
  .dx-pcard > .dx-pcover { height: 84px; border-radius: 50% !important; }
  .dx-pcover > .dx-mm-ic { display: none; }
  .dx-pav { width: 100%; height: 100%; border: 0; box-shadow: none; background: transparent; font-size: 1.6rem; }
}
/* clinic dashboard / patient file: spacing after a block that is followed by a .dx-sec header */
.dx-dash-gap { margin-bottom: 2.5rem; }
@media (max-width: 767.98px) { .dx-dash-gap { margin-bottom: 1.75rem; } }
/* titled panels with a hue (patient file overview): mini section header — tinted icon tile + bold title + fading rule */
.dx-medsec[class*="dx-hue-"] > h6 { position: relative; font-size: 1.02rem; gap: .55rem; padding-bottom: .7rem; margin-bottom: .9rem; color: var(--dx-text); flex-wrap: wrap; }
.dx-medsec[class*="dx-hue-"] > h6::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px; background: linear-gradient(to left, var(--h-line), transparent 92%); }
[dir=ltr] .dx-medsec[class*="dx-hue-"] > h6::after { background: linear-gradient(to right, var(--h-line), transparent 92%); }
.dx-medsec[class*="dx-hue-"] > h6 > .bi:first-child { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--h-soft); color: var(--h); font-size: 1.05rem; }

/* Krown partner mark as an icon (menu, «المزيد» sheet, /krown) — the gold crown, not a Bootstrap glyph */
.bi-krown::before { content: "" !important; display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.18em;
  background: url("../img/partners/krown-crown.svg") center / contain no-repeat; }

/* ---- «الدعم الفني» (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: #ff3b5c; box-shadow: 0 0 0 2px rgba(255,59,92,.25); 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: #ff3b5c; box-shadow: 0 0 0 2px #fff; }
.dx-um-support { font-weight: 600; }
.dx-support { display: flex; flex-direction: column; gap: .5rem; }
.dx-sup-help { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border-radius: 1rem; background: linear-gradient(135deg, #eaf2fe, #f4f8ff); border: 1px solid #cfe0fb; color: var(--dx-text, #0f1b33); text-decoration: none; }
.dx-sup-help:hover { border-color: var(--dx-accent, #0b6fe0); color: var(--dx-text, #0f1b33); }
.dx-sup-help-ic { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--dx-accent, #0b6fe0); color: #fff; font-size: 1.2rem; }
.dx-sup-help-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.dx-sup-help-t span { font-size: .84rem; color: var(--dx-mute, #4a5566); }
.dx-support-frame-wrap { position: relative; border-radius: 1rem; overflow: hidden; background: #fff; border: 1px solid var(--bs-border-color, #e3e8ef); box-shadow: 0 4px 18px rgba(10,26,58,.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: #6b7a90; background: #fff; transition: opacity .25s; }
.dx-support-loading.is-done { opacity: 0; pointer-events: none; }
.dx-support-fallback { display: none; align-items: center; gap: .6rem; flex-wrap: wrap; background: #fff8e6; border: 1px solid #f5d98c; color: #6b4e00; 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: #6b7a90; }
@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; }
}

/* ---- DentX lockup (2026-10-12): vector logo + tagline as live text (views/partials/brand.ejs) ---- */
.dx-lockup { display: inline-flex; flex-direction: column; align-items: center; gap: .3rem; line-height: 1.2; max-width: 100%; }
.dx-lockup-logo { display: block; width: 100%; height: auto; }
.dx-tagline { display: flex; align-items: center; justify-content: center; gap: .55rem; max-width: 100%; font-style: italic; font-weight: 600; font-size: .95rem; color: #e6ecf5; letter-spacing: .2px; }
.dx-tagline > span { min-width: 0; text-align: center; overflow-wrap: anywhere; }
.dx-tagline.dx-tag-ar { font-style: normal; font-weight: 700; }
.dx-tagline > i { flex: 0 0 auto; height: 2px; width: 2rem; border-radius: 2px; background: linear-gradient(90deg, transparent, #1aa3ff); }
.dx-tagline > i:last-child { background: linear-gradient(90deg, #1aa3ff, transparent); }
.dx-lockup-light .dx-tagline { color: #0f1b33; }
.dx-lockup-light .dx-tagline > i { background: linear-gradient(90deg, transparent, #0a8dff); }
.dx-lockup-light .dx-tagline > i:last-child { background: linear-gradient(90deg, #0a8dff, transparent); }
.dx-glow .dx-lockup-logo { filter: drop-shadow(0 0 14px rgba(26,140,255,.38)); }
.dx-glow .dx-tagline { text-shadow: 0 0 12px rgba(26,140,255,.35); position: relative; padding-bottom: .55rem; }
.dx-glow .dx-tagline::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 0; height: 2px; border-radius: 2px; background: radial-gradient(closest-side, #39b6ff, rgba(26,140,255,.35) 60%, transparent); box-shadow: 0 0 12px rgba(26,140,255,.6); }
.auth-brand .dx-lockup { width: 300px; max-width: 82vw; }
.auth-brand .dx-tagline { font-size: 1rem; }
.auth-admin { color: rgba(255,255,255,.55); text-decoration: none; font-size: .85rem; }
.auth-admin:hover, .auth-admin:focus { color: #fff; }
.dx-hdr-logo { height: 34px; width: auto; display: block; }
.sa-foot-tag { font-style: italic; color: #64748b; }
.sa-tag-preview { background: radial-gradient(ellipse 70% 80% at 50% 40%, #0b2150 0%, #05102a 60%, #020611 100%); border-radius: .75rem; padding: 1.25rem 1rem; text-align: center; }
.sa-tag-preview .dx-lockup { width: 300px; max-width: 100%; }
@media (max-width: 420px) { .dx-tagline > i { width: 1.1rem; } .sa-tag-preview .dx-tagline { font-size: .85rem; } }

/* ---- language switcher «English | العربية» (views/partials/lang_switch.ejs) ---- */
.dx-lang { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; line-height: 1; }
.dx-lang a { text-decoration: none; font-weight: 600; padding: .3rem .1rem; border-bottom: 2px solid transparent; }
.dx-lang a[lang=ar] { font-family: 'Cairo', sans-serif; }
.dx-lang-dark, .dx-lang-dark a { color: var(--dx-text-3); }
.dx-lang-dark a:hover { color: var(--dx-text); }
.dx-lang-dark a.is-on { color: var(--dx-text); border-bottom-color: var(--dx-accent); }
.dx-lang-light, .dx-lang-light a { color: rgba(255,255,255,.72); }
.dx-lang-light a:hover, .dx-lang-light a.is-on { color: #fff; }
.dx-lang-light a.is-on { border-bottom-color: #19c3ff; }
.dx-lang-sep { opacity: .45; }
.dx-lang-pill { display: inline-block; padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--dx-border-strong); color: var(--dx-text-2); text-decoration: none; font-weight: 600; font-size: .8rem; }
.dx-lang-pill[lang=ar] { font-family: 'Cairo', sans-serif; }
.dx-lang-pill.is-on { background: var(--dx-accent); border-color: var(--dx-accent); color: #fff; }
.auth-top { display: flex; justify-content: flex-end; margin: -.5rem 0 .75rem; }
.dx-more-lang { display: flex; justify-content: center; padding: .6rem 0 .2rem; }
